Run archivebox

This commit is contained in:
Ivan R. 2024-11-02 19:04:43 +05:00
parent c788582950
commit 7879676250
Signed by: lumin
GPG key ID: E0937DC7CD6D3817
5 changed files with 69 additions and 0 deletions

6
archivebox.yml Normal file
View file

@ -0,0 +1,6 @@
---
- hosts: webservers
roles:
- name: archivebox
csrf_trusted_origins: https://archive.comfycamp.space
allowed_hosts: archive.comfycamp.space

View file

@ -0,0 +1,16 @@
---
argument_specs:
main:
options:
csrf_trusted_origins:
type: str
required: true
allowed_hosts:
type: str
required: true
public_index:
type: bool
public_snapshots:
type: bool
save_archive_dot_org:
type: bool

View file

@ -0,0 +1,38 @@
---
- name: Create archivebox volume
become: true
community.docker.docker_volume:
name: archivebox
- name: Create data dir
become: true
ansible.builtin.file:
path: /mnt/hdd/archivebox-data
state: directory
mode: "1700"
owner: root
- name: Create nested data dir
become: true
ansible.builtin.file:
path: /mnt/hdd/archivebox-data/_data
state: directory
mode: "1700"
owner: "911"
- name: Run archivebox
become: true
community.docker.docker_container:
name: archivebox-1
image: archivebox/archivebox:0.7.2
env:
PUBLIC_INDEX: "{{ public_index | string }}"
PUBLIC_SNAPSHOTS: "{{ public_snapshots | string }}"
SAVE_ARCHIVE_DOT_ORG: "{{ save_archive_dot_org | string }}"
CSRF_TRUSTED_ORIGINS: "{{ csrf_trusted_origins }}"
ALLOWED_HOSTS: "{{ allowed_hosts }}"
PUID: "911"
PGID: "911"
networks:
- name: haproxy
volumes:
- archivebox:/data
- /mnt/hdd/archivebox-data/_data:/data/archive
restart_policy: unless-stopped

View file

@ -0,0 +1,3 @@
public_index: false
public_snapshots: false
save_archive_dot_org: false

View file

@ -105,6 +105,9 @@ frontend https
acl host_grafana hdr(host) -i grafana.comfycamp.space
use_backend grafana if host_grafana
acl host_archivebox hdr(host) -i archive.comfycamp.space
use_backend archivebox if host_archivebox
acl host_mta_sts hdr(host) -i mta-sts.comfycamp.space
use_backend mta_sts if host_mta_sts
@ -214,3 +217,6 @@ backend immich
option http-server-close
timeout tunnel 1h
server s1 immich-1:2283 check
backend archivebox
server s1 archivebox-1:8000 check