mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-11-20 04:25:16 +00:00
NetVisor: v0.10.0 fixes (#9255)
This commit is contained in:
@@ -35,7 +35,7 @@ function update_script() {
|
|||||||
msg_ok "Stopped services"
|
msg_ok "Stopped services"
|
||||||
|
|
||||||
msg_info "Backing up configurations"
|
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"
|
msg_ok "Backed up configurations"
|
||||||
|
|
||||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "netvisor" "mayanayza/netvisor" "tarball" "latest" "/opt/netvisor"
|
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}')"
|
TOOLCHAIN="$(grep "channel" /opt/netvisor/backend/rust-toolchain.toml | awk -F\" '{print $2}')"
|
||||||
RUST_TOOLCHAIN=$TOOLCHAIN setup_rust
|
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"
|
msg_info "Creating frontend UI"
|
||||||
export PUBLIC_SERVER_HOSTNAME=default
|
export PUBLIC_SERVER_HOSTNAME=default
|
||||||
export PUBLIC_SERVER_PORT=60072
|
export PUBLIC_SERVER_PORT=""
|
||||||
cd /opt/netvisor/ui
|
cd /opt/netvisor/ui
|
||||||
$STD npm ci --no-fund --no-audit
|
$STD npm ci --no-fund --no-audit
|
||||||
$STD npm run build
|
$STD npm run build
|
||||||
@@ -64,10 +70,16 @@ function update_script() {
|
|||||||
mv ./target/release/server /usr/bin/netvisor-server
|
mv ./target/release/server /usr/bin/netvisor-server
|
||||||
msg_ok "Built 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
|
$STD cargo build --release --bin daemon
|
||||||
cp ./target/release/daemon /usr/bin/netvisor-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"
|
msg_info "Starting services"
|
||||||
systemctl start netvisor-server netvisor-daemon
|
systemctl start netvisor-server netvisor-daemon
|
||||||
|
|||||||
@@ -35,6 +35,10 @@
|
|||||||
{
|
{
|
||||||
"text": "The integrated daemon config is located at `/root/.config/daemon/config.json`",
|
"text": "The integrated daemon config is located at `/root/.config/daemon/config.json`",
|
||||||
"type": "info"
|
"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"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ RUST_TOOLCHAIN=$TOOLCHAIN setup_rust
|
|||||||
|
|
||||||
msg_info "Creating frontend UI"
|
msg_info "Creating frontend UI"
|
||||||
export PUBLIC_SERVER_HOSTNAME=default
|
export PUBLIC_SERVER_HOSTNAME=default
|
||||||
export PUBLIC_SERVER_PORT=60072
|
export PUBLIC_SERVER_PORT=""
|
||||||
cd /opt/netvisor/ui
|
cd /opt/netvisor/ui
|
||||||
$STD npm ci --no-fund --no-audit
|
$STD npm ci --no-fund --no-audit
|
||||||
$STD npm run build
|
$STD npm run build
|
||||||
@@ -49,20 +49,18 @@ cp ./target/release/daemon /usr/bin/netvisor-daemon
|
|||||||
msg_ok "Built Netvisor-daemon"
|
msg_ok "Built Netvisor-daemon"
|
||||||
|
|
||||||
msg_info "Configuring server & daemon for first-run"
|
msg_info "Configuring server & daemon for first-run"
|
||||||
|
LOCAL_IP="$(hostname -I | awk '{print $1}')"
|
||||||
cat <<EOF >/opt/netvisor/.env
|
cat <<EOF >/opt/netvisor/.env
|
||||||
### - UI
|
|
||||||
PUBLIC_SERVER_HOSTNAME=default
|
|
||||||
PUBLIC_SERVER_PORT=60072
|
|
||||||
|
|
||||||
### - SERVER
|
### - SERVER
|
||||||
NETVISOR_DATABASE_URL=postgresql://$PG_DB_USER:$PG_DB_PASS@localhost:5432/$PG_DB_NAME
|
NETVISOR_DATABASE_URL=postgresql://$PG_DB_USER:$PG_DB_PASS@localhost:5432/$PG_DB_NAME
|
||||||
NETVISOR_WEB_EXTERNAL_PATH="/opt/netvisor/ui/build"
|
NETVISOR_WEB_EXTERNAL_PATH="/opt/netvisor/ui/build"
|
||||||
|
NETVISOR_SERVER_PUBLIC_URL=http://${LOCAL_IP}:60072
|
||||||
NETVISOR_SERVER_PORT=60072
|
NETVISOR_SERVER_PORT=60072
|
||||||
NETVISOR_LOG_LEVEL=info
|
NETVISOR_LOG_LEVEL=info
|
||||||
NETVISOR_INTEGRATED_DAEMON_URL=http://127.0.0.1:60073
|
NETVISOR_INTEGRATED_DAEMON_URL=http://127.0.0.1:60073
|
||||||
## - uncomment to disable signups
|
## - uncomment to disable signups
|
||||||
# NETVISOR_DISABLE_REGISTRATION=true
|
# NETVISOR_DISABLE_REGISTRATION=true
|
||||||
## - uncomment when behind reverse proxy
|
## - uncomment when using TLS
|
||||||
# NETVISOR_USE_SECURE_SESSION_COOKIES=true
|
# NETVISOR_USE_SECURE_SESSION_COOKIES=true
|
||||||
|
|
||||||
### - OIDC (optional)
|
### - OIDC (optional)
|
||||||
@@ -74,8 +72,14 @@ NETVISOR_INTEGRATED_DAEMON_URL=http://127.0.0.1:60073
|
|||||||
## - Callback URL for reference
|
## - Callback URL for reference
|
||||||
# http://your-netvisor-domain:60072/api/auth/oidc/callback
|
# 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
|
### - 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_BIND_ADDRESS=0.0.0.0
|
||||||
NETVISOR_NAME="netvisor-daemon"
|
NETVISOR_NAME="netvisor-daemon"
|
||||||
NETVISOR_HEARTBEAT_INTERVAL=30
|
NETVISOR_HEARTBEAT_INTERVAL=30
|
||||||
@@ -112,7 +116,7 @@ After=network.target netvisor-server.service
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
EnvironmentFile=/opt/netvisor/.env
|
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
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
StandardOutput=journal
|
StandardOutput=journal
|
||||||
|
|||||||
Reference in New Issue
Block a user