fix(scripts): revert to public URL, rely on /etc/hosts for NAT loopback
All checks were successful
Build and Release .deb / build-deb (push) Successful in 21s
All checks were successful
Build and Release .deb / build-deb (push) Successful in 21s
This commit is contained in:
parent
ed7ce07f13
commit
1adaf9768f
1 changed files with 2 additions and 15 deletions
|
|
@ -1,21 +1,13 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
REPO_URL="https://git.geronzi.fr"
|
||||
OWNER="geronzi"
|
||||
REPO="full_updater"
|
||||
TOKEN_FILE="/etc/full-updater/token"
|
||||
INSTALLED_VERSION=$(dpkg -s full-updater 2>/dev/null | grep "^Version:" | awk '{print $2}' || echo "0.0.0")
|
||||
|
||||
# Détecter si on est sur le réseau interne (host Proxmox ou LXC)
|
||||
# et utiliser l'IP interne de Forgejo si c'est le cas (NAT loopback)
|
||||
if curl -s --max-time 2 "http://10.0.0.4:3000/api/v1/repos/${OWNER}/${REPO}/releases/latest" > /dev/null 2>&1; then
|
||||
REPO_URL="http://10.0.0.4:3000"
|
||||
echo "=== Full Updater Update (mode interne) ==="
|
||||
else
|
||||
REPO_URL="https://git.geronzi.fr"
|
||||
echo "=== Full Updater Update ==="
|
||||
fi
|
||||
|
||||
echo "=== Full Updater Update ==="
|
||||
echo "Version installée : ${INSTALLED_VERSION}"
|
||||
|
||||
# Build API headers
|
||||
|
|
@ -66,11 +58,6 @@ if [ -z "$ASSET_URL" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Si on est en mode interne, remplacer l'URL publique par l'URL interne dans le download
|
||||
if [ "$REPO_URL" = "http://10.0.0.4:3000" ]; then
|
||||
ASSET_URL=$(echo "$ASSET_URL" | sed 's|https://git.geronzi.fr|http://10.0.0.4:3000|g')
|
||||
fi
|
||||
|
||||
TMP_DEB="/tmp/full-updater-${LATEST_VERSION}.deb"
|
||||
echo "Téléchargement de ${ASSET_URL}..."
|
||||
curl -s -L -o "$TMP_DEB" "${HEADERS[@]}" "$ASSET_URL"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue