feat: add packaging, deployment, error pages, and project docs
Phase 7 — Polish:
- Error page template with styled 404/403/500 pages
- Error rendering helper on Renderer
Phase 8 — Packaging & Deployment:
- Containerfile: multi-stage build, non-root user, health check,
OCI labels with build date and git revision
- Makefile: build, test, cross-compile, deb, rpm, container,
tarballs, checksums targets
- nfpm.yaml: .deb and .rpm package config
- systemd service: hardened with NoNewPrivileges, ProtectSystem,
ProtectHome, PrivateTmp, RestrictSUIDSGID
- Default environment file with commented examples
- postinstall/preremove scripts (shellcheck validated)
- compose.yaml: example Podman/Docker Compose
- Caddyfile.example: subdomain, subpath, and remote proxy configs
- CHANGELOG.md for release notes
- CLAUDE.md with architecture, conventions, and quick reference
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 16:34:32 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
# Pre-remove script for Favoritter .deb/.rpm package.
|
2026-03-29 19:26:29 +02:00
|
|
|
# Only stops and disables the service on actual removal, not on upgrade.
|
|
|
|
|
#
|
|
|
|
|
# Debian/Ubuntu: called with "remove" on uninstall, "upgrade" on upgrade.
|
|
|
|
|
# RPM (Fedora/RHEL): called with 0 on final removal, 1+ on upgrade.
|
feat: add packaging, deployment, error pages, and project docs
Phase 7 — Polish:
- Error page template with styled 404/403/500 pages
- Error rendering helper on Renderer
Phase 8 — Packaging & Deployment:
- Containerfile: multi-stage build, non-root user, health check,
OCI labels with build date and git revision
- Makefile: build, test, cross-compile, deb, rpm, container,
tarballs, checksums targets
- nfpm.yaml: .deb and .rpm package config
- systemd service: hardened with NoNewPrivileges, ProtectSystem,
ProtectHome, PrivateTmp, RestrictSUIDSGID
- Default environment file with commented examples
- postinstall/preremove scripts (shellcheck validated)
- compose.yaml: example Podman/Docker Compose
- Caddyfile.example: subdomain, subpath, and remote proxy configs
- CHANGELOG.md for release notes
- CLAUDE.md with architecture, conventions, and quick reference
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 16:34:32 +02:00
|
|
|
set -e
|
|
|
|
|
|
2026-03-29 19:26:29 +02:00
|
|
|
action="${1:-}"
|
|
|
|
|
|
|
|
|
|
case "$action" in
|
|
|
|
|
# Debian: full removal.
|
|
|
|
|
remove|purge)
|
|
|
|
|
if command -v systemctl >/dev/null 2>&1; then
|
|
|
|
|
systemctl stop favoritter 2>/dev/null || true
|
|
|
|
|
systemctl disable favoritter 2>/dev/null || true
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
# RPM: $1 is the number of remaining installations.
|
|
|
|
|
0)
|
|
|
|
|
if command -v systemctl >/dev/null 2>&1; then
|
|
|
|
|
systemctl stop favoritter 2>/dev/null || true
|
|
|
|
|
systemctl disable favoritter 2>/dev/null || true
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
# Debian "upgrade" or RPM "1+" — do nothing, the service stays running.
|
|
|
|
|
# The new postinstall will daemon-reload and restart.
|
|
|
|
|
*)
|
|
|
|
|
;;
|
|
|
|
|
esac
|