Fix plugin routing, missing includes, and make SCRIPTS_DIR configurable
- Rename varaverk.page → Varaverk.page: unRAID nginx only routes URLs starting with a capital letter (~^/[A-Z].*), lowercase caused 404 - Add require_once config.php to include/scheduler.php and include/docs.php: both used SCRIPTS_DIR constant without including the file that defines it - Replace hardcoded SCRIPTS_DIR with cfg-file-backed setting: reads from /boot/config/plugins/varaverk/varaverk.cfg, falls back to default on first run - Add Plugin Settings card to Config tab with scripts path field - Add api/settings.php to write the cfg file (validates directory exists)
This commit is contained in:
@@ -2,8 +2,12 @@
|
||||
// Config file parser and writer.
|
||||
// Reads master.conf and the appropriate host*.conf based on running host.
|
||||
|
||||
define('SCRIPTS_DIR', '/mnt/user/appdata/unraid_scripts');
|
||||
define('PLUGIN_CFG', '/boot/config/plugins/varaverk/varaverk.cfg');
|
||||
|
||||
$_vv_cfg = @parse_ini_file(PLUGIN_CFG) ?: [];
|
||||
define('SCRIPTS_DIR', $_vv_cfg['SCRIPTS_DIR'] ?? '/mnt/user/appdata/unraid_scripts');
|
||||
define('CONF_DIR', SCRIPTS_DIR . '/Configurations');
|
||||
unset($_vv_cfg);
|
||||
|
||||
function vv_get_hostname(): string {
|
||||
return trim(shell_exec('hostname -s') ?: '');
|
||||
|
||||
Reference in New Issue
Block a user