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 should not use canary mobile pages (#9929)

liuyia95803d33bfc
diff --git a/packages/backend/server/src/base/config/default.ts b/packages/backend/server/src/base/config/default.ts
index d8861ccb10..7018654362 100644
--- a/packages/backend/server/src/base/config/default.ts
+++ b/packages/backend/server/src/base/config/default.ts
@@ -20,7 +20,7 @@ function getPredefinedAFFiNEConfig(): PreDefinedAFFiNEConfig {
'production',
'script',
]);
- const AFFINE_ENV = readEnv<AFFINE_ENV>('AFFINE_ENV', 'dev', [
+ const AFFINE_ENV = readEnv<AFFINE_ENV>('AFFINE_ENV', 'production', [
'dev',
'beta',
'production',
diff --git a/packages/backend/server/src/core/selfhost/static.ts b/packages/backend/server/src/core/selfhost/static.ts
index 4f900d6647..d1f4c1ef24 100644
--- a/packages/backend/server/src/core/selfhost/static.ts
+++ b/packages/backend/server/src/core/selfhost/static.ts
@@ -107,7 +107,7 @@ export class StaticFilesResolver implements OnModuleInit {
// fallback all unknown routes
app.get([basePath, basePath + '/*'], this.check.use, (req, res) => {
const mobile =
- this.config.AFFINE_ENV === 'dev' &&
+ this.config.affine.canary &&
isMobile({
ua: req.headers['user-agent'] ?? undefined,
});