Skip to content

post-setup.sh: follow-up improvements from code review #10

@riccjohn

Description

@riccjohn

Follow-up items from the review of #9.

Issues

  • set -euo pipefail + || echo "" conflict — Pi-hole grep -oP runs in a subshell where a non-zero exit (no match) can abort the script despite the fallback. Fix:

    PIHOLE_API_KEY=$(docker exec pihole grep -oP '(?<=app_password = ")[^"]+' \
      /etc/pihole/pihole.toml 2>/dev/null) || PIHOLE_API_KEY=""
  • Pi-hole logout bodyDELETE /api/auth passes {"sid": "..."} as JSON body, but Pi-hole v6 doesn't expect a body for logout. Currently masked by || true so harmless, but should be corrected.

  • Jellyfin sort_by(.DateCreated) assumption — Relies on ISO 8601 string sort being equivalent to chronological sort. Add a comment noting this assumption.

Enhancements

  • --help flag — Print the script's header comment when invoked with --help or -h.
  • Summary at the end — Print which keys were written vs skipped so the user doesn't have to scroll back.
  • README: mention Portainer timeout is handled — The old docs warned about Portainer's setup wizard timing out. Worth a one-liner noting the script handles initial account creation so you don't have to race the clock.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions