fix: correct IMAGE_DIR path to /var/www/static
All checks were successful
CI / update (push) Successful in 1m15s

Change production path check from /var/lib/www to /var/www/static
to match actual production environment configuration.

Updated migration endpoint and all documentation references.
This commit is contained in:
2026-01-02 12:25:06 +01:00
parent 7a756b708f
commit c10fce5d4b
2 changed files with 11 additions and 11 deletions

View File

@@ -11,7 +11,7 @@ import { rename } from 'node:fs/promises';
export const POST = (async ({ locals, request }) => {
// Only allow in production (check if IMAGE_DIR contains production path)
const isProd = IMAGE_DIR.includes('/var/lib/www');
const isProd = IMAGE_DIR.includes('/var/www/static');
// Require confirmation token to prevent accidental runs
const data = await request.json();
@@ -19,7 +19,7 @@ export const POST = (async ({ locals, request }) => {
const adminToken = data?.adminToken;
if (!isProd) {
throw error(403, 'This endpoint only runs in production (IMAGE_DIR must be /var/lib/www)');
throw error(403, 'This endpoint only runs in production (IMAGE_DIR must be /var/www/static)');
}
if (confirmToken !== 'MIGRATE_IMAGES') {