diff --git a/deploy.sh b/deploy.sh index 807d5ab..988c054 100755 --- a/deploy.sh +++ b/deploy.sh @@ -49,11 +49,15 @@ if [ "$GREENFIELD" = true ]; then chattr -R -i "$TARGET_DIR" 2>/dev/null || true fi - # Preserve .env across greenfield destroy + # Preserve .env and Zoraxy certs across greenfield destroy if [ -f "$TARGET_DIR/.env" ]; then cp "$TARGET_DIR/.env" /tmp/nextworkspace.env.bak echo "[INFO] Preserved .env" fi + if [ -d "$TARGET_DIR/config/zoraxy/conf/certs" ]; then + cp -r "$TARGET_DIR/config/zoraxy" /tmp/nextworkspace.zoraxy.bak + echo "[INFO] Preserved Zoraxy config + certs" + fi rm -rf "$TARGET_DIR" @@ -64,12 +68,17 @@ if [ "$GREENFIELD" = true ]; then mkdir -p "$TARGET_DIR/compose" mkdir -p "$TARGET_DIR/logs" - # Restore preserved .env + # Restore preserved .env and Zoraxy config+certs if [ -f /tmp/nextworkspace.env.bak ]; then mv /tmp/nextworkspace.env.bak "$TARGET_DIR/.env" chmod 600 "$TARGET_DIR/.env" echo "[INFO] Restored .env" fi + if [ -d /tmp/nextworkspace.zoraxy.bak ]; then + cp -r /tmp/nextworkspace.zoraxy.bak/* "$TARGET_DIR/config/zoraxy/" + rm -rf /tmp/nextworkspace.zoraxy.bak + echo "[INFO] Restored Zoraxy config + certs" + fi echo "[5/6] Copying binary..." cp "$BINARY_NAME" "$TARGET_DIR/$BINARY_NAME"