Skip to content

Commit 9395ef6

Browse files
authored
Merge pull request #359 from booxter/image-proxy-data-dir
image-proxy: honor AURRAL_DATA_DIR
2 parents a237cdf + 62e62f1 commit 9395ef6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

backend/services/imageProxyService.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ const __filename = fileURLToPath(import.meta.url);
99
const __dirname = path.dirname(__filename);
1010

1111
const IMAGE_PROXY_ROUTE = "/api/image-proxy";
12-
const IMAGE_PROXY_DIR = path.join(__dirname, "..", "data", "image-proxy");
12+
const DEFAULT_DATA_DIR = path.join(__dirname, "..", "data");
13+
const DATA_DIR = process.env.AURRAL_DATA_DIR
14+
? path.resolve(process.env.AURRAL_DATA_DIR)
15+
: DEFAULT_DATA_DIR;
16+
const IMAGE_PROXY_DIR = path.join(DATA_DIR, "image-proxy");
1317
const CACHE_TTL_MS = 30 * 24 * 60 * 60 * 1000;
1418
const FETCH_TIMEOUT_MS = 25000;
1519
const OPTIMIZED_IMAGE_MAX_BYTES = 1024 * 1024;

0 commit comments

Comments
 (0)