1.9.0 Release affine

This commit is contained in:
2026-04-06 23:33:44 +09:00
parent 8c3fe409ae
commit 664cf2956d
12 changed files with 414 additions and 4 deletions

View File

@@ -0,0 +1,49 @@
[Quadlet]
DefaultDependencies=false
[Unit]
Description=AFFiNE
After=redis_affine.service manticore_affine.service
Wants=redis_affine.service manticore_affine.service
[Container]
Image=ghcr.io/toeverything/affine:{{ version['containers']['affine'] }}
ContainerName=affine
HostName=affine
PublishPort={{ services['affine']['ports']['http'] }}:3010
Volume=%h/data/containers/affine:/root/.affine/storage:rw
Volume=%h/containers/affine/config:/root/.affine/config
Volume=%h/containers/affine/ssl:/etc/ssl/affine:ro
# General
Environment="TZ=Asia/Seoul"
## OIDC callback URIs
Environment="AFFINE_SERVER_HOST={{ services['affine']['domain']['public'] }}.{{ domain['public'] }}"
Environment="AFFINE_SERVER_EXTERNAL_URL=https://{{ services['affine']['domain']['public'] }}.{{ domain['public'] }}"
Environment="AFFINE_SERVER_HTTPS=true"
Secret=AFFINE_PRIVATE_KEY,type=env
# Database
Secret=AFFINE_DATABASE_URL,type=env,target=DATABASE_URL
## Enable AI function: this needs pgvector
# Redis
Environment="REDIS_SERVER_HOST=host.containers.internal"
Environment="REDIS_SERVER_PORT={{ services['affine']['ports']['redis'] }}"
# Indexer
Environment="AFFINE_INDEXER_ENABLED=true"
Environment="AFFINE_INDEXER_SEARCH_ENDPOINT=http://host.containers.internal:{{ services['affine']['ports']['manticore'] }}"
[Service]
ExecStartPre=/usr/bin/nc -zv {{ services['postgresql']['domain'] }}.{{ domain['internal'] }} {{ services['postgresql']['ports']['tcp'] }}
Restart=always
RestartSec=10s
TimeoutStopSec=120
[Install]
WantedBy=default.target

View File

@@ -2,7 +2,7 @@
DefaultDependencies=false
[Unit]
Description=Manticore
Description=Manticore - {{ manticore_service }}
[Container]
Image=docker.io/manticoresearch/manticore:{{ version['containers']['manticore'] }}

View File

@@ -110,7 +110,7 @@ identity_providers:
key: {{ secret "/run/secrets/AUTHELIA_JWKS_RS256" | mindent 10 "|" | msquote }}
- algorithm: 'ES256'
use: 'sig'
key: {{ secret "/run/secrets/AUTHELIA_JWKS_ES256" | mindent 10 "|" | msquote }}{% endraw %}
key: {{ secret "/run/secrets/AUTHELIA_JWKS_ES256" | mindent 10 "|" | msquote }}{% endraw %}
clients:
# https://www.authelia.com/integration/openid-connect/clients/synology-dsm/
- client_id: 'dsm'
@@ -344,3 +344,24 @@ identity_providers:
access_token_signed_response_alg: 'RS256'
userinfo_signed_response_alg: 'none'
token_endpoint_auth_method: 'none'
# https://docs.affine.pro/self-host-affine/administer/oauth-2-0
- client_id: 'affine'
client_name: 'Affine'
client_secret: '{{ hostvars['console']['affine']['oidc']['hash'] }}'
public: false
authorization_policy: 'one_factor'
require_pkce: false
pkce_challenge_method: ''
redirect_uris:
- 'https://{{ services['affine']['domain']['public'] }}.{{ domain['public'] }}/oauth/callback'
scopes:
- 'openid'
- 'profile'
- 'email'
response_types:
- 'code'
grant_types:
- 'authorization_code'
access_token_signed_response_alg: 'none'
userinfo_signed_response_alg: 'none'
token_endpoint_auth_method: 'client_secret_post'

View File

@@ -71,3 +71,9 @@
header_up Host {http.request.header.X-Forwarded-Host}
}
}
{{ services['affine']['domain']['internal'] }}.{{ domain['internal'] }} {
import private_tls
reverse_proxy host.containers.internal:{{ services['affine']['ports']['http'] }} {
header_up Host {http.request.header.X-Forwarded-Host}
}
}

View File

@@ -127,6 +127,15 @@
}
}
}
{{ services['affine']['domain']['public'] }}.{{ domain['public'] }} {
import crowdsec_log
route {
crowdsec
reverse_proxy https://{{ services['affine']['domain']['internal'] }}.{{ domain['internal'] }} {
header_up Host {http.reverse_proxy.upstream.host}
}
}
}
# Internal domain
{{ node['name'] }}.{{ domain['internal'] }} {