NetVisor: v0.10.0 fixes (#9255)

This commit is contained in:
Chris
2025-11-19 03:36:55 -05:00
committed by GitHub
parent 783db6630a
commit e3164f6ea5
3 changed files with 33 additions and 13 deletions

View File

@@ -35,7 +35,7 @@ function update_script() {
msg_ok "Stopped services"
msg_info "Backing up configurations"
cp /opt/netvisor/.env /opt/netvisor.env
cp /opt/netvisor/.env /opt/netvisor.env.bak
msg_ok "Backed up configurations"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "netvisor" "mayanayza/netvisor" "tarball" "latest" "/opt/netvisor"
@@ -49,10 +49,16 @@ function update_script() {
TOOLCHAIN="$(grep "channel" /opt/netvisor/backend/rust-toolchain.toml | awk -F\" '{print $2}')"
RUST_TOOLCHAIN=$TOOLCHAIN setup_rust
mv /opt/netvisor.env /opt/netvisor/.env
cp /opt/netvisor.env.bak /opt/netvisor/.env
LOCAL_IP="$(hostname -I | awk '{print $1}')"
if ! grep -q "PUBLIC_URL"; then
sed -i "\|_PATH=|a\NETVISOR_SERVER_PUBLIC_URL=http://${LOCAL_IP}:60072" /opt/netvisor/.env
fi
sed -i 's|_TARGET=.*$|_URL=http://127.0.0.1:60072|' /opt/netvisor/.env
msg_info "Creating frontend UI"
export PUBLIC_SERVER_HOSTNAME=default
export PUBLIC_SERVER_PORT=60072
export PUBLIC_SERVER_PORT=""
cd /opt/netvisor/ui
$STD npm ci --no-fund --no-audit
$STD npm run build
@@ -64,10 +70,16 @@ function update_script() {
mv ./target/release/server /usr/bin/netvisor-server
msg_ok "Built Netvisor-server"
msg_info "Building Netvisor-daemon (amd64 version)"
msg_info "Building Netvisor-daemon"
$STD cargo build --release --bin daemon
cp ./target/release/daemon /usr/bin/netvisor-daemon
msg_ok "Built Netvisor-daemon (amd64 version)"
msg_ok "Built Netvisor-daemon"
sed -i -e 's|-target|-url|' \
-e 's| --server-port |:|' \
/etc/systemd/system/netvisor-daemon.service
sed -i '/^ \"server_target.*$/d' /root/.config/daemon/config.json
systemctl daemon-reload
msg_info "Starting services"
systemctl start netvisor-server netvisor-daemon

View File

@@ -35,6 +35,10 @@
{
"text": "The integrated daemon config is located at `/root/.config/daemon/config.json`",
"type": "info"
},
{
"text": "When using a reverse proxy, edit `/opt/netvisor/ui/build/_app/env.js`: add 443 to `PUBLIC_SERVER_PORT` and remove 'default' from `PUBLIC_SERVER_HOSTNAME`.",
"type": "info"
}
]
}

View File

@@ -31,7 +31,7 @@ RUST_TOOLCHAIN=$TOOLCHAIN setup_rust
msg_info "Creating frontend UI"
export PUBLIC_SERVER_HOSTNAME=default
export PUBLIC_SERVER_PORT=60072
export PUBLIC_SERVER_PORT=""
cd /opt/netvisor/ui
$STD npm ci --no-fund --no-audit
$STD npm run build
@@ -49,20 +49,18 @@ cp ./target/release/daemon /usr/bin/netvisor-daemon
msg_ok "Built Netvisor-daemon"
msg_info "Configuring server & daemon for first-run"
LOCAL_IP="$(hostname -I | awk '{print $1}')"
cat <<EOF >/opt/netvisor/.env
### - UI
PUBLIC_SERVER_HOSTNAME=default
PUBLIC_SERVER_PORT=60072
### - SERVER
NETVISOR_DATABASE_URL=postgresql://$PG_DB_USER:$PG_DB_PASS@localhost:5432/$PG_DB_NAME
NETVISOR_WEB_EXTERNAL_PATH="/opt/netvisor/ui/build"
NETVISOR_SERVER_PUBLIC_URL=http://${LOCAL_IP}:60072
NETVISOR_SERVER_PORT=60072
NETVISOR_LOG_LEVEL=info
NETVISOR_INTEGRATED_DAEMON_URL=http://127.0.0.1:60073
## - uncomment to disable signups
# NETVISOR_DISABLE_REGISTRATION=true
## - uncomment when behind reverse proxy
## - uncomment when using TLS
# NETVISOR_USE_SECURE_SESSION_COOKIES=true
### - OIDC (optional)
@@ -74,8 +72,14 @@ NETVISOR_INTEGRATED_DAEMON_URL=http://127.0.0.1:60073
## - Callback URL for reference
# http://your-netvisor-domain:60072/api/auth/oidc/callback
### - SMTP (password reset and notifications - optional)
# NETVISOR_SMTP_RELAY=smtp.gmail.com:587
# NETVISOR_SMTP_USERNAME=your-email@gmail.com
# NETVISOR_SMTP_PASSWORD=your-app-password
# NETVISOR_SMTP_EMAIL=netvisor@yourdomain.tld
### - INTEGRATED DAEMON
NETVISOR_SERVER_TARGET=127.0.0.1
NETVISOR_SERVER_URL=http://127.0.0.1:60072
NETVISOR_BIND_ADDRESS=0.0.0.0
NETVISOR_NAME="netvisor-daemon"
NETVISOR_HEARTBEAT_INTERVAL=30
@@ -112,7 +116,7 @@ After=network.target netvisor-server.service
[Service]
Type=simple
EnvironmentFile=/opt/netvisor/.env
ExecStart=/usr/bin/netvisor-daemon --server-target http://127.0.0.1 --server-port 60072 --network-id ${NETWORK_ID} --daemon-api-key ${API_KEY}
ExecStart=/usr/bin/netvisor-daemon --server-url http://127.0.0.1:60072 --network-id ${NETWORK_ID} --daemon-api-key ${API_KEY}
Restart=always
RestartSec=10
StandardOutput=journal