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
7 changed files with 177 additions and 32 deletions
+5
View File
@@ -59,10 +59,15 @@ 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=
# alternative search service
#COMPOSE_FILE="$COMPOSE_FILE:compose.meilisearch.yml"
#SECRET_MEILI_MASTER_KEY_VERSION=v1
# ====================================
# MAIL
+13 -29
View File
@@ -15,38 +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`
## 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
@@ -58,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).
+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.7.4
image: valeriansaliou/sonic:v1.5.1
# secrets:
# - sonic_password
volumes:
-1
View File
@@ -86,7 +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}"
- "coop-cloud.${STACK_NAME}.version=1.0.0+1.0.5-social-amd64"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000"]
interval: 30s
+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
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.