aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-09-03 09:49:04 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-09-05 10:17:02 +0200
commit8ae03c37181822617418d1fc372982b245ac0a9a (patch)
treee98e4a57ca85f2fd982aa8054476c9983cbb2398
parent589d9f55f6f3f0d069d4bbb207d3d20769cc4ded (diff)
downloadPeerTube-8ae03c37181822617418d1fc372982b245ac0a9a.tar.gz
PeerTube-8ae03c37181822617418d1fc372982b245ac0a9a.tar.zst
PeerTube-8ae03c37181822617418d1fc372982b245ac0a9a.zip
Add creation reason
-rw-r--r--client/src/app/+about/about-instance/about-instance.component.html12
-rw-r--r--client/src/app/+about/about-instance/about-instance.component.ts2
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html26
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss4
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts2
-rw-r--r--config/default.yaml3
-rw-r--r--config/production.yaml.example54
-rw-r--r--server/controllers/api/config.ts2
-rw-r--r--server/initializers/config.ts2
-rw-r--r--server/tests/api/check-params/config.ts1
-rw-r--r--server/tests/api/server/config.ts3
-rw-r--r--shared/extra-utils/server/config.ts1
-rw-r--r--shared/models/server/about.model.ts1
-rw-r--r--shared/models/server/custom-config.model.ts1
14 files changed, 100 insertions, 14 deletions
diff --git a/client/src/app/+about/about-instance/about-instance.component.html b/client/src/app/+about/about-instance/about-instance.component.html
index 80acfcce0..8b21137af 100644
--- a/client/src/app/+about/about-instance/about-instance.component.html
+++ b/client/src/app/+about/about-instance/about-instance.component.html
@@ -24,19 +24,25 @@
24 </div> 24 </div>
25 25
26 <div class="block administrator" *ngIf="html.administrator"> 26 <div class="block administrator" *ngIf="html.administrator">
27 <div i18n class="section-title">Who are we?</div> 27 <div i18n class="section-title">Who we are</div>
28 28
29 <div [innerHTML]="html.administrator"></div> 29 <div [innerHTML]="html.administrator"></div>
30 </div> 30 </div>
31 31
32 <div class="block creation-reason" *ngIf="creationReason">
33 <div i18n class="section-title">Why we created this instance</div>
34
35 <p>{{ creationReason }}</p>
36 </div>
37
32 <div class="block maintenance-lifetime" *ngIf="maintenanceLifetime"> 38 <div class="block maintenance-lifetime" *ngIf="maintenanceLifetime">
33 <div i18n class="section-title">How long do we plan to maintain this instance?</div> 39 <div i18n class="section-title">How long we plan to maintain this instance</div>
34 40
35 <p>{{ maintenanceLifetime }}</p> 41 <p>{{ maintenanceLifetime }}</p>
36 </div> 42 </div>
37 43
38 <div class="block business-model" *ngIf="businessModel"> 44 <div class="block business-model" *ngIf="businessModel">
39 <div i18n class="section-title">How will we pay this instance?</div> 45 <div i18n class="section-title">How we will pay this instance</div>
40 46
41 <p>{{ businessModel }}</p> 47 <p>{{ businessModel }}</p>
42 </div> 48 </div>
diff --git a/client/src/app/+about/about-instance/about-instance.component.ts b/client/src/app/+about/about-instance/about-instance.component.ts
index e2c448501..b6cade4fe 100644
--- a/client/src/app/+about/about-instance/about-instance.component.ts
+++ b/client/src/app/+about/about-instance/about-instance.component.ts
@@ -25,6 +25,7 @@ export class AboutInstanceComponent implements OnInit {
25 administrator: '' 25 administrator: ''
26 } 26 }
27 27
28 creationReason = ''
28 maintenanceLifetime = '' 29 maintenanceLifetime = ''
29 businessModel = '' 30 businessModel = ''
30 31
@@ -61,6 +62,7 @@ export class AboutInstanceComponent implements OnInit {
61 async ([ about, translations ]) => { 62 async ([ about, translations ]) => {
62 this.shortDescription = about.instance.shortDescription 63 this.shortDescription = about.instance.shortDescription
63 64
65 this.creationReason = about.instance.creationReason
64 this.maintenanceLifetime = about.instance.maintenanceLifetime 66 this.maintenanceLifetime = about.instance.maintenanceLifetime
65 this.businessModel = about.instance.businessModel 67 this.businessModel = about.instance.businessModel
66 68
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
index 5aa6fda3c..ef24e5b24 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
@@ -21,7 +21,7 @@
21 <div class="form-group"> 21 <div class="form-group">
22 <label i18n for="instanceShortDescription">Short description</label> 22 <label i18n for="instanceShortDescription">Short description</label>
23 <textarea 23 <textarea
24 id="instanceShortDescription" formControlName="shortDescription" 24 id="instanceShortDescription" formControlName="shortDescription" class="small"
25 [ngClass]="{ 'input-error': formErrors['instance.shortDescription'] }" 25 [ngClass]="{ 'input-error': formErrors['instance.shortDescription'] }"
26 ></textarea> 26 ></textarea>
27 <div *ngIf="formErrors.instance.shortDescription" class="form-error">{{ formErrors.instance.shortDescription }}</div> 27 <div *ngIf="formErrors.instance.shortDescription" class="form-error">{{ formErrors.instance.shortDescription }}</div>
@@ -130,14 +130,26 @@
130 <div i18n class="inner-form-title">You and your instance</div> 130 <div i18n class="inner-form-title">You and your instance</div>
131 131
132 <div class="form-group"> 132 <div class="form-group">
133 <label i18n for="instanceAdministrator">Who is behind the instance? </label> 133 <label i18n for="instanceAdministrator">Who is behind the instance?</label>
134 <div class="label-small-info">A single person? A non profit? A company?</div> 134 <div class="label-small-info">A single person? A non profit? A company?</div>
135 135
136 <my-markdown-textarea
137 id="instanceAdministrator" formControlName="administrator" textareaWidth="500px" textareaHeight="75px" [previewColumn]="true"
138 [classes]="{ 'input-error': formErrors['instance.administrator'] }"
139 ></my-markdown-textarea>
140
141 <div *ngIf="formErrors.instance.administrator" class="form-error">{{ formErrors.instance.administrator }}</div>
142 </div>
143
144 <div class="form-group">
145 <label i18n for="instanceCreationReason">Why did you create this instance?</label>
146 <div class="label-small-info">To share your personal videos? To open registrations and allow people to upload what they want?</div>
147
136 <textarea 148 <textarea
137 id="instanceAdministrator" formControlName="administrator" 149 id="instanceCreationReason" formControlName="creationReason" class="small"
138 [ngClass]="{ 'input-error': formErrors['instance.administrator'] }" 150 [ngClass]="{ 'input-error': formErrors['instance.creationReason'] }"
139 ></textarea> 151 ></textarea>
140 <div *ngIf="formErrors.instance.administrator" class="form-error">{{ formErrors.instance.administrator }}</div> 152 <div *ngIf="formErrors.instance.creationReason" class="form-error">{{ formErrors.instance.creationReason }}</div>
141 </div> 153 </div>
142 154
143 <div class="form-group"> 155 <div class="form-group">
@@ -145,7 +157,7 @@
145 <div class="label-small-info">It's important to know for users who want to register on your instance</div> 157 <div class="label-small-info">It's important to know for users who want to register on your instance</div>
146 158
147 <textarea 159 <textarea
148 id="instanceMaintenanceLifetime" formControlName="maintenanceLifetime" 160 id="instanceMaintenanceLifetime" formControlName="maintenanceLifetime" class="small"
149 [ngClass]="{ 'input-error': formErrors['instance.maintenanceLifetime'] }" 161 [ngClass]="{ 'input-error': formErrors['instance.maintenanceLifetime'] }"
150 ></textarea> 162 ></textarea>
151 <div *ngIf="formErrors.instance.maintenanceLifetime" class="form-error">{{ formErrors.instance.maintenanceLifetime }}</div> 163 <div *ngIf="formErrors.instance.maintenanceLifetime" class="form-error">{{ formErrors.instance.maintenanceLifetime }}</div>
@@ -156,7 +168,7 @@
156 <div class="label-small-info">With you own funds? With users donations? Advertising?</div> 168 <div class="label-small-info">With you own funds? With users donations? Advertising?</div>
157 169
158 <textarea 170 <textarea
159 id="instanceBusinessModel" formControlName="businessModel" 171 id="instanceBusinessModel" formControlName="businessModel" class="small"
160 [ngClass]="{ 'input-error': formErrors['instance.businessModel'] }" 172 [ngClass]="{ 'input-error': formErrors['instance.businessModel'] }"
161 ></textarea> 173 ></textarea>
162 <div *ngIf="formErrors.instance.businessModel" class="form-error">{{ formErrors.instance.businessModel }}</div> 174 <div *ngIf="formErrors.instance.businessModel" class="form-error">{{ formErrors.instance.businessModel }}</div>
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss
index 68f1b01b7..2b4d0da2c 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss
@@ -44,8 +44,8 @@ textarea {
44 44
45 display: block; 45 display: block;
46 46
47 &#instanceShortDescription { 47 &.small {
48 height: 100px; 48 height: 75px;
49 } 49 }
50} 50}
51 51
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
index 3119ab040..e6f56bc97 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
@@ -100,6 +100,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
100 100
101 terms: null, 101 terms: null,
102 codeOfConduct: null, 102 codeOfConduct: null,
103
104 creationReason: null,
103 moderationInformation: null, 105 moderationInformation: null,
104 administrator: null, 106 administrator: null,
105 maintenanceLifetime: null, 107 maintenanceLifetime: null,
diff --git a/config/default.yaml b/config/default.yaml
index f84ecfcf9..7ed096dcd 100644
--- a/config/default.yaml
+++ b/config/default.yaml
@@ -243,6 +243,9 @@ instance:
243 # Who moderates the instance? What is the policy regarding NSFW videos? Political videos? etc 243 # Who moderates the instance? What is the policy regarding NSFW videos? Political videos? etc
244 moderation_information: '' # Supports markdown 244 moderation_information: '' # Supports markdown
245 245
246 # Why did you create this instance?
247 creation_reason: ''
248
246 # Who is behind the instance? A single person? A non profit? 249 # Who is behind the instance? A single person? A non profit?
247 administrator: '' 250 administrator: ''
248 251
diff --git a/config/production.yaml.example b/config/production.yaml.example
index 397e52740..b86068bde 100644
--- a/config/production.yaml.example
+++ b/config/production.yaml.example
@@ -251,9 +251,58 @@ auto_blacklist:
251instance: 251instance:
252 name: 'PeerTube' 252 name: 'PeerTube'
253 short_description: 'PeerTube, a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.' 253 short_description: 'PeerTube, a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.'
254 description: '' # Support markdown 254 description: 'Welcome to this PeerTube instance!' # Support markdown
255 terms: '' # Support markdown 255 terms: 'No terms for now.' # Support markdown
256 code_of_conduct: '' # Supports markdown
257
258 # Who moderates the instance? What is the policy regarding NSFW videos? Political videos? etc
259 moderation_information: '' # Supports markdown
260
261 # Why did you create this instance?
262 creation_reason: ''
263
264 # Who is behind the instance? A single person? A non profit?
265 administrator: ''
266
267 # How long do you plan to maintain this instance?
268 maintenance_lifetime: ''
269
270 # How will you pay the PeerTube instance server? With you own funds? With users donations? Advertising?
271 business_model: ''
272
273 # What are the main languages of your instance? To interact with your users for example
274 # Uncomment or add the languages you want
275 # List of supported languages: https://peertube.cpy.re/api/v1/videos/languages
276 languages:
277# - en
278# - es
279# - fr
280
281 # You can specify the main categories of your instance (dedicated to music, gaming or politics etc)
282 # Uncomment or add the category ids you want
283 # List of supported categories: https://peertube.cpy.re/api/v1/videos/categories
284 categories:
285# - 1 # Music
286# - 2 # Films
287# - 3 # Vehicles
288# - 4 # Art
289# - 5 # Sports
290# - 6 # Travels
291# - 7 # Gaming
292# - 8 # People
293# - 9 # Comedy
294# - 10 # Entertainment
295# - 11 # News & Politics
296# - 12 # How To
297# - 13 # Education
298# - 14 # Activism
299# - 15 # Science & Technology
300# - 16 # Animals
301# - 17 # Kids
302# - 18 # Food
303
256 default_client_route: '/videos/trending' 304 default_client_route: '/videos/trending'
305
257 # Whether or not the instance is dedicated to NSFW content 306 # Whether or not the instance is dedicated to NSFW content
258 # Enabling it will allow other administrators to know that you are mainly federating sensitive content 307 # Enabling it will allow other administrators to know that you are mainly federating sensitive content
259 # Moreover, the NSFW checkbox on video upload will be automatically checked by default 308 # Moreover, the NSFW checkbox on video upload will be automatically checked by default
@@ -261,6 +310,7 @@ instance:
261 # By default, "do_not_list" or "blur" or "display" NSFW videos 310 # By default, "do_not_list" or "blur" or "display" NSFW videos
262 # Could be overridden per user with a setting 311 # Could be overridden per user with a setting
263 default_nsfw_policy: 'do_not_list' 312 default_nsfw_policy: 'do_not_list'
313
264 customizations: 314 customizations:
265 javascript: '' # Directly your JavaScript code (without <script> tags). Will be eval at runtime 315 javascript: '' # Directly your JavaScript code (without <script> tags). Will be eval at runtime
266 css: '' # Directly your CSS code (without <style> tags). Will be injected at runtime 316 css: '' # Directly your CSS code (without <style> tags). Will be injected at runtime
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',
diff --git a/shared/extra-utils/server/config.ts b/shared/extra-utils/server/config.ts
index 785421c98..66e0a008e 100644
--- a/shared/extra-utils/server/config.ts
+++ b/shared/extra-utils/server/config.ts
@@ -55,6 +55,7 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti
55 terms: 'my super terms', 55 terms: 'my super terms',
56 codeOfConduct: 'my super coc', 56 codeOfConduct: 'my super coc',
57 57
58 creationReason: 'my super creation reason',
58 moderationInformation: 'my super moderation information', 59 moderationInformation: 'my super moderation information',
59 administrator: 'Kuja', 60 administrator: 'Kuja',
60 maintenanceLifetime: 'forever', 61 maintenanceLifetime: 'forever',
diff --git a/shared/models/server/about.model.ts b/shared/models/server/about.model.ts
index e32ed26ee..bde4e0b50 100644
--- a/shared/models/server/about.model.ts
+++ b/shared/models/server/about.model.ts
@@ -7,6 +7,7 @@ export interface About {
7 7
8 codeOfConduct: string 8 codeOfConduct: string
9 9
10 creationReason: string
10 moderationInformation: string 11 moderationInformation: string
11 administrator: string 12 administrator: string
12 maintenanceLifetime: string 13 maintenanceLifetime: string
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts
index 0c331a820..a7c2a3bab 100644
--- a/shared/models/server/custom-config.model.ts
+++ b/shared/models/server/custom-config.model.ts
@@ -8,6 +8,7 @@ export interface CustomConfig {
8 terms: string 8 terms: string
9 codeOfConduct: string 9 codeOfConduct: string
10 10
11 creationReason: string
11 moderationInformation: string 12 moderationInformation: string
12 administrator: string 13 administrator: string
13 maintenanceLifetime: string 14 maintenanceLifetime: string