Files

38 lines
1.8 KiB
JavaScript
Raw Permalink Normal View History

2026-09-13 20:23:05 +01:00
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export const ROOT = path.resolve(__dirname, '..');
export const PUBLIC_DIR = path.join(ROOT, 'public');
// All mutable state lives under DATA_DIR so it can be a mounted volume and
// survive an "unzip the new version over the old one" upgrade untouched.
export const DATA_DIR = process.env.DATA_DIR || path.join(ROOT, 'data');
export const UPLOAD_DIR = path.join(DATA_DIR, 'uploads');
export const SESSION_DIR = path.join(DATA_DIR, 'sessions');
export const USERS_FILE = path.join(DATA_DIR, 'users.json');
export const CONFIG_FILE = path.join(DATA_DIR, 'config.json');
export const LOG_FILE = path.join(DATA_DIR, 'app.log');
export const PORT = parseInt(process.env.PORT || '3000', 10);
export const HOST = process.env.HOST || '0.0.0.0';
// Absolute URL the audience's phones can reach. If empty we derive it from the
// incoming request, which is fine on a LAN but should be set behind a proxy.
export const PUBLIC_BASE_URL = (process.env.PUBLIC_BASE_URL || '').replace(/\/+$/, '');
// The first time the app runs with no users file, it seeds one admin account
// from these values. After that they're ignored — manage users in the app.
export const SEED_ADMIN_USER = process.env.ADMIN_USERNAME || 'admin';
export const SEED_ADMIN_PASSWORD = process.env.ADMIN_PASSWORD || 'admin';
export const SEED_ADMIN_EMAIL = process.env.ADMIN_EMAIL || '';
export const MAX_UPLOAD_MB = parseInt(process.env.MAX_UPLOAD_MB || '500', 10);
export const CONVERT_TIMEOUT_MS = parseInt(process.env.CONVERT_TIMEOUT_MS || '240000', 10);
export const SOFFICE_BIN = process.env.SOFFICE_BIN || 'libreoffice';
export const FFMPEG_BIN = process.env.FFMPEG_BIN || 'ffmpeg';
export const APP_VERSION = '1.7';