Replace configure/reconfigure with config show/edit/sync

Collapse the confusing dual commands into one config surface, rename
configure.sh to config.sh, and keep deprecated aliases for older installs.
This commit is contained in:
soulis-1256 2026-08-05 18:01:54 +03:00
parent a97d6e58ed
commit 35b408d441
No known key found for this signature in database
9 changed files with 112 additions and 57 deletions

View file

@ -12,11 +12,11 @@ Self-hosted media automation, set up in minutes, not a weekend.
- **Docker-native stack:** One Compose project, overlays for VPN vs direct access, optional services via `compose/custom.yaml` — no host package installs for the *arr suite.
- **Guided install, multi-platform:** Interactive wizard (or express defaults) for Linux, WSL2, and Windows (PowerShell → WSL). Fail-fast VPN check before the rest of setup when VPN is enabled.
- **Auto-wired services:** Post-install configure connects Radarr, Sonarr, Prowlarr, qBittorrent, Seerr, Recyclarr, and Jellyfin (libraries, auth, root folders, download clients) instead of a manual weekend of clicking.
- **Auto-wired services:** Post-install wiring connects Radarr, Sonarr, Prowlarr, qBittorrent, Seerr, Recyclarr, and Jellyfin (libraries, auth, root folders, download clients) instead of a manual weekend of clicking.
- **Quality profiles that ship ready:** Recyclarr syncs assemblrr-named HD and UHD (and TV) profiles from TRaSH Guides; setup only picks Seerr’s default. Both resolutions stay available for overrides.
- **Request → library path:** Seerr in front of Radarr/Sonarr for a simple request UX, with hardlinks-friendly media layout for Jellyfin/Emby/Plex.
- **VPN-first downloads:** Gluetun integration, download client traffic forced through the VPN context, `check-vpn` / start-time verification, and a vpn-watchdog for stalled routing.
- **Operator CLI:** `start` / `stop` / `restart` / `status` / `health` / `logs`, `configure` / `reconfigure`, `backup` / `restore`, `update-containers` / `update-cli`, and a careful `uninstall` that preserves media unless you opt in.
- **Operator CLI:** `start` / `stop` / `restart` / `status` / `health` / `logs`, `config` (show / edit / sync), `backup` / `restore`, `update-containers` / `update-cli`, and a careful `uninstall` that preserves media unless you opt in.
- **Fail-safe backups:** CLI snapshots of configuration before risky updates so you can roll back without rebuilding from scratch.
- **Secrets outside `.env`:** Service login and VPN credentials live under `secrets/`; runtime settings stay in `.assemblrr-config` and `.env`.
- **Optional extras:** Lidarr, SABnzbd, Bazarr, Watchtower via custom compose — deployed, not auto-configured.
@ -66,9 +66,10 @@ After install, the CLI is on your `PATH` as `assemblrr`. Run `assemblrr <command
| `status` | Show container status |
| `health` | Show healthcheck status of all services |
| `logs [service]` | Follow logs (all services, or one) |
| `config` | Show current configuration |
| `configure` | Auto-configure APIs (Radarr, Prowlarr) using jq |
| `reconfigure` | Re-run the setup wizard |
| `config` | List config subcommands |
| `config show` | Show current configuration |
| `config edit` | Re-run the setup wizard (current values as defaults) |
| `config sync` | Re-wire service APIs (Radarr, Sonarr, Prowlarr, Seerr, …) |
| `backup /target/dir` | Snapshot configuration |
| `restore /backup.tar.gz` | Restore from a backup archive |
| `update-containers` | Pull latest images and restart (offers a backup first) |
@ -117,7 +118,7 @@ That is expected community-guide churn — not a VPN or Docker failure.
docker exec recyclarr recyclarr list quality-profiles sonarr
```
3. Update the relevant pack under `templates/recyclarr/includes/` (or the live copies in your install’s `config/recyclarr/includes/`) with the new trash IDs. Root config is `templates/recyclarr/recyclarr.yml`.
4. Re-run sync, then refresh Seerr: `assemblrr configure`
4. Re-run Recyclarr, then refresh app wiring: `assemblrr config sync`
We try to keep templates current, but **plan on occasional manual updates** if you rely on TRaSH-backed profiles long-term. Official docs: [Recyclarr](https://recyclarr.dev/) · [TRaSH Guides](https://trash-guides.info/).

View file

@ -67,11 +67,9 @@ declare -A COMMANDS=(
["restore"]="restores from a backup archive"
["update-containers"]="updates all containers"
["update-cli"]="updates the CLI script to the latest version"
["reconfigure"]="re-runs the setup wizard to change configuration"
["logs"]="shows container logs (optionally specify service name)"
["health"]="checks health status of all services"
["config"]="shows current configuration"
["configure"]="auto-configures Radarr, Prowlarr, and indexers"
["config"]="configuration: show options, or run show / edit / sync"
)
# log_error_inline — same as log_error but without exit (used by check_health)
@ -104,7 +102,10 @@ show_help() {
echo " ${APP_CLI_NAME} logs jellyfin # View specific service logs"
echo " ${APP_CLI_NAME} health # Check health of all services"
echo " ${APP_CLI_NAME} update-cli # Update CLI to latest version"
echo " ${APP_CLI_NAME} reconfigure # Re-run setup wizard"
echo " ${APP_CLI_NAME} config # List config subcommands"
echo " ${APP_CLI_NAME} config show # Show current configuration"
echo " ${APP_CLI_NAME} config edit # Re-run setup wizard"
echo " ${APP_CLI_NAME} config sync # Re-wire service APIs"
}
wait_for_services() {
@ -478,6 +479,78 @@ show_config() {
done
}
show_config_help() {
echo "Usage: ${APP_CLI_NAME} config [subcommand]"
echo
echo "Subcommands:"
printf " %-12s %s\n" "show" "Show current configuration"
printf " %-12s %s\n" "edit" "Re-run the setup wizard (current values as defaults)"
printf " %-12s %s\n" "sync" "Re-wire service APIs (Radarr, Sonarr, Prowlarr, Seerr, …)"
echo
echo "Examples:"
echo " ${APP_CLI_NAME} config # List config options"
echo " ${APP_CLI_NAME} config show # Show configuration"
echo " ${APP_CLI_NAME} config edit # Change install choices"
echo " ${APP_CLI_NAME} config sync # Repair / re-apply app wiring"
}
# Re-run setup wizard (write files, restart stack, wire apps)
config_edit() {
echo "Re-running ${APP_DISPLAY_NAME} setup wizard..."
echo "Current configuration will be used as defaults."
echo
local setup_script
if [ -f "$INSTALL_DIR/setup.sh" ]; then
setup_script="$INSTALL_DIR/setup.sh"
else
local tmp_dir
tmp_dir=$(mktemp -d)
if ! git clone --depth=1 "${APP_REPO_URL}" "$tmp_dir/assemblrr" 2>/dev/null; then
log_error "Failed to clone ${APP_REPO_URL}. Check your internet connection and repository access."
fi
setup_script="$tmp_dir/assemblrr/bin/setup.sh"
fi
bash "$setup_script"
}
# Re-wire service APIs only (post-install automation)
config_sync() {
if [ -f "$INSTALL_DIR/config.sh" ]; then
bash "$INSTALL_DIR/config.sh"
elif [ -f "$INSTALL_DIR/configure.sh" ]; then
# Legacy install name
bash "$INSTALL_DIR/configure.sh"
else
log_error "config.sh not found in $INSTALL_DIR"
fi
}
config_cmd() {
local sub=${1:-}
case "$sub" in
"")
show_config_help
;;
show)
show_config
;;
edit)
config_edit
;;
sync)
config_sync
;;
--help|-h|help)
show_config_help
;;
*)
log_error "Unknown config subcommand: $sub\nRun '${APP_CLI_NAME} config' for usage"
;;
esac
}
restore_app() {
local backup_file="$1"
@ -594,27 +667,6 @@ update_cli() {
[ -n "$tmp_dir" ] && rm -rf "$tmp_dir"
}
reconfigure_app() {
echo "Re-running ${APP_DISPLAY_NAME} setup wizard..."
echo "Current configuration will be used as defaults."
echo
# Find the setup script — could be in install dir or need to be cloned
local setup_script
if [ -f "$INSTALL_DIR/setup.sh" ]; then
setup_script="$INSTALL_DIR/setup.sh"
else
local tmp_dir
tmp_dir=$(mktemp -d)
if ! git clone --depth=1 "${APP_REPO_URL}" "$tmp_dir/assemblrr" 2>/dev/null; then
log_error "Failed to clone ${APP_REPO_URL}. Check your internet connection and repository access."
fi
setup_script="$tmp_dir/assemblrr/bin/setup.sh"
fi
bash "$setup_script"
}
main() {
local command=${1:-"--help"}
local destination=${2:-.}
@ -661,9 +713,6 @@ main() {
update-cli)
update_cli
;;
reconfigure)
reconfigure_app
;;
logs)
show_logs "$@"
;;
@ -671,14 +720,16 @@ main() {
check_health
;;
config)
show_config
config_cmd "${2:-}"
;;
# Deprecated aliases (hidden from help)
reconfigure)
log_warning "'reconfigure' is deprecated — use: ${APP_CLI_NAME} config edit"
config_edit
;;
configure)
if [ -f "$INSTALL_DIR/configure.sh" ]; then
bash "$INSTALL_DIR/configure.sh"
else
log_error "configure.sh not found in $INSTALL_DIR"
fi
log_warning "'configure' is deprecated — use: ${APP_CLI_NAME} config sync"
config_sync
;;
*)
log_error "Unknown command: $command\nRun '${APP_CLI_NAME} --help' for usage information"

View file

@ -1,9 +1,9 @@
#!/bin/bash
set -euo pipefail
# assemblrr Service Auto-Configuration
# Configures Radarr, Prowlarr, and related services after initial deployment
# Called by setup.sh after containers start, or via: assemblrr configure
# assemblrr service wiring (config sync)
# Wires Radarr, Prowlarr, and related services after initial deployment
# Called by setup.sh after containers start, or via: assemblrr config sync
# Uses jq for JSON parsing
# --- Config discovery ---

View file

@ -248,7 +248,7 @@ copy_configuration_files() {
["templates/recyclarr/includes/sonarr-soft-cfs.yml"]="templates/recyclarr/includes/sonarr-soft-cfs.yml"
["branding.conf"]="branding.conf"
["bin/cli.sh"]="cli.sh"
["bin/configure.sh"]="configure.sh"
["bin/config.sh"]="config.sh"
["bin/setup.sh"]="setup.sh"
["bin/docker-install.sh"]="docker-install.sh"
["scripts/jellyfin-refresh.sh"]="scripts/jellyfin-refresh.sh"
@ -660,12 +660,14 @@ if ! run_docker compose "${COMPOSE_ARGS[@]}" --profile "$media_service" up -d; t
log_error "Failed to start ${APP_DISPLAY_NAME} services"
fi
# Auto-configure services (Radarr, Prowlarr, etc.)
if [ -f "$install_directory/configure.sh" ]; then
if ! bash "$install_directory/configure.sh"; then
log_warning "Auto-configuration had issues. You can re-run: $APP_CLI_NAME configure"
# Wire services (Radarr, Prowlarr, etc.)
if [ -f "$install_directory/config.sh" ]; then
if ! bash "$install_directory/config.sh"; then
log_warning "Auto-configuration had issues. You can re-run: $APP_CLI_NAME config sync"
fi
fi
# Drop legacy name if an older install left it behind
rm -f "$install_directory/configure.sh" 2>/dev/null || true
# Install CLI and set permissions
echo

View file

@ -1,5 +1,5 @@
#!/bin/bash
# assemblrr API helpers — sourced by configure.sh
# assemblrr API helpers — sourced by config.sh
# Provides: jq helpers, API request wrappers, API key discovery, wait_for_api
# Requires: lib/core.sh already sourced (for logging), API_HOST and INSTALL_DIR set

View file

@ -1,9 +1,9 @@
#!/bin/bash
# assemblrr *arr service configuration — sourced by configure.sh
# assemblrr *arr service configuration — sourced by config.sh
# Provides: set_arr_auth, qbit helpers, configure_arr_service, profile lookups,
# configure_radarr, configure_sonarr, configure_prowlarr
# Requires: lib/core.sh (logging), lib/api.sh (api_get/post/put/delete helpers),
# configure.sh (_cfg_log_info, log_step, log_step_fail, AUTH_USERNAME, etc.)
# config.sh (_cfg_log_info, log_step, log_step_fail, AUTH_USERNAME, etc.)
set -euo pipefail

View file

@ -1,9 +1,9 @@
#!/bin/bash
# assemblrr Jellyfin configuration — sourced by configure.sh
# assemblrr Jellyfin configuration — sourced by config.sh
# Provides: configure_jellyfin, configure_jellyfin_xml_fallback,
# configure_jellyfin_libraries, configure_jellyfin_notifications
# Requires: lib/core.sh (logging), lib/api.sh (api_get/post helpers),
# configure.sh (_cfg_log_info, log_step, log_step_fail, AUTH_USERNAME, etc.)
# config.sh (_cfg_log_info, log_step, log_step_fail, AUTH_USERNAME, etc.)
set -euo pipefail

View file

@ -1,9 +1,9 @@
#!/bin/bash
# assemblrr Seerr & Recyclarr configuration — sourced by configure.sh
# assemblrr Seerr & Recyclarr configuration — sourced by config.sh
# Provides: configure_seerr, configure_recyclarr
# Requires: lib/core.sh (logging), lib/api.sh (api_get/post helpers),
# lib/arr.sh (lookup_radarr_profile, lookup_sonarr_profile),
# configure.sh (_cfg_log_info, log_step, log_step_fail, etc.)
# config.sh (_cfg_log_info, log_step, log_step_fail, etc.)
set -euo pipefail

View file

@ -84,7 +84,7 @@ function Copy-ProjectToWSL2 {
$wslSourcePath = "/mnt/$driveLetter" + ($ProjectDir.Substring(2) -replace '\\', '/')
wsl -d $Distro -- bash -c "cp -r $wslSourcePath/* /tmp/$AppName/ && cp -r $wslSourcePath/.env.example $wslSourcePath/.gitignore /tmp/$AppName/ 2>/dev/null; true"
wsl -d $Distro -- bash -c "chmod +x /tmp/$AppName/bin/setup.sh /tmp/$AppName/bin/cli.sh /tmp/$AppName/bin/docker-install.sh /tmp/$AppName/bin/configure.sh /tmp/$AppName/lib/*.sh /tmp/$AppName/scripts/*.sh 2>/dev/null"
wsl -d $Distro -- bash -c "chmod +x /tmp/$AppName/bin/setup.sh /tmp/$AppName/bin/cli.sh /tmp/$AppName/bin/docker-install.sh /tmp/$AppName/bin/config.sh /tmp/$AppName/lib/*.sh /tmp/$AppName/scripts/*.sh 2>/dev/null"
# Convert CRLF to LF on shell scripts (Windows line endings break bash)
wsl -d $Distro -- bash -c "sed -i 's/\r$//' /tmp/$AppName/bin/*.sh /tmp/$AppName/lib/*.sh /tmp/$AppName/branding.conf /tmp/$AppName/compose/*.yaml /tmp/$AppName/compose/examples/*.yaml /tmp/$AppName/templates/*.env /tmp/$AppName/templates/*.yml /tmp/$AppName/scripts/*.sh 2>/dev/null; true"
@ -243,7 +243,8 @@ if [ -z "`$INSTALL_DIR" ]; then
exit 1
fi
echo "Install directory: `$INSTALL_DIR"
cp /tmp/$AppName/bin/cli.sh /tmp/$AppName/bin/setup.sh /tmp/$AppName/bin/docker-install.sh /tmp/$AppName/bin/configure.sh /tmp/$AppName/branding.conf "`$INSTALL_DIR/"
cp /tmp/$AppName/bin/cli.sh /tmp/$AppName/bin/setup.sh /tmp/$AppName/bin/docker-install.sh /tmp/$AppName/bin/config.sh /tmp/$AppName/branding.conf "`$INSTALL_DIR/"
rm -f "`$INSTALL_DIR/configure.sh" 2>/dev/null || true
mkdir -p "`$INSTALL_DIR/lib"
cp /tmp/$AppName/lib/*.sh "`$INSTALL_DIR/lib/"
cp /tmp/$AppName/compose/base.yaml /tmp/$AppName/compose/vpn.yaml /tmp/$AppName/compose/direct-access.yaml "`$INSTALL_DIR/compose/"