From 3e7fcf13509111d0dc2eef527967c40010f4eccc Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:56:39 +0100 Subject: [PATCH] Arcane: write both env names, stop shipping the unused .env (#18466) The compose file from main now uses ARCANE_ENCRYPTION_KEY and ARCANE_PROJECTS_DIRECTORY, which the latest image (2.17.3) does not read, so it panicked on a missing ENCRYPTION_KEY. Arcane 3 in turn refuses to start when only the old names are set. Install and update now keep both names in compose.yaml, which also carries existing installs over to 3. The .env was never referenced by the compose file, but compose parses it, and the unanchored ENCRYPTION_KEY sed turned the renamed line into ARCANE_#ENCRYPTION_KEY and broke every install. New installs no longer download it; update repairs the broken line. --- tools/addon/arcane.sh | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/tools/addon/arcane.sh b/tools/addon/arcane.sh index 11886f447..45b924854 100644 --- a/tools/addon/arcane.sh +++ b/tools/addon/arcane.sh @@ -58,8 +58,21 @@ function uninstall() { # ============================================================================== # UPDATE # ============================================================================== +# Arcane 3 needs the ARCANE_* names, the current latest image reads only the old ones. +function sync_env_names() { + local key + for key in ENCRYPTION_KEY PROJECTS_DIRECTORY; do + grep -q "^[[:space:]]*- ARCANE_${key}=" "$COMPOSE_FILE" || sed -i "/^[[:space:]]*- ${key}=/{p;s/- ${key}=/- ARCANE_${key}=/;}" "$COMPOSE_FILE" + grep -q "^[[:space:]]*- ${key}=" "$COMPOSE_FILE" || sed -i "/^[[:space:]]*- ARCANE_${key}=/{p;s/- ARCANE_${key}=/- ${key}=/;}" "$COMPOSE_FILE" + done + if [[ -f "$ENV_FILE" ]]; then + sed -i 's/^ARCANE_#/#ARCANE_/' "$ENV_FILE" + fi +} + function update() { chown -R 65532:65532 /etc/arcane/projects /etc/arcane/builds 2>/dev/null || true + sync_env_names msg_info "Pulling latest ${APP} image" cd "$INSTALL_PATH" @@ -85,9 +98,8 @@ function install() { msg_ok "Created ${INSTALL_PATH}" # Generate secrets and config values - local ENCRYPTION_KEY JWT_SECRET PROJ_DIR BUILDS_DIR + local ENCRYPTION_KEY PROJ_DIR BUILDS_DIR ENCRYPTION_KEY=$(random_password 32) - JWT_SECRET=$(random_password 32) PROJ_DIR="/etc/arcane/projects" BUILDS_DIR="/etc/arcane/builds" @@ -108,20 +120,12 @@ function install() { curl -fsSL "https://raw.githubusercontent.com/getarcaneapp/arcane/refs/heads/main/docker/examples/compose.basic.yaml" -o "$COMPOSE_FILE" msg_ok "Downloaded Docker Compose file" - msg_info "Downloading .env file" - curl -fsSL "https://raw.githubusercontent.com/getarcaneapp/arcane/refs/heads/main/.env.example" -o "$ENV_FILE" - chmod 600 "$ENV_FILE" - msg_ok "Downloaded .env file" - - msg_info "Configuring compose and env files" + msg_info "Configuring compose file" sed -i '/^[[:space:]]*#/!s|/host/path/to/projects|'"$PROJ_DIR"'|g' "$COMPOSE_FILE" sed -i '/^[[:space:]]*#/!s|/host/path/to/builds|'"$BUILDS_DIR"'|g' "$COMPOSE_FILE" sed -i '/^[[:space:]]*#/!s|ENCRYPTION_KEY=.*|ENCRYPTION_KEY='"$ENCRYPTION_KEY"'|g' "$COMPOSE_FILE" - sed -i '/^[[:space:]]*#/!s|JWT_SECRET=.*|JWT_SECRET='"$JWT_SECRET"'|g' "$COMPOSE_FILE" - sed -i '/^[[:space:]]*#/!s|APP_URL=.*|APP_URL=http://localhost:'"$DEFAULT_PORT"'|g' "$ENV_FILE" - sed -i '/^[[:space:]]*#/!s|ENCRYPTION_KEY=.*|#&|g' "$ENV_FILE" - sed -i '/^[[:space:]]*#/!s|JWT_SECRET=.*|#&|g' "$ENV_FILE" - msg_ok "Configured compose and env files" + sync_env_names + msg_ok "Configured compose file" msg_info "Starting ${APP}" cd "$INSTALL_PATH"