70 Commits

Author SHA1 Message Date
0669d30a8b Split optional config into separate compose files
All checks were successful
continuous-integration/drone/tag Build is passing
2026-01-24 12:52:10 +00:00
36059b02dd Merge pull request 'Split out into separate compose files' (#11) from compose-split into main
Reviewed-on: #11
2026-01-24 12:45:24 +00:00
274e46e96e Fixup compose.postal.yml 2026-01-23 18:41:07 +00:00
5a942c67a0 Split out into separate compose files 2026-01-23 18:37:27 +00:00
3db5ca8b55 Karrot v17.2.1 and use proper healthcheck endpoint
All checks were successful
continuous-integration/drone/tag Build is passing
2026-01-23 11:00:52 +00:00
1cee5fd5d2 Upgrade to karrot v17.2.0
All checks were successful
continuous-integration/drone/tag Build is passing
2026-01-21 00:35:57 +00:00
32354ad984 Increase start_period to allow slow migrations
All checks were successful
continuous-integration/drone/tag Build is passing
2025-12-30 12:38:13 +00:00
8b1aa49240 Update to Karrot v17.1.0
All checks were successful
continuous-integration/drone/tag Build is passing
2025-12-24 22:42:57 +00:00
047d27a969 Update to karrot v17.0.0
All checks were successful
continuous-integration/drone/tag Build is passing
2025-12-21 00:27:19 +00:00
81dd82ba86 Upgrade to Karrot v16.2.0
All checks were successful
continuous-integration/drone/tag Build is passing
2025-04-10 00:01:54 +01:00
ec767e3eea Update to Karrot v16.1.0
All checks were successful
continuous-integration/drone/tag Build is passing
2025-04-01 23:21:21 +01:00
5b3506ff19 Fix healthcheck URL
All checks were successful
continuous-integration/drone/tag Build is passing
2025-01-30 19:05:44 +00:00
909eab8458 Update to karrot v16.0.0
All checks were successful
continuous-integration/drone/tag Build is passing
2025-01-30 18:44:11 +00:00
b60feecd68 Update .drone.yml 2025-01-08 10:09:13 -08:00
3ad265ce56 Update to karrot v15.2.0
All checks were successful
continuous-integration/drone/tag Build is passing
- includes plugins
2024-06-24 23:45:55 +01:00
798e4ea45d Update to karrot v15.1.1
All checks were successful
continuous-integration/drone/tag Build is passing
2024-05-23 11:01:52 +01:00
5b91dbe2c7 Update to karrot v15.0.0
All checks were successful
continuous-integration/drone/tag Build is passing
2024-05-22 15:41:05 +01:00
ece4d2e428 Update to karrot v14.1.0
All checks were successful
continuous-integration/drone/tag Build is passing
2024-04-04 23:53:03 +01:00
7e028c6c34 Update release doc to fix --user arg position 2024-04-01 20:21:13 +01:00
7964281022 Update readme to show backups are configured 2024-03-29 17:13:26 +00:00
1839764a33 Update readme 2024-03-29 16:30:08 +00:00
ad652a2815 Don't include geoip volume in main compose.yml 2024-03-29 16:24:44 +00:00
036e5b33eb More docs in .env.sample 2024-03-29 16:20:09 +00:00
7937f686f2 1.0.0+14.0.1 release 2024-03-29 15:58:20 +00:00
30df8b46d0 Fix geoip override config 2024-03-25 22:36:26 +00:00
1f46da81a0 Add permission fixing cmd
Since we run karrot as karrot user now, the uploads need to be
owned by that user.
2024-03-25 22:36:03 +00:00
83e1c78b6a Merge pull request 'Use updated docker images' (#10) from change/use-new-docker-images into main
Reviewed-on: #10
2024-03-25 18:48:20 +00:00
a707991df9 Add initial compose file declaration
Other ones don't seem to have it, but it wouldn't work on mine
without it :/
2024-03-25 18:33:43 +00:00
2a472504ea Switch to v14.0.1 image 2024-03-25 17:55:26 +00:00
df863e057e Document geoip compose file 2024-03-25 12:36:22 +00:00
2c9c054a3c Fixups 2024-03-25 01:02:19 +00:00
e52fb2c61a Move geoip to seperate compose file 2024-03-25 00:44:35 +00:00
e9b65d460d Remove custom entrypoint
Karrot can now read _FILE config values natively
2024-01-26 00:26:14 +00:00
b6ddeb89b9 Bump 2024-01-26 00:20:18 +00:00
9a5b97b338 Use livekit_api_secret 2024-01-26 00:16:53 +00:00
3ce645b455 Update recipe to Karrot v13.0.0 2024-01-25 23:53:58 +00:00
2e1c0a9b50 Improved nginx configuration + new images
- correct URL for community proxy
- allow nginx to recheck if backend was done before
- new karrot beta images
2024-01-18 00:46:17 +00:00
abe5537bb0 Add backup bot labels 2024-01-17 19:24:43 +00:00
2f7ed80cd9 Bump nginx config version again 2024-01-17 19:06:15 +00:00
dbb0ca555b Add VAPID_ADMIN_EMAIL config 2024-01-17 19:00:14 +00:00
95f6b0cfc6 Bump entrypoint version 2024-01-17 18:51:22 +00:00
37e00b85af Bump nginx config version 2024-01-17 18:51:01 +00:00
6dcf9d9c70 Fix vapid private key configuration 2024-01-17 18:49:42 +00:00
0b29b35ef6 Set nginx client_max_body_size 2024-01-17 18:46:31 +00:00
7f8d9c0843 Add vapid keys configuration 2024-01-17 18:42:26 +00:00
cc61f80953 Update images 2024-01-17 18:37:35 +00:00
9b1a1436c1 Switch to backend-beta image 2023-10-30 23:13:20 +00:00
0e48efc279 Add drone config for generating catalogue 2023-10-30 23:10:58 +00:00
d99fcbeaa8 Pass more environment variables to karrot 2023-10-25 10:45:52 +01:00
39816dcf54 Version bumps 2023-10-19 19:04:39 +01:00
8c6a6202d4 Set MODE=prod and bump frontend image 2023-10-19 19:03:27 +01:00
96b3c0f9dd Configure default CSRF_TRUSTED_ORIGINS 2023-10-19 19:03:05 +01:00
5dbce885f0 Add CSRF_TRUSTED_ORIGINS env variable 2023-10-19 17:59:41 +01:00
6af64089a5 fix web healthcheck 2023-10-19 16:47:53 +02:00
71b63e04a4 fix entrypoint 2023-10-19 16:03:38 +02:00
5fcc4382e8 make maxmind key optional 2023-10-19 15:55:35 +02:00
df23e73573 Merge branch 'main' of ssh://git.coopcloud.tech:2222/coop-cloud/karrot 2023-10-19 15:43:27 +02:00
1760243846 wip 2023-10-19 15:43:25 +02:00
03fa1f41b6 Bump backend image version 2023-10-19 14:43:23 +01:00
2d18570bd7 Fix SLL -> SSL typo 2023-10-19 14:22:34 +01:00
ab83480668 wip 2023-10-19 15:18:26 +02:00
9e55669a35 fix depends_on 2023-10-19 14:59:17 +02:00
78940df2ab wip 2023-10-19 14:52:51 +02:00
66193db1b6 wip 2023-10-19 14:41:56 +02:00
2536b67d4a Merge branch 'main' of ssh://git.coopcloud.tech:2222/coop-cloud/karrot 2022-09-30 22:19:27 +02:00
9ec5ed1d3f chore: publish 0.1.0+0.1.0 release 2022-09-30 22:18:34 +02:00
5d9f04911d chore: publish 0.1.0+0.1.0 release 2022-09-30 19:13:37 +02:00
e4c18a4826 fully working with e-mail support 2022-09-30 17:16:26 +02:00
45fbf25a19 healthcheck 2022-09-30 17:29:19 +02:00
bd554f3342 first working commit 2022-09-29 19:33:06 +02:00
18 changed files with 453 additions and 176 deletions

17
.drone.yml Normal file
View File

@ -0,0 +1,17 @@
---
kind: pipeline
name: generate recipe catalogue
steps:
- name: release a new version
image: plugins/downstream
settings:
server: https://build.coopcloud.tech
token:
from_secret: drone_abra-bot_token
fork: true
repositories:
- toolshed/auto-recipes-catalogue-json
trigger:
event: tag

View File

@ -1,21 +1,108 @@
TYPE=karrot
# For more information about these options
# see https://docs.karrot.world/self-host/settings
DOMAIN=karrot.example.com
LETS_ENCRYPT_ENV=production
# postal,smtp,sonsole
EMAIL_BACKEND=console
# only set those when using SMTP
#EMAIL_FROM=
#EMAIL_PASSWORD=
#SMTP_HOST=
#SMTP_USE_SSL=true
#SMTP_PORT=465
COMPOSE_FILE="compose.yml"
# account id for maxmind (for GeoIP)
MAXMIND_ACCOUNT_ID=
# License key for maxmind
MAXMIND_LICENSE_KEY=
SITE_NAME=karrot dev
SITE_LOGO=https://user-images.githubusercontent.com/31616/36565633-517373a4-1821-11e8-9948-5bf6887c667e.png
FILE_UPLOAD_MAX_SIZE=10m
# Useful to set this, it's a comma separated list of email address.
# Anyone that registers with one of these emails addresses is considered an instance admin
# and will have access to the instance admin UI within Karrot
#ADMIN_EMAILS=
SECRET_DB_PASSWORD_VERSION=v1
SECRET_SECRET_KEY_VERSION=v1
SECRET_SMTP_PASSWORD_VERSION=v1
SECRET_MAXMIND_LICENSE_KEY_VERSION=v1
SECRET_VAPID_PRIVATE_KEY_VERSION=v1
SECRET_LIVEKIT_API_SECRET_VERSION=v1
SECRET_POSTAL_API_KEY_VERSION=v1
# Email
#------------------------------------------------------
# Note: you can also configure this in the admin UI
# Can be: postal, smtp, or console
EMAIL_BACKEND=console
# SMTP
#-----------------------
# when EMAIL_BACKEND=smtp
# SMTP USER and EMAIL_FROM are usually the same
# make sure to set the smtp_password secret
#COMPOSE_FILE="$COMPOSE_FILE:compose.smtp.yml"
#EMAIL_FROM=
#SMTP_USER=
#SMTP_HOST=
#SMTP_USE_SSL=
#SMTP_USE_TLS=true
#SMTP_PORT=587
# Postal
#-----------------------
# when EMAIL_BACKEND=postal
# make sure to set the postal_api_key secret
#COMPOSE_FILE="$COMPOSE_FILE:compose.postal.yml"
#POSTAL_API_URL=
# Postal incoming email
#-----------------------
# If you are using postal for incoming email, set these.
# You can use smtp for outgoing and postal for incoming if you wish!
#POSTAL_WEBHOOK_KEY=
#EMAIL_REPLY_DOMAIN=
# MaxMind GeoIP (optional)
#------------------------------------------------------
# account id for maxmind (for GeoIP)
# uncomment if using maxmind account
# make sure to set the maxmind_license_key secret
#COMPOSE_FILE="$COMPOSE_FILE:compose.geoip.yml"
#MAXMIND_ACCOUNT_ID=
# Web Push (Vapid) (optional)
#------------------------------------------------------
# Note: you can also configure this in the instance admin UI
# You need to generate a valid vapid keypair
# You can generate one by running:
# docker run --rm codeberg.org/karrot/generate-vapid-keypair
# make sure to set the vapid_private_key secret
#COMPOSE_FILE="$COMPOSE_FILE:compose.vapid.yml"
#VAPID_PUBLIC_KEY=
#VAPID_ADMIN_EMAIL=
# Video calls (optional)
#------------------------------------------------------
# Note: you can also configure this in the admin UI
# make sure to set the livekit_api_secret secret
#COMPOSE_FILE="$COMPOSE_FILE:compose.livekit.yml"
#MEET_LIVEKIT_ENDPOINT=
#MEET_LIVEKIT_API_KEY=
# You probably don't need to touch these
#------------------------------------------------------
SITE_URL=https://${DOMAIN}
LETS_ENCRYPT_ENV=production
CSRF_TRUSTED_ORIGINS=${SITE_URL}

31
README.md Normal file
View File

@ -0,0 +1,31 @@
# karrot
Karrot is a free and open-source tool for grassroots initiatives and groups of people that want to coordinate face-to-face activities on a local, autonomous and voluntary basis.
<!-- metadata -->
* **Category**: Utilities
* **Status**: 3, stable
* **Image**: [`karrot-frontend`](https://codeberg.org/karrot/-/packages/container/karrot-backend)/[`karrot-frontend`](https://codeberg.org/karrot/-/packages/container/karrot-backend),4,upstream
* **Healthcheck**: Yes
* **Backups**: Yes
* **Email**: Yes
* **Tests**: No
* **SSO**: No
<!-- endmetadata -->
## Basic usage
1. Set up Docker Swarm and [`abra`]
2. `abra app new karrot`
3. `abra app config <karrot app name>`
4. `abra app deploy <karrot app name>`
See [Karrot Self-hosting docs](https://docs.karrot.world/self-host/coop-cloud/getting-started) for more information.
## Configuration options
`MAXMIND_ACCOUNT_ID` and `MAXMIND_ACCOUNT_KEY` are API credentials from maxmind.com. You need an account there to get GeoIP data for Karrot.
[`abra`]: https://git.coopcloud.tech/coop-cloud/abra

19
abra.sh
View File

@ -1,2 +1,17 @@
export NGINX_CONFIG_VERSION=v1
export POSTGRES_ENTRYPOINT_VERSION=v1
fix-permissions() {
if [ "$(whoami)" != "root" ]; then
echo "error: you must be root to fix permissions"
echo "Try adding '--user root'"
exit 1
fi
echo "Fixing permissions"
echo "Making karrot the owner of uploads"
chown -R karrot:karrot /app/uploads
echo "Making karrot the owner of plugins"
chown -R karrot:karrot /app/plugins
echo "Done"
}

View File

@ -1,13 +0,0 @@
FROM python:3.7-buster
WORKDIR /app
RUN apt-get update && \
apt-get install -y gdal-bin
COPY ./karrot-backend.pyz /app/karrot-backend.pyz
RUN sed -i -e's/ main/ main contrib non-free/g' /etc/apt/sources.list && \
apt-get update && \
apt-get install -y libmaxminddb0 libmaxminddb-dev geoipupdate

Binary file not shown.

Binary file not shown.

30
compose.geoip.yml Normal file
View File

@ -0,0 +1,30 @@
version: "3.8"
services:
app:
volumes:
- "geoip_data:/var/lib/GeoIP"
worker:
volumes:
- "geoip_data:/var/lib/GeoIP"
geoip:
image: "ghcr.io/maxmind/geoipupdate:v6"
volumes:
- "geoip_data:/usr/share/GeoIP"
secrets:
- maxmind_license_key
environment:
- "GEOIPUPDATE_EDITION_IDS=GeoLite2-City GeoLite2-Country"
- "GEOIPUPDATE_ACCOUNT_ID=${MAXMIND_ACCOUNT_ID:-}"
- "GEOIPUPDATE_LICENSE_KEY_FILE=/run/secrets/maxmind_license_key"
- "GEOIPUPDATE_FREQUENCY=72"
secrets:
maxmind_license_key:
external: true
name: ${STACK_NAME}_maxmind_license_key_${SECRET_MAXMIND_LICENSE_KEY_VERSION}
volumes:
geoip_data:

23
compose.livekit.yml Normal file
View File

@ -0,0 +1,23 @@
version: "3.8"
services:
app:
secrets:
- livekit_api_secret
environment:
- MEET_LIVEKIT_ENDPOINT
- MEET_LIVEKIT_API_KEY
- MEET_LIVEKIT_API_SECRET_FILE=/run/secrets/livekit_api_secret
worker:
secrets:
- livekit_api_secret
environment:
- MEET_LIVEKIT_ENDPOINT
- MEET_LIVEKIT_API_KEY
- MEET_LIVEKIT_API_SECRET_FILE=/run/secrets/livekit_api_secret
secrets:
livekit_api_secret:
external: true
name: ${STACK_NAME}_livekit_api_secret_${SECRET_LIVEKIT_API_SECRET_VERSION}

21
compose.postal.yml Normal file
View File

@ -0,0 +1,21 @@
version: "3.8"
services:
app:
secrets:
- postal_api_key
environment:
- POSTAL_API_KEY_FILE=/run/secrets/postal_api_key
- POSTAL_API_URL
worker:
secrets:
- postal_api_key
environment:
- POSTAL_API_KEY_FILE=/run/secrets/postal_api_key
- POSTAL_API_URL
secrets:
postal_api_key:
external: true
name: ${STACK_NAME}_postal_api_key_${SECRET_POSTAL_API_KEY_VERSION}

29
compose.smtp.yml Normal file
View File

@ -0,0 +1,29 @@
version: "3.8"
services:
app:
secrets:
- smtp_password
environment:
- SMTP_HOST
- SMTP_PASSWORD_FILE=/run/secrets/smtp_password
- SMTP_PORT
- SMTP_USE_SSL
- SMTP_USE_TLS
- SMTP_USER
worker:
secrets:
- smtp_password
environment:
- SMTP_HOST
- SMTP_PASSWORD_FILE=/run/secrets/smtp_password
- SMTP_PORT
- SMTP_USE_SSL
- SMTP_USE_TLS
- SMTP_USER
secrets:
smtp_password:
external: true
name: ${STACK_NAME}_smtp_password_${SECRET_SMTP_PASSWORD_VERSION}

23
compose.vapid.yml Normal file
View File

@ -0,0 +1,23 @@
version: "3.8"
services:
app:
secrets:
- vapid_private_key
environment:
- VAPID_ADMIN_EMAIL
- VAPID_PUBLIC_KEY
- VAPID_PRIVATE_KEY_FILE=/run/secrets/vapid_private_key
worker:
secrets:
- vapid_private_key
environment:
- VAPID_ADMIN_EMAIL
- VAPID_PUBLIC_KEY
- VAPID_PRIVATE_KEY_FILE=/run/secrets/vapid_private_key
secrets:
vapid_private_key:
external: true
name: ${STACK_NAME}_vapid_private_key_${SECRET_VAPID_PRIVATE_KEY_VERSION}

View File

@ -2,24 +2,27 @@ version: "3.8"
services:
web:
image: "vlafvlaf/karrot_frontend:0.0.3"
configs:
- source: nginx_config
target: /etc/nginx/conf.d/default.conf
image: "codeberg.org/karrot/karrot-frontend:v17.2.1"
depends_on:
- app
environment:
- DOMAIN
- FILE_UPLOAD_MAX_SIZE
- FILE_UPLOAD_DIR=/app/uploads/
- CSP_CONNECT_SRC=${CSP_CONNECT_SRC:-}
- LISTEN=80
- BACKEND=app:8000
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/"]
interval: 30s
interval: 15s
timeout: 3s
retries: 30
retries: 2
start_period: 15s
networks:
- internal
- proxy
volumes:
- "app_data:/app/uploads"
- "app_data:/app/uploads/"
deploy:
update_config:
failure_action: rollback
@ -30,85 +33,106 @@ 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=0.0.1+testing"
app:
image: "vlafvlaf/karrot_backend:test"
image: "codeberg.org/karrot/karrot-backend:v17.2.1"
networks:
- internal
depends_on:
- db
- redis
secrets:
- db_password
- secret_key
volumes:
- "shiv_data:/root/.shiv"
- "geoip_data:/var/lib/GeoIP"
- "app_data:/app/uploads"
- "app_data:/app/uploads/"
- "plugins_data:/app/plugins/"
environment:
- MAXMIND_ACCOUNT_ID
- MAXMIND_LICENSE_KEY
- EMAIL_FROM
- SMTP_PASSWORD
- SMTP_HOST
- ADMIN_EMAILS
- CSRF_TRUSTED_ORIGINS
- DATABASE_CONN_MAX_AGE
- DATABASE_HOST=db
- DATABASE_NAME=karrot
- DATABASE_PASSWORD_FILE=/run/secrets/db_password
- DATABASE_PORT=5432
- DATABASE_USER=karrot
- EMAIL_BACKEND
- SMTP_PORT
- SMTP_USE_SSL
- SITE_URL=http://localhost:8000
- EMAIL_FROM
- EMAIL_REPLY_DOMAIN
- FILE_UPLOAD_DIR=/app/uploads/
- FILE_UPLOAD_USE_ACCEL_REDIRECT=true
- FILE_UPLOAD_MAX_SIZE
- FORUM_BANNER_TOPIC_ID
- FORUM_DISCUSSIONS_FEED
- LISTEN_HOST=0.0.0.0
- LISTEN_SERVER=uvicorn
- SECRET_KEY=foobar
- DATABASE_HOST=db
- DATABASE_PORT=5432
- DATABASE_NAME=karrot
- DATABASE_USER=karrot
- DATABASE_PASSWORD=karrot
- MODE=prod
# Keep POSTAL_WEBHOOK_KEY in main compose file
# as you can use it without the other postal vars
- POSTAL_WEBHOOK_KEY
- PROXY_DISCOURSE_URL
- PLUGIN_DIR=/app/plugins/
- REDIS_DB=0
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_DB=0
- SECRET_KEY_FILE=/run/secrets/secret_key
- SITE_LOGO
- SITE_NAME
- SITE_URL
- MIGRATE=yes
command: server
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/"]
interval: 30s
test: ["CMD", "curl", "-f", "http://localhost:8000/api/healthcheck/"]
interval: 10s
timeout: 3s
retries: 90
command: >
sh -c "
echo 'EditionIDs GeoLite2-City GeoLite2-Country' > /etc/GeoIP.conf &&
echo AccountID $${MAXMIND_ACCOUNT_ID} >> /etc/GeoIP.conf &&
echo LicenseKey $${MAXMIND_LICENSE_KEY} >> /etc/GeoIP.conf &&
echo 'Updating geoip data, first time could be slow...' &&
geoipupdate &&
pip install tzdata &&
python karrot-backend.pyz migrate &&
python karrot-backend.pyz server
"
retries: 3
# sometimes migrations can take their time..
start_period: 600s
deploy:
labels:
- "coop-cloud.${STACK_NAME}.version=4.0.0+17.2.1"
- "backupbot.backup=true"
- "backupbot.backup.path=/app/uploads"
worker:
image: "vlafvlaf/karrot_backend:test"
image: "codeberg.org/karrot/karrot-backend:v17.2.1"
depends_on:
# shiv + geoip data gets loaded on the first run of the app
# so to ensure it's available in the worker too, we need to wait
- app
volumes:
- "shiv_data:/root/.shiv"
- "geoip_data:/var/lib/GeoIP"
networks:
- internal
secrets:
- db_password
- secret_key
volumes:
- "app_data:/app/uploads/"
- "plugins_data:/app/plugins/"
environment:
- SITE_URL=http://localhost:8000
- ADMIN_EMAILS
- DATABASE_CONN_MAX_AGE
- DATABASE_HOST=db
- DATABASE_NAME=karrot
- DATABASE_PASSWORD_FILE=/run/secrets/db_password
- DATABASE_PORT=5432
- DATABASE_USER=karrot
- EMAIL_BACKEND
- EMAIL_FROM
- EMAIL_REPLY_DOMAIN
- LISTEN_HOST=0.0.0.0
- LISTEN_SERVER=uvicorn
- SECRET_KEY=foobar
- DATABASE_HOST=db
- DATABASE_PORT=5432
- DATABASE_NAME=karrot
- DATABASE_USER=karrot
- DATABASE_PASSWORD=karrot
- MODE=prod
# Keep POSTAL_WEBHOOK_KEY in main compose file
# as you can use it without the other postal vars
- POSTAL_WEBHOOK_KEY
- PLUGIN_DIR=/app/plugins/
- REDIS_DB=0
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_DB=0
command:
sh -c "
pip install tzdata &&
python karrot-backend.pyz worker"
- SECRET_KEY_FILE=/run/secrets/secret_key
- SITE_LOGO
- SITE_NAME
- SITE_URL
command: worker
redis:
image: "redis:6-alpine"
command: ["redis-server", "--appendonly", "yes"]
@ -129,40 +153,37 @@ services:
interval: 10s
timeout: 3s
retries: 30
configs:
- source: postgres_extensions
target: /docker-entrypoint-initdb.d/extensions.sql
mode: 0555
secrets:
- db_password
volumes:
- "postgres_data:/var/lib/postgresql/data"
networks:
- internal
environment:
- POSTGRES_PASSWORD=karrot
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
- POSTGRES_USER=karrot
- POSTGRES_DB=karrot
deploy:
labels:
backupbot.backup: "true"
backupbot.backup.pre-hook: "PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /var/lib/postgresql/data/postgres-backup.sql"
backupbot.backup.post-hook: "rm -rf /var/lib/postgresql/data/postgres-backup.sql"
backupbot.backup.path: "/var/lib/postgresql/data/"
secrets:
db_password:
external: true
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
configs:
nginx_config:
name: ${STACK_NAME}_nginx_config_${NGINX_CONFIG_VERSION}
file: nginx.conf.tmpl
template_driver: golang
postgres_extensions:
name: ${STACK_NAME}_postgres_extensions_${POSTGRES_ENTRYPOINT_VERSION}
file: pg_extensions.sql
secret_key:
external: true
name: ${STACK_NAME}_secret_key_${SECRET_SECRET_KEY_VERSION}
volumes:
shiv_data:
geoip_data:
app_data:
plugins_data:
postgres_data:
redis_data:
networks:
proxy:
external: true

View File

@ -1,4 +0,0 @@
FROM nginx:1.20.1-alpine
RUN curl https://download.karrot.world/karrot-frontend-production.zip -o karrot-frontend.zip && \
unzip -o karrot-frontend.zip -d /usr/share/nginx/html

View File

@ -1,64 +0,0 @@
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name web;
root /usr/share/nginx/html;
location / {
try_files $uri /index.html;
if_modified_since off;
expires off;
etag off;
# TODO: csp headers
}
location /css {
expires max;
}
location /js {
expires max;
}
location /img {
expires max;
}
location /fonts {
expires max;
}
# /app/uploads
location /media/ {
alias /app/uploads/;
expires max;
}
location /community_proxy/ {
proxy_pass https://community.foodsaving.world/;
}
location ^\/(api(\-auth)?|docs|silk)\/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
# this port is whatever port 80 is mapped to outside the container
proxy_set_header Host $host:8080;
proxy_pass http://app:8000;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions;
proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
proxy_set_header Sec-WebSocket-Protocol $http_sec_websocket_protocol;
proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version;
}
}

View File

@ -3,6 +3,8 @@ map $http_upgrade $connection_upgrade {
'' close;
}
client_max_body_size {{ env "FILE_UPLOAD_MAX_SIZE" }};
server {
listen 80;
server_name {{ env "DOMAIN" }};
@ -39,9 +41,9 @@ server {
alias /app/uploads/;
expires max;
}
location /community_proxy/ {
proxy_pass https://community.foodsaving.world/;
proxy_pass https://community.karrot.world/;
}
location ~ ^\/(api(\-auth)?|docs|silk)\/ {
@ -50,7 +52,12 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
# this port is whatever port 80 is mapped to outside the container
proxy_set_header Host $host:80;
proxy_pass http://app:8000;
# resolver + backend as a variable means can run when backend is not up yet
resolver 127.0.0.11 valid=3s;
set $backend app:8000;
proxy_pass http://$backend$request_uri;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;

32
release/1.0.0+14.0.1 Normal file
View File

@ -0,0 +1,32 @@
Major upgrade because this switches to new set of docker images with new python version.
Full release info available here: https://codeberg.org/karrot/karrot/releases/tag/v14.0.1
## Fix to uploaded file permissions
We now run the container as non-root user which means the file permissions need updating.
After you deployment you can fix that by running:
```
abra app cmd --user root <domain> app fix-permissions
```
(Note: we need `--user root` there, as we need to be `root` in the container to change the permissions)
## geoip changes
Now the geoip update server is run using an additional compose file config, so if you are using geoip with a maxmind account, modify your config to include:
```
COMPOSE_FILE="compose.yml"
COMPOSE_FILE="$COMPOSE_FILE:compose.geoip.yml"
MAXMIND_ACCOUNT_ID=youraccountid
SECRET_MAXMIND_LICENSE_KEY_VERSION=v1
```
And ensure you have the `maxmind_license_key` secret set, which you can do with:
```
abra app secret insert <domain> maxmind_license_key v1 <key>
```

22
release/4.0.0+17.2.1 Normal file
View File

@ -0,0 +1,22 @@
This is a major release update because you might need to change your app config.
Now, all the optional features are split out into separate compose files, and you need
to include them explictly if you are using them.
SMTP:
COMPOSE_FILE="$COMPOSE_FILE:compose.smtp.yml"
Postal:
COMPOSE_FILE="$COMPOSE_FILE:compose.postal.yml"
Web Push (Vapid):
COMPOSE_FILE="$COMPOSE_FILE:compose.vapid.yml"
Video calls (meet):
COMPOSE_FILE="$COMPOSE_FILE:compose.livekit.yml"
Additionally you now need to set "livekit_api_secret"
Previously it was MEET_LIVEKIT_API_SECRET env var.
abra app secret insert <domain> livekit_api_secret v1 <secret>
GeoIP (this was already separate):
COMPOSE_FILE="$COMPOSE_FILE:compose.geoip.yml"