diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/controllers/api/config.ts | 2 | ||||
-rw-r--r-- | server/initializers/config.ts | 2 | ||||
-rw-r--r-- | server/tests/api/check-params/config.ts | 1 | ||||
-rw-r--r-- | server/tests/api/server/config.ts | 3 |
4 files changed, 8 insertions, 0 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index b5244756d..909907ad6 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -161,6 +161,7 @@ function getAbout (req: express.Request, res: express.Response) { | |||
161 | terms: CONFIG.INSTANCE.TERMS, | 161 | terms: CONFIG.INSTANCE.TERMS, |
162 | codeOfConduct: CONFIG.INSTANCE.CODE_OF_CONDUCT, | 162 | codeOfConduct: CONFIG.INSTANCE.CODE_OF_CONDUCT, |
163 | 163 | ||
164 | creationReason: CONFIG.INSTANCE.CREATION_REASON, | ||
164 | moderationInformation: CONFIG.INSTANCE.MODERATION_INFORMATION, | 165 | moderationInformation: CONFIG.INSTANCE.MODERATION_INFORMATION, |
165 | administrator: CONFIG.INSTANCE.ADMINISTRATOR, | 166 | administrator: CONFIG.INSTANCE.ADMINISTRATOR, |
166 | maintenanceLifetime: CONFIG.INSTANCE.MAINTENANCE_LIFETIME, | 167 | maintenanceLifetime: CONFIG.INSTANCE.MAINTENANCE_LIFETIME, |
@@ -232,6 +233,7 @@ function customConfig (): CustomConfig { | |||
232 | terms: CONFIG.INSTANCE.TERMS, | 233 | terms: CONFIG.INSTANCE.TERMS, |
233 | codeOfConduct: CONFIG.INSTANCE.CODE_OF_CONDUCT, | 234 | codeOfConduct: CONFIG.INSTANCE.CODE_OF_CONDUCT, |
234 | 235 | ||
236 | creationReason: CONFIG.INSTANCE.CREATION_REASON, | ||
235 | moderationInformation: CONFIG.INSTANCE.MODERATION_INFORMATION, | 237 | moderationInformation: CONFIG.INSTANCE.MODERATION_INFORMATION, |
236 | administrator: CONFIG.INSTANCE.ADMINISTRATOR, | 238 | administrator: CONFIG.INSTANCE.ADMINISTRATOR, |
237 | maintenanceLifetime: CONFIG.INSTANCE.MAINTENANCE_LIFETIME, | 239 | maintenanceLifetime: CONFIG.INSTANCE.MAINTENANCE_LIFETIME, |
diff --git a/server/initializers/config.ts b/server/initializers/config.ts index 4e2b07e64..8df411ca5 100644 --- a/server/initializers/config.ts +++ b/server/initializers/config.ts | |||
@@ -211,6 +211,8 @@ const CONFIG = { | |||
211 | get TERMS () { return config.get<string>('instance.terms') }, | 211 | get TERMS () { return config.get<string>('instance.terms') }, |
212 | get CODE_OF_CONDUCT () { return config.get<string>('instance.code_of_conduct') }, | 212 | get CODE_OF_CONDUCT () { return config.get<string>('instance.code_of_conduct') }, |
213 | 213 | ||
214 | get CREATION_REASON () { return config.get<string>('instance.creation_reason') }, | ||
215 | |||
214 | get MODERATION_INFORMATION () { return config.get<string>('instance.moderation_information') }, | 216 | get MODERATION_INFORMATION () { return config.get<string>('instance.moderation_information') }, |
215 | get ADMINISTRATOR () { return config.get<string>('instance.administrator') }, | 217 | get ADMINISTRATOR () { return config.get<string>('instance.administrator') }, |
216 | get MAINTENANCE_LIFETIME () { return config.get<string>('instance.maintenance_lifetime') }, | 218 | get MAINTENANCE_LIFETIME () { return config.get<string>('instance.maintenance_lifetime') }, |
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index f716dc673..9b902a1cd 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts | |||
@@ -29,6 +29,7 @@ describe('Test config API validators', function () { | |||
29 | terms: 'my super terms', | 29 | terms: 'my super terms', |
30 | codeOfConduct: 'my super coc', | 30 | codeOfConduct: 'my super coc', |
31 | 31 | ||
32 | creationReason: 'my super reason', | ||
32 | moderationInformation: 'my super moderation information', | 33 | moderationInformation: 'my super moderation information', |
33 | administrator: 'Kuja', | 34 | administrator: 'Kuja', |
34 | maintenanceLifetime: 'forever', | 35 | maintenanceLifetime: 'forever', |
diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index da75495a5..85d0f9702 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts | |||
@@ -30,6 +30,7 @@ function checkInitialConfig (server: ServerInfo, data: CustomConfig) { | |||
30 | expect(data.instance.description).to.equal('Welcome to this PeerTube instance!') | 30 | expect(data.instance.description).to.equal('Welcome to this PeerTube instance!') |
31 | 31 | ||
32 | expect(data.instance.terms).to.equal('No terms for now.') | 32 | expect(data.instance.terms).to.equal('No terms for now.') |
33 | expect(data.instance.creationReason).to.be.empty | ||
33 | expect(data.instance.codeOfConduct).to.be.empty | 34 | expect(data.instance.codeOfConduct).to.be.empty |
34 | expect(data.instance.moderationInformation).to.be.empty | 35 | expect(data.instance.moderationInformation).to.be.empty |
35 | expect(data.instance.administrator).to.be.empty | 36 | expect(data.instance.administrator).to.be.empty |
@@ -90,6 +91,7 @@ function checkUpdatedConfig (data: CustomConfig) { | |||
90 | expect(data.instance.description).to.equal('my super description') | 91 | expect(data.instance.description).to.equal('my super description') |
91 | 92 | ||
92 | expect(data.instance.terms).to.equal('my super terms') | 93 | expect(data.instance.terms).to.equal('my super terms') |
94 | expect(data.instance.creationReason).to.equal('my super creation reason') | ||
93 | expect(data.instance.codeOfConduct).to.equal('my super coc') | 95 | expect(data.instance.codeOfConduct).to.equal('my super coc') |
94 | expect(data.instance.moderationInformation).to.equal('my super moderation information') | 96 | expect(data.instance.moderationInformation).to.equal('my super moderation information') |
95 | expect(data.instance.administrator).to.equal('Kuja') | 97 | expect(data.instance.administrator).to.equal('Kuja') |
@@ -212,6 +214,7 @@ describe('Test config', function () { | |||
212 | terms: 'my super terms', | 214 | terms: 'my super terms', |
213 | codeOfConduct: 'my super coc', | 215 | codeOfConduct: 'my super coc', |
214 | 216 | ||
217 | creationReason: 'my super creation reason', | ||
215 | moderationInformation: 'my super moderation information', | 218 | moderationInformation: 'my super moderation information', |
216 | administrator: 'Kuja', | 219 | administrator: 'Kuja', |
217 | maintenanceLifetime: 'forever', | 220 | maintenanceLifetime: 'forever', |