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
|
||||
csrf_trusted_origins: https://archive.comfycamp.space
|
||||
allowed_hosts: archive.comfycamp.space
|
||||
archive_dir: /mnt/hdd/archivebox-data
|
||||
|
|
|
@ -2,12 +2,23 @@
|
|||
argument_specs:
|
||||
main:
|
||||
options:
|
||||
tag:
|
||||
type: str
|
||||
uid:
|
||||
type: int
|
||||
gid:
|
||||
type: int
|
||||
archive_dir:
|
||||
type: str
|
||||
description: "Path to the archive directory"
|
||||
csrf_trusted_origins:
|
||||
type: str
|
||||
required: true
|
||||
description: "Full URL to your instance, e.g. https://example.com"
|
||||
allowed_hosts:
|
||||
type: str
|
||||
required: true
|
||||
description: "The domain of your instance, e.g. example.com"
|
||||
public_index:
|
||||
type: bool
|
||||
public_snapshots:
|
||||
|
|
|
@ -6,33 +6,34 @@
|
|||
- name: Create data dir
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: /mnt/hdd/archivebox-data
|
||||
path: "{{ archive_dir }}"
|
||||
state: directory
|
||||
mode: "1700"
|
||||
owner: root
|
||||
- name: Create nested data dir
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: /mnt/hdd/archivebox-data/_data
|
||||
path: "{{ archive_dir }}/_data"
|
||||
state: directory
|
||||
mode: "1700"
|
||||
owner: "911"
|
||||
owner: "{{ uid | string }}"
|
||||
- name: Run archivebox
|
||||
become: true
|
||||
community.docker.docker_container:
|
||||
name: archivebox-1
|
||||
image: archivebox/archivebox:0.7.2
|
||||
image: archivebox/archivebox:{{ tag }}
|
||||
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"
|
||||
PUID: "{{ uid | string }}"
|
||||
PGID: "{{ gid | string }}"
|
||||
networks:
|
||||
- name: haproxy
|
||||
volumes:
|
||||
- archivebox:/data
|
||||
- /mnt/hdd/archivebox-data/_data:/data/archive
|
||||
- "archivebox:/data"
|
||||
- "{{ archive_dir }}/_data:/data/archive"
|
||||
- "/etc/timezone:/etc/timezone:ro"
|
||||
restart_policy: unless-stopped
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
uid: 911
|
||||
gid: 911
|
||||
tag: "0.7.2"
|
||||
|
||||
public_index: false
|
||||
public_snapshots: false
|
||||
save_archive_dot_org: false
|
||||
|
||||
archive_dir: /var/lib/docker/volumes/archivebox/_data/archive
|
||||
|
|
Loading…
Reference in a new issue