Make archivebox role customizable
External HDD is no longer needed. UID, GID and container tag may be changed. The time zone now matches the host.
This commit is contained in:
parent
a73cebb48f
commit
ca070782c9
4 changed files with 27 additions and 8 deletions
|
@ -4,3 +4,4 @@
|
||||||
- name: archivebox
|
- name: archivebox
|
||||||
csrf_trusted_origins: https://archive.comfycamp.space
|
csrf_trusted_origins: https://archive.comfycamp.space
|
||||||
allowed_hosts: archive.comfycamp.space
|
allowed_hosts: archive.comfycamp.space
|
||||||
|
archive_dir: /mnt/hdd/archivebox-data
|
||||||
|
|
|
@ -2,12 +2,23 @@
|
||||||
argument_specs:
|
argument_specs:
|
||||||
main:
|
main:
|
||||||
options:
|
options:
|
||||||
|
tag:
|
||||||
|
type: str
|
||||||
|
uid:
|
||||||
|
type: int
|
||||||
|
gid:
|
||||||
|
type: int
|
||||||
|
archive_dir:
|
||||||
|
type: str
|
||||||
|
description: "Path to the archive directory"
|
||||||
csrf_trusted_origins:
|
csrf_trusted_origins:
|
||||||
type: str
|
type: str
|
||||||
required: true
|
required: true
|
||||||
|
description: "Full URL to your instance, e.g. https://example.com"
|
||||||
allowed_hosts:
|
allowed_hosts:
|
||||||
type: str
|
type: str
|
||||||
required: true
|
required: true
|
||||||
|
description: "The domain of your instance, e.g. example.com"
|
||||||
public_index:
|
public_index:
|
||||||
type: bool
|
type: bool
|
||||||
public_snapshots:
|
public_snapshots:
|
||||||
|
|
|
@ -6,33 +6,34 @@
|
||||||
- name: Create data dir
|
- name: Create data dir
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /mnt/hdd/archivebox-data
|
path: "{{ archive_dir }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "1700"
|
mode: "1700"
|
||||||
owner: root
|
owner: root
|
||||||
- name: Create nested data dir
|
- name: Create nested data dir
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /mnt/hdd/archivebox-data/_data
|
path: "{{ archive_dir }}/_data"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "1700"
|
mode: "1700"
|
||||||
owner: "911"
|
owner: "{{ uid | string }}"
|
||||||
- name: Run archivebox
|
- name: Run archivebox
|
||||||
become: true
|
become: true
|
||||||
community.docker.docker_container:
|
community.docker.docker_container:
|
||||||
name: archivebox-1
|
name: archivebox-1
|
||||||
image: archivebox/archivebox:0.7.2
|
image: archivebox/archivebox:{{ tag }}
|
||||||
env:
|
env:
|
||||||
PUBLIC_INDEX: "{{ public_index | string }}"
|
PUBLIC_INDEX: "{{ public_index | string }}"
|
||||||
PUBLIC_SNAPSHOTS: "{{ public_snapshots | string }}"
|
PUBLIC_SNAPSHOTS: "{{ public_snapshots | string }}"
|
||||||
SAVE_ARCHIVE_DOT_ORG: "{{ save_archive_dot_org | string }}"
|
SAVE_ARCHIVE_DOT_ORG: "{{ save_archive_dot_org | string }}"
|
||||||
CSRF_TRUSTED_ORIGINS: "{{ csrf_trusted_origins }}"
|
CSRF_TRUSTED_ORIGINS: "{{ csrf_trusted_origins }}"
|
||||||
ALLOWED_HOSTS: "{{ allowed_hosts }}"
|
ALLOWED_HOSTS: "{{ allowed_hosts }}"
|
||||||
PUID: "911"
|
PUID: "{{ uid | string }}"
|
||||||
PGID: "911"
|
PGID: "{{ gid | string }}"
|
||||||
networks:
|
networks:
|
||||||
- name: haproxy
|
- name: haproxy
|
||||||
volumes:
|
volumes:
|
||||||
- archivebox:/data
|
- "archivebox:/data"
|
||||||
- /mnt/hdd/archivebox-data/_data:/data/archive
|
- "{{ archive_dir }}/_data:/data/archive"
|
||||||
|
- "/etc/timezone:/etc/timezone:ro"
|
||||||
restart_policy: unless-stopped
|
restart_policy: unless-stopped
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
uid: 911
|
||||||
|
gid: 911
|
||||||
|
tag: "0.7.2"
|
||||||
|
|
||||||
public_index: false
|
public_index: false
|
||||||
public_snapshots: false
|
public_snapshots: false
|
||||||
save_archive_dot_org: false
|
save_archive_dot_org: false
|
||||||
|
|
||||||
|
archive_dir: /var/lib/docker/volumes/archivebox/_data/archive
|
||||||
|
|
Loading…
Reference in a new issue