Root cause of a real production failure on the first live install
(wap-proxy, 2026-07-25): DB_PASSWORD was generated with
`openssl rand -base64 24`, which can produce '/', '+', or '=' --
docker-compose.yml then naively interpolated the raw password into
postgres://postgres:${DB_PASSWORD}@db:5432/..., and a generated
password containing '/' broke the connection string outright. The API
never became healthy; log ingestion failed completely.
- install.sh now generates with `openssl rand -hex 32` (always
[0-9a-f], can't produce this class of character). Same fix applied
everywhere else openssl-rand-base64-24 was referenced.
- docker-compose.yml no longer builds DATABASE_URL by string
interpolation -- DB_PASSWORD is passed as its own var and the API
assembles the connection string safely internally using
net/url.UserPassword (proper percent-encoding), a second,
independent layer so the installer doesn't rely on the password
generator alone. See the matching argus-appliance commit for the
Go-side change and its regression test.
- backup.sh/healthcheck.sh/restore.sh/uninstall.sh still defaulted
ARGUS_INSTALL_DIR to $HOME/argus, inconsistent with install.sh/
update.sh's own /opt/argus default (changed in an earlier commit
this session) -- confirmed live on the same install: healthcheck.sh
and uninstall.sh reported "no installation found" when run from the
real, correct directory. All five scripts now agree on /opt/argus.
Corresponding argus-appliance fix (config.go's buildDatabaseURL, v3.73.1)
already built and pushed to git-cloud.weboria.eu/weboria/argus-api.
60 lines
2.1 KiB
Bash
Executable File
60 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# ARGUS uninstaller — stops and removes ARGUS containers.
|
|
#
|
|
# By default this KEEPS your data (database, certificates, uploaded config) —
|
|
# it only stops and removes containers, so a plain re-install (install.sh)
|
|
# picks up right where you left off.
|
|
#
|
|
# cd /opt/argus && ./uninstall.sh # containers only, data kept
|
|
# ./uninstall.sh --remove-data # also destroys all data (asks to confirm)
|
|
# ./uninstall.sh --remove-data --yes # non-interactive, for scripted use
|
|
#
|
|
set -euo pipefail
|
|
|
|
INSTALL_DIR="${ARGUS_INSTALL_DIR:-/opt/argus}"
|
|
REMOVE_DATA=false
|
|
ASSUME_YES=false
|
|
|
|
for arg in "$@"; do
|
|
case "$arg" in
|
|
--remove-data) REMOVE_DATA=true ;;
|
|
--yes|-y) ASSUME_YES=true ;;
|
|
*) echo "Unknown option: $arg" >&2; exit 1 ;;
|
|
esac
|
|
done
|
|
|
|
bold() { printf '\033[1m%s\033[0m\n' "$1"; }
|
|
info() { printf ' %s\n' "$1"; }
|
|
ok() { printf ' \033[32m✓\033[0m %s\n' "$1"; }
|
|
warn() { printf ' \033[33m!\033[0m %s\n' "$1"; }
|
|
fail() { printf ' \033[31m✗\033[0m %s\n' "$1" >&2; exit 1; }
|
|
|
|
bold "ARGUS Uninstaller"
|
|
echo
|
|
|
|
[ -f "$INSTALL_DIR/docker-compose.yml" ] || fail "No ARGUS installation found at $INSTALL_DIR (set ARGUS_INSTALL_DIR if you installed elsewhere)."
|
|
cd "$INSTALL_DIR"
|
|
|
|
if [ "$REMOVE_DATA" = "true" ] && [ "$ASSUME_YES" != "true" ]; then
|
|
warn "This will permanently delete your ARGUS database, certificates, and all"
|
|
warn "uploaded configuration. This cannot be undone."
|
|
printf " Type YES to confirm: "
|
|
read -r CONFIRM
|
|
[ "$CONFIRM" = "YES" ] || fail "Aborted — data was not touched."
|
|
fi
|
|
|
|
if [ "$REMOVE_DATA" = "true" ]; then
|
|
bold "Stopping ARGUS and removing all data..."
|
|
docker compose down -v
|
|
ok "Containers and data volumes removed"
|
|
else
|
|
bold "Stopping ARGUS (data preserved)..."
|
|
docker compose down
|
|
ok "Containers removed — database and certificates are untouched"
|
|
info "Re-run install.sh (or 'docker compose up -d' here) to bring ARGUS back with the same data."
|
|
fi
|
|
|
|
echo
|
|
info "Configuration files remain at ${INSTALL_DIR} — remove that directory yourself if you want a completely clean slate."
|