create instance). // The token is shown exactly once, right after the instance is created. define('MANAGE_INSTANCE', ''); define('MANAGE_TOKEN', ''); // Seconds per HTTP request. Gallery media makes backups large, so the long // timeout (upload, package download) is generous. define('MANAGE_HTTP_TIMEOUT', 15); define('MANAGE_HTTP_TIMEOUT_LONG', 600); // --------------------------------------------------------------------------- // Application layout // --------------------------------------------------------------------------- // manage-client/ sits in the document root, next to index.php. define('MANAGE_APP_ROOT', dirname(__DIR__)); // The installed version lives in app/version.php as APP_VERSION. The file is // read with a regular expression, never executed, so the value stays readable // even in a process that already loaded the old constant. define('MANAGE_VERSION_FILE', MANAGE_APP_ROOT . '/app/version.php'); define('MANAGE_VERSION_CONSTANT', 'APP_VERSION'); // Working directories, all under data/ — which .htaccess already blocks and // .gitignore already excludes. define('MANAGE_WORK_DIR', MANAGE_APP_ROOT . '/data/manage/work/'); define('MANAGE_UPDATE_BACKUP_DIR', MANAGE_APP_ROOT . '/data/manage/updates/'); define('MANAGE_BACKUP_DIR', MANAGE_APP_ROOT . '/data/manage/backups/'); define('MANAGE_LOG_FILE', MANAGE_APP_ROOT . '/data/manage/manage-client.log'); // --------------------------------------------------------------------------- // Update // --------------------------------------------------------------------------- // Never overwritten by an update. config/ holds this installation's S3 // credentials and the admin password hash; data/ and media/ are its content. // The sample files in config/ are deliberately not protected, so a release can // still ship new defaults for them. define('MANAGE_UPDATE_PROTECTED_PATHS', [ 'config/config.php', 'config/credentials.php', 'data/', 'media/', '.git/', 'manage-client/config.php', ]); // A package must contain these, otherwise it is not this application and // nothing is copied. define('MANAGE_UPDATE_SANITY_PATHS', ['app/bootstrap.php']); // Runs after a successful deployment: creates missing directories, clears the // archive worker's stale lock, appends to data/update-history.log. define('MANAGE_UPDATE_POST_HOOK', [ 'file' => MANAGE_APP_ROOT . '/app/after-update.php', 'callback' => 'after_update_hook', ]); // Migrations shipped inside the release package (see migrations/README.md). // Not to be confused with the per-gallery data migration in admin/migrate.php, // which stays an operator decision. define('MANAGE_MIGRATIONS_DIR', MANAGE_APP_ROOT . '/migrations'); define('MANAGE_MIGRATIONS_STATE', MANAGE_APP_ROOT . '/data/manage/migrations.json'); // --------------------------------------------------------------------------- // Backup // --------------------------------------------------------------------------- // Operational data only: the flat-file storage plus the locally hosted images. // Gallery photos live in S3 and are not part of this — the bucket is the // system of record for those. Application files come from the release package. // // config/credentials.php and config/config.php stay out on purpose: a backup // is uploaded to the manage server and can be downloaded there, so it must not // carry the S3 keys or the admin password hash. define('MANAGE_BACKUP_SOURCES', [ // site.json, archive-queue.json, worker-key.json, login-throttle.json ['as' => 'data', 'glob' => 'data/*.json'], // One JSON file per gallery: titles, topics, image lists, passwords. ['as' => 'data/galleries', 'dir' => 'data/galleries'], // Hero image and showreel images, uploaded through the backoffice. ['as' => 'media', 'dir' => 'media'], // Which release migrations have run — lives under data/manage/, which is // otherwise excluded so the backup directory cannot back itself up. ['as' => 'manage', 'file' => 'data/manage/migrations.json'], ]); // No database: this project is flat-file throughout. define('MANAGE_BACKUP_DATABASE', null); // Local archives kept on the instance. They contain JPEGs, so they are large; // the manage server keeps the longer history. define('MANAGE_BACKUP_LOCAL_RETENTION', 3); // How old the last backup may get before the backoffice makes a new one, in // seconds. This is the schedule on hosting without cron: any admin page load // past the interval starts a backup in the background (see app/manage.php). // 0 disables it — the right value only when a real cron job runs the CLI. define('MANAGE_BACKUP_AUTO_INTERVAL_SECONDS', 604800); // JPEGs do not compress; the JSON files do, and they are the small part. // Leaving deflate on costs little and keeps the JSON side small. define('MANAGE_BACKUP_COMPRESS', true); // Upload every new backup to the manage server. define('MANAGE_BACKUP_UPLOAD', true); // Additional targets besides the manage server: s3, sftp, custom. // See https://manage.med0.de/client-docs/ (05_BACKUP_SOURCES). define('MANAGE_BACKUP_REMOTE_TARGETS', []);