8 Commits

Author SHA1 Message Date
d39892feaa Merge branch 'main' into feature/authentik-integration 2026-05-14 15:41:31 +00:00
d5d3c1e553 feat: integrate authentik 2026-05-14 12:36:39 -03:00
4661b61938 Merge pull request 'chore: Configure Renovate' (#4) from renovate/configure into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #4
2025-09-14 16:29:35 +00:00
e6aa5518c6 Add renovate.json 2025-09-14 16:27:14 +00:00
20d883f772 chore: publish 1.0.0+v0.16.0 release
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2025-09-11 18:07:27 -04:00
972cdf6c91 fix: add more envs to drone, remove secret gen
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-11 18:00:49 -04:00
3f1c985dc6 fix: update config versions in .drone.yml
Some checks failed
continuous-integration/drone/push Build is failing
2025-09-11 17:52:07 -04:00
fdea96d548 Merge pull request 'feat: use sqlite by default' (#3) from default-sqlite into main
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #3
2025-09-11 21:46:12 +00:00
8 changed files with 91 additions and 6 deletions

View File

@ -7,7 +7,6 @@ steps:
settings: settings:
host: swarm-test.autonomic.zone host: swarm-test.autonomic.zone
stack: writefreely stack: writefreely
generate_secrets: true
purge: true purge: true
deploy_key: deploy_key:
from_secret: drone_ssh_swarm_test from_secret: drone_ssh_swarm_test
@ -16,11 +15,11 @@ steps:
environment: environment:
DOMAIN: writefreely.swarm-test.autonomic.zone DOMAIN: writefreely.swarm-test.autonomic.zone
STACK_NAME: writefreely STACK_NAME: writefreely
ASSETS_PATH: /usr/share/writefreely
DATA_PATH: /data
LETS_ENCRYPT_ENV: production LETS_ENCRYPT_ENV: production
CONFIG_WRITEFREELY_VERSION: v1 CONFIG_INI_VERSION: v1
CONFIG_ENTRYPOINT_VERSION: v1 WRITEFREELY_ENTRYPOINT_VERSION: v1
SECRET_DB_ROOT_PASSWORD_VERSION: v1
SECRET_DB_PASSWORD_VERSION: v1
trigger: trigger:
branch: branch:
- main - main

View File

@ -48,3 +48,12 @@ LETS_ENCRYPT_ENV=production
#OAUTH_HOST=https://<your domain>/realms/<your realm>/protocol/openid-connect #OAUTH_HOST=https://<your domain>/realms/<your realm>/protocol/openid-connect
#OAUTH_DISPLAY_NAME=Keycloak #OAUTH_DISPLAY_NAME=Keycloak
#OAUTH_CLIENT_SECRET_VERSION=v1 #OAUTH_CLIENT_SECRET_VERSION=v1
## Uncomment to use Authentik. This only works if Keycloak is disabled.
## See README.md for explanation.
#AUTHENTIK_ENABLED=1
#COMPOSE_FILE="$COMPOSE_FILE:compose.authentik.yml"
#OAUTH_HOST=https://<your domain>
#OAUTH_DISPLAY_NAME=Authentik
#OAUTH_CLIENT_ID_VERSION=v1
#OAUTH_CLIENT_SECRET_VERSION=v1

View File

@ -36,6 +36,44 @@ For the **OAUTH_HOST** config, it uses this format: `https://keycloak.example.co
To set the client secret: `abra app secret insert <domain> oauth_client_secret v1` To set the client secret: `abra app secret insert <domain> oauth_client_secret v1`
## Authentik setup
If you've set up Authentik for SSO, you can integrate it into Writefreely by running the following steps:
1. In the Authentik app, uncomment the Writefreely configuration to enable the associated blueprint:
```
COMPOSE_FILE="$COMPOSE_FILE:compose.writefreely.yml"
WRITEFREELY_DOMAIN=writefreely.example.com
SECRET_WRITEFREELY_ID_VERSION=v1
SECRET_WRITEFREELY_SECRET_VERSION=v1
APP_ICONS="writefreely:~/.abra/recipes/authentik/icons/writefreely.png"
WRITEFREELY_APPGROUP="$GROUP_DOCUMENTATION"
```
2. Also in Authentik, generate the client id/secret pair.
```
abra app secret generate <authentik_app_name> writefreely_id v1
```
```
abra app secret generate <authentik_app_name> writefreely_secret v1
```
3. Uncomment and properly set the configs for Authentik in `abra app config <domain>`.
4. Set the client id/secret that were generated previously, by running:
```
abra app secret insert <domain> oauth_client_id v1
```
```
abra app secret insert <domain> oauth_client_secret v1
```
## MariaDB ## MariaDB
By default, this recipe uses sqlite. If you wish to use MariaDB instead: By default, this recipe uses sqlite. If you wish to use MariaDB instead:

16
compose.authentik.yml Normal file
View File

@ -0,0 +1,16 @@
---
version: "3.8"
services:
app:
secrets:
- oauth_client_id
- oauth_client_secret
secrets:
oauth_client_id:
external: true
name: ${STACK_NAME}_oauth_client_id_${OAUTH_CLIENT_ID_VERSION}
oauth_client_secret:
external: true
name: ${STACK_NAME}_oauth_client_secret_${OAUTH_CLIENT_SECRET_VERSION}

View File

@ -30,7 +30,7 @@ services:
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect" - "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.scheme=https"
- "traefik.http.middlewares.${STACK_NAME}-redirect.redirectscheme.permanent=true" - "traefik.http.middlewares.${STACK_NAME}-redirect.redirectscheme.permanent=true"
- "coop-cloud.${STACK_NAME}.version=0.1.0+latest" - "coop-cloud.${STACK_NAME}.version=1.0.0+v0.16.0"
volumes: volumes:
local-data: local-data:

View File

@ -69,4 +69,21 @@ map_user_id = sub
map_username = preferred_username map_username = preferred_username
map_display_name = map_display_name =
map_email = email map_email = email
{{ else if eq (env "AUTHENTIK_ENABLED") "1" }}
[oauth.generic]
client_id = {{ secret "oauth_client_id" }}
client_secret = {{ secret "oauth_client_secret" }}
host = {{ env "OAUTH_HOST" }}
display_name = {{ env "OAUTH_DISPLAY_NAME" }}
callback_proxy =
callback_proxy_api =
token_endpoint = /application/o/token/
inspect_endpoint = /application/o/userinfo/
auth_endpoint = /application/o/authorize/
scope = openid profile email
allow_disconnect = false
map_user_id = sub
map_username = preferred_username
map_display_name =
map_email = email
{{ end }} {{ end }}

6
renovate.json Normal file
View File

@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}