+<h1 class="sr-only" i18n>Configuration</h1>
<form role="form" [formGroup]="form">
<div ngbNav #nav="ngbNav" class="nav-tabs">
<label i18n for="instanceCategories">Main instance categories</label>
<div>
- <p-multiSelect
- inputId="instanceCategories" [options]="categoryItems" formControlName="categories" [showToggleAll]="false"
- [defaultLabel]="getDefaultCategoryLabel()" [selectedItemsLabel]="getSelectedCategoryLabel()"
- emptyFilterMessage="No results found" i18n-emptyFilterMessage
- ></p-multiSelect>
+ <my-select-checkbox
+ id="instanceCategories"
+ formControlName="categories" [availableItems]="categoryItems"
+ [selectableGroup]="false"
+ i18n-placeholder placeholder="Add a new category"
+ >
+ </my-select-checkbox>
</div>
</div>
<label i18n for="instanceLanguages">Main languages you/your moderators speak</label>
<div>
- <p-multiSelect
- inputId="instanceLanguages" [options]="languageItems" formControlName="languages" [showToggleAll]="false"
- [defaultLabel]="getDefaultLanguageLabel()" [selectedItemsLabel]="getSelectedLanguageLabel()"
- emptyFilterMessage="No results found" i18n-emptyFilterMessage
- ></p-multiSelect>
+ <my-select-checkbox
+ id="instanceLanguages"
+ formControlName="languages" [availableItems]="languageItems"
+ [selectableGroup]="false"
+ i18n-placeholder placeholder="Add a new language"
+ >
+ </my-select-checkbox>
</div>
</div>
<div class="form-group">
<my-peertube-checkbox
inputName="signupEnabled" formControlName="enabled"
- i18n-labelText labelText="Signup 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]="{ 'disabled-checkbox-extra': !isSignupEnabled() }"
<div [ngClass]="{ 'disabled-checkbox-extra': !isSignupEnabled() }" class="mt-3">
<label i18n for="signupLimit">Signup limit</label>
- <input
- type="number" min="-1" id="signupLimit" class="form-control"
- formControlName="limit" [ngClass]="{ 'input-error': formErrors['signup.limit'] }"
- >
+ <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 *ngIf="form.value['signup']['limit'] === -1" class="text-muted">Signup won't be limited to a fixed number of users.</small>
</div>
</div>
</div>
- <div class="form-row mt-4"> <!-- new videos grid -->
+ <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">NEW VIDEOS</div>
+ <div i18n class="inner-form-title">VIDEOS</div>
</div>
<div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
<div class="form-group">
<my-peertube-checkbox
inputName="autoBlacklistVideosOfUsersEnabled" formControlName="enabled"
- i18n-labelText labelText="Blacklist new videos automatically"
+ 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>
</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]="{ 'disabled-checkbox-extra': !isSearchIndexEnabled() }">
+ <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]="{ 'disabled-checkbox-extra': !isSearchIndexEnabled() }"
+ 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]="{ 'disabled-checkbox-extra': !isSearchIndexEnabled() }"
+ 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>
<p i18n>⚠️ This functionality requires a lot of attention and extra moderation.</p>
<span i18n>
- You should only follow indexes you trust, or <a href="https://framagit.org/framasoft/peertube/instances-peertube#peertube-auto-follow">host your own</a>.
+ 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>
<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-container i18n>Instance allowed 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 />
+ 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 whitelisted.
+ to see if you instance is allowed.
</ng-container>
</ng-template>
</my-peertube-checkbox>
</ng-template>
</ng-container>
+ <div ngbNavItem="live">
+ <a ngbNavLink i18n>Live streaming</a>
+
+ <ng-template ngbNavContent>
+
+ <div class="form-row mt-5">
+ <div class="form-group col-12 col-lg-4 col-xl-3">
+ <div i18n class="inner-form-title">LIVE</div>
+ <div i18n class="inner-form-description">
+ Enable users of your instance to stream live.
+ </div>
+ </div>
+
+ <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
+
+ <ng-container formGroupName="live">
+
+ <div class="form-group">
+ <my-peertube-checkbox inputName="liveEnabled" formControlName="enabled">
+ <ng-template ptTemplate="label">
+ <ng-container i18n>Allow live streaming</ng-container>
+ </ng-template>
+
+ <ng-container ngProjectAs="description" i18n>
+ ⚠️ Enabling live streaming requires trust in your users and extra moderation work
+ </ng-container>
+
+ <ng-container ngProjectAs="extra">
+
+ <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
+ <my-peertube-checkbox
+ inputName="liveAllowReplay" formControlName="allowReplay"
+ i18n-labelText labelText="Allow your users to automatically publish a replay of their live"
+ >
+ <ng-container ngProjectAs="description" i18n>
+ If the user quota is reached, PeerTube will automatically terminate the live streaming
+ </ng-container>
+ </my-peertube-checkbox>
+ </div>
+
+ <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
+ <label i18n for="liveMaxInstanceLives">Max lives created on your instance (-1 for "unlimited")</label>
+ <div class="number-with-unit">
+ <input type="number" name="liveMaxInstanceLives" formControlName="maxInstanceLives" />
+ <span i18n>{form.value['live']['maxInstanceLives'], plural, =1 {live} other {lives}}</span>
+ </div>
+ </div>
+
+ <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
+ <label i18n for="liveMaxUserLives">Max lives created per user (-1 for "unlimited")</label>
+ <div class="number-with-unit">
+ <input type="number" name="liveMaxUserLives" formControlName="maxUserLives" />
+ <span i18n>{form.value['live']['maxUserLives'], plural, =1 {live} other {lives}}</span>
+ </div>
+ </div>
+
+ <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
+ <label i18n for="liveMaxDuration">Max live duration</label>
+ <div class="peertube-select-container">
+ <ng-select
+ labelForId="liveMaxDuration" [items]="liveMaxDurationOptions" formControlName="maxDuration"
+ bindLabel="label" bindValue="value"
+ [clearable]="false"
+ [searchable]="false"
+ ></ng-select>
+ </div>
+ </div>
+
+ <ng-container formGroupName="transcoding">
+
+ <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
+ <my-peertube-checkbox
+ inputName="liveTranscodingEnabled" formControlName="enabled"
+ i18n-labelText labelText="Enable live transcoding"
+ >
+ <ng-container ngProjectAs="description" i18n>
+ Requires a lot of CPU!
+ </ng-container>
+ </my-peertube-checkbox>
+ </div>
+
+ <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() || !isLiveTranscodingEnabled() }">
+ <label i18n for="liveTranscodingThreads">Live transcoding threads</label>
+ <div class="peertube-select-container">
+ <select id="liveTranscodingThreads" formControlName="threads" class="form-control">
+ <option *ngFor="let transcodingThreadOption of transcodingThreadOptions" [value]="transcodingThreadOption.value">
+ {{ transcodingThreadOption.label }} {transcodingThreadOption.value, plural, =0 {} =1 {thread} other {threads}}
+ </option>
+ </select>
+ </div>
+ <div *ngIf="formErrors.live.transcoding.threads" class="form-error">{{ formErrors.live.transcoding.threads }}</div>
+ </div>
+
+ <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() || !isLiveTranscodingEnabled() }">
+ <label i18n for="liveTranscodingThreads">Live 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 liveResolutions">
+ <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>
+ </ng-container>
+ </my-peertube-checkbox>
+ </div>
+ </ng-container>
+ </div>
+ </div>
+
+ </ng-template>
+ </div>
+
<ng-container ngbNavItem="advanced-configuration">
<a ngbNavLink i18n>Advanced configuration</a>
i18n-labelText labelText="Allow additional extensions"
>
<ng-container ngProjectAs="description">
- <span i18n>Allows users to upload .mkv, .mov, .avi and .flv videos.</span>
+ <span i18n>Allows users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos.</span>
</ng-container>
</my-peertube-checkbox>
</div>
<div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
<my-peertube-checkbox
inputName="transcodingHlsEnabled" formControlName="enabled"
- i18n-labelText labelText="HLS support enabled"
+ i18n-labelText labelText="HLS with P2P support enabled"
>
<ng-template ptTemplate="help">
<ng-container i18n>
<div class="peertube-select-container">
<select id="transcodingThreads" formControlName="threads" class="form-control">
<option *ngFor="let transcodingThreadOption of transcodingThreadOptions" [value]="transcodingThreadOption.value">
- {{ transcodingThreadOption.label }}
+ {{ transcodingThreadOption.label }} {transcodingThreadOption.value, plural, =0 {} =1 {thread} other {threads}}
</option>
</select>
</div>
<div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
- <label i18n for="transcodingThreads">Resolutions to generate</label>
+ <label i18n>Resolutions to generate</label>
<div class="ml-2 mt-2 d-flex flex-column">
<ng-container formGroupName="resolutions">
<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" class="form-control"
- formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.previews.size'] }"
- >
+ <div class="number-with-unit">
+ <input
+ type="number" min="0" id="cachePreviewsSize" class="form-control"
+ formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.previews.size'] }"
+ >
+ <span i18n>{form.value['cache']['previews']['size'], plural, =1 {cached image} other {cached images}}</span>
+ </div>
<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" class="form-control"
- formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.captions.size'] }"
- >
+ <div class="number-with-unit">
+ <input
+ type="number" min="0" id="cacheCaptionsSize" class="form-control"
+ formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.captions.size'] }"
+ >
+ <span i18n>{form.value['cache']['captions']['size'], plural, =1 {cached image} other {cached images}}</span>
+ </div>
<div *ngIf="formErrors.cache.captions.size" class="form-error">{{ formErrors.cache.captions.size }}</div>
</div>
</ng-container>
<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">
- <span class="form-error submit-error" i18n *ngIf="!form.valid">It seems like the configuration is invalid. Please search for potential errors in the different tabs.</span>
+ <span class="form-error submit-error" i18n *ngIf="!form.valid">
+ It seems like the configuration is invalid. Please search for potential errors in the different tabs.
+ </span>
+
+ <span class="form-error submit-error" i18n *ngIf="!hasLiveAllowReplayConsistentOptions()">
+ You cannot allow live replay if you don't enable transcoding.
+ </span>
- <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid">
+ <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid || !hasConsistentOptions()">
</div>
</div>
</form>