mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-25 06:25:56 +01:00
[Fix] PatchMon: remove VITE_API_URL from frontend env (#12294)
This commit is contained in:
@@ -51,13 +51,10 @@ function update_script() {
|
||||
|
||||
msg_info "Updating PatchMon"
|
||||
VERSION=$(get_latest_github_release "PatchMon/PatchMon")
|
||||
PROTO="$(sed -n '/SERVER_PROTOCOL/s/[^=]*=//p' /opt/backend.env)"
|
||||
HOST="$(sed -n '/SERVER_HOST/s/[^=]*=//p' /opt/backend.env)"
|
||||
SERVER_PORT="$(sed -n '/SERVER_PORT/s/[^=]*=//p' /opt/backend.env)"
|
||||
[[ "$PROTO" == "http" ]] && PORT=":3001"
|
||||
sed -i 's/PORT=3399/PORT=3001/' /opt/backend.env
|
||||
sed -i -e "s/VERSION=.*/VERSION=$VERSION/" \
|
||||
-e "\|VITE_API_URL=|s|http.*|${PROTO:-http}://${HOST:-$LOCAL_IP}${PORT:-}/api/v1|" /opt/frontend.env
|
||||
-e '/^VITE_API_URL/d' /opt/frontend.env
|
||||
export NODE_ENV=production
|
||||
cd /opt/patchmon
|
||||
$STD npm install --no-audit --no-fund --no-save --ignore-scripts
|
||||
|
||||
@@ -34,7 +34,6 @@ $STD npm install --no-audit --no-fund --no-save --ignore-scripts
|
||||
|
||||
cd /opt/patchmon/frontend
|
||||
cat <<EOF >./.env
|
||||
VITE_API_URL=http://${LOCAL_IP}:3001/api/v1
|
||||
VITE_APP_NAME=PatchMon
|
||||
VITE_APP_VERSION=${VERSION}
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user