You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.4 KiB
52 lines
1.4 KiB
5 years ago
|
{% for share in nas_shares %}
|
||
|
{% if share.protocols.http.enabled %}
|
||
5 years ago
|
Alias /{{ share.name }} {{ share.path | default(nas_root_dir + '/data/' + share.name) }}
|
||
5 years ago
|
RewriteEngine On
|
||
|
{% if share.protocols.http.force_ssl %}
|
||
|
RewriteCond %{HTTPS} =off
|
||
|
RewriteRule ^/{{ share.name }}(/.*|$) https://%{HTTP_HOST}/{{ share.name }}$1
|
||
|
{% endif %}
|
||
|
|
||
5 years ago
|
<Directory {{ share.path | default(nas_root_dir + '/data/' + share.name) }}>
|
||
5 years ago
|
Options None
|
||
|
Options +FollowSymlinks
|
||
|
{% if share.protocols.http.force_ssl %}
|
||
|
SSLRequireSSL On
|
||
|
{% endif %}
|
||
|
{% if share.protocols.http.indexes %}
|
||
|
Options +Indexes
|
||
|
{% endif %}
|
||
4 years ago
|
{% 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 %}
|
||
5 years ago
|
</Directory>
|
||
|
|
||
|
|
||
|
{% endif %}
|
||
|
{% endfor %}
|