diff --git a/lib/config.sh b/lib/config.sh index 44f96b4..9854f88 100644 --- a/lib/config.sh +++ b/lib/config.sh @@ -56,8 +56,10 @@ load_config() { RSYNC_EXTRA_OPTS="${RSYNC_EXTRA_OPTS:-}" DISK_USAGE_THRESHOLD="${DISK_USAGE_THRESHOLD:-$DEFAULT_DISK_USAGE_THRESHOLD}" - # WORK_DIR can be overridden in config; re-export if changed - export WORK_DIR + # WORK_DIR from detect_mode takes precedence — ignore config value + # to prevent root-mode paths leaking into user-mode sessions. + # Re-run detect_mode to restore the correct value if config overrode it. + detect_mode # --debug flag overrides config [[ "${GNIZA4LINUX_DEBUG:-false}" == "true" ]] && LOG_LEVEL="debug" diff --git a/tui/models.py b/tui/models.py index 6680196..2bc86e2 100644 --- a/tui/models.py +++ b/tui/models.py @@ -206,7 +206,6 @@ class AppSettings: ssh_retries: str = "3" rsync_extra_opts: str = "" disk_usage_threshold: str = "95" - work_dir: str = "/usr/local/gniza/workdir" web_port: str = "2323" web_host: str = "0.0.0.0" web_api_key: str = "" @@ -231,7 +230,6 @@ class AppSettings: ssh_retries=data.get("SSH_RETRIES", "3"), rsync_extra_opts=data.get("RSYNC_EXTRA_OPTS", ""), disk_usage_threshold=data.get("DISK_USAGE_THRESHOLD", "95"), - work_dir=data.get("WORK_DIR", "/usr/local/gniza/workdir"), web_port=data.get("WEB_PORT", "2323"), web_host=data.get("WEB_HOST", "0.0.0.0"), web_api_key=data.get("WEB_API_KEY", ""), @@ -256,7 +254,6 @@ class AppSettings: "SSH_RETRIES": self.ssh_retries, "RSYNC_EXTRA_OPTS": self.rsync_extra_opts, "DISK_USAGE_THRESHOLD": self.disk_usage_threshold, - "WORK_DIR": self.work_dir, "WEB_PORT": self.web_port, "WEB_HOST": self.web_host, "WEB_API_KEY": self.web_api_key, diff --git a/tui/screens/settings.py b/tui/screens/settings.py index c20a609..eade053 100644 --- a/tui/screens/settings.py +++ b/tui/screens/settings.py @@ -61,8 +61,6 @@ class SettingsScreen(Screen): yield Input(value=settings.ssh_retries, id="set-sshretries") yield Static("Extra rsync options:") yield Input(value=settings.rsync_extra_opts, id="set-rsyncopts") - yield Static("Work Directory:") - yield Input(value=settings.work_dir, placeholder="/usr/local/gniza/workdir", id="set-workdir") yield Static("Web Dashboard", classes="section-label") yield Static("Port:") yield Input(value=settings.web_port, id="set-web-port") @@ -103,7 +101,6 @@ class SettingsScreen(Screen): ssh_retries=self.query_one("#set-sshretries", Input).value.strip() or "3", rsync_extra_opts=self.query_one("#set-rsyncopts", Input).value.strip(), disk_usage_threshold=self.query_one("#set-diskthreshold", Input).value.strip() or "95", - work_dir=self.query_one("#set-workdir", Input).value.strip() or "/usr/local/gniza/workdir", web_port=self.query_one("#set-web-port", Input).value.strip() or "2323", web_host=self.query_one("#set-web-host", Input).value.strip() or "0.0.0.0", web_api_key=self.query_one("#set-web-key", Input).value,