Compare commits
14 Commits
0.1.0+v2.7
...
main
Author | SHA1 | Date |
---|---|---|
3wc | 93f240b959 | |
trav | e81374b8b7 | |
trav | 134083eb13 | |
trav | baba7e2a0e | |
3wc | 30e9ade4dc | |
trav | 5cf17cb417 | |
trav | 0a56c49916 | |
trav | 6dcbd3a0b8 | |
3wc | 2fe463799b | |
3wc | 9f587c6c5a | |
3wc | 3765ceaeb2 | |
3wc | bb35b39ea9 | |
3wc | 949f952ae4 | |
3wc | 915075da74 |
39
.drone.yml
39
.drone.yml
|
@ -0,0 +1,39 @@
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: deploy to swarm-test.autonomic.zone
|
||||||
|
steps:
|
||||||
|
- name: deployment
|
||||||
|
image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest
|
||||||
|
settings:
|
||||||
|
host: swarm-test.autonomic.zone
|
||||||
|
stack: loomio
|
||||||
|
generate_secrets: true
|
||||||
|
purge: true
|
||||||
|
deploy_key:
|
||||||
|
from_secret: drone_ssh_swarm_test
|
||||||
|
networks:
|
||||||
|
- proxy
|
||||||
|
environment:
|
||||||
|
DOMAIN: loomio.swarm-test.autonomic.zone
|
||||||
|
STACK_NAME: loomio
|
||||||
|
LETS_ENCRYPT_ENV: production
|
||||||
|
LOOMIO_ENTRYPOINT_VERSION: v1
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
---
|
||||||
|
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:
|
||||||
|
- coop-cloud/auto-recipes-catalogue-json
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event: tag
|
|
@ -19,6 +19,9 @@ SMTP_PASSWORD=password
|
||||||
SMTP_USE_SSL=1
|
SMTP_USE_SSL=1
|
||||||
# to disable SSL comment out line rather than changing to 0
|
# to disable SSL comment out line rather than changing to 0
|
||||||
|
|
||||||
|
# Whyyyy does this need to be set separately
|
||||||
|
NOTIFICATIONS_EMAIL_ADDRESS=noreply@example.com
|
||||||
|
|
||||||
REPLY_HOSTNAME=loomio.example.com
|
REPLY_HOSTNAME=loomio.example.com
|
||||||
|
|
||||||
# helper bot is the account which welcomes people to their groups.
|
# helper bot is the account which welcomes people to their groups.
|
||||||
|
@ -37,6 +40,9 @@ FORCE_SSL=1
|
||||||
# Enable rate limiting on group creation, other POST actions
|
# Enable rate limiting on group creation, other POST actions
|
||||||
USE_RACK_ATTACK=1
|
USE_RACK_ATTACK=1
|
||||||
|
|
||||||
|
SECRET_DEVISE_SECRET_VERSION=v1 #length=64
|
||||||
|
SECRET_SECRET_COOKIE_TOKEN_VERSION=v1 #length=64
|
||||||
|
|
||||||
# Send catch up email (missed yesterday) weekly
|
# Send catch up email (missed yesterday) weekly
|
||||||
# EMAIL_CATCH_UP_WEEKLY=1
|
# EMAIL_CATCH_UP_WEEKLY=1
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,12 @@
|
||||||
2. Deploy [`coop-cloud/traefik`]
|
2. Deploy [`coop-cloud/traefik`]
|
||||||
3. `abra app new loomio` (optionally with `--pass` if you'd like
|
3. `abra app new loomio` (optionally with `--pass` if you'd like
|
||||||
to save secrets in `pass`)
|
to save secrets in `pass`)
|
||||||
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to
|
4. `abra app config YOURAPPDOMAIN` - be sure to change `$DOMAIN` to something that resolves to
|
||||||
your Docker swarm box
|
your Docker swarm box
|
||||||
5. `abra app YOURAPPDOMAIN deploy`
|
5. `abra app deploy YOURAPPDOMAIN`
|
||||||
6. This should be automated but you also need to run `abra app run loomio_some_domain app rake db:migrate`
|
6. This should be automated but you also need to run `abra app run loomio_some_domain app rake db:migrate`
|
||||||
7. Open the configured domain in your browser to finish set-up
|
7. Open the configured domain in your browser to finish set-up
|
||||||
|
8. Give yourself admin rights by running `User.last.update(is_admin: true)`
|
||||||
|
|
||||||
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
|
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
|
||||||
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik
|
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik
|
||||||
|
|
2
abra.sh
2
abra.sh
|
@ -1 +1 @@
|
||||||
export LOOMIO_ENTRYPOINT_VERSION=v1
|
export LOOMIO_ENTRYPOINT_VERSION=v3
|
||||||
|
|
44
compose.yml
44
compose.yml
|
@ -16,6 +16,7 @@ x-environment: &default-env
|
||||||
SMTP_USERNAME: ${SMTP_USERNAME}
|
SMTP_USERNAME: ${SMTP_USERNAME}
|
||||||
SMTP_PASSWORD: ${SMTP_PASSWORD}
|
SMTP_PASSWORD: ${SMTP_PASSWORD}
|
||||||
SMTP_USE_SSL: ${SMTP_USE_SSL}
|
SMTP_USE_SSL: ${SMTP_USE_SSL}
|
||||||
|
NOTIFICATIONS_EMAIL_ADDRESS: ${NOTIFICATIONS_EMAIL_ADDRESS}
|
||||||
REPLY_HOSTNAME: ${REPLY_HOSTNAME}
|
REPLY_HOSTNAME: ${REPLY_HOSTNAME}
|
||||||
HELPER_BOT_EMAIL: ${HELPER_BOT_EMAIL}
|
HELPER_BOT_EMAIL: ${HELPER_BOT_EMAIL}
|
||||||
RAILS_ENV: ${RAILS_ENV}
|
RAILS_ENV: ${RAILS_ENV}
|
||||||
|
@ -24,8 +25,8 @@ x-environment: &default-env
|
||||||
MAX_THREADS: ${MAX_THREADS}
|
MAX_THREADS: ${MAX_THREADS}
|
||||||
FORCE_SSL: ${FORCE_SSL}
|
FORCE_SSL: ${FORCE_SSL}
|
||||||
USE_RACK_ATTACK: ${USE_RACK_ATTACK}
|
USE_RACK_ATTACK: ${USE_RACK_ATTACK}
|
||||||
DEVISE_SECRET: uuaYZNGgeKCMqGc5pPd3seNSrvKkVO9+pAu6JvrQI4M6T395m8dLJja5qza8HaHY
|
DEVISE_SECRET_FILE: /run/secrets/devise_secret
|
||||||
SECRET_COOKIE_TOKEN: uuaYZNGgeKCMqGc5pPd3seNSrvKkVO9+pAu6JvrQI4M6T395m8dLJja5qza8HaHY
|
SECRET_COOKIE_TOKEN_FILE: /run/secrets/secret_cookie_token
|
||||||
SAML_APP_KEY:
|
SAML_APP_KEY:
|
||||||
SAML_IDP_METADATA_URL:
|
SAML_IDP_METADATA_URL:
|
||||||
SAML_ISSUER:
|
SAML_ISSUER:
|
||||||
|
@ -33,12 +34,15 @@ x-environment: &default-env
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: loomio/loomio:v2.11.13
|
image: loomio/loomio:v2.22.0
|
||||||
configs:
|
configs:
|
||||||
- source: entrypoint
|
- source: entrypoint
|
||||||
target: /entrypoint.sh
|
target: /entrypoint.sh
|
||||||
mode: 0555
|
mode: 0555
|
||||||
entrypoint: /entrypoint.sh
|
entrypoint: /entrypoint.sh
|
||||||
|
secrets:
|
||||||
|
- devise_secret
|
||||||
|
- secret_cookie_token
|
||||||
volumes:
|
volumes:
|
||||||
- loomio_uploads:/loomio/public/system
|
- loomio_uploads:/loomio/public/system
|
||||||
- loomio_storage:/loomio/storage
|
- loomio_storage:/loomio/storage
|
||||||
|
@ -61,9 +65,17 @@ services:
|
||||||
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
||||||
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
||||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||||
- "coop-cloud.${STACK_NAME}.version=0.1.0+v2.7.10"
|
- "coop-cloud.${STACK_NAME}.version=0.5.0+v2.22.0"
|
||||||
worker:
|
worker:
|
||||||
image: loomio/loomio:v2.11.13
|
image: loomio/loomio:v2.22.0
|
||||||
|
configs:
|
||||||
|
- source: entrypoint
|
||||||
|
target: /entrypoint.sh
|
||||||
|
mode: 0555
|
||||||
|
entrypoint: /entrypoint.sh
|
||||||
|
secrets:
|
||||||
|
- devise_secret
|
||||||
|
- secret_cookie_token
|
||||||
networks:
|
networks:
|
||||||
- backend
|
- backend
|
||||||
environment:
|
environment:
|
||||||
|
@ -77,7 +89,7 @@ services:
|
||||||
- loomio_files:/loomio/public/files
|
- loomio_files:/loomio/public/files
|
||||||
- loomio_plugins:/loomio/plugins/docker
|
- loomio_plugins:/loomio/plugins/docker
|
||||||
db:
|
db:
|
||||||
image: postgres:12.7
|
image: postgres:12.17
|
||||||
networks:
|
networks:
|
||||||
- backend
|
- backend
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -108,10 +120,16 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- REDIS_URL=redis://redis:6379
|
- REDIS_URL=redis://redis:6379
|
||||||
cron:
|
cron:
|
||||||
image: loomio/loomio:v2.7.10
|
image: loomio/loomio:v2.22.0
|
||||||
entrypoint: "/usr/local/bundle/bin/bundle"
|
configs:
|
||||||
command: ["exec", "rake", "loomio:hourly_tasks"]
|
- source: entrypoint
|
||||||
|
target: /entrypoint.sh
|
||||||
|
mode: 0555
|
||||||
|
entrypoint: [ "/entrypoint.sh", "rake loomio:hourly_tasks" ]
|
||||||
environment: *default-env
|
environment: *default-env
|
||||||
|
secrets:
|
||||||
|
- devise_secret
|
||||||
|
- secret_cookie_token
|
||||||
volumes:
|
volumes:
|
||||||
- loomio_uploads:/loomio/public/system
|
- loomio_uploads:/loomio/public/system
|
||||||
- loomio_storage:/loomio/storage
|
- loomio_storage:/loomio/storage
|
||||||
|
@ -148,3 +166,11 @@ configs:
|
||||||
entrypoint:
|
entrypoint:
|
||||||
name: ${STACK_NAME}_entrypoint_${LOOMIO_ENTRYPOINT_VERSION}
|
name: ${STACK_NAME}_entrypoint_${LOOMIO_ENTRYPOINT_VERSION}
|
||||||
file: entrypoint.sh
|
file: entrypoint.sh
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
devise_secret:
|
||||||
|
external: true
|
||||||
|
name: ${STACK_NAME}_devise_secret_${SECRET_DEVISE_SECRET_VERSION}
|
||||||
|
secret_cookie_token:
|
||||||
|
external: true
|
||||||
|
name: ${STACK_NAME}_secret_cookie_token_${SECRET_SECRET_COOKIE_TOKEN_VERSION}
|
||||||
|
|
|
@ -1,10 +1,38 @@
|
||||||
#! /bin/sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
file_env() {
|
||||||
|
# 3wc: Load $VAR_FILE into $VAR - useful for secrets. See
|
||||||
|
# https://medium.com/@adrian.gheorghe.dev/using-docker-secrets-in-your-environment-variables-7a0609659aab
|
||||||
|
local var="$1"
|
||||||
|
local fileVar="${var}_FILE"
|
||||||
|
local def="${2:-}"
|
||||||
|
|
||||||
|
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
|
||||||
|
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
local val="$def"
|
||||||
|
if [ "${!var:-}" ]; then
|
||||||
|
val="${!var}"
|
||||||
|
elif [ "${!fileVar:-}" ]; then
|
||||||
|
val="$(< "${!fileVar}")"
|
||||||
|
fi
|
||||||
|
export "$var"="$val"
|
||||||
|
unset "$fileVar"
|
||||||
|
}
|
||||||
|
|
||||||
|
file_env "DEVISE_SECRET"
|
||||||
|
file_env "SECRET_COOKIE_TOKEN"
|
||||||
|
|
||||||
if test ! -f /loomio/storage/migrations_ran; then
|
if test ! -f /loomio/storage/migrations_ran; then
|
||||||
echo "first deploy, running migrations..."
|
echo "first deploy, running migrations..."
|
||||||
rake db:setup
|
rake db:setup
|
||||||
touch /loomio/storage/migrations_ran
|
touch /loomio/storage/migrations_ran
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$1" ]; then
|
||||||
echo "starting loomio!"
|
echo "Running '$1'"
|
||||||
/loomio/docker_start.sh
|
$1
|
||||||
|
else
|
||||||
|
echo "starting loomio!"
|
||||||
|
/loomio/docker_start.sh
|
||||||
|
fi
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
Loomio seems to have added a new setting, NOTIFICATIONS_EMAIL_ADDRESS, to
|
||||||
|
define what address transactional emails should come from.
|
||||||
|
|
||||||
|
If you don't set it, it will default to notifications@$MAIL_DOMAIN, which is
|
||||||
|
unlikely to work in many cases.
|
||||||
|
|
||||||
|
If you find that transactional emails aren't working, try setting
|
||||||
|
NOTIFICATIONS_EMAIL_ADDRESS to the same value as SUPPORT_EMAIL,
|
||||||
|
HELPER_BOT_EMAIL, or SMTP_USERNAME.
|
Loading…
Reference in New Issue