Allow to auto follow a specific URL
This commit is contained in:
parent
3a1a00a4af
commit
95cd31f1fe
|
@ -61,7 +61,7 @@ exports.config = {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
maxSessions: 1,
|
// maxSessions: 1,
|
||||||
// BrowserStack compatible ports: https://www.browserstack.com/question/664
|
// BrowserStack compatible ports: https://www.browserstack.com/question/664
|
||||||
baseUrl: 'http://localhost:3333/',
|
baseUrl: 'http://localhost:3333/',
|
||||||
framework: 'jasmine',
|
framework: 'jasmine',
|
||||||
|
|
|
@ -367,7 +367,8 @@ followings:
|
||||||
# /!\ Don't enable this if you don't have a reactive moderation team /!\
|
# /!\ Don't enable this if you don't have a reactive moderation team /!\
|
||||||
auto_follow_index:
|
auto_follow_index:
|
||||||
enabled: false
|
enabled: false
|
||||||
index_url: 'https://instances.joinpeertube.org'
|
# Host your own using https://framagit.org/framasoft/peertube/instances-peertube#peertube-auto-follow
|
||||||
|
index_url: ''
|
||||||
|
|
||||||
theme:
|
theme:
|
||||||
default: 'default'
|
default: 'default'
|
||||||
|
|
|
@ -381,7 +381,8 @@ followings:
|
||||||
# /!\ Don't enable this if you don't have a reactive moderation team /!\
|
# /!\ Don't enable this if you don't have a reactive moderation team /!\
|
||||||
auto_follow_index:
|
auto_follow_index:
|
||||||
enabled: false
|
enabled: false
|
||||||
index_url: 'https://instances.joinpeertube.org'
|
# Host your own using https://framagit.org/framasoft/peertube/instances-peertube#peertube-auto-follow
|
||||||
|
index_url: ''
|
||||||
|
|
||||||
theme:
|
theme:
|
||||||
default: 'default'
|
default: 'default'
|
||||||
|
|
|
@ -42,6 +42,10 @@ export class AutoFollowIndexInstances extends AbstractScheduler {
|
||||||
this.lastCheck = new Date()
|
this.lastCheck = new Date()
|
||||||
|
|
||||||
const { body } = await doRequest<any>({ uri, qs, json: true })
|
const { body } = await doRequest<any>({ uri, qs, json: true })
|
||||||
|
if (!body.data || Array.isArray(body.data) === false) {
|
||||||
|
logger.error('Cannot auto follow instances of index %s: bad URL format. Please check the auto follow URL.', indexUrl)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const hosts: string[] = body.data.map(o => o.host)
|
const hosts: string[] = body.data.map(o => o.host)
|
||||||
const chunks = chunk(hosts, 20)
|
const chunks = chunk(hosts, 20)
|
||||||
|
|
|
@ -177,7 +177,7 @@ describe('Test auto follows', function () {
|
||||||
followings: {
|
followings: {
|
||||||
instance: {
|
instance: {
|
||||||
autoFollowIndex: {
|
autoFollowIndex: {
|
||||||
indexUrl: 'http://localhost:42100',
|
indexUrl: 'http://localhost:42100/api/v1/instances/hosts',
|
||||||
enabled: true
|
enabled: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue