aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html
blob: 21a719d42ef8c869669f769935209abe7f6d2bfe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
<ng-container [formGroup]="form">
  <div class="form-row mt-5"> <!-- appearance grid -->
    <div class="form-group col-12 col-lg-4 col-xl-3">
      <div i18n class="inner-form-title">APPEARANCE</div>
      <div i18n class="inner-form-description">
        Use <a routerLink="/admin/plugins">plugins & themes</a> for more involved changes, or <a routerLink="/admin/config/edit-custom" fragment="advanced-configuration">add slight customizations</a>.
      </div>
    </div>

    <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">

      <ng-container formGroupName="theme">
        <div class="form-group">
          <label i18n for="themeDefault">Theme</label>

          <div class="peertube-select-container">
            <select formControlName="default" id="themeDefault" class="form-control">
              <option i18n value="default">default</option>

              <option *ngFor="let theme of getAvailableThemes()" [value]="theme">{{ theme }}</option>
            </select>
          </div>
        </div>
      </ng-container>

      <div class="form-group" formGroupName="instance">
        <label i18n for="instanceDefaultClientRoute">Landing page</label>

        <div class="peertube-select-container">
          <select id="instanceDefaultClientRoute" formControlName="defaultClientRoute" class="form-control">
            <option i18n value="/videos/overview">Discover videos</option>

            <optgroup i18n-label label="Trending pages">
              <option i18n value="/videos/trending">Default trending page</option>
              <option i18n value="/videos/trending?alg=best" [disabled]="!doesTrendingVideosAlgorithmsEnabledInclude('best')">Best videos</option>
              <option i18n value="/videos/trending?alg=hot" [disabled]="!doesTrendingVideosAlgorithmsEnabledInclude('hot')">Hot videos</option>
              <option i18n value="/videos/trending?alg=most-viewed" [disabled]="!doesTrendingVideosAlgorithmsEnabledInclude('most-viewed')">Most viewed videos</option>
              <option i18n value="/videos/trending?alg=most-liked" [disabled]="!doesTrendingVideosAlgorithmsEnabledInclude('most-liked')">Most liked videos</option>
            </optgroup>

            <option i18n value="/videos/recently-added">Recently added videos</option>
            <option i18n value="/videos/local">Local videos</option>
          </select>
        </div>

        <div *ngIf="formErrors.instance.defaultClientRoute" class="form-error">{{ formErrors.instance.defaultClientRoute }}</div>
      </div>

      <div class="form-group" formGroupName="trending">
        <ng-container formGroupName="videos">
          <ng-container formGroupName="algorithms">
            <label i18n for="trendingVideosAlgorithmsDefault">Default trending page</label>

            <div class="peertube-select-container">
              <select id="trendingVideosAlgorithmsDefault" formControlName="default" class="form-control">
                <option i18n value="best">Best videos</option>
                <option i18n value="hot">Hot videos</option>
                <option i18n value="most-viewed">Most viewed videos</option>
                <option i18n value="most-liked">Most liked videos</option>
              </select>
            </div>

            <div *ngIf="formErrors.trending.videos.algorithms.default" class="form-error">{{ formErrors.trending.videos.algorithms.default }}</div>
          </ng-container>
        </ng-container>
      </div>

    </div>
  </div>

  <div class="form-row mt-4"> <!-- broadcast grid -->
    <div class="form-group col-12 col-lg-4 col-xl-3">
      <div i18n class="inner-form-title">BROADCAST MESSAGE</div>
      <div i18n class="inner-for-description">
        Display a message on your instance
      </div>
    </div>

    <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">

      <ng-container formGroupName="broadcastMessage">

        <div class="form-group">
          <my-peertube-checkbox
            inputName="broadcastMessageEnabled" formControlName="enabled"
            i18n-labelText labelText="Enable broadcast message"
          ></my-peertube-checkbox>
        </div>

        <div class="form-group">
          <my-peertube-checkbox
            inputName="broadcastMessageDismissable" formControlName="dismissable"
            i18n-labelText labelText="Allow users to dismiss the broadcast message "
          ></my-peertube-checkbox>
        </div>

        <div class="form-group">
          <label i18n for="broadcastMessageLevel">Broadcast message level</label>

          <div class="peertube-select-container">
            <select id="broadcastMessageLevel" formControlName="level" class="form-control">
              <option value="info">info</option>
              <option value="warning">warning</option>
              <option value="error">error</option>
            </select>
          </div>

          <div *ngIf="formErrors.broadcastMessage.level" class="form-error">{{ formErrors.broadcastMessage.level }}</div>
        </div>

        <div class="form-group">
          <label i18n for="broadcastMessageMessage">Message</label><my-help helpType="markdownText"></my-help>

          <my-markdown-textarea
            name="broadcastMessageMessage" formControlName="message" textareaMaxWidth="500px"
            [classes]="{ 'input-error': formErrors['broadcastMessage.message'] }"
          ></my-markdown-textarea>

          <div *ngIf="formErrors.broadcastMessage.message" class="form-error">{{ formErrors.broadcastMessage.message }}</div>
        </div>

      </ng-container>

    </div>
  </div>

  <div class="form-row mt-4"> <!-- new users grid -->
    <div class="form-group col-12 col-lg-4 col-xl-3">
      <div i18n class="inner-form-title">NEW USERS</div>
      <div i18n class="inner-for-description">
        Manage <a routerLink="/admin/users">users</a> to set their quota individually.
      </div>
    </div>

    <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">

      <ng-container formGroupName="signup">
        <div class="form-group">
          <my-peertube-checkbox
            inputName="signupEnabled" formControlName="enabled"
            i18n-labelText labelText="Enable Signup"
          >
            <ng-container ngProjectAs="description">
              <span i18n>⚠️ This functionality requires a lot of attention and extra moderation.</span>

              <div class="alert alert-info alert-signup" *ngIf="signupAlertMessage">{{ signupAlertMessage }}</div>
            </ng-container>

            <ng-container ngProjectAs="extra">
              <my-peertube-checkbox [ngClass]="getDisabledSignupClass()"
                inputName="signupRequiresEmailVerification" formControlName="requiresEmailVerification"
                i18n-labelText labelText="Signup requires email verification"
              ></my-peertube-checkbox>

              <div [ngClass]="getDisabledSignupClass()" class="mt-3">
                <label i18n for="signupLimit">Signup limit</label>

                <div class="number-with-unit">
                  <input
                    type="number" min="-1" id="signupLimit" class="form-control"
                    formControlName="limit" [ngClass]="{ 'input-error': formErrors['signup.limit'] }"
                  >
                  <span i18n>{form.value['signup']['limit'], plural, =1 {user} other {users}}</span>
                </div>

                <div *ngIf="formErrors.signup.limit" class="form-error">{{ formErrors.signup.limit }}</div>

                <small i18n *ngIf="hasUnlimitedSignup()" class="text-muted">Signup won't be limited to a fixed number of users.</small>
              </div>
            </ng-container>
          </my-peertube-checkbox>
        </div>
      </ng-container>

      <ng-container formGroupName="user">
        <div class="form-group">
          <label i18n for="userVideoQuota">Default video quota per user</label>

          <my-select-custom-value
            id="userVideoQuota"
            [items]="getVideoQuotaOptions()"
            formControlName="videoQuota"
            i18n-inputSuffix inputSuffix="bytes" inputType="number"
            [clearable]="false"
          ></my-select-custom-value>

          <div *ngIf="formErrors.user.videoQuota" class="form-error">{{ formErrors.user.videoQuota }}</div>
        </div>

        <div class="form-group">
          <label i18n for="userVideoQuotaDaily">Default daily upload limit per user</label>

          <my-select-custom-value
            id="userVideoQuotaDaily"
            [items]="getVideoQuotaDailyOptions()"
            formControlName="videoQuotaDaily"
            i18n-inputSuffix inputSuffix="bytes" inputType="number"
            [clearable]="false"
          ></my-select-custom-value>

          <div *ngIf="formErrors.user.videoQuotaDaily" class="form-error">{{ formErrors.user.videoQuotaDaily }}</div>
        </div>
      </ng-container>

    </div>
  </div>

  <div class="form-row mt-4"> <!-- videos grid -->
    <div class="form-group col-12 col-lg-4 col-xl-3">
      <div i18n class="inner-form-title">VIDEOS</div>
    </div>

    <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">

      <ng-container formGroupName="import">

        <ng-container formGroupName="videos">

          <div class="form-group mt-4">
            <label i18n for="importConcurrency">Import jobs concurrency</label>
            <span i18n class="text-muted ml-1">allows to import multiple videos in parallel. ⚠️ Requires a PeerTube restart.</span>

            <div class="number-with-unit">
              <input type="number" name="importConcurrency" formControlName="concurrency" />
              <span i18n>jobs in parallel</span>
            </div>

            <div *ngIf="formErrors.import.concurrency" class="form-error">{{ formErrors.import.concurrency }}</div>
          </div>

          <div class="form-group" formGroupName="http">
            <my-peertube-checkbox
              inputName="importVideosHttpEnabled" formControlName="enabled"
              i18n-labelText labelText="Allow import with HTTP URL (e.g. YouTube)"
            ></my-peertube-checkbox>
          </div>

          <div class="form-group" formGroupName="torrent">
            <my-peertube-checkbox
              inputName="importVideosTorrentEnabled" formControlName="enabled"
              i18n-labelText labelText="Allow import with a torrent file or a magnet URI"
            ></my-peertube-checkbox>
          </div>

        </ng-container>
      </ng-container>

      <ng-container formGroupName="autoBlacklist">
        <ng-container formGroupName="videos">
          <ng-container formGroupName="ofUsers">

            <div class="form-group">
              <my-peertube-checkbox
                inputName="autoBlacklistVideosOfUsersEnabled" formControlName="enabled"
                i18n-labelText labelText="Block new videos automatically"
              >
              <ng-container ngProjectAs="description">
                <span i18n>Unless a user is marked as trusted, their videos will stay private until a moderator reviews them.</span>
              </ng-container>
            </my-peertube-checkbox>
            </div>

          </ng-container>
        </ng-container>
      </ng-container>

    </div>
  </div>

  <div class="form-row mt-4"> <!-- search grid -->
    <div class="form-group col-12 col-lg-4 col-xl-3">
      <div i18n class="inner-form-title">SEARCH</div>
    </div>

    <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">

      <ng-container formGroupName="search">
        <ng-container formGroupName="remoteUri">

          <div class="form-group">
            <my-peertube-checkbox
              inputName="searchRemoteUriUsers" formControlName="users"
              i18n-labelText labelText="Allow users to do remote URI/handle search"
            >
              <ng-container ngProjectAs="description">
                <span i18n>Allow <strong>your users</strong> to look up remote videos/actors that may not be federated with your instance</span>
              </ng-container>
            </my-peertube-checkbox>
          </div>

          <div class="form-group">
            <my-peertube-checkbox
              inputName="searchRemoteUriAnonymous" formControlName="anonymous"
              i18n-labelText labelText="Allow anonymous to do remote URI/handle search"
            >
              <ng-container ngProjectAs="description">
                <span i18n>Allow <strong>anonymous users</strong> to look up remote videos/actors that may not be federated with your instance</span>
              </ng-container>
            </my-peertube-checkbox>
          </div>

        </ng-container>

        <ng-container formGroupName="searchIndex">
          <div class="form-group">
            <my-peertube-checkbox
              inputName="searchIndexEnabled" formControlName="enabled"
              i18n-labelText labelText="Enable global search"
            >
              <ng-container ngProjectAs="description">
                <p i18n>⚠️ This functionality depends heavily on the moderation of instances followed by the search index you select.</p>

                <span i18n>
                  You should only use moderated search indexes in production, or <a href="https://framagit.org/framasoft/peertube/search-index">host your own</a>.
                </span>
              </ng-container>

              <ng-container ngProjectAs="extra">
                <div [ngClass]="getDisabledSearchIndexClass()">
                  <label i18n for="searchIndexUrl">Search index URL</label>

                  <input
                    type="text"  id="searchIndexUrl" class="form-control"
                    formControlName="url" [ngClass]="{ 'input-error': formErrors['search.searchIndex.url'] }"
                  >

                  <div *ngIf="formErrors.search.searchIndex.url" class="form-error">{{ formErrors.search.searchIndex.url }}</div>
                </div>

                <div class="mt-3">
                  <my-peertube-checkbox [ngClass]="getDisabledSearchIndexClass()"
                    inputName="searchIndexDisableLocalSearch" formControlName="disableLocalSearch"
                    i18n-labelText labelText="Disable local search in search bar"
                  ></my-peertube-checkbox>
                </div>

                <div class="mt-3">
                  <my-peertube-checkbox [ngClass]="getDisabledSearchIndexClass()"
                    inputName="searchIndexIsDefaultSearch" formControlName="isDefaultSearch"
                    i18n-labelText labelText="Search bar uses the global search index by default"
                  >
                    <ng-container ngProjectAs="description">
                      <span i18n>Otherwise the local search stays used by default</span>
                    </ng-container>
                  </my-peertube-checkbox>
                </div>

              </ng-container>
            </my-peertube-checkbox>
          </div>

        </ng-container>

      </ng-container>

    </div>
  </div>

  <div class="form-row mt-4"> <!-- federation grid -->
    <div class="form-group col-12 col-lg-4 col-xl-3">
      <div i18n class="inner-form-title">FEDERATION</div>
      <div i18n class="inner-form-description">
        Manage <a routerLink="/admin/follows">relations</a> with other instances.
      </div>
    </div>

    <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">

      <ng-container formGroupName="followers">
        <ng-container formGroupName="instance">

          <div class="form-group">
            <my-peertube-checkbox
              inputName="followersInstanceEnabled" formControlName="enabled"
              i18n-labelText labelText="Other instances can follow yours"
            ></my-peertube-checkbox>
          </div>

          <div class="form-group">
            <my-peertube-checkbox
              inputName="followersInstanceManualApproval" formControlName="manualApproval"
              i18n-labelText labelText="Manually approve new instance followers"
            ></my-peertube-checkbox>
          </div>
        </ng-container>
      </ng-container>

      <ng-container formGroupName="followings">
        <ng-container formGroupName="instance">

          <ng-container formGroupName="autoFollowBack">
            <div class="form-group">
              <my-peertube-checkbox
                inputName="followingsInstanceAutoFollowBackEnabled" formControlName="enabled"
                i18n-labelText labelText="Automatically follow back instances"
              >
                <ng-container ngProjectAs="description">
                  <span i18n>⚠️ This functionality requires a lot of attention and extra moderation.</span>
                </ng-container>
              </my-peertube-checkbox>
            </div>
          </ng-container>

          <ng-container formGroupName="autoFollowIndex">
            <div class="form-group">
              <my-peertube-checkbox
                inputName="followingsInstanceAutoFollowIndexEnabled" formControlName="enabled"
                i18n-labelText labelText="Automatically follow instances of a public index"
              >
                <ng-container ngProjectAs="description">
                  <p i18n>⚠️ This functionality requires a lot of attention and extra moderation.</p>

                  <span i18n>
                    You should only follow moderated indexes in production, or <a href="https://framagit.org/framasoft/peertube/instances-peertube#peertube-auto-follow">host your own</a>.
                  </span>
                </ng-container>

                <ng-container ngProjectAs="extra">
                  <div [ngClass]="{ 'disabled-checkbox-extra': !isAutoFollowIndexEnabled() }">
                    <label i18n for="followingsInstanceAutoFollowIndexUrl">Index URL</label>
                    <input
                      type="text" id="followingsInstanceAutoFollowIndexUrl" class="form-control"
                      formControlName="indexUrl" [ngClass]="{ 'input-error': formErrors['followings.instance.autoFollowIndex.indexUrl'] }"
                    >
                    <div *ngIf="formErrors.followings.instance.autoFollowIndex.indexUrl" class="form-error">{{ formErrors.followings.instance.autoFollowIndex.indexUrl }}</div>
                  </div>
                </ng-container>
              </my-peertube-checkbox>
            </div>

          </ng-container>
        </ng-container>
      </ng-container>

    </div>
  </div>

  <div class="form-row mt-4"> <!-- administrators grid -->
    <div class="form-group col-12 col-lg-4 col-xl-3">
      <div i18n class="inner-form-title">ADMINISTRATORS</div>
    </div>

    <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">

      <div class="form-group" formGroupName="admin">
        <label i18n for="adminEmail">Admin email</label>

        <input
          type="text" id="adminEmail" class="form-control"
          formControlName="email" [ngClass]="{ 'input-error': formErrors['admin.email'] }"
        >

        <div *ngIf="formErrors.admin.email" class="form-error">{{ formErrors.admin.email }}</div>
      </div>

      <div class="form-group" formGroupName="contactForm">
        <my-peertube-checkbox
          inputName="enableContactForm" formControlName="enabled"
          i18n-labelText labelText="Enable contact form"
        ></my-peertube-checkbox>
      </div>

    </div>
  </div>

  <div class="form-row mt-4"> <!-- Twitter grid -->
    <div class="form-group col-12 col-lg-4 col-xl-3">
      <div i18n class="inner-form-title">TWITTER</div>
      <div i18n class="inner-form-description">
        Provide the Twitter account representing your instance to improve link previews.
        If you don't have a Twitter account, just leave the default value.
      </div>
    </div>

    <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">

      <ng-container formGroupName="services">
        <ng-container formGroupName="twitter">

          <div class="form-group">
            <label i18n for="signupLimit">Your Twitter username</label>

            <input
              type="text" id="servicesTwitterUsername" class="form-control"
              formControlName="username" [ngClass]="{ 'input-error': formErrors['services.twitter.username'] }"
            >

            <div *ngIf="formErrors.services.twitter.username" class="form-error">{{ formErrors.services.twitter.username }}</div>
          </div>

          <div class="form-group">
            <my-peertube-checkbox inputName="servicesTwitterWhitelisted" formControlName="whitelisted">
              <ng-template ptTemplate="label">
                <ng-container i18n>Instance allowed by Twitter</ng-container>
              </ng-template>

              <ng-template ptTemplate="help">
                <ng-container i18n>
                  If your instance is explicitly allowed by Twitter, a video player will be embedded in the Twitter feed on PeerTube video share.<br />
                  If the instance is not, we use an image link card that will redirect to your PeerTube instance.<br /><br />
                  Check this checkbox, save the configuration and test with a video URL of your instance (https://example.com/videos/watch/blabla) on
                  <a target='_blank' rel='noopener noreferrer' href='https://cards-dev.twitter.com/validator'>https://cards-dev.twitter.com/validator</a>
                  to see if you instance is allowed.
                </ng-container>
              </ng-template>
            </my-peertube-checkbox>
          </div>

        </ng-container>
      </ng-container>

    </div>
  </div>
</ng-container>