Compare commits

...

10 Commits

Author SHA1 Message Date
tolerryan
0a247fff18 add auth exclusion for webhook api 2026-11-13 08:04:48 -06:00
tolerryan
6f920e4497 updating playbook for 2nd vps 2026-11-01 03:34:41 +00:00
tolerryan
a9aed98130 updating the rest of the cojnfig from 1Y to 12M 2026-10-07 05:10:48 +00:00
tolerryan
4ac07e10fd set consent to 12 months, 1Y is not supported 2026-10-07 05:04:38 +00:00
tolerryan
914b018e21 tesing sync to git 2026-10-02 13:31:27 +00:00
tolerryan
386bf8e5d7 oidc update to not request consent each login 2026-10-02 13:04:26 +00:00
tolerryan
18baf6aa7c fix dns inside docker 2026-10-02 05:37:28 +00:00
tolerryan
29ee25fbef adding slskd 2026-10-02 05:17:58 +00:00
tolerryan
067a9bf39b oidc update 2026-09-28 03:46:08 +00:00
tolerryan
679fcc75be Authelia ODIC update for wikijs 2026-09-28 02:50:10 +00:00
10 changed files with 247 additions and 48 deletions

View File

@@ -80,4 +80,4 @@ ansible-playbook site.yml --limit vps1 -u root --ask-pass
```
After that first run creates `deploy_user` and installs your SSH key,
subsequent runs will use `deploy_user` automatically via `ansible.cfg`.
subsequent runs will use `deploy_user` automatically via `ansible.cfg`.

View File

@@ -9,10 +9,10 @@ all:
#vps2:
# ansible_host: 203.0.113.11
dbservers:
archivewarrior:
hosts:
#vps3:
# ansible_host: 203.0.113.12
chi2:
ansible_host: 107.175.70.69
authelia:
hosts:

View File

@@ -0,0 +1,13 @@
# User config
archive_user: jester45
archive_uid: 1024
archive_gid: 1024
# Path Configurations
base_app_dir: "/app/archivewarrior"
docker_dir: "/app/docker/archivewarrior"
data_dir: "/app/data/archivewarrior"
# Container Configuration
container_name: "archivewarrior"
image_version: "latest"

View File

@@ -0,0 +1,78 @@
---
- name: Remove nginx, avoids port 80 conflict
ansible.builtin.apt:
name: nginx
state: absent
- name: Remove nginx service, avoids port 80 conflict
ansible.builtin.service:
name: nginx
state: stopped
enabled: false
- name: Create authelia directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: "0750"
loop:
- "{{ authelia_base_dir }}"
- "{{ authelia_config_dir }}"
- "{{ authelia_data_dir }}"
- name: Check if Caddyfile path is wrongly a directory
ansible.builtin.stat:
path: "{{ authelia_base_dir }}/Caddyfile"
register: caddyfile_stat
- name: Remove Caddyfile if it was created as a directory
ansible.builtin.file:
path: "{{ authelia_base_dir }}/Caddyfile"
state: absent
when: caddyfile_stat.stat.exists and caddyfile_stat.stat.isdir
- name: Deploy Caddyfile
ansible.builtin.template:
src: Caddyfile.j2
dest: "{{ authelia_base_dir }}/Caddyfile"
owner: root
group: root
mode: "0640"
notify: restart authelia
- name: Deploy configuration.yml
ansible.builtin.template:
src: configuration.yml.j2
dest: "{{ authelia_config_dir }}/configuration.yml"
owner: root
group: root
mode: "0640"
notify: restart authelia
- name: Deploy users_database.yml
ansible.builtin.template:
src: users_database.yml.j2
dest: "{{ authelia_config_dir }}/users_database.yml"
owner: root
group: root
mode: "0640"
notify: restart authelia
when: authelia_users is defined
- name: Deploy docker-compose.yml
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{ authelia_base_dir }}/docker-compose.yml"
owner: root
group: root
mode: "0640"
register: compose_file
- name: Pull and start authelia via docker compose
community.docker.docker_compose_v2:
project_src: "{{ authelia_base_dir }}"
state: present
pull: missing

View File

@@ -0,0 +1,98 @@
---
- name: Deploy ArchiveWarrior Docker Container
hosts: all
become: true
vars:
tasks:
# ----------------------------------------------------
# 1. PREREQUISITES & DOCKER INSTALLATION
# ----------------------------------------------------
- name: Check if Docker is already installed
ansible.builtin.command: docker --version
register: docker_check
changed_when: false
failed_when: false
- name: Install Docker via convenience script if missing
ansible.builtin.shell: |
set -o pipefail
curl -fsSL https://docker.com | sh
args:
executable: /bin/bash
when: docker_check.rc != 0
changed_when: true
- name: Ensure Docker service is running and enabled
ansible.builtin.systemd:
name: docker
state: started
enabled: true
# ----------------------------------------------------
# 2. USER & DIRECTORY CONFIGURATION
# ----------------------------------------------------
- name: Create dedicated group for ArchiveWarrior
ansible.builtin.group:
name: "{{ archive_user }}"
gid: "{{ archive_gid }}"
state: present
- name: Create dedicated system user for ArchiveWarrior
ansible.builtin.user:
name: "{{ archive_user }}"
uid: "{{ archive_uid }}"
group: "{{ archive_user }}"
groups: docker
append: true
shell: /usr/sbin/nologin
system: true
state: present
- name: Create persistent storage and layout directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ archive_user }}"
group: "{{ archive_user }}"
mode: '0755'
loop:
- "{{ base_app_dir }}"
- "{{ docker_dir }}"
- "{{ data_dir }}"
# ----------------------------------------------------
# 3. DOCKER COMPOSE DEPLOYMENT
# ----------------------------------------------------
- name: Write docker-compose.yml configuration file
ansible.builtin.copy:
dest: "{{ docker_dir }}/docker-compose.yml"
owner: "{{ archive_user }}"
group: "{{ archive_user }}"
mode: '0640'
content: |
version: '3.8'
services:
archivewarrior:
image: atdr.meo.ws/archiveteam/archivewarrior:${image_version}
container_name: ${container_name}
restart: unless-stopped
user: "${archive_uid}:${archive_gid}"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
- ${data_dir}:/home/warrior/data
environment:
- DOWNLOADER=YourNameOrNickname
- SELECTED_PROJECT=auto
- CONCURRENT_ITEMS=6
- name: Pull and start ArchiveWarrior Docker container
# Using community.docker.docker_compose_v2 to handle stack management safely
community.docker.docker_compose_v2:
project_src: "{{ docker_dir }}"
state: present
pull: always

View File

@@ -11,25 +11,30 @@ auth.{{ authelia_domain }} {
}
semaphore.frantecrt.duckdns.org {
# Import the auth configuration block
import authelia_auth
# Webhook endpoint: skip Authelia, Semaphore's own integration auth protects it
@webhook path /api/integrations/*
handle @webhook {
reverse_proxy semaphore.netbird.cloud:3000
}
# Route the traffic to your backend application if authenticated
reverse_proxy semaphore.netbird.cloud:3000
# Everything else: protected by Authelia
handle {
import authelia_auth
reverse_proxy semaphore.netbird.cloud:3000
}
}
git.frantecrt.duckdns.org {
# Import the auth configuration block
import authelia_auth
# Route the traffic to your backend application if authenticated
reverse_proxy gitea.netbird.cloud:3000
}
wikijs.frantecrt.duckdns.org {
# Not using authelia_auth as it breaks the app's login page.
# Not using authelia_auth as it breaks the app's login page.
reverse_proxy wikijs.netbird.cloud:3000
}
vault.frantecrt.duckdns.org {
@@ -37,4 +42,20 @@ vault.frantecrt.duckdns.org {
reverse_proxy wikijs.netbird.cloud:8080
reverse_proxy /notifications/hub* wikijs.netbird.cloud:3012
reverse_proxy /notifications/anonymous_hub* wikijs.netbird.cloud:3012
}
}
slskd.frantecrt.duckdns.org {
# Import the auth configuration block
import authelia_auth
# Route the traffic to your backend application if authenticated
reverse_proxy navidrome.netbird.cloud:5030
}
navidrome.frantecrt.duckdns.org {
# Import the auth configuration block
import authelia_auth
# Route the traffic to your backend application if authenticated
reverse_proxy navidrome.netbird.cloud:4533
}

View File

@@ -64,6 +64,14 @@ identity_providers:
- alt_emails
- preferred_username
- name
wikijs_claims_policy:
id_token:
- groups
- email
- email_verified
- alt_emails
- preferred_username
- name
clients:
- client_id: semaphore
client_name: Semaphore
@@ -71,6 +79,8 @@ identity_providers:
claims_policy: semaphore_claims_policy
public: false
authorization_policy: two_factor
consent_mode: 'pre-configured'
pre_configured_consent_duration: '12M' # Reask consent for data share 1 year after first login
redirect_uris:
- https://semaphore.{{ authelia_domain }}/api/auth/oidc/authelia/redirect
scopes:
@@ -81,16 +91,20 @@ identity_providers:
- client_id: wikijs
client_name: Wiki
client_secret: {{ wikijs_client_secret }}
claims_policy: wikijs_claims_policy
public: false
authorization_policy: 'two_factor'
authorization_policy: two_factor
consent_mode: 'pre-configured'
pre_configured_consent_duration: '12M' # Reask consent for data share 1 year after first login
require_pkce: false
pkce_challenge_method: ''
redirect_uris:
- 'https://wikijs.{{ authelia_domain }}/login/{{ wikijs_uuid }}/callback' # Note this must be copied during step 7 of the Application configuration.
scopes:
- 'openid'
- 'profile'
- 'email'
- openid
- profile
- email
- groups
response_types:
- 'code'
grant_types:

View File

@@ -8,7 +8,7 @@ services:
ports:
- "127.0.0.1:{{ authelia_port }}:{{ authelia_port }}"
environment:
- TZ={{ ansible_facts.timezone | default('UTC') }}
- TZ={{ ansible_facts['timezone'] | default('UTC') }}
caddy:
image: caddy:2
@@ -16,6 +16,7 @@ services:
restart: unless-stopped
network_mode: host
volumes:
- /etc/resolv.conf:/etc/resolv.conf:ro
- {{ authelia_base_dir }}/Caddyfile:/etc/caddy/Caddyfile
- {{ authelia_data_dir }}/caddy_data:/data
- {{ authelia_data_dir }}/caddy_config:/config
- {{ authelia_data_dir }}/caddy_config:/config

View File

@@ -1,27 +0,0 @@
---
- name: Install postgresql
ansible.builtin.apt:
name:
- "postgresql-{{ postgres_version }}"
- python3-psycopg2
state: present
- name: Ensure postgresql is running and enabled
ansible.builtin.service:
name: postgresql
state: started
enabled: true
# - name: Create databases
# become_user: postgres
# community.postgresql.postgresql_db:
# name: "{{ item.name }}"
# loop: "{{ postgres_databases }}"
# - name: Create users
# become_user: postgres
# community.postgresql.postgresql_user:
# name: "{{ item.name }}"
# password: "{{ item.password }}"
# loop: "{{ postgres_users }}"
# no_log: true

View File

@@ -20,11 +20,12 @@
- docker
- nginx
- name: Database servers
hosts: dbservers
- name: archivewarrior servers
hosts: archivewarrior
become: true
roles:
- postgres
- docker
- archivewarrior
- name: authelia servers
hosts: authelia