mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-07 00:57:00 +02:00
Update to 2022-10-19 17:00
This commit is contained in:
51
roles/nas/templates/httpd.conf.j2
Normal file
51
roles/nas/templates/httpd.conf.j2
Normal file
@@ -0,0 +1,51 @@
|
||||
{% for share in nas_shares %}
|
||||
{% if share.protocols.http.enabled %}
|
||||
Alias /{{ share.name }} {{ share.path | default(nas_root_dir + '/data/' + share.name) }}
|
||||
RewriteEngine On
|
||||
{% if share.protocols.http.force_ssl %}
|
||||
RewriteCond %{HTTPS} =off
|
||||
RewriteRule ^/{{ share.name }}(/.*|$) https://%{HTTP_HOST}/{{ share.name }}$1
|
||||
{% endif %}
|
||||
|
||||
<Directory {{ share.path | default(nas_root_dir + '/data/' + share.name) }}>
|
||||
Options None
|
||||
Options +FollowSymlinks
|
||||
{% if share.protocols.http.force_ssl %}
|
||||
SSLRequireSSL On
|
||||
{% endif %}
|
||||
{% if share.protocols.http.indexes %}
|
||||
Options +Indexes
|
||||
{% endif %}
|
||||
{% if share.protocols.http.webdav %}
|
||||
Dav On
|
||||
{% endif %}
|
||||
{% if not share.protocols.http.public %}
|
||||
AuthType Basic
|
||||
AuthName "Authenicated zone"
|
||||
AuthBasicProvider external
|
||||
AuthExternal pwauth
|
||||
|
||||
# Read only access
|
||||
<Limit GET PROPFIND OPTIONS LOCK UNLOCK REPORT>
|
||||
{% for user in share.acl.read_users %}
|
||||
Require user {{ user }}
|
||||
{% endfor %}
|
||||
{% for group in share.acl.read_groups %}
|
||||
Require unix-group {{ group }}
|
||||
{% endfor %}
|
||||
</Limit>
|
||||
# Write access through webdav always requires authentication
|
||||
<LimitExcept GET PROPFIND OPTIONS LOCK UNLOCK REPORT>
|
||||
{% for user in share.acl.write_users %}
|
||||
Require user {{ user }}
|
||||
{% endfor %}
|
||||
{% for group in share.acl.write_groups %}
|
||||
Require unix-group {{ group }}
|
||||
{% endfor %}
|
||||
</LimitExcept>
|
||||
{% endif %}
|
||||
</Directory>
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
Reference in New Issue
Block a user