aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2022-10-04 10:53:00 +0200
committerGitHub <noreply@github.com>2022-10-04 10:53:00 +0200
commit6c5f0d3aebbd9debcd33a9aab306b130547852a5 (patch)
treebb5da168dc1d60f13c3fd6247fa9082928529a8a /shared
parentcfd57d2ca0bb058087f7dc90fcc3e8442b0288e1 (diff)
downloadPeerTube-6c5f0d3aebbd9debcd33a9aab306b130547852a5.tar.gz
PeerTube-6c5f0d3aebbd9debcd33a9aab306b130547852a5.tar.zst
PeerTube-6c5f0d3aebbd9debcd33a9aab306b130547852a5.zip
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>
Diffstat (limited to 'shared')
-rw-r--r--shared/server-commands/server/server.ts33
1 files changed, 20 insertions, 13 deletions
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 {
182 this.port = parseInt(parsed.port) 182 this.port = parseInt(parsed.port)
183 } 183 }
184 184
185 getDirectoryPath (directoryName: string) {
186 const testDirectory = 'test' + this.internalServerNumber
187
188 return join(root(), testDirectory, directoryName)
189 }
190
185 async flushAndRun (configOverride?: Object, options: RunServerOptions = {}) { 191 async flushAndRun (configOverride?: Object, options: RunServerOptions = {}) {
186 await ServersCommand.flushTests(this.internalServerNumber) 192 await ServersCommand.flushTests(this.internalServerNumber)
187 193
@@ -341,19 +347,20 @@ export class PeerTubeServer {
341 suffix: '_test' + this.internalServerNumber 347 suffix: '_test' + this.internalServerNumber
342 }, 348 },
343 storage: { 349 storage: {
344 tmp: `test${this.internalServerNumber}/tmp/`, 350 tmp: this.getDirectoryPath('tmp') + '/',
345 bin: `test${this.internalServerNumber}/bin/`, 351 bin: this.getDirectoryPath('bin') + '/',
346 avatars: `test${this.internalServerNumber}/avatars/`, 352 avatars: this.getDirectoryPath('avatars') + '/',
347 videos: `test${this.internalServerNumber}/videos/`, 353 videos: this.getDirectoryPath('videos') + '/',
348 streaming_playlists: `test${this.internalServerNumber}/streaming-playlists/`, 354 streaming_playlists: this.getDirectoryPath('streaming-playlists') + '/',
349 redundancy: `test${this.internalServerNumber}/redundancy/`, 355 redundancy: this.getDirectoryPath('redundancy') + '/',
350 logs: `test${this.internalServerNumber}/logs/`, 356 logs: this.getDirectoryPath('logs') + '/',
351 previews: `test${this.internalServerNumber}/previews/`, 357 previews: this.getDirectoryPath('previews') + '/',
352 thumbnails: `test${this.internalServerNumber}/thumbnails/`, 358 thumbnails: this.getDirectoryPath('thumbnails') + '/',
353 torrents: `test${this.internalServerNumber}/torrents/`, 359 torrents: this.getDirectoryPath('torrents') + '/',
354 captions: `test${this.internalServerNumber}/captions/`, 360 captions: this.getDirectoryPath('captions') + '/',
355 cache: `test${this.internalServerNumber}/cache/`, 361 cache: this.getDirectoryPath('cache') + '/',
356 plugins: `test${this.internalServerNumber}/plugins/` 362 plugins: this.getDirectoryPath('plugins') + '/',
363 well_known: this.getDirectoryPath('well-known') + '/'
357 }, 364 },
358 admin: { 365 admin: {
359 email: `admin${this.internalServerNumber}@example.com` 366 email: `admin${this.internalServerNumber}@example.com`