1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00

server: serve files from storage/well-known (#5214)

* server: serve files from storage/well-known

closes #5206

* well-known: add tests

* test: try to skip new tests

* test: another try

* fix(config/prod): well_known path

* test: fix broken tests

* Update misc-endpoints.ts

* Use getDirectoryPath for tests

* Fix tests

Co-authored-by: Chocobozzz <me@florianbigard.com>
This commit is contained in:
kontrollanten 2022-10-04 10:53:00 +02:00 committed by GitHub
parent cfd57d2ca0
commit 6c5f0d3aeb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 83 additions and 41 deletions

View file

@ -182,6 +182,12 @@ export class PeerTubeServer {
this.port = parseInt(parsed.port)
}
getDirectoryPath (directoryName: string) {
const testDirectory = 'test' + this.internalServerNumber
return join(root(), testDirectory, directoryName)
}
async flushAndRun (configOverride?: Object, options: RunServerOptions = {}) {
await ServersCommand.flushTests(this.internalServerNumber)
@ -341,19 +347,20 @@ export class PeerTubeServer {
suffix: '_test' + this.internalServerNumber
},
storage: {
tmp: `test${this.internalServerNumber}/tmp/`,
bin: `test${this.internalServerNumber}/bin/`,
avatars: `test${this.internalServerNumber}/avatars/`,
videos: `test${this.internalServerNumber}/videos/`,
streaming_playlists: `test${this.internalServerNumber}/streaming-playlists/`,
redundancy: `test${this.internalServerNumber}/redundancy/`,
logs: `test${this.internalServerNumber}/logs/`,
previews: `test${this.internalServerNumber}/previews/`,
thumbnails: `test${this.internalServerNumber}/thumbnails/`,
torrents: `test${this.internalServerNumber}/torrents/`,
captions: `test${this.internalServerNumber}/captions/`,
cache: `test${this.internalServerNumber}/cache/`,
plugins: `test${this.internalServerNumber}/plugins/`
tmp: this.getDirectoryPath('tmp') + '/',
bin: this.getDirectoryPath('bin') + '/',
avatars: this.getDirectoryPath('avatars') + '/',
videos: this.getDirectoryPath('videos') + '/',
streaming_playlists: this.getDirectoryPath('streaming-playlists') + '/',
redundancy: this.getDirectoryPath('redundancy') + '/',
logs: this.getDirectoryPath('logs') + '/',
previews: this.getDirectoryPath('previews') + '/',
thumbnails: this.getDirectoryPath('thumbnails') + '/',
torrents: this.getDirectoryPath('torrents') + '/',
captions: this.getDirectoryPath('captions') + '/',
cache: this.getDirectoryPath('cache') + '/',
plugins: this.getDirectoryPath('plugins') + '/',
well_known: this.getDirectoryPath('well-known') + '/'
},
admin: {
email: `admin${this.internalServerNumber}@example.com`