Skip to content

Commit

Permalink
fix: clean up env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
apalchys committed Jul 9, 2024
1 parent c3acac8 commit 5669ecf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 46 deletions.
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
40 changes: 0 additions & 40 deletions server/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
export interface IConfig {
app: {
admins: string[];
};
users: {
cloud: {
username: string;
Expand All @@ -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;
Expand All @@ -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',
Expand All @@ -85,33 +63,15 @@ 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 || '',
region: process.env.RSSHCOOL_API_AWS_REGION || '',
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',
};
7 changes: 3 additions & 4 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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"
]
},
Expand Down

0 comments on commit 5669ecf

Please sign in to comment.