| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <?php
- // Manage client configuration.
- //
- // Copy this file to config.php inside this folder and adjust the values.
- // config.php must NOT be committed to the host project's repository, and it
- // must NOT be part of the release package (see 06_UPDATE_PACKAGING.md).
- //
- // Every constant has a default in lib/client.php, so a minimal config.php only
- // needs the three connection values plus the backup sources.
- // ---------------------------------------------------------------------------
- // Connection
- // ---------------------------------------------------------------------------
- // Base URL of the manage server, without a trailing slash and without /api.
- define("MANAGE_SERVER_URL", "https://manage.example.org");
- // Instance id and token, both shown when the instance is created on the server
- // (Instanzen -> Instanz anlegen). The token is displayed exactly once.
- define("MANAGE_INSTANCE", "example-prod");
- define("MANAGE_TOKEN", "");
- // Seconds per HTTP request. Package downloads and backup uploads use the long
- // timeout, manifest and heartbeat the short one.
- define("MANAGE_HTTP_TIMEOUT", 15);
- define("MANAGE_HTTP_TIMEOUT_LONG", 300);
- // ---------------------------------------------------------------------------
- // Application layout
- // ---------------------------------------------------------------------------
- // Root of the host application. Defaults to the parent of this folder, which is
- // correct when manage-client/ sits directly in the application root.
- define("MANAGE_APP_ROOT", dirname(__DIR__));
- // Where the installed version is stored.
- // - PHP file with a constant: set both values
- // - plain text file containing only "v1.2.3": set MANAGE_VERSION_CONSTANT null
- define("MANAGE_VERSION_FILE", MANAGE_APP_ROOT . "/includes/version.php");
- define("MANAGE_VERSION_CONSTANT", "APP_VERSION");
- // Working directories. Must be writable by PHP and should not be web-readable.
- 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
- // ---------------------------------------------------------------------------
- // Paths the updater must never overwrite, relative to MANAGE_APP_ROOT.
- // A trailing slash marks a directory; everything below it is protected.
- define("MANAGE_UPDATE_PROTECTED_PATHS", [
- "config.php",
- "data/",
- ".git/",
- "manage-client/config.php",
- ]);
- // A package must contain at least one of these paths, otherwise it is rejected
- // before anything is copied. Guards against deploying an unrelated ZIP.
- define("MANAGE_UPDATE_SANITY_PATHS", ["index.php"]);
- // Optional callback executed after a successful deployment.
- // See docs/07_POST_UPDATE_HOOKS.md.
- define("MANAGE_UPDATE_POST_HOOK", null);
- // define("MANAGE_UPDATE_POST_HOOK", [
- // "file" => MANAGE_APP_ROOT . "/includes/after-update.php",
- // "callback" => "myProjectAfterUpdate",
- // ]);
- // Migrations shipped inside the release package. Set to null to disable.
- define("MANAGE_MIGRATIONS_DIR", MANAGE_APP_ROOT . "/migrations");
- define("MANAGE_MIGRATIONS_STATE", MANAGE_APP_ROOT . "/data/manage/migrations.json");
- // ---------------------------------------------------------------------------
- // Backup
- // ---------------------------------------------------------------------------
- // What goes into the archive. Paths are relative to MANAGE_APP_ROOT.
- // "glob" => shell glob, non-recursive
- // "dir" => directory, recursive
- // "file" => single file
- // "as" => path prefix inside the ZIP
- define("MANAGE_BACKUP_SOURCES", [
- ["as" => "data", "glob" => "data/*.json"],
- ["as" => "data/uploads", "dir" => "data/uploads"],
- ]);
- // Optional MySQL/MariaDB dump. null disables it entirely.
- define("MANAGE_BACKUP_DATABASE", null);
- // define("MANAGE_BACKUP_DATABASE", [
- // "dsn" => "mysql:host=localhost;dbname=myproject;charset=utf8mb4",
- // "user" => "myproject",
- // "password" => "...",
- // // Optional: only dump the structure of these tables, not their rows.
- // "skip_data_tables" => ["sessions", "cache"],
- // ]);
- // Local archives kept on the instance. Minimum 1.
- define("MANAGE_BACKUP_LOCAL_RETENTION", 4);
- // Interval for manageBackupCreateAutomaticIfDue(), in seconds. 0 disables it.
- // Default is weekly. Irrelevant when a cron job runs the CLI instead.
- define("MANAGE_BACKUP_AUTO_INTERVAL_SECONDS", 604800);
- // Compress entries in the ZIP. Deflate needs zlib (bundled with PHP by default)
- // and matters mostly for SQL dumps; false stores everything uncompressed.
- define("MANAGE_BACKUP_COMPRESS", true);
- // Upload every new backup to the manage server. Set false for local-only backups.
- define("MANAGE_BACKUP_UPLOAD", true);
- // Additional targets besides the manage server: s3, sftp, custom.
- // See docs/05_BACKUP_SOURCES.md.
- define("MANAGE_BACKUP_REMOTE_TARGETS", []);
|