update stalwart-bootstrap

This commit is contained in:
2026-04-26 13:28:24 +00:00
parent 087a9c055e
commit 2464371f38
2 changed files with 11 additions and 2 deletions
+6 -1
View File
@@ -210,10 +210,15 @@ start_services() {
echo "Starting stalwart..." echo "Starting stalwart..."
$DOCKER_COMPOSE_COMMAND -f ./stalwart/docker-compose.yaml up --pull always -d $DOCKER_COMPOSE_COMMAND -f ./stalwart/docker-compose.yaml up --pull always -d
if [ $? -ne 0 ]; then
print_error "failed to start Stalwart!"
exit 1
fi
$DOCKER_COMPOSE_COMMAND -f ./stalwart/docker-compose.yaml run --rm --pull always stalwart-bootstrap
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
print_success "Stalwart started successfully." print_success "Stalwart started successfully."
else else
print_error "failed to start Stalwart!" print_error "Stalwart bootstrap failed!"
exit 1 exit 1
fi fi
+5 -1
View File
@@ -40,6 +40,7 @@ services:
max-file: "3" max-file: "3"
stalwart-bootstrap: stalwart-bootstrap:
profiles: [bootstrap]
build: build:
context: . context: .
dockerfile: Dockerfile.bootstrap dockerfile: Dockerfile.bootstrap
@@ -71,7 +72,10 @@ services:
# 3) Idempotent SystemSettings update (singleton) # 3) Idempotent SystemSettings update (singleton)
stalwart-cli update SystemSettings --field "defaultHostname=$$STALWART_DEFAULT_HOSTNAME" --field "defaultDomainId=$$DOMAIN_ID" stalwart-cli update SystemSettings --field "defaultHostname=$$STALWART_DEFAULT_HOSTNAME" --field "defaultDomainId=$$DOMAIN_ID"
# 4) Trigger settings reload so url_https recomputes (no restart needed) # 4) Trust X-Forwarded-* headers from Caddy (real client IP for security/rate-limit)
stalwart-cli update Http --field useXForwarded=true
# 5) Trigger settings reload so url_https recomputes (no restart needed)
stalwart-cli create Action/ReloadSettings --json "{}" stalwart-cli create Action/ReloadSettings --json "{}"
echo "Bootstrap complete" echo "Bootstrap complete"