+ </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 the public index"
+ >
+ <ng-container ngProjectAs="description">
+ <span i18n>⚠️ This functionality requires a lot of attention and extra moderation.</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"
+ 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"
+ 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>
+
+ </ng-template>
+ </ngb-tab>
+
+ <ngb-tab id="services" i18n-title title="Services">
+ <ng-template ngbTabContent>
+
+ <div class="form-row mt-5"> <!-- 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">
+ Optional. If any, provide the Twitter account representing your instance to improve link previews.
+ </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"
+ 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 whitelisted by Twitter</ng-container>
+ </ng-template>
+
+ <ng-template ptTemplate="help">
+ <ng-container i18n>
+ If your instance is whitelisted by Twitter, a video player will be embedded in the Twitter feed on PeerTube video share.<br />
+ If the instance is not whitelisted, we use an image link card that will redirect on 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 whitelisted.
+ </ng-container>
+ </ng-template>
+ </my-peertube-checkbox>
+ </div>
+
+ </ng-container>
+ </ng-container>
+
+ </div>
+ </div>
+
+ </ng-template>
+ </ngb-tab>
+
+ <ngb-tab id="advanced-configuration" i18n-title title="Advanced configuration">
+ <ng-template ngbTabContent>
+
+ <div class="form-row mt-5"> <!-- transcoding grid -->
+ <div class="form-group col-12 col-lg-4 col-xl-3">
+ <div i18n class="inner-form-title">TRANSCODING</div>
+ <div i18n class="inner-form-description">
+ Process uploaded videos so that they are in a streamable form that any device can play. Though costly in
+ resources, this is a critical part of PeerTube, so tread carefully.
+ </div>
+ </div>
+
+ <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
+
+ <ng-container formGroupName="transcoding">
+
+ <div class="form-group">
+ <my-peertube-checkbox inputName="transcodingEnabled" formControlName="enabled">
+ <ng-template ptTemplate="label">
+ <ng-container i18n>Transcoding enabled</ng-container>
+ </ng-template>
+
+ <ng-template ptTemplate="help">
+ <ng-container i18n>If you disable transcoding, many videos from your users will not work!</ng-container>
+ </ng-template>
+
+ <ng-container ngProjectAs="extra">
+
+ <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
+ <my-peertube-checkbox
+ inputName="transcodingAllowAdditionalExtensions" formControlName="allowAdditionalExtensions"
+ i18n-labelText labelText="Allow additional extensions"
+ >
+ <ng-container ngProjectAs="description">
+ <span i18n>Allows users to upload .mkv, .mov, .avi and .flv videos.</span>
+ </ng-container>
+ </my-peertube-checkbox>
+ </div>
+
+ <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
+ <my-peertube-checkbox
+ inputName="transcodingAllowAudioFiles" formControlName="allowAudioFiles"
+ i18n-labelText labelText="Allow audio files upload"
+ >
+ <ng-container ngProjectAs="description">
+ <span i18n>Allows users to upload audio files that will be merged with the preview file on upload.</span>
+ </ng-container>
+ </my-peertube-checkbox>
+ </div>
+
+ <ng-container formGroupName="webtorrent">
+ <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
+ <my-peertube-checkbox
+ inputName="transcodingWebTorrentEnabled" formControlName="enabled"
+ i18n-labelText labelText="WebTorrent support enabled"
+ >
+ <ng-template ptTemplate="help">
+ <ng-container i18n>
+ <strong>Experimental, we suggest you to not disable webtorrent support for now</strong>
+
+ <p>If you also enabled HLS support, it will multiply videos storage by 2</p>
+
+ <br />
+
+ <strong>If disabled, breaks federation with PeerTube instances < 2.1</strong>
+ </ng-container>
+ </ng-template>
+ </my-peertube-checkbox>
+ </div>
+ </ng-container>
+
+ <ng-container formGroupName="hls">
+ <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
+ <my-peertube-checkbox
+ inputName="transcodingHlsEnabled" formControlName="enabled"
+ i18n-labelText labelText="HLS support enabled"
+ >
+ <ng-template ptTemplate="help">
+ <ng-container i18n>
+ <strong>Requires ffmpeg >= 4.1</strong>
+
+ <p>Generate HLS playlists and fragmented MP4 files resulting in a better playback than with the current default player:</p>
+ <ul>
+ <li>Resolution change is smoother</li>
+ <li>Faster playback in particular with long videos</li>
+ <li>More stable playback (less bugs/infinite loading)</li>
+ </ul>
+
+ <p>If you also enabled WebTorrent support, it will multiply videos storage by 2</p>
+ </ng-container>
+ </ng-template>
+ </my-peertube-checkbox>
+ </div>
+ </ng-container>
+
+ </ng-container>
+ </my-peertube-checkbox>
+ </div>
+
+ <div class="form-group">
+
+ <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
+ <label i18n for="transcodingThreads">Transcoding threads</label>
+ <div class="peertube-select-container">
+ <select id="transcodingThreads" formControlName="threads">
+ <option *ngFor="let transcodingThreadOption of transcodingThreadOptions" [value]="transcodingThreadOption.value">
+ {{ transcodingThreadOption.label }}
+ </option>
+ </select>
+ </div>
+ <div *ngIf="formErrors.transcoding.threads" class="form-error">{{ formErrors.transcoding.threads }}</div>
+ </div>
+
+ </div>
+
+ <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
+
+ <label i18n for="transcodingThreads">Resolutions to generate</label>
+
+ <div class="ml-2 mt-2 d-flex flex-column">
+ <ng-container formGroupName="resolutions">
+ <div class="form-group" *ngFor="let resolution of resolutions">
+ <my-peertube-checkbox
+ [inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id"
+ labelText="{{resolution.label}}"
+ >
+ <ng-template *ngIf="resolution.description" ptTemplate="help">
+ <div [innerHTML]="resolution.description"></div>
+ </ng-template>
+ </my-peertube-checkbox>
+ </div>
+ </ng-container>
+ </div>
+
+ </div>
+
+ </ng-container>
+
+ </div>
+ </div>
+
+ <div class="form-row mt-4"> <!-- cache grid -->
+ <div class="form-group col-12 col-lg-4 col-xl-3">
+ <div i18n class="inner-form-title">CACHE</div>
+ <div i18n class="inner-form-description">
+ Some files are not federated, and fetched when necessary. Define their caching policies.
+ </div>
+ </div>
+
+ <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
+
+ <ng-container formGroupName="cache">
+ <div class="form-group" formGroupName="previews">
+ <label i18n for="cachePreviewsSize">Number of previews to keep in cache</label>
+ <input
+ type="number" min="0" id="cachePreviewsSize"
+ formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.previews.size'] }"
+ >
+ <div *ngIf="formErrors.cache.previews.size" class="form-error">{{ formErrors.cache.previews.size }}</div>
+ </div>
+
+ <div class="form-group" formGroupName="captions">
+ <label i18n for="cacheCaptionsSize">Number of video captions to keep in cache</label>
+ <input
+ type="number" min="0" id="cacheCaptionsSize"
+ formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.captions.size'] }"
+ >
+ <div *ngIf="formErrors.cache.captions.size" class="form-error">{{ formErrors.cache.captions.size }}</div>
+ </div>
+ </ng-container>
+
+ </div>
+ </div>
+
+ <div class="form-row mt-4"> <!-- cache grid -->
+ <div class="form-group col-12 col-lg-4 col-xl-3">
+ <div class="anchor" id="customizations"></div> <!-- customizations anchor -->
+ <div i18n class="inner-form-title">CUSTOMIZATIONS</div>
+ <div i18n class="inner-form-description">
+ Slight modifications to your PeerTube instance for when creating a plugin or theme is overkill.
+ </div>
+ </div>
+
+ <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
+
+ <ng-container formGroupName="instance">
+ <ng-container formGroupName="customizations">
+ <div class="form-group">
+ <label i18n for="customizationJavascript">JavaScript</label>
+ <my-help>
+ <ng-template ptTemplate="customHtml">
+ <ng-container i18n>
+ Write JavaScript code directly.<br />Example: <pre>console.log('my instance is amazing');</pre>
+ </ng-container>
+ </ng-template>
+ </my-help>
+
+ <textarea
+ id="customizationJavascript" formControlName="javascript"
+ [ngClass]="{ 'input-error': formErrors['instance.customizations.javascript'] }"
+ ></textarea>
+
+ <div *ngIf="formErrors.instance.customizations.javascript" class="form-error">{{ formErrors.instance.customizations.javascript }}</div>
+ </div>
+
+ <div class="form-group">
+ <label for="customizationCSS">CSS</label>
+
+ <my-help>
+ <ng-template ptTemplate="customHtml">
+ <ng-container i18n>
+ Write CSS code directly. Example:<br /><br />
+ <pre>
+ #custom-css {{ '{' }}
+ color: red;
+ {{ '}' }}
+ </pre>
+ Prepend with <em>#custom-css</em> to override styles. Example:<br /><br />
+ <pre>
+ #custom-css .logged-in-email {{ '{' }}
+ color: red;
+ {{ '}' }}
+ </pre>
+ </ng-container>
+ </ng-template>
+ </my-help>
+
+ <textarea
+ id="customizationCSS" formControlName="css"
+ [ngClass]="{ 'input-error': formErrors['instance.customizations.css'] }"
+ ></textarea>
+ <div *ngIf="formErrors.instance.customizations.css" class="form-error">{{ formErrors.instance.customizations.css }}</div>
+ </div>
+ </ng-container>
+ </ng-container>
+
+ </div>
+ </div>
+
+ </ng-template>
+ </ngb-tab>
+ </ngb-tabset>
+
+ <div class="form-row mt-4"> <!-- submit placement block -->
+ <div class="col-md-7 col-xl-5"></div>
+ <div class="col-md-5 col-xl-5">
+ <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid">
+ <span class="form-error" i18n *ngIf="!form.valid">It seems like the configuration is invalid. Please search for potential errors in the different tabs.</span>