Customers can view and cancel their booking through a link in the e-mail. Fixes #18

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-13 15:25:46 +02:00
co-authored by Claude Opus 5.5
parent d610479c52
commit 91c2a06a3e
29 changed files with 797 additions and 63 deletions
+4
View File
@@ -6,6 +6,10 @@ REZERVATOR_PREFIX=rezervator
# Image the customer containers are started from
REZERVATOR_IMAGE=rezervator:latest
# Time zone of the customers. Bookings are made in local time, and the application compares
# them with its clock (today's date, the deadline for cancelling a booking).
REZERVATOR_TZ=Europe/Prague
# Reverse proxy in front of the customer containers:
# traefik runs as a container of this stack, routes by domain, can issue certificates itself
# nginx the nginx already installed on this host. Every customer container listens on
+4
View File
@@ -144,6 +144,10 @@ This creates the database and its role, writes `customers/alpha/config.toml` wit
An optional third argument sets the sender address of e-mails (default `noreply@<domain>`).
The config gets `public_url = 'https://<domain>'`, the address used for links in e-mails (the page where a customer can view and cancel a booking). Customers created before this setting existed have no `public_url`; their links use the address of the request, which is fine behind Traefik or an nginx server block of the domain. Add the line to `customers/<name>/config.toml` and run `upgrade <name>` if you want it explicit.
Containers run in the time zone set by `REZERVATOR_TZ` in `.env` (default `Europe/Prague`). It takes effect when a container is created, that is on `add`, `upgrade` and `restore`.
`./rezervator.sh list` shows all customers, their ports and the state of their containers.
## Upgrading
+2
View File
@@ -8,6 +8,8 @@ key = '@SESSION_KEY@'
[network]
bind_ip = '0.0.0.0'
port = 3000
# Address for links in e-mails (the page where a customer can view and cancel a booking)
public_url = 'https://@DOMAIN@'
[database]
user = '@DB_USER@'
+4
View File
@@ -64,6 +64,7 @@ load_env() {
NETWORK="$PREFIX"
CUSTOMER_MAX_CONNECTIONS="${CUSTOMER_MAX_CONNECTIONS:-5}"
BASE_PORT="${BASE_PORT:-3100}"
TIME_ZONE="${REZERVATOR_TZ:-Europe/Prague}"
case "$PROXY" in traefik|nginx) ;; *) die "REZERVATOR_PROXY must be traefik or nginx" ;; esac
case "$POSTGRES" in container|host) ;; *) die "REZERVATOR_POSTGRES must be container or host" ;; esac
@@ -230,6 +231,8 @@ run_container() {
--network "$NETWORK"
--volume "$CUSTOMERS_DIR/$name/config.toml:/app/config/config.toml:ro"
--volume "$(volume_name "$name"):/app/data"
# Times of bookings are local times; the deadline for cancelling is compared with the clock
--env "TZ=$TIME_ZONE"
--label "rezervator.stack=$PREFIX"
--label "rezervator.customer=$name"
--label "rezervator.domain=$domain"
@@ -392,6 +395,7 @@ SQL
-e "s|@DB_PORT@|$PG_PORT|" \
-e "s|@MAX_CONNECTIONS@|$CUSTOMER_MAX_CONNECTIONS|" \
-e "s|@MAIL_FROM@|$mail_from|" \
-e "s|@DOMAIN@|$domain|" \
"$DEPLOY_DIR/config.template.toml" > "$dir/config.toml"
# The directory is closed to other users; the application in the container must be able to read the file
chmod 644 "$dir/config.toml"