Skip to content

Commit

Permalink
v6.0.6 (#135)
Browse files Browse the repository at this point in the history
Minor updates
* Using latest base image
* Don't add (non-existent) bf-nginx-webdav module to nu config
* Adding custom configuration support via /etc/nginx/sites/custom.conf

Documentation updates
* Adding README to explain custom.conf support
  • Loading branch information
bfren authored Dec 1, 2023
1 parent 124b603 commit 115b813
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM bfren/nginx:nginx1.24-alpine3.18-6.0.4
FROM bfren/nginx:nginx1.24-alpine3.18-6.0.5

LABEL org.opencontainers.image.source="https://github.com/bfren/docker-nginx-webdav"

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Very Simple WebDAV server - serves files mounted in `/www`. There is **no** aut

By default files are served read-only - change two environment variables to enable full write access as well.

If you wish to add custom Nginx configuration, map a file to `/etc/nginx/sites/custom.conf`. This is included last, so anything you add here will override default values.

## Contents

* [Ports](#ports)
Expand All @@ -20,10 +22,10 @@ By default files are served read-only - change two environment variables to enab

## Environment Variables

| Variable | Values | Description | Default |
| ---------------- | ----------- | ------------------------------------------------------------------------ | ------- |
| `NGINX_WEBDAV_ACCESS` | 'r' or 'rw' | Set to 'r' for read-only or 'rw' for read/write access (without quotes). | r |
| `NGINX_WEBDAV_METHODS` | string | For full write access set to 'PUT DELETE MKCOL COPY MOVE'. | off |
| Variable | Values | Description | Default |
| ------------------------- | ----------- | ------------------------------------------------------------------------ | ------- |
| `BF_NGINX_WEBDAV_ACCESS` | 'r' or 'rw' | Set to 'r' for read-only or 'rw' for read/write access (without quotes). | r |
| `BF_NGINX_WEBDAV_METHODS` | string | For full write access set to 'PUT DELETE MKCOL COPY MOVE'. | off |

## Licence

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.5
6.0.6
2 changes: 1 addition & 1 deletion overlay/etc/bf/init.d/21-config.nu
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ bf env load

# Generate nginx configuration file
def main [] {
bf write "Generating nginx configuration file."
bf write "Generating localhost configuration file."
bf esh template $"(bf env NGINX_ETC_SITES)/localhost.conf"
}
28 changes: 23 additions & 5 deletions overlay/etc/bf/templates/localhost.conf.esh
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
server {
# listen to port 80 - this is designed to be a local-only image, behind a proxy server
# https://nginx.org/en/docs/http/ngx_http_core_module.html#listen
listen 80;
listen [::]:80;

# files root
# https://nginx.org/en/docs/http/ngx_http_core_module.html#root
root <% bf-env NGINX_WWW %>;

# allow index page for accessing files via a browser
# https://nginx.org/en/docs/http/ngx_http_autoindex_module.html#autoindex
autoindex on;

# define temporary file hierarchy
# https://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_temp_path
client_body_temp_path /tmp 1 2;

# enable WebDAV extensions
# https://nginx.org/en/docs/http/ngx_http_dav_module.html#dav_access
# https://nginx.org/en/docs/http/ngx_http_dav_module.html#dav_methods
dav_access all:<% bf-env NGINX_WEBDAV_ACCESS %>;
dav_methods <% bf-env NGINX_WEBDAV_METHODS %>;
dav_ext_methods <% bf-env NGINX_WEBDAV_EXT_METHODS %>;

client_body_temp_path /tmp;

# create intermediate directories when PUTting a new file
# https://nginx.org/en/docs/http/ngx_http_dav_module.html#create_full_put_path
create_full_put_path on;

proxy_max_temp_file_size 0;
# remove upload limits
# https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering
# https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_max_temp_file_size
proxy_buffering off;

proxy_max_temp_file_size 0;
include helpers/uploads.conf;
}

# include custom configuration file
include sites/custom[.].conf;
}
3 changes: 0 additions & 3 deletions overlay/tmp/install
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@ def main [] {
let version = bf fs read /tmp/NGINX_BUILD
bf write $"Installing nginx v($version) WebDAV extension."
bf pkg install [$"nginx-mod-http-dav-ext=($version)"]

# add bf-nginx-webdav module to config
bf config use bf-nginx-webdav
}

0 comments on commit 115b813

Please sign in to comment.