mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-12-06 20:11:33 +01:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8c150c18f | ||
|
|
ebd8a870a5 | ||
|
|
a07327d882 |
No files matched your search
+2
-22
@@ -76,9 +76,7 @@ EOF
|
||||
sleep 1
|
||||
chown -R hermes:hermes /home/hermes || msg_warn "Could not take ownership of everything under /home/hermes"
|
||||
fi
|
||||
if [[ -f /home/hermes/.config/systemd/user/hermes-dashboard.service && ! -f /home/hermes/.hermes/backend_migration.json ]]; then
|
||||
$STD runuser -l hermes -c 'systemctl --user daemon-reload && systemctl --user enable hermes-dashboard'
|
||||
fi
|
||||
$STD runuser -l hermes -c 'systemctl --user daemon-reload && systemctl --user enable hermes-dashboard'
|
||||
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
|
||||
@@ -90,26 +88,8 @@ EOF
|
||||
msg_ok "Updated Hermes Agent"
|
||||
|
||||
msg_info "Starting Services"
|
||||
$STD runuser -l hermes -c '
|
||||
systemctl --user daemon-reload
|
||||
if systemctl --user is-enabled -q hermes-dashboard 2>/dev/null; then systemctl --user start hermes-dashboard; fi
|
||||
if systemctl --user is-enabled -q hermes-gateway 2>/dev/null; then systemctl --user restart hermes-gateway; fi
|
||||
'
|
||||
$STD runuser -l hermes -c 'systemctl --user start hermes-dashboard'
|
||||
msg_ok "Started Services"
|
||||
|
||||
# hermes dashboard is deprecated; upstream moves it onto the gateway's Webapp on the same address.
|
||||
if [[ -f /home/hermes/.config/systemd/user/hermes-dashboard.service && ! -f /home/hermes/.hermes/backend_migration.json ]]; then
|
||||
msg_info "Moving the Dashboard to the Gateway's Webapp"
|
||||
for _ in {1..30}; do
|
||||
curl -so /dev/null http://127.0.0.1:9119/ && break
|
||||
sleep 1
|
||||
done
|
||||
if $STD runuser -l hermes -c 'set -a; source /etc/default/hermes; set +a; hermes gateway migrate --backends --apply --yes'; then
|
||||
msg_ok "Moved the Dashboard to the Gateway's Webapp"
|
||||
else
|
||||
msg_warn "Could not move the Dashboard to the Gateway's Webapp, it keeps running"
|
||||
fi
|
||||
fi
|
||||
msg_ok "Updated successfully!"
|
||||
exit
|
||||
}
|
||||
|
||||
+3
-3
@@ -459,14 +459,14 @@ function fetch_prebuilt_libs() {
|
||||
local oci_dir
|
||||
oci_dir="$(mktemp -d)"
|
||||
PREBUILT_BUNDLE="$(mktemp -d)"
|
||||
if ! $STD skopeo copy --retry-times 3 --override-os linux --override-arch "$(arch_resolve amd64 arm64)" "docker://${image}" "oci:${oci_dir}:img"; then
|
||||
if ! $STD skopeo copy --override-os linux --override-arch "$(arch_resolve amd64 arm64)" "docker://${image}" "oci:${oci_dir}:img"; then
|
||||
rm -rf "$oci_dir" "$PREBUILT_BUNDLE"
|
||||
msg_error "Could not download Immich's base image (${image}). Immich was not updated."
|
||||
exit 115
|
||||
fi
|
||||
if ! $STD umoci unpack --rootless --image "${oci_dir}:img" "$PREBUILT_BUNDLE"; then
|
||||
if ! $STD umoci unpack --image "${oci_dir}:img" "$PREBUILT_BUNDLE"; then
|
||||
rm -rf "$oci_dir" "$PREBUILT_BUNDLE"
|
||||
msg_error "Could not unpack Immich's base image. Immich was not updated."
|
||||
msg_error "Could not unpack Immich's base image. Immich needs Proxmox VE 9.1 or newer; it was not updated."
|
||||
exit 105
|
||||
fi
|
||||
rm -rf "$oci_dir"
|
||||
|
||||
+4
-17
@@ -50,24 +50,11 @@ function update_script() {
|
||||
export DOTNET_SYSTEM_NET_DISABLEIPV6=1
|
||||
$STD dotnet publish src/NetworkOptimizer.Web -c Release -r "$RID" --self-contained -o /opt/networkoptimizer/publish
|
||||
chmod +x /opt/networkoptimizer/publish/NetworkOptimizer.Web
|
||||
msg_ok "Rebuilt NetworkOptimizer"
|
||||
|
||||
msg_info "Building Go Helpers"
|
||||
TOOLS=/opt/networkoptimizer/publish/tools
|
||||
VERSION="$(cat ~/.networkoptimizer)"
|
||||
LDFLAGS="-s -w -X main.version=${VERSION#v}"
|
||||
mkdir -p "$TOOLS"
|
||||
mkdir -p /opt/networkoptimizer/publish/tools
|
||||
cd /opt/networkoptimizer/src/uwnspeedtest
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/uwnspeedtest-linux-arm64" .
|
||||
[[ "$(arch_resolve)" != "arm64" ]] && CGO_ENABLED=0 GOOS=linux GOARCH="$(arch_resolve)" $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/uwnspeedtest-linux-$(arch_resolve)" .
|
||||
cd /opt/networkoptimizer/src/wansteer
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/wansteer-linux-arm64" .
|
||||
cd /opt/networkoptimizer/src/apagent
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/apagent-linux-arm" .
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/apagent-linux-arm64" .
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=mipsle GOMIPS=softfloat $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/apagent-linux-mipsle" .
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=mips GOMIPS=softfloat $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/apagent-linux-mips" .
|
||||
msg_ok "Built Go Helpers"
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $STD go build -trimpath -ldflags "-s -w" -o /opt/networkoptimizer/publish/tools/uwnspeedtest-linux-arm64 .
|
||||
[[ "$(arch_resolve)" != "arm64" ]] && CGO_ENABLED=0 GOOS=linux GOARCH="$(arch_resolve)" $STD go build -trimpath -ldflags "-s -w" -o "/opt/networkoptimizer/publish/tools/uwnspeedtest-linux-$(arch_resolve)" .
|
||||
msg_ok "Rebuilt NetworkOptimizer"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start networkoptimizer
|
||||
|
||||
@@ -63,23 +63,36 @@ chown hermes:hermes /home/hermes/.hermes/.env
|
||||
chmod 600 /home/hermes/.hermes/.env
|
||||
msg_ok "Configured API Server"
|
||||
|
||||
msg_info "Setting up Gateway and Webapp"
|
||||
$STD runuser -l hermes -c '
|
||||
set -a; source /etc/default/hermes; set +a
|
||||
hermes webapp --build-only
|
||||
hermes config set webapp.enabled true
|
||||
hermes config set webapp.host 127.0.0.1
|
||||
hermes config set webapp.port 9119
|
||||
hermes gateway install
|
||||
systemctl --user enable --now hermes-gateway
|
||||
'
|
||||
msg_ok "Set up Gateway and Webapp"
|
||||
msg_info "Creating Dashboard Service"
|
||||
mkdir -p /home/hermes/.config/systemd/user
|
||||
cat <<EOF >/home/hermes/.config/systemd/user/hermes-dashboard.service
|
||||
[Unit]
|
||||
Description=Hermes Agent Web Dashboard
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
UMask=0077
|
||||
WorkingDirectory=%h
|
||||
EnvironmentFile=/etc/default/hermes
|
||||
ExecStart=%h/.local/bin/hermes dashboard --host 127.0.0.1 --port 9119 --no-open
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
EOF
|
||||
chown -R hermes:hermes /home/hermes/.config
|
||||
$STD runuser -l hermes -c 'systemctl --user daemon-reload && systemctl --user enable --now hermes-dashboard'
|
||||
msg_ok "Created Dashboard Service"
|
||||
|
||||
msg_info "Creating Setup Helper"
|
||||
cat <<'SETUP' >/usr/bin/hermes-setup
|
||||
#!/usr/bin/env bash
|
||||
su - hermes -c 'set -a; source /etc/default/hermes; set +a; hermes setup'
|
||||
su - hermes -c 'systemctl --user enable -q hermes-gateway && systemctl --user restart hermes-gateway'
|
||||
if [[ -f /home/hermes/.config/systemd/user/hermes-gateway.service ]]; then
|
||||
su - hermes -c 'systemctl --user enable --now hermes-gateway'
|
||||
fi
|
||||
echo "Hermes setup complete."
|
||||
SETUP
|
||||
chmod +x /usr/bin/hermes-setup
|
||||
|
||||
@@ -204,7 +204,7 @@ export LD_RUN_PATH=/usr/local/lib
|
||||
# Immich ships the custom photo-processing libraries (libjxl, jpegli, libheif,
|
||||
# libraw, ImageMagick, libvips) prebuilt in its own OCI base image. Pull the one
|
||||
# the release's Dockerfile pins (skopeo + umoci, no container runtime) and use its
|
||||
# /usr/local. There is no compile fallback.
|
||||
# /usr/local. There is no compile fallback: this needs Proxmox VE 9.1 or newer.
|
||||
msg_info "Deploying prebuilt image-processing libraries"
|
||||
BASE_REF="$(curl -fsSL "https://raw.githubusercontent.com/immich-app/immich/${RELEASE}/server/Dockerfile" | awk '/^FROM ghcr.io\/immich-app\/base-server-dev/ {print $2; exit}')" || true
|
||||
if [[ -z "$BASE_REF" ]]; then
|
||||
@@ -220,16 +220,14 @@ if ! $STD apt install -y --no-install-recommends skopeo umoci; then
|
||||
fi
|
||||
OCI_DIR="$(mktemp -d)"
|
||||
OCI_BUNDLE="$(mktemp -d)"
|
||||
if ! $STD skopeo copy --retry-times 3 --override-os linux --override-arch "$(arch_resolve amd64 arm64)" "docker://${BASE_IMAGE}" "oci:${OCI_DIR}:img"; then
|
||||
if ! $STD skopeo copy --override-os linux --override-arch "$(arch_resolve amd64 arm64)" "docker://${BASE_IMAGE}" "oci:${OCI_DIR}:img"; then
|
||||
rm -rf "$OCI_DIR" "$OCI_BUNDLE"
|
||||
msg_error "Could not download Immich's base image (${BASE_IMAGE})."
|
||||
exit 115
|
||||
fi
|
||||
# --rootless skips restoring the image's owners: a container whose idmap leaves out
|
||||
# one of them (uid 1000 for bind mounts) fails lchown with "invalid argument".
|
||||
if ! $STD umoci unpack --rootless --image "${OCI_DIR}:img" "$OCI_BUNDLE"; then
|
||||
if ! $STD umoci unpack --image "${OCI_DIR}:img" "$OCI_BUNDLE"; then
|
||||
rm -rf "$OCI_DIR" "$OCI_BUNDLE"
|
||||
msg_error "Could not unpack Immich's base image."
|
||||
msg_error "Could not unpack Immich's base image. Immich needs Proxmox VE 9.1 or newer."
|
||||
exit 105
|
||||
fi
|
||||
# The libraries, headers and ImageMagick data, without the node runtime, global
|
||||
|
||||
@@ -43,22 +43,12 @@ $STD dotnet publish src/NetworkOptimizer.Web -c Release -r "$RID" --self-contain
|
||||
chmod +x /opt/networkoptimizer/publish/NetworkOptimizer.Web
|
||||
msg_ok "Built NetworkOptimizer"
|
||||
|
||||
msg_info "Building Go Helpers"
|
||||
TOOLS=/opt/networkoptimizer/publish/tools
|
||||
VERSION="$(cat ~/.networkoptimizer)"
|
||||
LDFLAGS="-s -w -X main.version=${VERSION#v}"
|
||||
mkdir -p "$TOOLS"
|
||||
msg_info "Building Speed Test Binaries"
|
||||
mkdir -p /opt/networkoptimizer/publish/tools
|
||||
cd /opt/networkoptimizer/src/uwnspeedtest
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/uwnspeedtest-linux-arm64" .
|
||||
[[ "$(arch_resolve)" != "arm64" ]] && CGO_ENABLED=0 GOOS=linux GOARCH="$(arch_resolve)" $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/uwnspeedtest-linux-$(arch_resolve)" .
|
||||
cd /opt/networkoptimizer/src/wansteer
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/wansteer-linux-arm64" .
|
||||
cd /opt/networkoptimizer/src/apagent
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/apagent-linux-arm" .
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/apagent-linux-arm64" .
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=mipsle GOMIPS=softfloat $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/apagent-linux-mipsle" .
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=mips GOMIPS=softfloat $STD go build -trimpath -ldflags "$LDFLAGS" -o "$TOOLS/apagent-linux-mips" .
|
||||
msg_ok "Built Go Helpers"
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $STD go build -trimpath -ldflags "-s -w" -o /opt/networkoptimizer/publish/tools/uwnspeedtest-linux-arm64 .
|
||||
[[ "$(arch_resolve)" != "arm64" ]] && CGO_ENABLED=0 GOOS=linux GOARCH="$(arch_resolve)" $STD go build -trimpath -ldflags "-s -w" -o "/opt/networkoptimizer/publish/tools/uwnspeedtest-linux-$(arch_resolve)" .
|
||||
msg_ok "Built Speed Test Binaries"
|
||||
|
||||
msg_info "Configuring NetworkOptimizer"
|
||||
cat <<EOF >/opt/networkoptimizer/networkoptimizer.env
|
||||
|
||||
Reference in new issue
Block a user