2026-AUG-29
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
identity_providers:
|
||||
oidc:
|
||||
claims_policies:
|
||||
linkwarden:
|
||||
id_token:
|
||||
- 'preferred_username'
|
||||
- 'name'
|
||||
- 'email'
|
||||
- 'email_verified'
|
||||
- 'groups'
|
||||
clients:
|
||||
# https://www.authelia.com/integration/openid-connect/clients/linkwarden/
|
||||
- client_id: 'linkwarden'
|
||||
claims_policy: 'linkwarden'
|
||||
client_name: 'linkwarden'
|
||||
consent_mode: 'implicit'
|
||||
client_secret: ''
|
||||
public: false
|
||||
authorization_policy: 'one_factor'
|
||||
require_pkce: false
|
||||
pkce_challenge_method: ''
|
||||
redirect_uris:
|
||||
- 'https://linkwarden.example.com/api/v1/auth/callback/oidc'
|
||||
scopes:
|
||||
- 'openid'
|
||||
- 'groups'
|
||||
- 'email'
|
||||
- 'profile'
|
||||
response_types:
|
||||
- 'code'
|
||||
grant_types:
|
||||
- 'authorization_code'
|
||||
access_token_signed_response_alg: 'none'
|
||||
userinfo_signed_response_alg: 'none'
|
||||
token_endpoint_auth_method: 'client_secret_basic'
|
||||
@@ -0,0 +1,13 @@
|
||||
services:
|
||||
linkwarden:
|
||||
domain:
|
||||
public: "link"
|
||||
internal: "link.app"
|
||||
ports:
|
||||
http: "3005"
|
||||
dependency:
|
||||
web: "app-public"
|
||||
db: "postgresql"
|
||||
version:
|
||||
containers:
|
||||
linkwarden: "v2.16.1"
|
||||
@@ -0,0 +1,53 @@
|
||||
[Quadlet]
|
||||
DefaultDependencies=false
|
||||
|
||||
[Unit]
|
||||
Description=LinkWarden
|
||||
|
||||
[Container]
|
||||
Image=ghcr.io/linkwarden/linkwarden:{{ version['containers']['linkwarden'] }}
|
||||
ContainerName=linkwarden
|
||||
HostName=linkwarden
|
||||
PublishPort={{ services['linkwarden']['ports']['http'] }}:3000/tcp
|
||||
|
||||
# Volumes
|
||||
Volume=%h/data/containers/linkwarden/data:/data/data:rw
|
||||
Volume=%h/containers/linkwarden/ssl:/etc/ssl/linkwarden:ro
|
||||
|
||||
# General
|
||||
Environment="TZ={{ timezone }}"
|
||||
Environment="NEXTAUTH_URL=https://{{ services['linkwarden']['domain']['public'] }}.{{ domain['public'] }}/api/v1/auth"
|
||||
Environment="ALLOW_PRIVATE_NETWORK_ACCESS=true"
|
||||
Environment="ALLOW_INSECURE_TLS=false"
|
||||
Secret=LINKWARDEN_SECRET_KEY,type=env,target=NEXTAUTH_SECRET
|
||||
|
||||
# Database (PostgreSQL)
|
||||
# postgresql://linkwarden:PASSWORD@db.example.com:5432/linkwarden_db?sslmode=require&sslrootcert=/run/secrets/postgres-ca.crt&sslaccept=strict
|
||||
Secret=LINKWARDEN_DATABASE_URL,type=env,target=DATABASE_URL
|
||||
|
||||
# OIDC
|
||||
Environment="NEXT_PUBLIC_OIDC_ENABLED=true"
|
||||
Environment="OIDC_CUSTOM_NAME=Authelia"
|
||||
Environment="OIDC_WELLKNOWN_URL=https://{{ services['authelia']['domain']['public'] }}.{{ domain['public'] }}/.well-known/openid-configuration"
|
||||
Environment="OIDC_CLIENT_ID=linkwarden"
|
||||
Environment="OIDC_SCOPES=openid groups email profile"
|
||||
Environment="NEXT_PUBLIC_DISABLE_REGISTRATION=true"
|
||||
Environment="NEXT_PUBLIC_CREDENTIALS_ENABLED=false"
|
||||
Environment="DISABLE_NEW_SSO_USERS=false"
|
||||
Secret=LINKWARDEN_OIDC_CLIENT_SECRET,type=env,target=OIDC_CLIENT_SECRET
|
||||
|
||||
# Archiving
|
||||
Environment="DISABLE_BROWSER=true"
|
||||
Environment="NEXT_PUBLIC_MAX_FILE_BUFFER=250"
|
||||
# Meili search
|
||||
# Environment=MEILI_HOST=""
|
||||
# Environment=MEILI_MASTER_KEY=""
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/nc -zv {{ services['postgresql']['domain']['internal'] }}.{{ domain['internal'] }} {{ services['postgresql']['ports']['tcp'] }}
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
TimeoutStopSec=120
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@@ -0,0 +1,8 @@
|
||||
postgresql:
|
||||
password:
|
||||
linkwarden: ""
|
||||
linkwarden:
|
||||
secret_key: ""
|
||||
oidc:
|
||||
secret: ""
|
||||
hash: ""
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
- name: Create linkwarden directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ node['home_path'] }}/{{ item }}"
|
||||
state: "directory"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ node['group'] }}"
|
||||
mode: "0770"
|
||||
loop:
|
||||
- "data/containers/linkwarden"
|
||||
- "data/containers/linkwarden/data"
|
||||
- "containers/linkwarden"
|
||||
- "containers/linkwarden/ssl"
|
||||
|
||||
- name: Deploy root certificate
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
{{ hostvars['console']['ca']['root']['crt'] }}
|
||||
dest: "{{ node['home_path'] }}/containers/linkwarden/ssl/{{ root_cert_filename }}"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ node['group'] }}"
|
||||
mode: "0440"
|
||||
become: true
|
||||
notify: "notification_restart_linkwarden"
|
||||
no_log: true
|
||||
|
||||
- name: Register secret value to podman secret
|
||||
containers.podman.podman_secret:
|
||||
name: "{{ item.name }}"
|
||||
data: "{{ item.value }}"
|
||||
state: "present"
|
||||
force: true
|
||||
loop:
|
||||
- name: "LINKWARDEN_SECRET_KEY"
|
||||
value: "{{ hostvars['console']['linkwarden']['secret_key'] }}"
|
||||
- name: "LINKWARDEN_OIDC_CLIENT_SECRET"
|
||||
value: "{{ hostvars['console']['linkwarden']['oidc']['secret'] }}"
|
||||
- name: "LINKWARDEN_DATABASE_URL"
|
||||
value: "postgresql://linkwarden:{{ hostvars['console']['postgresql']['password']['linkwarden'] | urlencode | replace('/', '%2F') }}\
|
||||
@{{ services['postgresql']['domain']['internal'] }}.{{ domain['internal'] }}/linkwarden_db?sslmode=require&\
|
||||
sslcert=/etc/ssl/linkwarden/{{ root_cert_filename }}&sslaccept=strict"
|
||||
notify: "notification_restart_linkwarden"
|
||||
no_log: true
|
||||
|
||||
- name: Pull image
|
||||
containers.podman.podman_image:
|
||||
name: "ghcr.io/linkwarden/linkwarden"
|
||||
tag: "{{ version['containers']['linkwarden'] }}"
|
||||
state: "present"
|
||||
pull: true
|
||||
|
||||
- name: Deploy container file
|
||||
ansible.builtin.template:
|
||||
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/linkwarden/linkwarden.container.j2"
|
||||
dest: "{{ node['home_path'] }}/.config/containers/systemd/linkwarden.container"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ node['group'] }}"
|
||||
mode: "0644"
|
||||
notify: "notification_restart_linkwarden"
|
||||
|
||||
- name: Enable linkwarden.service
|
||||
ansible.builtin.systemd:
|
||||
name: "linkwarden.service"
|
||||
state: "started"
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
scope: "user"
|
||||
|
||||
- name: Check container archive images
|
||||
ansible.builtin.stat:
|
||||
path: "{{ node['home_path'] }}/archives/containers/ghcr.io_linkwarden_linkwarden_{{ version['containers']['linkwarden'] }}.tar"
|
||||
register: container_archive_images
|
||||
|
||||
- name: Save container archive images
|
||||
containers.podman.podman_save:
|
||||
image:
|
||||
- "ghcr.io/linkwarden/linkwarden:{{ version['containers']['linkwarden'] }}"
|
||||
dest: "{{ node['home_path'] }}/archives/containers/ghcr.io_linkwarden_linkwarden_{{ version['containers']['linkwarden'] }}.tar"
|
||||
format: "oci-archive"
|
||||
force: false
|
||||
when: not container_archive_images.stat.exists
|
||||
|
||||
- name: Fetch container archive images
|
||||
ansible.builtin.fetch:
|
||||
src: "{{ node['home_path'] }}/archives/containers/ghcr.io_linkwarden_linkwarden_{{ version['containers']['linkwarden'] }}.tar"
|
||||
dest: "{{ hostvars['console']['node']['data_path'] }}/images/containers/"
|
||||
flat: true
|
||||
Reference in New Issue
Block a user