[global]
  p: {{ copyparty.port }}
  e2dsa  # scan and index all files in all volumes on startup
  no-robots  # prevent search engine indexing
  usernames  # require username+password for login
  ah-alg: argon2  # enable argon2 password hashing
{% if copyparty.ah_salt | default('') %}
  ah-salt: {{ copyparty.ah_salt }}  # fixed salt for consistent password hashing
{% endif %}
  log-fk: 3  # reduce password logging (0=all, 3=hash only, 4=no passwords in log)
  z, qr  # enable zeroconf (LAN service discovery) and QR code
  shr: /shr  # enable shares feature
  hist: /cfg/hists/  # history/log directory
{% if copyparty.reverse_proxy | default(false) %}
  xff-hdr: X-Forwarded-For  # read client IP from this header
  xff-src: {{ copyparty.xff_src }}  # trust this reverse proxy IP
  rproxy: 1  # single IP in X-Forwarded-For header
{% endif %}

{% if copyparty.accounts | default([]) | length > 0 %}
[accounts]
{% for account in copyparty.accounts %}
  {{ account.user }}: {{ account.password }}
{% endfor %}

{% endif %}
{% for volume in copyparty.volumes | default([]) %}
[/{{ volume.name | default(volume.path.split('/')[-1]) }}]
  {{ volume.path }}
  accs:
{% for acc in volume.accs %}
{% for perm, users in acc.items() %}
    {{ perm }}: {{ users }}
{% endfor %}
{% endfor %}
{% if volume.flags is defined and volume.flags | length > 0 %}
  flags:
{% for flag in volume.flags %}
{% if flag is mapping %}
{% for key, value in flag.items() %}
    {{ key }}: {{ value }}
{% endfor %}
{% else %}
    {{ flag }}
{% endif %}
{% endfor %}
{% endif %}

{% endfor %}
