From 787882db51d7395ffaba7abe586f9dd120f7e239 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 2 Dec 2025 06:03:55 -0500 Subject: [PATCH] NetVisor: patch systemd file to fix new OIDC config (#9562) --- ct/netvisor.sh | 3 +++ frontend/public/json/netvisor.json | 2 +- install/netvisor-install.sh | 15 ++++++--------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ct/netvisor.sh b/ct/netvisor.sh index 63285ae6a4..c51985fd25 100644 --- a/ct/netvisor.sh +++ b/ct/netvisor.sh @@ -79,6 +79,9 @@ function update_script() { -e 's| --server-port |:|' \ /etc/systemd/system/netvisor-daemon.service sed -i '/^ \"server_target.*$/d' /root/.config/daemon/config.json + if ! grep -q "WorkingD" /etc/systemd/system/netvisor-server.service; then + sed -i '\|simple$|a\WorkingDirectory=/opt/netvisor/backend' /etc/systemd/system/netvisor-server.service + fi systemctl daemon-reload msg_info "Starting services" diff --git a/frontend/public/json/netvisor.json b/frontend/public/json/netvisor.json index b4d4fb85f9..4da83eb8a8 100644 --- a/frontend/public/json/netvisor.json +++ b/frontend/public/json/netvisor.json @@ -10,7 +10,7 @@ "privileged": false, "interface_port": 60072, "documentation": "https://github.com/mayanayza/netvisor", - "config_path": "/opt/netvisor/.env", + "config_path": "/opt/netvisor/.env, OIDC: /opt/netvisor/oidc.toml", "website": "https://github.com/mayanayza/netvisor", "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/png/netvisor.png", "description": "Automatically discover and visually document network infrastructure", diff --git a/install/netvisor-install.sh b/install/netvisor-install.sh index 5d6f2cd83e..fee67a940a 100644 --- a/install/netvisor-install.sh +++ b/install/netvisor-install.sh @@ -62,15 +62,9 @@ NETVISOR_INTEGRATED_DAEMON_URL=http://127.0.0.1:60073 # NETVISOR_DISABLE_REGISTRATION=true ## - uncomment when using TLS # NETVISOR_USE_SECURE_SESSION_COOKIES=true - -### - OIDC (optional) -# NETVISOR_OIDC_ISSUER_URL= -# NETVISOR_OIDC_CLIENT_ID= -# NETVISOR_OIDC_CLIENT_SECRET= -# NETVISOR_OIDC_PROVIDER_NAME= -# NETVISOR_OIDC_REDIRECT_URL= -## - Callback URL for reference -# http://your-netvisor-domain:60072/api/auth/oidc/callback +## - see https://github.com/imbolc/axum-client-ip?tab=readme-ov-file#configurable-vs-specific-extractors +## - before uncommenting the below +# NETVISOR_CLIENT_IP_SOURCE= ### - SMTP (password reset and notifications - optional) # NETVISOR_SMTP_RELAY=smtp.gmail.com:587 @@ -83,6 +77,8 @@ NETVISOR_SERVER_URL=http://127.0.0.1:60072 NETVISOR_BIND_ADDRESS=0.0.0.0 NETVISOR_NAME="netvisor-daemon" NETVISOR_HEARTBEAT_INTERVAL=30 + +### - see https://github.com/mayanayza/netvisor/blob/main/docs/CONFIGURATION.md for more options EOF cat </etc/systemd/system/netvisor-server.service @@ -92,6 +88,7 @@ After=network.target postgresql.service [Service] Type=simple +WorkingDirectory=/opt/netvisor/backend EnvironmentFile=/opt/netvisor/.env ExecStart=/usr/bin/netvisor-server Restart=always