Skip to content

Commit

Permalink
fix: node tls reject unauthorized (#5116)
Browse files Browse the repository at this point in the history
* fix: node tls reject unauthorized

* fix: account use svc
  • Loading branch information
zijiren233 authored Sep 28, 2024
1 parent ebe7f51 commit d3ba17b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
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

0 comments on commit d3ba17b

Please sign in to comment.