</div>
</div>
+ <div class="form-group">
+ <label for="instanceShortDescription">Short description</label>
+ <textarea
+ id="instanceShortDescription" formControlName="instanceShortDescription"
+ [ngClass]="{ 'input-error': formErrors['instanceShortDescription'] }"
+ ></textarea>
+ <div *ngIf="formErrors.instanceShortDescription" class="form-error">
+ {{ formErrors.instanceShortDescription }}
+ </div>
+ </div>
+
<div class="form-group">
<label for="instanceDescription">Description</label><my-help helpType="markdownText"></my-help>
<my-markdown-textarea
@include peertube-textarea(500px, 150px);
display: block;
+
+ &#instanceShortDescription {
+ height: 100px;
+ }
}
import {
ADMIN_EMAIL,
CACHE_PREVIEWS_SIZE,
- INSTANCE_NAME,
+ INSTANCE_NAME, INSTANCE_SHORT_DESCRIPTION,
SIGNUP_LIMIT,
TRANSCODING_THREADS
} from '@app/shared/forms/form-validators/custom-config'
form: FormGroup
formErrors = {
instanceName: '',
+ instanceShortDescription: '',
instanceDescription: '',
instanceTerms: '',
instanceDefaultClientRoute: '',
customizationCSS: ''
}
validationMessages = {
+ instanceShortDescription: INSTANCE_SHORT_DESCRIPTION.MESSAGES,
instanceName: INSTANCE_NAME.MESSAGES,
cachePreviewsSize: CACHE_PREVIEWS_SIZE.MESSAGES,
signupLimit: SIGNUP_LIMIT.MESSAGES,
buildForm () {
const formGroupData = {
instanceName: [ '', INSTANCE_NAME.VALIDATORS ],
+ instanceShortDescription: [ '', INSTANCE_SHORT_DESCRIPTION.VALIDATORS ],
instanceDescription: [ '' ],
instanceTerms: [ '' ],
instanceDefaultClientRoute: [ '' ],
const data: CustomConfig = {
instance: {
name: this.form.value['instanceName'],
+ shortDescription: this.form.value['instanceShortDescription'],
description: this.form.value['instanceDescription'],
terms: this.form.value['instanceTerms'],
defaultClientRoute: this.form.value['instanceDefaultClientRoute'],
private updateForm () {
const data = {
instanceName: this.customConfig.instance.name,
+ instanceShortDescription: this.customConfig.instance.shortDescription,
instanceDescription: this.customConfig.instance.description,
instanceTerms: this.customConfig.instance.terms,
instanceDefaultClientRoute: this.customConfig.instance.defaultClientRoute,
private config: ServerConfig = {
instance: {
name: 'PeerTube',
+ shortDescription: '',
defaultClientRoute: '',
customizations: {
javascript: '',
}
}
+export const INSTANCE_SHORT_DESCRIPTION = {
+ VALIDATORS: [ Validators.max(250) ],
+ MESSAGES: {
+ 'max': 'Short description should not be longer than 250 characters.'
+ }
+}
+
export const CACHE_PREVIEWS_SIZE = {
VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ],
MESSAGES: {
instance:
name: 'PeerTube'
+ short_description: 'PeerTube, a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.'
description: 'Welcome to this PeerTube instance!' # Support markdown
terms: 'No terms for now.' # Support markdown
default_client_route: '/videos/trending'
instance:
name: 'PeerTube'
+ short_description: 'PeerTube, a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.'
description: '' # Support markdown
terms: '' # Support markdown
default_client_route: '/videos/trending'
const json: ServerConfig = {
instance: {
name: CONFIG.INSTANCE.NAME,
+ shortDescription: CONFIG.INSTANCE.SHORT_DESCRIPTION,
defaultClientRoute: CONFIG.INSTANCE.DEFAULT_CLIENT_ROUTE,
customizations: {
javascript: CONFIG.INSTANCE.CUSTOMIZATIONS.JAVASCRIPT,
const about: About = {
instance: {
name: CONFIG.INSTANCE.NAME,
+ shortDescription: CONFIG.INSTANCE.SHORT_DESCRIPTION,
description: CONFIG.INSTANCE.DESCRIPTION,
terms: CONFIG.INSTANCE.TERMS
}
const toUpdateJSON = omit(toUpdate, 'videoQuota')
toUpdateJSON.user['video_quota'] = toUpdate.user.videoQuota
toUpdateJSON.instance['default_client_route'] = toUpdate.instance.defaultClientRoute
+ toUpdateJSON.instance['short_description'] = toUpdate.instance.shortDescription
delete toUpdate.user.videoQuota
delete toUpdate.instance.defaultClientRoute
+ delete toUpdate.instance.shortDescription
await writeFilePromise(CONFIG.CUSTOM_FILE, JSON.stringify(toUpdateJSON, undefined, 2))
return {
instance: {
name: CONFIG.INSTANCE.NAME,
+ shortDescription: CONFIG.INSTANCE.SHORT_DESCRIPTION,
description: CONFIG.INSTANCE.DESCRIPTION,
terms: CONFIG.INSTANCE.TERMS,
defaultClientRoute: CONFIG.INSTANCE.DEFAULT_CLIENT_ROUTE,
},
INSTANCE: {
get NAME () { return config.get<string>('instance.name') },
+ get SHORT_DESCRIPTION () { return config.get<string>('instance.short_description') },
get DESCRIPTION () { return config.get<string>('instance.description') },
get TERMS () { return config.get<string>('instance.terms') },
get DEFAULT_CLIENT_ROUTE () { return config.get<string>('instance.default_client_route') },
}
}
- return ActorFollowModel.updateActorFollowsScoreAndRemoveBadOnes(goodUrls, badUrls, undefined)
+ return ActorFollowModel.updateActorFollowsScore(goodUrls, badUrls, undefined)
}
// ---------------------------------------------------------------------------
try {
await doRequest(options)
- ActorFollowModel.updateActorFollowsScoreAndRemoveBadOnes([ uri ], [], undefined)
+ ActorFollowModel.updateActorFollowsScore([ uri ], [], undefined)
} catch (err) {
- ActorFollowModel.updateActorFollowsScoreAndRemoveBadOnes([], [ uri ], undefined)
+ ActorFollowModel.updateActorFollowsScore([], [ uri ], undefined)
throw err
}
if (numberOfActorFollowsRemoved) logger.info('Removed bad %d actor follows.', numberOfActorFollowsRemoved)
}
- static updateActorFollowsScoreAndRemoveBadOnes (goodInboxes: string[], badInboxes: string[], t: Sequelize.Transaction) {
+ static updateActorFollowsScore (goodInboxes: string[], badInboxes: string[], t: Sequelize.Transaction) {
if (goodInboxes.length === 0 && badInboxes.length === 0) return
logger.info('Updating %d good actor follows and %d bad actor follows scores.', goodInboxes.length, badInboxes.length)
const updateParams: CustomConfig = {
instance: {
name: 'PeerTube updated',
+ shortDescription: 'my short description',
description: 'my super description',
terms: 'my super terms',
defaultClientRoute: '/videos/recently-added',
const data = res.body as CustomConfig
expect(data.instance.name).to.equal('PeerTube')
+ expect(data.instance.shortDescription).to.equal(
+ 'PeerTube, a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser ' +
+ 'with WebTorrent and Angular.'
+ )
expect(data.instance.description).to.equal('Welcome to this PeerTube instance!')
expect(data.instance.terms).to.equal('No terms for now.')
expect(data.instance.defaultClientRoute).to.equal('/videos/trending')
const newCustomConfig = {
instance: {
name: 'PeerTube updated',
+ shortDescription: 'my short description',
description: 'my super description',
terms: 'my super terms',
defaultClientRoute: '/videos/recently-added',
const data = res.body
expect(data.instance.name).to.equal('PeerTube updated')
+ expect(data.instance.shortDescription).to.equal('my short description')
expect(data.instance.description).to.equal('my super description')
expect(data.instance.terms).to.equal('my super terms')
expect(data.instance.defaultClientRoute).to.equal('/videos/recently-added')
const data = res.body
expect(data.instance.name).to.equal('PeerTube updated')
+ expect(data.instance.shortDescription).to.equal('my short description')
expect(data.instance.description).to.equal('my super description')
expect(data.instance.terms).to.equal('my super terms')
expect(data.instance.defaultClientRoute).to.equal('/videos/recently-added')
const data: About = res.body
expect(data.instance.name).to.equal('PeerTube updated')
+ expect(data.instance.shortDescription).to.equal('my short description')
expect(data.instance.description).to.equal('my super description')
expect(data.instance.terms).to.equal('my super terms')
})
const data = res.body
expect(data.instance.name).to.equal('PeerTube')
+ expect(data.instance.shortDescription).to.equal(
+ 'PeerTube, a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser ' +
+ 'with WebTorrent and Angular.'
+ )
expect(data.instance.description).to.equal('Welcome to this PeerTube instance!')
expect(data.instance.terms).to.equal('No terms for now.')
expect(data.instance.defaultClientRoute).to.equal('/videos/trending')
export interface About {
instance: {
name: string
+ shortDescription: string
description: string
terms: string
}
export interface CustomConfig {
instance: {
name: string
+ shortDescription: string
description: string
terms: string
defaultClientRoute: string
+++ /dev/null
-export interface Customization {
- instance: {
- customization: {
- javascript: string
- css: string
- }
- }
-}
instance: {
name: string
+ shortDescription: string
defaultClientRoute: string
customizations: {
javascript: string
$ cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u root
```
+Now you can subscribe to the mailing list for PeerTube administrators: https://framalistes.org/sympa/subscribe/peertube-admin
+
## Upgrade
#### Auto (minor versions only)