#!/bin/bash set -euo pipefail source "$HL_LIB" _assert_vars HL_TIMEZONE HL_DOMAIN; _ch_001-make_dirs() { mkdir -p ~/paperlessngx /data/paperlessngx; } _ch_002-copy_compose() { cp docker-compose.yml ~/paperlessngx/docker-compose.yml; export HL_PAPERLESS_SECRET="$(openssl rand -hex 24)"; cp $(_fill docker-compose.env.templ) ~/paperlessngx/docker-compose.env; } _ch_003-update_caddy() { cp $(_fill Caddyfile.templ) /etc/caddy/conf.d/paperlessngx.Caddyfile; chmod a+r /etc/caddy/conf.d/paperlessngx.Caddyfile; sudo systemctl reload caddy.service; } _ch_004-run_service() { cd ~/paperlessngx; docker-compose up -d; } _run_checkpoints