Compare commits
28 Commits
0.2.1+0.29
...
enable-bac
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cf5a8a195 | |||
| eecfe6239c | |||
| 012818dfc2 | |||
| 705a039676 | |||
| cf9739b856 | |||
| 0c59e8d3c1 | |||
| 8a1423afaf | |||
| a56da6b1a2 | |||
| 7761cf1a26 | |||
| 8dd6ecfbb4 | |||
| 9cf0790379 | |||
| 2b11b5b3a3 | |||
| 602d308074 | |||
| 74ad44a0bc | |||
| 44bda9adb5 | |||
| f72bfbec56 | |||
| 8f1f30be7e | |||
| ecee17b998 | |||
| b9aa85dbc6 | |||
| 3d27184388 | |||
| 2a9f7a58f5 | |||
| 1ecc727a97 | |||
| ed4c61dbe7 | |||
|
fcfacf8b20
|
|||
|
cf1136ce22
|
|||
|
4a57a0edf0
|
|||
|
97d2071afa
|
|||
|
24d85d5378
|
44
.drone.yml
Normal file
44
.drone.yml
Normal file
@ -0,0 +1,44 @@
|
||||
---
|
||||
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: rauthy
|
||||
generate_secrets: true
|
||||
purge: true
|
||||
deploy_key:
|
||||
from_secret: drone_ssh_swarm_test
|
||||
networks:
|
||||
- proxy
|
||||
environment:
|
||||
DOMAIN: rauthy.swarm-test.autonomic.zone
|
||||
STACK_NAME: rauthy
|
||||
LETS_ENCRYPT_ENV: staging
|
||||
CONFIG_TOML_VERSION: v2
|
||||
SECRET_ENC_KEYS_A_VERSION: a1
|
||||
SECRET_ENC_KEYS_B_VERSION: b1
|
||||
SECRET_HQL_RAFT_VERSION: v1
|
||||
SECRET_HQL_API_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:
|
||||
- toolshed/auto-recipes-catalogue-json
|
||||
|
||||
trigger:
|
||||
event: tag
|
||||
@ -1,14 +1,18 @@
|
||||
TYPE=rauthy
|
||||
DOMAIN=rauthy.example.com
|
||||
LETS_ENCRYPT_ENV=production
|
||||
ENABLE_BACKUPS=true
|
||||
|
||||
COMPOSE_FILE="compose.yml"
|
||||
|
||||
ADMIN_EMAIL=admin@example.org
|
||||
ADMIN_FORCE_MFA=true
|
||||
|
||||
SECRET_ENC_KEYS_VERSION=v1
|
||||
ENC_KEY_ACTIVE=""
|
||||
LOG_LEVEL=info
|
||||
|
||||
SECRET_ENC_KEYS_A_VERSION=a1 # generate=false
|
||||
SECRET_ENC_KEYS_B_VERSION=b1 # generate=false
|
||||
ENC_KEY_ACTIVE="a1"
|
||||
|
||||
SECRET_HQL_RAFT_VERSION=v1
|
||||
SECRET_HQL_API_VERSION=v1
|
||||
|
||||
50
README.md
50
README.md
@ -17,27 +17,33 @@
|
||||
|
||||
## Quick start
|
||||
|
||||
* `abra app new rauthy`
|
||||
|
||||
### Generate encryption keys
|
||||
|
||||
* `echo "$(openssl rand -hex 4)/$(openssl rand -base64 32)"`
|
||||
* `abra app secret insert <app> enc_keys v1 <enc-key>`
|
||||
* `abra app config <app>`
|
||||
* **N.B** you need to match the `ENC_KEY_ACTIVE` env var with the start of
|
||||
the generated `ENC_KEYS` value (everything before the `/`. See [the
|
||||
docs](https://sebadob.github.io/rauthy/config/encryption.html) for more)
|
||||
|
||||
### Generate secrets
|
||||
|
||||
* `abra app secret generate <app> -a`
|
||||
|
||||
### Deploy
|
||||
|
||||
* `abra app deploy <app>`
|
||||
* `abra app logs <app>`
|
||||
* You'll see the automatically generated admin password in the initial logs.
|
||||
Ensure that you reset this password after you log in. The `ADMIN_EMAIL` env
|
||||
var controls the value of the admin login username.
|
||||
1. `abra app new rauthy`
|
||||
2. `abra app cmd --local <app> generate_enc_keys`
|
||||
3. `abra app secret generate <app> --all`
|
||||
4. `abra app deploy <app>`
|
||||
5. `abra app logs <app>`
|
||||
- You'll see the automatically generated admin password in the initial logs.
|
||||
Ensure that you reset this password after you log in. The `ADMIN_EMAIL` env
|
||||
var controls the value of the admin login username.
|
||||
|
||||
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).
|
||||
|
||||
### Host mode networking
|
||||
|
||||
You'll want to enable this in your Traefik configuration to avoid getting
|
||||
mistakenly rate limited based on internal ipv4 addresses (e.g. `10.0.0.6`).
|
||||
|
||||
```
|
||||
COMPOSE_FILE="$COMPOSE_FILE:compose.host.yml"
|
||||
```
|
||||
|
||||
### Encryption key rotation
|
||||
|
||||
This recipe supports encryption key rotation as described in [the docs](https://sebadob.github.io/rauthy/config/encryption.html). To rotate keys the first time:
|
||||
|
||||
1. Increment the version of `SECRET_ENC_KEYS_B_VERSION=b1` to `b2`
|
||||
2. `abra app secret insert <app> enc_keys_b b2 "$(openssl rand -base64 32)"`
|
||||
2. Change `ENC_KEY_ACTIVE="a1"` to `b2` (this tells rauthy to encrypt new secrets with the new key while still having access to `a1`)
|
||||
3. `abra app deploy <app>`
|
||||
|
||||
To rotate keys any future time, follow the same pattern of incrementing the non-active secret version and changing the active secret to that newly generated secret.
|
||||
|
||||
14
abra.sh
14
abra.sh
@ -1 +1,13 @@
|
||||
export RAUTHY_CFG_VERSION=v2
|
||||
set -e
|
||||
|
||||
export CONFIG_TOML_VERSION=v3
|
||||
|
||||
generate_enc_keys() {
|
||||
KEY_A="$(openssl rand -base64 32)"
|
||||
KEY_B="$(openssl rand -base64 32)"
|
||||
abra app secret insert "$APP_NAME" enc_keys_a a1 "$KEY_A" --chaos
|
||||
abra app secret insert "$APP_NAME" enc_keys_b b1 "$KEY_B" --chaos
|
||||
echo "WARNING: secrets are NOT shown again, please save them NOW"
|
||||
echo " enc_keys_a $KEY_A"
|
||||
echo " enc_keys_b $KEY_B"
|
||||
}
|
||||
|
||||
@ -1,6 +1,3 @@
|
||||
---
|
||||
version: "3.13"
|
||||
|
||||
services:
|
||||
app:
|
||||
environment:
|
||||
@ -8,6 +5,7 @@ services:
|
||||
- SMTP_ENABLED
|
||||
- SMTP_FROM
|
||||
- SMTP_URL
|
||||
- SMTP_PORT
|
||||
- SMTP_USERNAME
|
||||
secrets:
|
||||
- smtp_password
|
||||
|
||||
32
compose.yml
32
compose.yml
@ -1,19 +1,18 @@
|
||||
---
|
||||
version: "3.13"
|
||||
|
||||
services:
|
||||
app:
|
||||
image: ghcr.io/sebadob/rauthy:0.29.4
|
||||
image: ghcr.io/sebadob/rauthy:0.33.1
|
||||
environment:
|
||||
- ADMIN_EMAIL
|
||||
- ADMIN_FORCE_MFA
|
||||
- DOMAIN
|
||||
- ENC_KEY_ACTIVE
|
||||
- LOG_LEVEL
|
||||
configs:
|
||||
- source: rauthy_cfg
|
||||
target: /app/rauthy.cfg
|
||||
- source: config_toml
|
||||
target: /app/config.toml
|
||||
secrets:
|
||||
- enc_keys
|
||||
- enc_keys_a
|
||||
- enc_keys_b
|
||||
- hql_api
|
||||
- hql_raft
|
||||
volumes:
|
||||
@ -29,21 +28,28 @@ services:
|
||||
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
|
||||
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||
- "coop-cloud.${STACK_NAME}.version=0.2.1+0.29.4"
|
||||
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.redirectscheme.scheme=https"
|
||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.redirectscheme.permanent=true"
|
||||
- "coop-cloud.${STACK_NAME}.version=1.1.0+0.33.1"
|
||||
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
|
||||
configs:
|
||||
rauthy_cfg:
|
||||
name: ${STACK_NAME}_rauthy_cfg_${RAUTHY_CFG_VERSION}
|
||||
file: rauthy.cfg.tmpl
|
||||
config_toml:
|
||||
name: ${STACK_NAME}_config_toml_${CONFIG_TOML_VERSION}
|
||||
file: config.toml.tmpl
|
||||
template_driver: golang
|
||||
|
||||
secrets:
|
||||
enc_keys:
|
||||
name: ${STACK_NAME}_enc_keys_${SECRET_ENC_KEYS_VERSION}
|
||||
enc_keys_a:
|
||||
name: ${STACK_NAME}_enc_keys_a_${SECRET_ENC_KEYS_A_VERSION}
|
||||
external: true
|
||||
enc_keys_b:
|
||||
name: ${STACK_NAME}_enc_keys_b_${SECRET_ENC_KEYS_B_VERSION}
|
||||
external: true
|
||||
hql_raft:
|
||||
name: ${STACK_NAME}_hql_raft_${SECRET_HQL_RAFT_VERSION}
|
||||
|
||||
47
config.toml.tmpl
Normal file
47
config.toml.tmpl
Normal file
@ -0,0 +1,47 @@
|
||||
# PLEASE UPDATE THIS LINK WHEN UPGRADING RECIPE VERSION
|
||||
# https://github.com/sebadob/rauthy/blob/v0.31.1/config.toml
|
||||
|
||||
[bootstrap]
|
||||
admin_email = '{{ env "ADMIN_EMAIL" }}'
|
||||
|
||||
[cluster]
|
||||
node_id = 1
|
||||
secret_raft = '{{ secret "hql_raft" }}'
|
||||
secret_api = '{{ secret "hql_api" }}'
|
||||
|
||||
{{ if eq (env "SMTP_ENABLED") "1" }}
|
||||
[email]
|
||||
rauthy_admin_email = '{{ env "ADMIN_EMAIL" }}'
|
||||
sub_prefix = '{{ env "EMAIL_SUB_PREFIX" }}'
|
||||
smtp_url = '{{ env "SMTP_URL" }}'
|
||||
smtp_username = '{{ env "SMTP_USERNAME" }}'
|
||||
smtp_password = '{{ secret "smtp_password" }}'
|
||||
smtp_from = '{{ env "SMTP_FROM" }}'
|
||||
{{ end }}
|
||||
|
||||
[logging]
|
||||
level = '{{ env "LOG_LEVEL" }}'
|
||||
|
||||
[encryption]
|
||||
keys = [
|
||||
'{{ env "SECRET_ENC_KEYS_A_VERSION" }}/{{ secret "enc_keys_a" }}',
|
||||
'{{ env "SECRET_ENC_KEYS_B_VERSION" }}/{{ secret "enc_keys_b" }}'
|
||||
]
|
||||
key_active = '{{ env "ENC_KEY_ACTIVE" }}'
|
||||
|
||||
[mfa]
|
||||
admin_force_mfa = {{ env "ADMIN_FORCE_MFA" }}
|
||||
|
||||
[server]
|
||||
pub_url = '{{ env "DOMAIN" }}'
|
||||
scheme = 'http'
|
||||
proxy_mode = true
|
||||
trusted_proxies = [
|
||||
'127.0.0.1',
|
||||
'172.16.0.0/12',
|
||||
'10.0.0.0/8'
|
||||
]
|
||||
|
||||
[webauthn]
|
||||
rp_id = '{{ env "DOMAIN" }}'
|
||||
rp_origin = 'https://{{ env "DOMAIN" }}:443'
|
||||
1337
rauthy.cfg.tmpl
1337
rauthy.cfg.tmpl
File diff suppressed because it is too large
Load Diff
6
release/0.3.0+0.31.1
Normal file
6
release/0.3.0+0.31.1
Normal file
@ -0,0 +1,6 @@
|
||||
This was another breaking release from upstream:
|
||||
|
||||
https://github.com/sebadob/rauthy/releases/tag/v0.30.0
|
||||
|
||||
I've migrated the config to TOML format and reduced it to only the
|
||||
configuration options we use. I hope this is more manageable in the future.
|
||||
22
release/1.0.0+0.32.3
Normal file
22
release/1.0.0+0.32.3
Normal file
@ -0,0 +1,22 @@
|
||||
WARNING! ⚠️
|
||||
This release supports encryption key rotation, which unfortunately requires some migration steps:
|
||||
|
||||
1. Obtain your old encryption key (enc_keys) if you backed it up. If not, you can extract your current encryption key from the config file. This is pretty advanced and can only be done from the server itself:
|
||||
|
||||
docker secret list # to obtain the secret's full name
|
||||
docker service create --name temp-reader --secret <secret-name> --mode replicated-job alpine:latest sh -c "cat /run/secrets/<secret-name>" && docker service logs --raw temp-reader && echo && docker service rm temp-reader
|
||||
|
||||
NOTE: the enc_keys secret has the format `<key_id>/<key_value>`; we'll refer to those two parts as $KEY_ID and $KEY_VALUE from here on.
|
||||
|
||||
2. Add these lines to your config, overwriting the existing SECRET_ENC_KEYS_VERSION and ENC_KEY_ACTIVE values:
|
||||
|
||||
SECRET_ENC_KEYS_A_VERSION=$KEY_ID # generated=false
|
||||
SECRET_ENC_KEYS_B_VERSION=b1 # generated=false
|
||||
ENC_KEY_ACTIVE="$KEY_ID"
|
||||
|
||||
3. Set key_a and generate key_b:
|
||||
|
||||
abra app secret insert $STACK_NAME enc_keys_a $KEY_ID "<your-existing-secret>" -C
|
||||
abra app secret insert $STACK_NAME enc_keys_b b1 "$(openssl rand -base64 32)" -C
|
||||
|
||||
Then you can deploy :)
|
||||
1
release/next
Normal file
1
release/next
Normal file
@ -0,0 +1 @@
|
||||
Enables backup-bot-2 backups
|
||||
6
renovate.json
Normal file
6
renovate.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user