19 Commits
Author SHA1 Message Date
stevensting b0ba41f277 small fixes, set bonfire version to 1.0.5 2026-07-07 16:57:27 +02:00
stevensting df16876412 small fix for env var 2026-07-07 13:22:06 +02:00
stevensting d7c7703555 Merge branch 'main' into recipe-release 2026-07-07 12:41:03 +02:00
stevensting 6c4696d33a Merge branch 'main' into recipe-release 2026-07-07 12:15:58 +02:00
stevensting c6606ce828 fix more review findings 2026-07-07 11:50:43 +02:00
stevensting 1e9f29cdc4 fix review findings 2026-07-07 08:09:09 +00:00
stevensting 521e4124fe use all docker secrets directly with file access 2026-06-29 19:07:58 +02:00
stevensting 8ffe84e15e pass docker secrets by file names 2026-06-29 15:19:45 +02:00
stevensting a513bc6fa2 small fix 2026-06-29 14:31:29 +02:00
stevensting b002674215 move S3 to dedicated compose file and use docker secrets 2026-06-29 14:29:53 +02:00
stevensting 22c5d3b3e2 improve separation of compose files 2026-06-29 13:02:16 +02:00
stevensting 35d67a6823 restructure env file 2026-06-26 12:31:09 +02:00
stevensting 04a045ed33 fex versions of app and db, restructure .env.sample 2026-06-26 10:56:12 +02:00
stevensting 8436baf85b add healthcheck 2026-06-25 13:22:31 +02:00
stevensting bac96b0b82 move db to own compose file and fix version 2026-06-25 12:48:05 +02:00
stevensting f1e87ae7ca remove unused env vars 2026-06-25 11:51:24 +02:00
stevensting f03540e4c7 Merge branch 'main' into recipe-release 2026-06-25 09:41:36 +00:00
stevensting 318d7e36f6 Merge branch 'main' into recipe-release 2026-06-25 11:40:16 +02:00
stevensting 8b2f211eee move some env var defaults to compose 2026-06-25 11:35:18 +02:00
17 changed files with 188 additions and 216 deletions
+4 -13
View File
@@ -59,15 +59,14 @@ DB_MIGRATE_INDEXES_CONCURRENTLY=false
# ====================================
# SEARCH BACKEND
# recommended search backend sonic
#COMPOSE_FILE="$COMPOSE_FILE:compose.sonic.yml"
# docker secret cannot be used due to distroless image, threfore add secret here
#SONIC_PASSWORD=
# ====================================
# STATIC FILES & MAINTENANCE PAGE
## serve uploads with nginx (bypassing Phoenix) and show a maintenance page while the app restarts. NOTE: don't combine with BASIC_AUTH, as uploads would bypass it
#COMPOSE_FILE="$COMPOSE_FILE:compose.static.yml"
# alternative search service
#COMPOSE_FILE="$COMPOSE_FILE:compose.meilisearch.yml"
#SECRET_MEILI_MASTER_KEY_VERSION=v1
# ====================================
# MAIL
@@ -128,7 +127,6 @@ UPLOAD_LIMIT=20000000
# OpenID Connect: connect as a client to the OpenID Connect provider with callback url https://yourinstance.tld/openid/client/openid_1
#COMPOSE_FILE="$COMPOSE_FILE:compose.auth.openid.yml"
#SECRET_OPENID_CLIENT_SECRET_VERSION=v1
# OPENID_1_ISSUER=
# OPENID_1_DISCOVERY=
# OPENID_1_DISPLAY_NAME=
# OPENID_1_CLIENT_ID=
@@ -180,13 +178,6 @@ UPLOAD_LIMIT=20000000
#SECRET_HONEYCOMB_API_KEY_VERSION=v1
#SECRET_LIGHTSTEP_API_KEY_VERSION=v1
# ====================================
# PLAUSIBLE ANALYTICS
#PLAUSIBLE_PROXY_ENABLED=true
#PLAUSIBLE_PROXY_DOMAIN=https://plausible.example.com
#PLAUSIBLE_PROXY_SCRIPT_PATH=/js/script.js # optional
# ====================================
# BONFIRE EXTENSIONS AND MISC
+13 -33
View File
@@ -15,42 +15,24 @@ A [coop-cloud](https://coopcloud.tech) recipe for deploying [Bonfire](https://bo
## Basic usage
1. `abra app new bonfire --secrets`
2. `abra app config <app-name>`
3. `abra app deploy <app-name>`
4. Open the Elixir console: `abra app run <app-name> app bin/bonfire remote`
5. Create admin account in Elixir console (the first account created this way will get admin rights): `Bonfire.Me.make_account_only("my@email.net", "my pw")`
1. Set up Docker Swarm and [`abra`]
2. Deploy [`coop-cloud/traefik`]
3. `abra app new bonfire --secrets` (optionally with `--pass` if you'd like to save secrets in `pass`) and select your server from the list and enter the domain name you want Bonfire to be served from
4. `abra app config YOUR_APP_DOMAIN_NAME` and check/edit the config keys
5. `abra app deploy YOUR_APP_DOMAIN_NAME`
6. Open the configured domain in your browser and sign up!
## Use a custom Bonfire flavour
## Upgrades
`abra app deploy --force your-server.domain.name`
By default, this recipe deploys the Bonfire `social` flavour. If you want a different one uncomment and define `APP_FLAVOUR` in you env file.
## Use a custom Bonfire version
Attention: This is not recommended for production deployment!
You can deploy another version of Bonfire by using `APP_VERSION` and `APP_PLATFORM`. Be aware that not all versions might be compatible with this recipe, especially the quite old ones.
If you want to use bleeding edge releases try setting `APP_VERSION=latest-alpha`. When using this, every time you deploy with `abra app deploy --force <app-name>` the latest alpha replease will be used.
## Using a search backend
1. uncomment the `COMPOSE_FILE` line that contains `compose.sonic.yml` in the `.env` file for your bonfire instance.
NOTE: we recommend switching to the new `sonic` search backend (instead of the deprecated `meilisearch`):
1. comment the `COMPOSE_FILE` line that contains `compose.meilisearch.yml` in the `.env` file for your bonfire instancem and replace with a line like `COMPOSE_FILE="compose.yml:compose.sonic.yml"`
2. add `SONIC_PASSWORD=a-super-secret-password` to the same file (make sure to change the password after pasting!)
3. redeploy with `abra app deploy --force <app-name>`
3. redeploy with `abra app deploy --force your-server.domain.name`
## Serve uploads with nginx and show a maintenance page
An optional nginx service serves uploaded files straight from the uploads volume, so they don't go through the app, and keep working while it restarts. It also shows a maintenance page whenever the app is down, such as during upgrades. Uncomment the `COMPOSE_FILE` line that contains `compose.static.yml` in the `.env` file for your bonfire instance to enable.
## Protect the instance with basic auth
For e.g. a testing phase you can protect your Bonfire instance with basic auth:
1. uncomment the section `## BASIC_AUTH`
2. create a username/password combination with `echo $(htpasswd -nB <username>)`
3. add the combination as secret with `abra app secret insert <app-name> usersfile v1 '<the-user-password-combination>'`
##
[`abra`]: https://docs.coopcloud.tech/abra/
[`coop-cloud/traefik`]: https://git.coopcloud.tech/coop-cloud/traefik
## FAQ
@@ -62,5 +44,3 @@ Go into your app's Elixir console and enter something like `Bonfire.Me.make_acco
### How can I get to the app's Elixir console?
`abra app run your-server.domain.name app bin/bonfire remote`
For more, see [docs.coopcloud.tech](https://docs.coopcloud.tech).
+1 -7
View File
@@ -1,11 +1,5 @@
export APP_ENTRYPOINT_VERSION=v4
export PG_BACKUP_VERSION=v6
export MEILI_BACKUP_VERSION=v4
export SONIC_CFG_VERSION=v2
export SONIC_CFG_VERSION=v1
export SONIC_ENTRYPOINT_VERSION=v1
export POSTGRES_ENTRYPOINT_VERSION=v7
export POSTGRES_TUNE_VERSION=v2
export POSTGRES_CONF_TMPL_VERSION=v3
export BASH_ENVSUBST_VERSION=v1
export STATIC_NGINX_CONF_VERSION=v1
export MAINTENANCE_HTML_VERSION=v1
-1
View File
@@ -4,7 +4,6 @@ services:
app:
environment:
- OPENID_1_DISPLAY_NAME
- OPENID_1_ISSUER
- OPENID_1_DISCOVERY
- OPENID_1_CLIENT_ID
- OPENID_1_CLIENT_SECRET_FILE=/run/secrets/openid_client_secret
-2
View File
@@ -7,8 +7,6 @@ services:
labels:
- "traefik.http.middlewares.${STACK_NAME}_basicauth.basicauth.usersFile=/run/secrets/usersfile"
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}_basicauth"
# the uploads router (see compose.yml) needs the basic auth too, or uploads would bypass it
- "traefik.http.routers.${STACK_NAME}_uploads.middlewares=${STACK_NAME}_basicauth,${STACK_NAME}_uploads_csp"
secrets:
usersfile:
+51
View File
@@ -0,0 +1,51 @@
---
version: "3.8"
services:
app:
depends_on:
- search
environment:
- SEARCH_MEILI_INSTANCE=http://${STACK_NAME}_search:7700
secrets:
- meili_master_key
search:
image: getmeili/meilisearch:v1.14 # WIP: upgrade from v1.11 to 1.14
secrets:
- meili_master_key
volumes:
- "search-data:/meili_data"
- "dump-data:/meili_dumps"
networks:
- internal
entrypoint: ["tini", "--", "/docker-entrypoint.sh", "/bin/meilisearch"]
environment:
- MEILI_DUMP_DIR=/meili_dumps
configs:
- source: app_entrypoint
target: /docker-entrypoint.sh
mode: 0555
- source: meili_backup
target: /meili_backup.sh
mode: 0555
labels:
backupbot.backup: ${ENABLE_BACKUPS:-true}
backupbot.backup.volumes.search-data: "false"
backupbot.backup.volumes.dump-data.path: "/meili_dumps/meilisearch_latest.dump"
backupbot.backup.pre-hook: "/meili_backup.sh backup"
backupbot.restore.post-hook: '/meili_backup.sh restore'
volumes:
search-data:
dump-data:
configs:
meili_backup:
name: ${STACK_NAME}_meili_backup_${MEILI_BACKUP_VERSION:-v4}
file: meili_backup.sh
secrets:
meili_master_key:
external: true
name: ${STACK_NAME}_meili_master_key_${SECRET_MEILI_MASTER_KEY_VERSION:-v1}
+1 -1
View File
@@ -15,7 +15,7 @@ services:
# - sonic_password
search:
image: valeriansaliou/sonic:v1.8.1
image: valeriansaliou/sonic:v1.5.1
# secrets:
# - sonic_password
volumes:
-53
View File
@@ -1,53 +0,0 @@
---
version: "3.8"
# Opt-in nginx sidecar that serves uploads directly from the volume (bypassing Phoenix) and shows a maintenance page whenever the app has no running task (e.g. during redeploys and upgrades). NOTE: don't combine with `compose.basicauth.yml`, as uploads served from here would bypass the basic auth.
services:
static:
image: nginx:1.29.0-alpine
networks:
- proxy
volumes:
# NOTE: the app and this service share the local volume, so they must run on the same node
- upload-data:/srv/data/uploads:ro
configs:
- source: static_nginx_conf
target: /etc/nginx/conf.d/default.conf
mode: 0444
- source: maintenance_html
target: /srv/maintenance/maintenance.html
mode: 0444
healthcheck:
# 127.0.0.1 rather than localhost, as nginx only listens on IPv4
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1/maintenance.html"]
interval: 30s
timeout: 10s
retries: 10
start_period: 5s
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}_static.loadbalancer.server.port=80"
# serve uploads from here rather than through the app's `_uploads` router (which has the same rule, so this one needs an explicit higher priority)
- "traefik.http.routers.${STACK_NAME}_static_uploads.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS}) && PathPrefix(`/data/uploads/`)"
- "traefik.http.routers.${STACK_NAME}_static_uploads.priority=10000"
- "traefik.http.routers.${STACK_NAME}_static_uploads.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}_static_uploads.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}_static_uploads.service=${STACK_NAME}_static"
# lowest priority fallback: Traefik drops the app's routers while it has no running task, so requests land here and get the maintenance page
- "traefik.http.routers.${STACK_NAME}_maintenance.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}_maintenance.priority=1"
- "traefik.http.routers.${STACK_NAME}_maintenance.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}_maintenance.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}_maintenance.service=${STACK_NAME}_static"
configs:
static_nginx_conf:
name: ${STACK_NAME}_static_nginx_conf_${STATIC_NGINX_CONF_VERSION:-v1}
file: static.nginx.conf
maintenance_html:
name: ${STACK_NAME}_maintenance_html_${MAINTENANCE_HTML_VERSION:-v1}
file: maintenance.html
+1 -17
View File
@@ -3,7 +3,7 @@ version: "3.8"
services:
app:
image: ${CONTAINER_REGISTRY:-bonfirenetworks/bonfire}:${APP_VERSION:-1.0.7}-${APP_FLAVOUR:-social}-${APP_PLATFORM:-amd64}
image: ${CONTAINER_REGISTRY:-bonfirenetworks/bonfire}:${APP_VERSION:-1.0.5}-${APP_FLAVOUR:-social}-${APP_PLATFORM:-amd64}
logging:
driver: "json-file"
options:
@@ -49,8 +49,6 @@ services:
- ENABLE_SSO_PROVIDER
- OAUTH_ISSUER
- BONFIRE_CONSOLE_TOKEN
- SECRET_KEY_BASE_FILE=/run/secrets/secret_key_base
- SIGNING_SALT_FILE=/run/secrets/signing_salt
- ENCRYPTION_SALT_FILE=/run/secrets/encryption_salt
@@ -58,10 +56,6 @@ services:
- LIVEBOOK_PASSWORD_FILE=/run/secrets/livebook_password
- RELEASE_COOKIE_FILE=/run/secrets/release_cookie
- PLAUSIBLE_PROXY_ENABLED
- PLAUSIBLE_PROXY_DOMAIN
- PLAUSIBLE_PROXY_SCRIPT_PATH
secrets:
- secret_key_base
- signing_salt
@@ -75,8 +69,6 @@ services:
- proxy
- internal
entrypoint: ["/docker-entrypoint.sh", "./bin/bonfire", "start"]
# give the app time to shut down cleanly: on SIGTERM Oban stops fetching jobs and waits up to its `shutdown_grace_period` (default 15s) for running ones to finish, then the endpoint drains LiveView sockets and waits up to Thousand Island's `shutdown_timeout` (default 15s) for HTTP requests. These run one after the other, but the Swarm default (10s) force-kills the app first on every redeploy. Keep this above their sum.
stop_grace_period: 42s
configs:
- source: app_entrypoint
target: /docker-entrypoint.sh
@@ -94,14 +86,6 @@ services:
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
# uploads (e.g. SVG) are served from the instance's origin, so stop any script in them from running if opened directly
- "traefik.http.middlewares.${STACK_NAME}_uploads_csp.headers.customresponseheaders.Content-Security-Policy=sandbox; default-src 'none'; style-src 'unsafe-inline'"
- "traefik.http.routers.${STACK_NAME}_uploads.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS}) && PathPrefix(`/data/uploads/`)"
- "traefik.http.routers.${STACK_NAME}_uploads.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}_uploads.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}_uploads.service=${STACK_NAME}"
- "traefik.http.routers.${STACK_NAME}_uploads.middlewares=${STACK_NAME}_uploads_csp"
- "coop-cloud.${STACK_NAME}.version=2.0.3+1.0.7-social-amd64"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000"]
interval: 30s
-22
View File
@@ -1,22 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="refresh" content="30">
<title>Back in a moment</title>
<style>
body { margin: 0; min-height: 100vh; display: grid; place-items: center; font-family: system-ui, sans-serif; background: #1d1f21; color: #e5e5e5; text-align: center; }
main { max-width: 32rem; padding: 2rem; }
h1 { font-size: 1.5rem; }
p { line-height: 1.5; opacity: 0.8; }
</style>
</head>
<body>
<main>
<h1>Back in a moment</h1>
<p>This site is offline, possibly restarting for an upgrade.</p>
<p>Will try again in a few seconds...</p>
</main>
</body>
</html>
+107
View File
@@ -0,0 +1,107 @@
#!/bin/sh
set -e
backup() {
SECRET=$(cat /run/secrets/meili_master_key)
# Create dump
echo "Creating new Meilisearch dump..."
RESPONSE=$(curl -s -X POST 'http://localhost:7700/dumps' -H "Authorization: Bearer $SECRET")
echo "Response: $RESPONSE"
# More robust extraction of task UID
TASK_UID=$(echo "$RESPONSE" | sed -n 's/.*"taskUid":\([0-9]*\).*/\1/p')
if [ -z "$TASK_UID" ]; then
echo "Failed to extract task UID from response. Aborting."
exit 1
fi
echo "Waiting for dump creation (task $TASK_UID)..."
MAX_ATTEMPTS=600
ATTEMPT=0
while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
RESPONSE=$(curl -s "http://localhost:7700/tasks/$TASK_UID" -H "Authorization: Bearer $SECRET")
echo "Task status response: $RESPONSE"
TASK_STATUS=$(echo "$RESPONSE" | sed -n 's/.*"status":"\([^"]*\)".*/\1/p')
if [ -z "$TASK_STATUS" ]; then
echo "Failed to extract task status. Retrying..."
ATTEMPT=$((ATTEMPT+1))
sleep 5
continue
fi
echo "Current status: $TASK_STATUS"
if [ "$TASK_STATUS" = "succeeded" ]; then
echo "Dump creation succeeded"
break
elif [ "$TASK_STATUS" = "enqueued" ] || [ "$TASK_STATUS" = "processing" ]; then
echo "Dump creation in progress... ($TASK_STATUS)"
ATTEMPT=$((ATTEMPT+1))
sleep 5
else
echo "Dump creation in unexpected state: $TASK_STATUS. Giving up."
exit 1
fi
done
if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then
echo "Timed out waiting for dump creation"
exit 1
fi
# Extract dump UID more reliably
DUMP_UID=$(echo "$RESPONSE" | sed -n 's/.*"dumpUid":"\([^"]*\)".*/\1/p')
if [ -z "$DUMP_UID" ]; then
echo "Failed to extract dump UID. Aborting."
exit 1
fi
echo "Using dump $DUMP_UID"
# Check if file exists before copying
if [ ! -f "/meili_dumps/$DUMP_UID.dump" ]; then
echo "Dump file /meili_dumps/$DUMP_UID.dump not found!"
ls -la /meili_dumps/
exit 1
fi
cp -f "/meili_dumps/$DUMP_UID.dump" "/meili_dumps/meilisearch_latest.dump"
echo "Dump created and copied successfully. You can find it at /meili_dumps/meilisearch_latest.dump"
}
restore() {
echo 'Restarting Meilisearch with imported dump, may take a while to become available...'
# Check if dump file exists
if [ ! -f "/meili_dumps/meilisearch_latest.dump" ]; then
echo "Error: Dump file not found at /meili_dumps/meilisearch_latest.dump"
exit 1
fi
pkill meilisearch || echo "No Meilisearch process found to kill"
echo "Starting Meilisearch with import dump option..."
MEILI_NO_ANALYTICS=true /bin/meilisearch --import-dump /meili_dumps/meilisearch_latest.dump &
echo "Meilisearch restore process initiated..."
}
# Handle command line argument
case "$1" in
backup)
backup
;;
restore)
restore
;;
*)
echo "Usage: $0 {backup|restore}"
exit 1
;;
esac
+1 -1
View File
@@ -39,7 +39,7 @@ services:
configs:
postgres_entrypoint:
name: ${STACK_NAME}_postgres_entrypoint_${POSTGRES_ENTRYPOINT_VERSION:-v7}
name: ${STACK_NAME}_postgres_entrypoint_${POSTGRES_ENTRYPOINT_VERSION:-v6}
file: postgres/postgres-entrypoint.sh
postgres_tune:
name: ${STACK_NAME}_postgres_tune_${POSTGRES_TUNE_VERSION:-v2}
+4 -30
View File
@@ -8,12 +8,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
[[ "$SCRIPT_DIR" == "/" ]] && SCRIPT_DIR=""
# Configuration via environment variables
# The tuned config is a standalone config_file OUTSIDE the data dir, so it never shares postgresql.auto.conf with `ALTER SYSTEM`. Bonfire's InstanceTuning clears its own ALTER SYSTEM writes on every app boot (`ALTER SYSTEM RESET`), which wiped the tuner's values when both lived in auto.conf. Now RESET falls back to this file, and admin ALTER SYSTEM values survive restarts. Outside the data dir also keeps a fresh volume empty for initdb.
# POSTGRES_CONF_PATH="${POSTGRES_CONF_PATH:-/var/lib/postgresql/data/postgresql.auto.conf}"
POSTGRES_CONF_PATH="${POSTGRES_CONF_PATH:-/etc/postgresql/bonfire.conf}"
# NOT `-c name=value` per setting: command-line values outrank postgresql.auto.conf and would silently disable InstanceTuning
POSTGRES_START_CMD="${POSTGRES_START_CMD:-docker-entrypoint.sh postgres -c config_file=${POSTGRES_CONF_PATH}}"
PGDATA="${PGDATA:-/var/lib/postgresql/data}"
POSTGRES_CONF_PATH="${POSTGRES_CONF_PATH:-/var/lib/postgresql/data/postgresql.auto.conf}"
POSTGRES_START_CMD="${POSTGRES_START_CMD:-docker-entrypoint.sh postgres}"
# Check if envsubst is available, if not, load our bash implementation
if ! command -v envsubst &> /dev/null; then
@@ -49,32 +45,10 @@ if mkdir -p "${CONF_DIR}" 2>/dev/null; then
# Write the processed config
echo "$config" > "${POSTGRES_CONF_PATH}"
echo "PostgreSQL: Configuration generated at ${POSTGRES_CONF_PATH}"
# One-time cleanup for volumes created when this script wrote the tuned config INTO postgresql.auto.conf: those stale lines override the config_file above (and shared_buffers, max_connections etc. are not InstanceTuning knobs, so nothing else would ever clear them). Runs once per volume (marker file), so later admin ALTER SYSTEM values persist.
AUTO_CONF="${PGDATA}/postgresql.auto.conf"
TUNE_MARKER="${PGDATA}/.bonfire_tune_v2"
if [[ -f "${PGDATA}/PG_VERSION" && -f "${AUTO_CONF}" && ! -f "${TUNE_MARKER}" ]]; then
echo "PostgreSQL: removing keys the tuner now sets from ${AUTO_CONF} (one-time migration)"
tmp_conf="$(mktemp)"
# first input = the generated config (collect its keys), second = auto.conf (drop those keys, keep the rest)
awk 'NR==FNR { k=$0; sub(/[[:space:]]*=.*/, "", k); keys[k]=1; next }
{ k=$0; sub(/[[:space:]]*=.*/, "", k); if (!(k in keys)) print }' \
<(echo "$config") "${AUTO_CONF}" > "${tmp_conf}"
# write in place (not mv) so the file keeps its postgres ownership
cat "${tmp_conf}" > "${AUTO_CONF}"
rm -f "${tmp_conf}"
touch "${TUNE_MARKER}"
elif [[ ! -f "${PGDATA}/PG_VERSION" && ! -f "${TUNE_MARKER}" ]]; then
# Fresh volume: nothing to clean, but the marker can't be written yet (initdb needs an empty data dir). Write it once initdb is done, or the next boot would wrongly run the cleanup and drop admin ALTER SYSTEM values. The loop survives the exec below as an orphan and gives up after 10 minutes.
( for _ in $(seq 1 600); do
if [[ -f "${PGDATA}/PG_VERSION" ]]; then touch "${TUNE_MARKER}"; break; fi
sleep 1
done ) >/dev/null 2>&1 &
fi
# Check if we should start postgres
if [[ -n "${POSTGRES_START_CMD}" && "${POSTGRES_START_CMD}" != "none" ]]; then
# Start PostgreSQL with the tuned config_file. postgresql.auto.conf (ALTER SYSTEM) is still loaded from the data dir and layered on top
# Start PostgreSQL - postgresql.auto.conf is automatically loaded from data dir
exec ${POSTGRES_START_CMD}
else
echo "PostgreSQL: Skipping startup (POSTGRES_START_CMD is '${POSTGRES_START_CMD}')"
-1
View File
@@ -1 +0,0 @@
ATTENTION: this is the first release and contains a couple of breaking changes in comparison to the previously unreleased recipe. There are a lot of secrets, keys and passwords moved to docker secrets, and the .env.sample was completly restructured. It is recommended to start your env file from scratch from the new template to make sure nothing is missing.
-1
View File
@@ -1 +0,0 @@
Mailisearch search backend was removed. If you want to use a search backend switch to sonic. See readme on how to use it.
+5 -7
View File
@@ -6,15 +6,13 @@
[channel]
inet = "0.0.0.0:1491"
# keep in sync with :keepalive_interval in Bonfire.Search.Sonic, which must stay under this or Sonic drops our idle ingest/search connections
tcp_timeout = 300
# moved out of [channel.search], deprecated since Sonic 1.8
[search]
query_limit_default = 10
query_limit_maximum = 200
suggest_limit_default = 5
suggest_limit_maximum = 20
[channel.search]
query_limit_default = 10
query_limit_maximum = 200
suggest_limit_default = 5
suggest_limit_maximum = 20
[store.kv]
path = "/var/lib/sonic/store/kv/"
-27
View File
@@ -1,27 +0,0 @@
# used by compose.static.yml
server {
listen 80;
server_tokens off;
root /srv;
# mirrors the uploads `Plug.Static` in Bonfire's endpoint
location /data/uploads/ {
# uploads (e.g. SVG) are served from the instance's origin, so stop any script in them from running if opened directly
add_header Content-Security-Policy "sandbox; default-src 'none'; style-src 'unsafe-inline'" always;
gzip_static on;
try_files $uri =404;
}
# anything else only reaches this service while the app is down (see the maintenance router in compose.static.yml)
location / {
return 503;
}
error_page 503 /maintenance.html;
location = /maintenance.html {
root /srv/maintenance;
add_header Retry-After 30 always;
add_header Cache-Control "no-store" always;
}
}