Skip to content

Commit

Permalink
feat: handle autoindex format (#261)
Browse files Browse the repository at this point in the history
Close: #260
  • Loading branch information
matthieumarrast authored Feb 23, 2024
1 parent d8ec6c5 commit 8a9fbcf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
11 changes: 10 additions & 1 deletion adm/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ def coerce_storage_forbidden_dav_methods(value):
"storage_dav_access": {
**NON_REQUIRED_STRING,
"default": ""
}
},
"storage_autoindex_format": {
**NON_REQUIRED_STRING,
"default": "html",
},
}
}
}
Expand Down Expand Up @@ -130,3 +134,8 @@ def storage_satisfy(self):
def storage_forbidden_dav_methods(self):
self.load()
return self._doc["general"]["storage_forbidden_dav_methods"]

@property
def storage_autoindex_format(self):
self.load()
return self._doc["general"]["storage_autoindex_format"]
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@ storage_forbidden_dav_methods=null
# - if _use_storage=1 : user:rw
# - if _use_storage=0 : null
storage_dav_access={% if cookiecutter.use_storage == "no" %}null{% else %}user:rw{% endif %}

# If storage_autoindex = 1 (default) in module configuration, sets the format of directory listing
# (see http://nginx.org/en/docs/http/ngx_http_autoindex_module.html#autoindex_format)
storage_autoindex_format=html
1 change: 1 addition & 0 deletions config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ http {
min_delete_depth {{MFBASE_NGINX_STORAGE_MIN_DELETE_DEPTH}};
{% if MFBASE_NGINX_STORAGE_AUTOINDEX == "1" %}
autoindex on;
autoindex_format {{PLUGIN.configuration.storage_autoindex_format}};
{% endif %}
satisfy {{PLUGIN.configuration.storage_satisfy}};
{% for ALLOW in PLUGIN.configuration.storage_access_allows.split(',') %}
Expand Down

0 comments on commit 8a9fbcf

Please sign in to comment.