<div i18n class="inner-form-title">Signup</div>
- <my-peertube-checkbox
- inputName="signupEnabled" formControlName="signupEnabled"
- i18n-labelText labelText="Signup enabled"
- ></my-peertube-checkbox>
+ <div class="form-group">
+ <my-peertube-checkbox
+ inputName="signupEnabled" formControlName="signupEnabled"
+ i18n-labelText labelText="Signup enabled"
+ ></my-peertube-checkbox>
+ </div>
- <my-peertube-checkbox *ngIf="isSignupEnabled()"
- inputName="signupRequiresEmailVerification" formControlName="signupRequiresEmailVerification"
- i18n-labelText labelText="Signup requires email verification"
- ></my-peertube-checkbox>
+ <div class="form-group">
+ <my-peertube-checkbox *ngIf="isSignupEnabled()"
+ inputName="signupRequiresEmailVerification" formControlName="signupRequiresEmailVerification"
+ i18n-labelText labelText="Signup requires email verification"
+ ></my-peertube-checkbox>
+ </div>
<div *ngIf="isSignupEnabled()" class="form-group">
<label i18n for="signupLimit">Signup limit</label>
<div i18n class="inner-form-title">Import</div>
- <my-peertube-checkbox
- inputName="importVideosHttpEnabled" formControlName="importVideosHttpEnabled"
- i18n-labelText labelText="Video import with HTTP URL (i.e. YouTube) enabled"
- ></my-peertube-checkbox>
+ <div class="form-group">
+ <my-peertube-checkbox
+ inputName="importVideosHttpEnabled" formControlName="importVideosHttpEnabled"
+ i18n-labelText labelText="Video import with HTTP URL (i.e. YouTube) enabled"
+ ></my-peertube-checkbox>
+ </div>
- <my-peertube-checkbox
- inputName="importVideosTorrentEnabled" formControlName="importVideosTorrentEnabled"
- i18n-labelText labelText="Video import with a torrent file or a magnet URI enabled"
- ></my-peertube-checkbox>
+ <div class="form-group">
+ <my-peertube-checkbox
+ inputName="importVideosTorrentEnabled" formControlName="importVideosTorrentEnabled"
+ i18n-labelText labelText="Video import with a torrent file or a magnet URI enabled"
+ ></my-peertube-checkbox>
+ </div>
<div i18n class="inner-form-title">Administrator</div>
</div>
</div>
- <my-peertube-checkbox
- inputName="servicesTwitterWhitelisted" formControlName="servicesTwitterWhitelisted"
- i18n-labelText labelText="Instance whitelisted by Twitter"
- i18n-helpHtml helpHtml="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."
- ></my-peertube-checkbox>
+ <div class="form-group">
+ <my-peertube-checkbox
+ inputName="servicesTwitterWhitelisted" formControlName="servicesTwitterWhitelisted"
+ i18n-labelText labelText="Instance whitelisted by Twitter"
+ i18n-helpHtml helpHtml="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."
+ ></my-peertube-checkbox>
+ </div>
</ng-template>
</ngb-tab>
<div i18n class="inner-form-title">Transcoding</div>
- <my-peertube-checkbox
- inputName="transcodingEnabled" formControlName="transcodingEnabled"
- i18n-labelText labelText="Transcoding enabled"
- i18n-helpHtml helpHtml="If you disable transcoding, many videos from your users will not work!"
- ></my-peertube-checkbox>
+ <div class="form-group">
+ <my-peertube-checkbox
+ inputName="transcodingEnabled" formControlName="transcodingEnabled"
+ i18n-labelText labelText="Transcoding enabled"
+ i18n-helpHtml helpHtml="If you disable transcoding, many videos from your users will not work!"
+ ></my-peertube-checkbox>
+ </div>
<ng-template [ngIf]="isTranscodingEnabled()">
[inputName]="getResolutionKey(resolution)" [formControlName]="getResolutionKey(resolution)"
i18n-labelText labelText="Resolution {{resolution}} enabled"
></my-peertube-checkbox>
-
</div>
</ng-template>
</div>
</div>
- <my-peertube-checkbox
- inputName="webTorrentEnabled" formControlName="webTorrentEnabled"
- i18n-labelText labelText="Use WebTorrent to exchange parts of the video with others"
- ></my-peertube-checkbox>
+ <div class="form-group">
+ <my-peertube-checkbox
+ inputName="webTorrentEnabled" formControlName="webTorrentEnabled"
+ i18n-labelText labelText="Use WebTorrent to exchange parts of the video with others"
+ ></my-peertube-checkbox>
+ </div>
- <my-peertube-checkbox
- inputName="autoPlayVideo" formControlName="autoPlayVideo"
- i18n-labelText labelText="Automatically plays video"
- ></my-peertube-checkbox>
+ <div class="form-group">
+ <my-peertube-checkbox
+ inputName="autoPlayVideo" formControlName="autoPlayVideo"
+ i18n-labelText labelText="Automatically plays video"
+ ></my-peertube-checkbox>
+ </div>
<input type="submit" i18n-value value="Save" [disabled]="!form.valid">
</form>
import * as Bluebird from 'bluebird'
import * as validator from 'validator'
import { ResultList } from '../../shared/models'
-import { Activity, ActivityPubActor } from '../../shared/models/activitypub'
+import { Activity } from '../../shared/models/activitypub'
import { ACTIVITY_PUB } from '../initializers'
import { ActorModel } from '../models/activitypub/actor'
import { signJsonLDObject } from './peertube-crypto'
return signJsonLDObject(byActor, activity) as Promise<Activity>
}
-function getActorUrl (activityActor: string | ActivityPubActor) {
- if (typeof activityActor === 'string') return activityActor
+function getAPUrl (activity: string | { id: string }) {
+ if (typeof activity === 'string') return activity
- return activityActor.id
+ return activity.id
}
function checkUrlsSameHost (url1: string, url2: string) {
export {
checkUrlsSameHost,
- getActorUrl,
+ getAPUrl,
activityPubContextify,
activityPubCollectionPagination,
buildSignedActivity
import * as uuidv4 from 'uuid/v4'
import { ActivityPubActor, ActivityPubActorType } from '../../../shared/models/activitypub'
import { ActivityPubAttributedTo } from '../../../shared/models/activitypub/objects'
-import { checkUrlsSameHost, getActorUrl } from '../../helpers/activitypub'
+import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub'
import { isActorObjectValid, normalizeActor } from '../../helpers/custom-validators/activitypub/actor'
import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'
import { retryTransactionWrapper, updateInstanceWithAnother } from '../../helpers/database-utils'
import { logger } from '../../helpers/logger'
import { createPrivateAndPublicKeys } from '../../helpers/peertube-crypto'
-import { doRequest, doRequestAndSaveToFile, downloadImage } from '../../helpers/requests'
+import { doRequest, downloadImage } from '../../helpers/requests'
import { getUrlFromWebfinger } from '../../helpers/webfinger'
-import { AVATARS_SIZE, CONFIG, IMAGE_MIMETYPE_EXT, PREVIEWS_SIZE, sequelizeTypescript } from '../../initializers'
+import { AVATARS_SIZE, CONFIG, IMAGE_MIMETYPE_EXT, sequelizeTypescript } from '../../initializers'
import { AccountModel } from '../../models/account/account'
import { ActorModel } from '../../models/activitypub/actor'
import { AvatarModel } from '../../models/avatar/avatar'
recurseIfNeeded = true,
updateCollections = false
) {
- const actorUrl = getActorUrl(activityActor)
+ const actorUrl = getAPUrl(activityActor)
let created = false
let actor = await fetchActorByUrl(actorUrl, fetchType)
import { Activity, ActivityType } from '../../../../shared/models/activitypub'
-import { checkUrlsSameHost, getActorUrl } from '../../../helpers/activitypub'
+import { checkUrlsSameHost, getAPUrl } from '../../../helpers/activitypub'
import { logger } from '../../../helpers/logger'
import { ActorModel } from '../../../models/activitypub/actor'
import { processAcceptActivity } from './process-accept'
continue
}
- const actorUrl = getActorUrl(activity.actor)
+ const actorUrl = getAPUrl(activity.actor)
// When we fetch remote data, we don't have signature
if (options.signatureActor && actorUrl !== options.signatureActor.url) {
import { getOrCreateActorAndServerAndModel } from './actor'
import { logger } from '../../helpers/logger'
import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers'
-import { checkUrlsSameHost, getActorUrl } from '../../helpers/activitypub'
+import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub'
async function shareVideoByServerAndChannel (video: VideoModel, t: Transaction) {
if (video.privacy === VideoPrivacy.PRIVATE) return undefined
})
if (!body || !body.actor) throw new Error('Body or body actor is invalid')
- const actorUrl = getActorUrl(body.actor)
+ const actorUrl = getAPUrl(body.actor)
if (checkUrlsSameHost(shareUrl, actorUrl) !== true) {
throw new Error(`Actor url ${actorUrl} has not the same host than the share url ${shareUrl}`)
}
import { logger } from '../../helpers/logger'
import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers'
import { doRequest } from '../../helpers/requests'
-import { checkUrlsSameHost, getActorUrl } from '../../helpers/activitypub'
+import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub'
import { ActorModel } from '../../models/activitypub/actor'
import { getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from './url'
})
if (!body || !body.actor) throw new Error('Body or body actor is invalid')
- const actorUrl = getActorUrl(body.actor)
+ const actorUrl = getAPUrl(body.actor)
if (checkUrlsSameHost(actorUrl, rateUrl) !== true) {
throw new Error(`Rate url ${rateUrl} has not the same host than actor url ${actorUrl}`)
}
import { addVideoShares, shareVideoByServerAndChannel } from './share'
import { AccountModel } from '../../models/account/account'
import { fetchVideoByUrl, VideoFetchByUrlType } from '../../helpers/video'
-import { checkUrlsSameHost } from '../../helpers/activitypub'
+import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub'
async function federateVideoIfNeeded (video: VideoModel, isNewVideo: boolean, transaction?: sequelize.Transaction) {
// If the video is not private and published, we federate it
const refreshViews = options.refreshViews || false
// Get video url
- const videoUrl = typeof options.videoObject === 'string' ? options.videoObject : options.videoObject.id
+ const videoUrl = getAPUrl(options.videoObject)
let videoFromDatabase = await fetchVideoByUrl(videoUrl, fetchType)
if (videoFromDatabase) {