Browse Source

Allow to auto follow a specific URL

tags/v2.2.0-rc.1
Chocobozzz 5 months ago
parent
commit
95cd31f1fe
No known key found for this signature in database GPG Key ID: 583A612D890159BE
5 changed files with 10 additions and 4 deletions
  1. +1
    -1
      client/e2e/protractor.conf.js
  2. +2
    -1
      config/default.yaml
  3. +2
    -1
      config/production.yaml.example
  4. +4
    -0
      server/lib/schedulers/auto-follow-index-instances.ts
  5. +1
    -1
      server/tests/api/server/auto-follows.ts

+ 1
- 1
client/e2e/protractor.conf.js View File

@@ -61,7 +61,7 @@ exports.config = {
}
],

maxSessions: 1,
// maxSessions: 1,
// BrowserStack compatible ports: https://www.browserstack.com/question/664
baseUrl: 'http://localhost:3333/',
framework: 'jasmine',


+ 2
- 1
config/default.yaml View File

@@ -367,7 +367,8 @@ followings:
# /!\ Don't enable this if you don't have a reactive moderation team /!\
auto_follow_index:
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:
default: 'default'

+ 2
- 1
config/production.yaml.example View File

@@ -381,7 +381,8 @@ followings:
# /!\ Don't enable this if you don't have a reactive moderation team /!\
auto_follow_index:
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:
default: 'default'

+ 4
- 0
server/lib/schedulers/auto-follow-index-instances.ts View File

@@ -42,6 +42,10 @@ export class AutoFollowIndexInstances extends AbstractScheduler {
this.lastCheck = new Date()

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 chunks = chunk(hosts, 20)


+ 1
- 1
server/tests/api/server/auto-follows.ts View File

@@ -177,7 +177,7 @@ describe('Test auto follows', function () {
followings: {
instance: {
autoFollowIndex: {
indexUrl: 'http://localhost:42100',
indexUrl: 'http://localhost:42100/api/v1/instances/hosts',
enabled: true
}
}


Loading…
Cancel
Save