mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-23 21:06:22 +08:00
fix(server): set right AFFINE_SERVER_HOST env variable (#4108)
This commit is contained in:
@@ -67,18 +67,20 @@ const createHelmCommand = ({ isDryRun }) => {
|
|||||||
const graphqlReplicaCount = isProduction ? 3 : isBeta ? 2 : 2;
|
const graphqlReplicaCount = isProduction ? 3 : isBeta ? 2 : 2;
|
||||||
const syncReplicaCount = isProduction ? 6 : isBeta ? 3 : 2;
|
const syncReplicaCount = isProduction ? 6 : isBeta ? 3 : 2;
|
||||||
const namespace = isProduction ? 'production' : isBeta ? 'beta' : 'dev';
|
const namespace = isProduction ? 'production' : isBeta ? 'beta' : 'dev';
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||||
|
const host = DEPLOY_HOST || CANARY_DEPLOY_HOST;
|
||||||
const deployCommand = [
|
const deployCommand = [
|
||||||
`helm upgrade --install affine .github/helm/affine`,
|
`helm upgrade --install affine .github/helm/affine`,
|
||||||
`--namespace ${namespace}`,
|
`--namespace ${namespace}`,
|
||||||
`--set global.ingress.enabled=true`,
|
`--set global.ingress.enabled=true`,
|
||||||
`--set-json global.ingress.annotations=\"{ \\"kubernetes.io/ingress.class\\": \\"gce\\", \\"kubernetes.io/ingress.allow-http\\": \\"true\\", \\"kubernetes.io/ingress.global-static-ip-name\\": \\"${staticIpName}\\" }\"`,
|
`--set-json global.ingress.annotations=\"{ \\"kubernetes.io/ingress.class\\": \\"gce\\", \\"kubernetes.io/ingress.allow-http\\": \\"true\\", \\"kubernetes.io/ingress.global-static-ip-name\\": \\"${staticIpName}\\" }\"`,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
`--set-string global.ingress.host="${host}"`,
|
||||||
`--set-string global.ingress.host="${DEPLOY_HOST || CANARY_DEPLOY_HOST}"`,
|
|
||||||
...redisAndPostgres,
|
...redisAndPostgres,
|
||||||
`--set web.replicaCount=${webReplicaCount}`,
|
`--set web.replicaCount=${webReplicaCount}`,
|
||||||
`--set-string web.image.tag="${imageTag}"`,
|
`--set-string web.image.tag="${imageTag}"`,
|
||||||
`--set graphql.replicaCount=${graphqlReplicaCount}`,
|
`--set graphql.replicaCount=${graphqlReplicaCount}`,
|
||||||
`--set-string graphql.image.tag="${imageTag}"`,
|
`--set-string graphql.image.tag="${imageTag}"`,
|
||||||
|
`--set graphql.app.host=${host}`,
|
||||||
`--set graphql.app.objectStorage.r2.enabled=true`,
|
`--set graphql.app.objectStorage.r2.enabled=true`,
|
||||||
`--set-string graphql.app.objectStorage.r2.accountId="${R2_ACCOUNT_ID}"`,
|
`--set-string graphql.app.objectStorage.r2.accountId="${R2_ACCOUNT_ID}"`,
|
||||||
`--set-string graphql.app.objectStorage.r2.accessKeyId="${R2_ACCESS_KEY_ID}"`,
|
`--set-string graphql.app.objectStorage.r2.accessKeyId="${R2_ACCESS_KEY_ID}"`,
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ app.use(cookieParser());
|
|||||||
|
|
||||||
const config = app.get(Config);
|
const config = app.get(Config);
|
||||||
|
|
||||||
const host = config.host ?? 'localhost';
|
const host = config.node.prod ? '0.0.0.0' : 'localhost';
|
||||||
const port = config.port ?? 3010;
|
const port = config.port ?? 3010;
|
||||||
|
|
||||||
if (!config.objectStorage.r2.enabled) {
|
if (!config.objectStorage.r2.enabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user