diff options
author | kontrollanten <6680299+kontrollanten@users.noreply.github.com> | 2022-10-04 10:53:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-04 10:53:00 +0200 |
commit | 6c5f0d3aebbd9debcd33a9aab306b130547852a5 (patch) | |
tree | bb5da168dc1d60f13c3fd6247fa9082928529a8a /server/controllers | |
parent | cfd57d2ca0bb058087f7dc90fcc3e8442b0288e1 (diff) | |
download | PeerTube-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 'server/controllers')
-rw-r--r-- | server/controllers/well-known.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/server/controllers/well-known.ts b/server/controllers/well-known.ts index f467bd629..ce5883571 100644 --- a/server/controllers/well-known.ts +++ b/server/controllers/well-known.ts | |||
@@ -5,6 +5,7 @@ import { root } from '@shared/core-utils' | |||
5 | import { CONFIG } from '../initializers/config' | 5 | import { CONFIG } from '../initializers/config' |
6 | import { ROUTE_CACHE_LIFETIME, WEBSERVER } from '../initializers/constants' | 6 | import { ROUTE_CACHE_LIFETIME, WEBSERVER } from '../initializers/constants' |
7 | import { cacheRoute } from '../middlewares/cache/cache' | 7 | import { cacheRoute } from '../middlewares/cache/cache' |
8 | import { handleStaticError } from '@server/middlewares' | ||
8 | 9 | ||
9 | const wellKnownRouter = express.Router() | 10 | const wellKnownRouter = express.Router() |
10 | 11 | ||
@@ -69,6 +70,12 @@ wellKnownRouter.use('/.well-known/host-meta', | |||
69 | } | 70 | } |
70 | ) | 71 | ) |
71 | 72 | ||
73 | wellKnownRouter.use('/.well-known/', | ||
74 | cacheRoute(ROUTE_CACHE_LIFETIME.WELL_KNOWN), | ||
75 | express.static(CONFIG.STORAGE.WELL_KNOWN_DIR, { fallthrough: false }), | ||
76 | handleStaticError | ||
77 | ) | ||
78 | |||
72 | // --------------------------------------------------------------------------- | 79 | // --------------------------------------------------------------------------- |
73 | 80 | ||
74 | export { | 81 | export { |