- lib/common.sh: fix broken reverse_proxy target — localhost inside Caddy's container is the container's own loopback, not the host; change to host.docker.internal so proxied ports are actually reachable - services/caddy.sh: add extra_hosts host.docker.internal:host-gateway so the above resolves correctly; create caddy_net bridge network in Caddy's own compose so other services can reference it as external; update all Caddyfile template comments and README examples to match - services/filebrowser.sh: update image tag from deprecated :s6 to :latest; remove non-functional PUID/PGID env vars (filebrowser/filebrowser does not honour them); add configure_caddy_for_service call; add caddy_net - services/ntfy.sh: add configure_caddy_for_service call; add caddy_net - services/portainer.sh: add configure_caddy_for_service call; add caddy_net - services/frigate-notify.sh, watchtower.sh: add caddy_net for container-to-container comms (frigate, ntfy) without a Caddy call - All remaining web-facing Docker services: add caddy_net network block to docker-compose and CADDY_NET to .env where applicable; services using network_mode: host (wolf-pair, lyrion) have the top-level block only https://claude.ai/code/session_01UZus2Q9gNTfUdqSMrhuX29
96 lines
2.6 KiB
Bash
96 lines
2.6 KiB
Bash
#!/bin/bash
|
|
# services/actualbudget.sh — Open-source personal finance / budgeting (Actual Budget).
|
|
# Part of the modular post-install system (sourced by setup.sh).
|
|
#
|
|
# Ported from ubuntu-post-install-24.04-crowdsec.sh (# ---- ACTUALBUDGET ----).
|
|
# Own ~/docker/actualbudget/ with a standalone docker-compose.yml.
|
|
|
|
register_service actualbudget utilities "Open-source personal finance & budgeting (Actual Budget)" 5006
|
|
|
|
install_actualbudget() {
|
|
require_docker || return 1
|
|
|
|
local AB_DIR="$DOCKER_DIR/actualbudget"
|
|
|
|
if [ "$DRY_RUN" = true ]; then
|
|
echo "[DRY-RUN] Actual Budget would:"
|
|
echo " - Create $AB_DIR with docker-compose.yml (data/)"
|
|
echo " - Expose port 5006"
|
|
echo " - Offer a Caddy reverse proxy and to start the container"
|
|
return 0
|
|
fi
|
|
|
|
mkdir -p "$AB_DIR/data"
|
|
ensure_docker_dir_ownership "$AB_DIR"
|
|
cd "$AB_DIR" || return 1
|
|
|
|
local TZ_VAL; TZ_VAL="${SITE_TZ:-$(cat /etc/timezone 2>/dev/null || echo UTC)}"
|
|
|
|
cat > docker-compose.yml << 'AB_COMPOSE'
|
|
name: actualbudget
|
|
|
|
services:
|
|
actualbudget:
|
|
image: actualbudget/actual-server:latest
|
|
container_name: actualbudget
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5006:5006"
|
|
volumes:
|
|
- ./data:/data
|
|
env_file:
|
|
- .env
|
|
networks:
|
|
- caddy_net
|
|
|
|
networks:
|
|
caddy_net:
|
|
external: true
|
|
name: ${CADDY_NET:-caddy_net}
|
|
AB_COMPOSE
|
|
|
|
cat > .env << AB_ENV
|
|
TZ=$TZ_VAL
|
|
CADDY_NET=$SITE_CADDY_NET
|
|
AB_ENV
|
|
|
|
chown -R "$ACTUAL_USER:$ACTUAL_USER" "$AB_DIR"
|
|
log_success "Actual Budget configured at $AB_DIR"
|
|
|
|
configure_caddy_for_service "ActualBudget" "5006" "budget"
|
|
|
|
write_readme "$AB_DIR" << MD
|
|
# Actual Budget
|
|
|
|
Open-source personal finance and budgeting tool. Supports bank sync via
|
|
SimpleFIN (requires a SimpleFIN account at simplefin.org).
|
|
|
|
- Web UI: http://localhost:5006
|
|
- App data: \`data/\`
|
|
|
|
## Manage
|
|
\`\`\`bash
|
|
cd $AB_DIR
|
|
docker compose up -d # start
|
|
docker compose down # stop
|
|
docker compose logs -f # logs
|
|
docker compose pull && docker compose up -d # update
|
|
\`\`\`
|
|
|
|
## Notes
|
|
- First launch: create a budget file or import an existing one.
|
|
- Bank sync requires a SimpleFIN bridge subscription (simplefin.org).
|
|
MD
|
|
|
|
local START_AB=""
|
|
prompt_yn "Start Actual Budget now? (y/n):" "y" START_AB
|
|
if [ "$START_AB" = "y" ] || [ "$START_AB" = "Y" ]; then
|
|
docker compose up -d && log_success "Actual Budget started" || log_warning "Failed to start — check: docker compose logs"
|
|
fi
|
|
|
|
echo ""
|
|
echo " Access at: http://localhost:5006"
|
|
echo " Bank sync: simplefin.org (optional, paid)"
|
|
echo ""
|
|
}
|