From 6c5f0d3aebbd9debcd33a9aab306b130547852a5 Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Tue, 4 Oct 2022 10:53:00 +0200 Subject: 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 --- shared/server-commands/server/server.ts | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'shared/server-commands/server') diff --git a/shared/server-commands/server/server.ts b/shared/server-commands/server/server.ts index 2b4c9c9f8..a8f8c1d84 100644 --- a/shared/server-commands/server/server.ts +++ b/shared/server-commands/server/server.ts @@ -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` -- cgit v1.2.3