feat(server): adjust telemetry config (#6424)

This commit is contained in:
EYHN 2024-04-02 03:44:47 +00:00
parent 8bd2408b0c
commit 366e0a4b60
No known key found for this signature in database
GPG Key ID: 46C9E26A75AB276C
4 changed files with 9 additions and 1 deletions

View File

@ -30,6 +30,9 @@ services:
- NODE_ENV=production
- AFFINE_ADMIN_EMAIL=${AFFINE_ADMIN_EMAIL}
- AFFINE_ADMIN_PASSWORD=${AFFINE_ADMIN_PASSWORD}
# Telemetry allows us to collect data on how you use the affine. This data will helps us improve the app and provide better features.
# Uncomment next line if you wish to quit telemetry.
# - TELEMETRY_ENABLE=false
redis:
image: redis
container_name: affine_redis

View File

@ -36,4 +36,5 @@ AFFiNE.ENV_MAP = {
'featureFlags.syncClientVersionCheck',
'boolean',
],
TELEMETRY_ENABLE: ['telemetry.enabled', 'boolean'],
};

View File

@ -66,6 +66,9 @@ export class ServerConfigType {
description: 'credentials requirement',
})
credentialsRequirement!: CredentialsRequirementType;
@Field({ description: 'enable telemetry' })
enableTelemetry!: boolean;
}
export class ServerConfigResolver {
@ -87,6 +90,7 @@ export class ServerConfigResolver {
credentialsRequirement: {
password: AFFiNE.auth.password,
},
enableTelemetry: AFFiNE.telemetry.enabled,
};
}
}

View File

@ -188,7 +188,7 @@ export const getDefaultAFFiNEConfig: () => AFFiNEConfig = () => {
enabled: false,
},
telemetry: {
enabled: isSelfhosted && !process.env.DISABLE_SERVER_TELEMETRY,
enabled: isSelfhosted,
token: '389c0615a69b57cca7d3fa0a4824c930',
},
plugins: {