Skip to content

Commit

Permalink
Caddyfiles may contain secrets, remove world read permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
gizmoguy committed Nov 24, 2024
1 parent 443561b commit cd2b86b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
src: "Caddyfile"
dest: "/etc/caddy/Caddyfile"
owner: "root"
group: "root"
mode: "u=rw,g=r,o=r"
group: "caddy"
mode: "u=rw,g=r,o="
when: caddy_file != ""
notify: reload caddy

- name: Configure Caddyfiles
- name: Configure additional Caddyfiles in /etc/caddy/
ansible.builtin.template:
src: "Caddyfile"
dest: "/etc/caddy/{{ item.name }}"
owner: "root"
group: "root"
mode: "u=rw,g=r,o=r"
group: "caddy"
mode: "u=rw,g=r,o="
notify: reload caddy
loop: "{{ caddy_files | selectattr('dir', 'undefined') }}"
loop_control:
Expand All @@ -34,13 +34,13 @@
| map(attribute="dir")
| unique }}
- name: Configure Caddyfiles in subdirectory
- name: Configure Caddyfiles in subdirectories
ansible.builtin.template:
src: "Caddyfile"
dest: "/etc/caddy/{{ item.dir }}/{{ item.name }}"
owner: "root"
group: "root"
mode: "u=rw,g=r,o=r"
group: "caddy"
mode: "u=rw,g=r,o="
notify: reload caddy
loop: "{{ caddy_files | selectattr('dir', 'defined') }}"
loop_control:
Expand Down

0 comments on commit cd2b86b

Please sign in to comment.