Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(server): selfhost issues (#5623)

LongYinanc5ea6fd2c3c3
diff --git a/.github/helm/affine/charts/graphql/templates/deployment.yaml b/.github/helm/affine/charts/graphql/templates/deployment.yaml
index 5452a8564b..9c3e9b60ce 100644
--- a/.github/helm/affine/charts/graphql/templates/deployment.yaml
+++ b/.github/helm/affine/charts/graphql/templates/deployment.yaml
@@ -73,7 +73,7 @@ spec:
value: "{{ .Values.app.path }}"
- name: AFFINE_SERVER_HOST
value: "{{ .Values.app.host }}"
- - name: AFFINE_SERVER_HOST
+ - name: AFFINE_SERVER_HTTPS
value: "{{ .Values.app.https }}"
- name: ENABLE_R2_OBJECT_STORAGE
value: "{{ .Values.app.objectStorage.r2.enabled }}"
diff --git a/packages/backend/server/src/app.module.ts b/packages/backend/server/src/app.module.ts
index 8efc1b1f32..3307d14853 100644
--- a/packages/backend/server/src/app.module.ts
+++ b/packages/backend/server/src/app.module.ts
@@ -33,6 +33,7 @@ export const FunctionalityModules: Array<Type | DynamicModule> = [
},
],
imports: [...FunctionalityModules, ...BusinessModules],
- controllers: [AppController],
+ controllers:
+ process.env.SERVER_FLAVOR === 'selfhosted' ? [] : [AppController],
})
export class AppModule {}
diff --git a/packages/backend/server/src/fundamentals/config/def.ts b/packages/backend/server/src/fundamentals/config/def.ts
index ce8e80533e..55b95e1fa6 100644
--- a/packages/backend/server/src/fundamentals/config/def.ts
+++ b/packages/backend/server/src/fundamentals/config/def.ts
@@ -10,6 +10,13 @@ declare global {
// eslint-disable-next-line no-var
var AFFiNE: AFFiNEConfig;
}
+
+ // eslint-disable-next-line @typescript-eslint/no-namespace
+ namespace NodeJS {
+ interface ProcessEnv {
+ SERVER_FLAVOR: ServerFlavor | '';
+ }
+ }
}
export enum ExternalAccount {