Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: node tls reject unauthorized #5116

Merged
merged 2 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ const valuationMap: Record<string, number> = {

export async function GET(req: NextRequest) {
try {
const { SEALOS_DOMAIN } = process.env
const { ACCOUNT_URL, SEALOS_DOMAIN } = process.env
const baseUrl = ACCOUNT_URL
? ACCOUNT_URL
: `https://account-api.${SEALOS_DOMAIN}`;
const getResourcePrice = async () => {
try {
const res = await fetch(
`https://account-api.${SEALOS_DOMAIN}/account/v1alpha1/properties`,
`${baseUrl}/account/v1alpha1/properties`,
{
method: 'POST'
}
Expand Down
2 changes: 2 additions & 0 deletions frontend/providers/devbox/deploy/manifests/deploy.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ spec:
value: http://launchpad-monitor.sealos.svc.cluster.local:8428
- name: SQUASH_ENABLE
value: 'true'
- name: ACCOUNT_URL
value: http://account-service.account-system.svc.cluster.local:2333
securityContext:
runAsNonRoot: true
runAsUser: 1001
Expand Down
2 changes: 2 additions & 0 deletions frontend/providers/template/deploy/manifests/deploy.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ spec:
value: {{ .templateRepoBranch }}
- name: SHOW_AUTHOR
value: "false"
- name: ACCOUNT_URL
value: http://account-service.account-system.svc.cluster.local:2333
image: ghcr.io/labring/sealos-template-frontend:latest
imagePullPolicy: Always
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ export function transformProperties(data: properties): userPriceType {
}

const getResourcePrice = async () => {
const res = await fetch(
`https://account-api.${process.env.SEALOS_CLOUD_DOMAIN}/account/v1alpha1/properties`,
{
method: 'POST'
}
);
const baseUrl = process.env.ACCOUNT_URL
? process.env.ACCOUNT_URL
: `https://account-api.${process.env.SEALOS_CLOUD_DOMAIN}`;

const res = await fetch(`${baseUrl}/account/v1alpha1/properties`, {
method: 'POST'
});
const data = await res.json();
return transformProperties(data.data as properties);
};
Expand Down
Loading