From 5669ecfb6b42cb32aa07e90f66d43fe70cee4944 Mon Sep 17 00:00:00 2001 From: apalchys Date: Tue, 9 Jul 2024 10:00:42 +0200 Subject: [PATCH] fix: clean up env variables --- docker-compose.yml | 2 -- server/src/config.ts | 40 ---------------------------------------- turbo.json | 7 +++---- 3 files changed, 3 insertions(+), 46 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 13cd82d453..e7eb6a8d88 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,8 +32,6 @@ services: RSSHCOOL_PG_DATABASE: ${RSSHCOOL_PG_DATABASE} RSSHCOOL_API_ADMIN_USERNAME: ${RSSHCOOL_API_ADMIN_USERNAME} RSSHCOOL_API_ADMIN_PASSWORD: ${RSSHCOOL_API_ADMIN_PASSWORD} - RSSHCOOL_API_INTEGRATIONS_DISCORD_GRATITUDE_URL: ${RSSHCOOL_API_INTEGRATIONS_DISCORD_GRATITUDE_URL} - RSSHCOOL_API_HIRERS: ${RSSHCOOL_API_HIRERS} RSSHCOOL_API_AWS_SECRET_ACCESS_KEY: ${RSSHCOOL_API_AWS_SECRET_ACCESS_KEY} RSSHCOOL_API_AWS_ACCESS_KEY_ID: ${RSSHCOOL_API_AWS_ACCESS_KEY_ID} RSSHCOOL_API_AWS_REGION: ${RSSHCOOL_AWS_REGION} diff --git a/server/src/config.ts b/server/src/config.ts index bc9dd1cba3..52b20665d2 100755 --- a/server/src/config.ts +++ b/server/src/config.ts @@ -1,7 +1,4 @@ export interface IConfig { - app: { - admins: string[]; - }; users: { cloud: { username: string; @@ -27,21 +24,7 @@ export interface IConfig { username: string; password: string; }; - rateLimit: { - intervalMin: number; - max: number; - }; - roles: { - adminTeams: string[]; - hirers: string[]; - }; isDevMode: boolean; - pg: { - host: string; - username: string; - password: string; - database: string; - }; github: { org: string; privateKey: string; @@ -50,16 +33,11 @@ export interface IConfig { hooksSecret: string; }; port: number; - name: string; - sessionAge: number; sessionKey: string; host: string; } export const config: IConfig = { - app: { - admins: ['apalchys', 'dzmitry-varabei', 'mikhama', 'sonejka', 'aaliakseyenka', 'valerydluski'], - }, users: { cloud: { username: process.env.RSSHCOOL_API_USERS_CLOUD_USERNAME || 'test', @@ -85,19 +63,7 @@ export const config: IConfig = { installationId: process.env.RSSHCOOL_API_GITHUB_APP_INSTALL_ID || '', hooksSecret: process.env.RSSHCOOL_API_GITHUB_HOOKS_SECRET || 'hooks_secret', }, - roles: { - adminTeams: process.env.RSSCHOOL_ADMIN_TEAMS - ? process.env.RSSCHOOL_ADMIN_TEAMS.split(',') - : ['rsschool-dev-team@rolling-scopes'], - hirers: process.env.RSSHCOOL_API_HIRERS ? process.env.RSSHCOOL_API_HIRERS.split(',') : [], - }, isDevMode: process.env.NODE_ENV !== 'production', - pg: { - host: process.env.RSSHCOOL_PG_HOST || '', - username: process.env.RSSHCOOL_PG_USERNAME || '', - password: process.env.RSSHCOOL_PG_PASSWORD || '', - database: process.env.RSSHCOOL_PG_DATABASE || 'rs_school', - }, aws: { secretAccessKey: process.env.RSSHCOOL_API_AWS_SECRET_ACCESS_KEY || '', accessKeyId: process.env.RSSHCOOL_API_AWS_ACCESS_KEY_ID || '', @@ -105,13 +71,7 @@ export const config: IConfig = { restApiUrl: process.env.RSSHCOOL_API_AWS_REST_API_URL || '', restApiKey: process.env.RSSHCOOL_API_AWS_REST_API_KEY || '', }, - name: 'rsschool-api', port: parseInt(process.env.NODE_PORT || '3001', 10), - rateLimit: { - intervalMin: 5, - max: 100, - }, - sessionAge: 1000 * 60 * 60 * 24 * 2, sessionKey: process.env.RSSHCOOL_API_SESSION_KEY || 'secret', host: process.env.RSSHCOOL_HOST || 'http://localhost:3000', }; diff --git a/turbo.json b/turbo.json index df18c57c4a..0fa6dab8dc 100644 --- a/turbo.json +++ b/turbo.json @@ -14,7 +14,6 @@ "NODE_TLS_REJECT_UNAUTHORIZED", "RS_ENV", "RSSCHOOL_ADMIN_TEAMS", - "RSSCHOOL_ADMIN_TEAMS", "RSSHCOOL_API_ADMIN_PASSWORD", "RSSHCOOL_API_ADMIN_USERNAME", "RSSHCOOL_API_AUTH_CALLBACK", @@ -30,8 +29,6 @@ "RSSHCOOL_API_GITHUB_APP_INSTALL_ID", "RSSHCOOL_API_GITHUB_HOOKS_SECRET", "RSSHCOOL_API_GITHUB_PRIVATE_KEY", - "RSSHCOOL_API_HIRERS", - "RSSHCOOL_API_HIRERS", "RSSHCOOL_API_SESSION_KEY", "RSSHCOOL_API_USERS_CLOUD_PASSWORD", "RSSHCOOL_API_USERS_CLOUD_USERNAME", @@ -41,12 +38,14 @@ "RSSHCOOL_AWS_REST_API_URL", "RSSHCOOL_AWS_SECRET_ACCESS_KEY", "RSSHCOOL_HOST", + "RSSHCOOL_OPENAI_API_KEY", "RSSHCOOL_PG_DATABASE", "RSSHCOOL_PG_HOST", "RSSHCOOL_PG_PASSWORD", "RSSHCOOL_PG_USERNAME", "RSSHCOOL_UI_GCP_MAPS_API_KEY", - "RSSHCOOL_OPENAI_API_KEY", + "RSSHCOOL_USERS_ADMINS", + "RSSHCOOL_USERS_HIRERS", "SENTRY_DSN" ] },