Remove three old env variables (#2297)
* remove three old env variables IS_DATA_MODEL_SETTINGS_ENABLED IS_DEVELOPERS_SETTINGS_ENABLED FLEXIBLE_BACKEND_ENABLED * Fix database:reset script * Removing unused variable --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -25,7 +25,4 @@ SIGN_IN_PREFILLED=true
|
||||
# SUPPORT_FRONT_CHAT_ID=replace_me_with_front_chat_id
|
||||
# LOGGER_DRIVER=console
|
||||
# SENTRY_DSN=https://xxx@xxx.ingest.sentry.io/xxx
|
||||
# LOG_LEVEL=error,warn
|
||||
# FLEXIBLE_BACKEND_ENABLED=false
|
||||
# IS_DATA_MODEL_SETTINGS_ENABLED=false
|
||||
# IS_DEVELOPERS_SETTINGS_ENABLED=false
|
||||
# LOG_LEVEL=error,warn
|
||||
@ -14,8 +14,6 @@ REFRESH_TOKEN_SECRET=secret_refresh_token
|
||||
# ———————— Optional ————————
|
||||
# DEBUG_MODE=false
|
||||
# SIGN_IN_PREFILLED=false
|
||||
# IS_DATA_MODEL_SETTINGS_ENABLED=false
|
||||
# IS_DEVELOPERS_SETTINGS_ENABLED=false
|
||||
# ACCESS_TOKEN_EXPIRES_IN=30m
|
||||
# LOGIN_TOKEN_EXPIRES_IN=15m
|
||||
# REFRESH_TOKEN_EXPIRES_IN=90d
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
"database:truncate": "npx ts-node ./scripts/truncate-db.ts",
|
||||
"database:migrate": "yarn typeorm:migrate && yarn prisma:migrate",
|
||||
"database:generate": "yarn prisma:generate",
|
||||
"database:seed": "yarn prisma:seed && yarn command tenant:sync-metadata -w twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419 && yarn command tenant:migrate -w twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419 && yarn command tenant:data-seed -w twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419",
|
||||
"database:seed": "yarn prisma:seed && yarn build && yarn command tenant:sync-metadata -w twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419 && yarn command tenant:migrate -w twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419 && yarn command tenant:data-seed -w twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419",
|
||||
"database:reset": "yarn database:truncate && yarn database:init",
|
||||
"command": "node dist/src/command"
|
||||
},
|
||||
|
||||
@ -58,8 +58,8 @@ import { ExceptionFilter } from './filters/exception.filter';
|
||||
// Extract JWT from the request
|
||||
const token = ExtractJwt.fromAuthHeaderAsBearerToken()(request.req);
|
||||
|
||||
// If there is no token or flexible backend is disabled, return an empty schema
|
||||
if (!token || !environmentService.isFlexibleBackendEnabled()) {
|
||||
// If there is no token return an empty schema
|
||||
if (!token) {
|
||||
return new GraphQLSchema({});
|
||||
}
|
||||
|
||||
|
||||
@ -41,18 +41,9 @@ export class ClientConfig {
|
||||
@Field(() => Boolean)
|
||||
signInPrefilled: boolean;
|
||||
|
||||
@Field(() => Boolean)
|
||||
dataModelSettingsEnabled: boolean;
|
||||
|
||||
@Field(() => Boolean)
|
||||
developersSettingsEnabled: boolean;
|
||||
|
||||
@Field(() => Boolean)
|
||||
debugMode: boolean;
|
||||
|
||||
@Field(() => Boolean)
|
||||
flexibleBackendEnabled: boolean;
|
||||
|
||||
@Field(() => Support)
|
||||
support: Support;
|
||||
}
|
||||
|
||||
@ -22,13 +22,7 @@ export class ClientConfigResolver {
|
||||
this.environmentService.isTelemetryAnonymizationEnabled(),
|
||||
},
|
||||
signInPrefilled: this.environmentService.isSignInPrefilled(),
|
||||
dataModelSettingsEnabled:
|
||||
this.environmentService.isDataModelSettingsEnabled(),
|
||||
developersSettingsEnabled:
|
||||
this.environmentService.isDevelopersSettingsEnabled(),
|
||||
debugMode: this.environmentService.isDebugMode(),
|
||||
flexibleBackendEnabled:
|
||||
this.environmentService.isFlexibleBackendEnabled(),
|
||||
support: {
|
||||
supportDriver: this.environmentService.getSupportDriver(),
|
||||
supportFrontChatId: this.environmentService.getSupportFrontChatId(),
|
||||
|
||||
@ -19,18 +19,6 @@ export class EnvironmentService {
|
||||
return this.configService.get<boolean>('SIGN_IN_PREFILLED') ?? false;
|
||||
}
|
||||
|
||||
isDataModelSettingsEnabled(): boolean {
|
||||
return (
|
||||
this.configService.get<boolean>('IS_DATA_MODEL_SETTINGS_ENABLED') ?? false
|
||||
);
|
||||
}
|
||||
|
||||
isDevelopersSettingsEnabled(): boolean {
|
||||
return (
|
||||
this.configService.get<boolean>('IS_DEVELOPERS_SETTINGS_ENABLED') ?? false
|
||||
);
|
||||
}
|
||||
|
||||
isTelemetryEnabled(): boolean {
|
||||
return this.configService.get<boolean>('TELEMETRY_ENABLED') ?? true;
|
||||
}
|
||||
@ -41,10 +29,6 @@ export class EnvironmentService {
|
||||
);
|
||||
}
|
||||
|
||||
isFlexibleBackendEnabled(): boolean {
|
||||
return this.configService.get<boolean>('FLEXIBLE_BACKEND_ENABLED') ?? false;
|
||||
}
|
||||
|
||||
getPort(): number {
|
||||
return this.configService.get<number>('PORT') ?? 3000;
|
||||
}
|
||||
|
||||
@ -36,16 +36,6 @@ export class EnvironmentVariables {
|
||||
@IsBoolean()
|
||||
SIGN_IN_PREFILLED?: boolean;
|
||||
|
||||
@CastToBoolean()
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
IS_DATA_MODEL_SETTINGS_ENABLED?: boolean;
|
||||
|
||||
@CastToBoolean()
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
IS_DEVELOPERS_SETTINGS_ENABLED?: boolean;
|
||||
|
||||
@CastToBoolean()
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@ -56,11 +46,6 @@ export class EnvironmentVariables {
|
||||
@IsBoolean()
|
||||
TELEMETRY_ANONYMIZATION_ENABLED?: boolean;
|
||||
|
||||
@CastToBoolean()
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
FLEXIBLE_BACKEND_ENABLED?: boolean;
|
||||
|
||||
@CastToPositiveNumber()
|
||||
@IsNumber()
|
||||
@IsOptional()
|
||||
|
||||
Reference in New Issue
Block a user