feat: expose dir2opds via Caddy with basic auth + direct tailscale access
This commit is contained in:
@@ -5,9 +5,24 @@
|
||||
loop:
|
||||
- /opt/stacks/caddy
|
||||
|
||||
- name: copy Caddyfile
|
||||
ansible.builtin.copy:
|
||||
src: Caddyfile
|
||||
- name: Install apache2-utils for htpasswd
|
||||
ansible.builtin.apt:
|
||||
name: apache2-utils
|
||||
state: present
|
||||
become: true
|
||||
when: vault_dir2opds is defined
|
||||
|
||||
- name: Generate bcrypt hash for dir2opds basic auth
|
||||
ansible.builtin.shell: |
|
||||
htpasswd -bnB "{{ vault_dir2opds.basic_auth_user }}" "{{ vault_dir2opds.basic_auth_password }}" | awk -F: '{print $1, $2}'
|
||||
register: dir2opds_basic_auth_hash_result
|
||||
changed_when: false
|
||||
no_log: true
|
||||
when: vault_dir2opds is defined
|
||||
|
||||
- name: template Caddyfile
|
||||
ansible.builtin.template:
|
||||
src: Caddyfile.j2
|
||||
dest: /opt/stacks/caddy/Caddyfile
|
||||
owner: root
|
||||
mode: 644
|
||||
|
||||
Reference in New Issue
Block a user