Skip to content
Snippets Groups Projects
Commit 8a937e2e authored by michael.minelli's avatar michael.minelli
Browse files

Config => Add gitlab secret

parent 6211a07c
No related branches found
No related tags found
No related merge requests found
...@@ -19,8 +19,12 @@ class Config { ...@@ -19,8 +19,12 @@ class Config {
secret: string; expiresIn: number; secret: string; expiresIn: number;
}; };
public readonly permissions: { public readonly login: {
teachingStaff: Array<string>; gitlab: {
client: {
secret: string
}
}
}; };
public readonly gitlab: { public readonly gitlab: {
...@@ -35,9 +39,6 @@ class Config { ...@@ -35,9 +39,6 @@ class Config {
maxSameName: number; resultsFolder: string, pipelineResultsFolder: string; default: { description: string; visibility: string; }; maxSameName: number; resultsFolder: string, pipelineResultsFolder: string; default: { description: string; visibility: string; };
}; };
public readonly userPasswordLength: number;
public readonly userPasswordSaltRounds: number;
constructor() { constructor() {
this.api = { this.api = {
port: Number(process.env.API_PORT || 30992) port: Number(process.env.API_PORT || 30992)
...@@ -50,8 +51,12 @@ class Config { ...@@ -50,8 +51,12 @@ class Config {
expiresIn: Number(process.env.SESSION_TIMEOUT || 0) expiresIn: Number(process.env.SESSION_TIMEOUT || 0)
}; };
this.permissions = { this.login = {
teachingStaff: JSON5.parse(process.env.ROLES_WITH_TEACHING_STAFF_PERMISSIONS || '[]') gitlab: {
client: {
secret: process.env.LOGIN_GITLAB_CLIENT_SECRET || ''
}
}
}; };
this.gitlab = { this.gitlab = {
...@@ -97,9 +102,6 @@ class Config { ...@@ -97,9 +102,6 @@ class Config {
visibility : process.env.EXERCISE_DEFAULT_VISIBILITY || GitlabVisibility.PRIVATE visibility : process.env.EXERCISE_DEFAULT_VISIBILITY || GitlabVisibility.PRIVATE
} }
}; };
this.userPasswordLength = Number(process.env.USER_PASSWORD_LENGTH || 0);
this.userPasswordSaltRounds = Number(process.env.USER_PASSWORD_SALT_ROUNDS || 10);
} }
public getResultsFolder(exercise: Exercise): string { public getResultsFolder(exercise: Exercise): string {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment