Skip to content

Commit 0005bb4

Browse files
authored
v2.0.0 (#13)
Major updates * Using latest base image * Simplifying Dockerfile and using bcg-install with install script * Moving templates directory * Using new BCG_E * Namespacing environment variables Minor updates * Consolidating attributes files Documentation updates * Making comments more consistent * Updates to README Build updates * Updating build definitions
1 parent 5a82dfc commit 0005bb4

File tree

12 files changed

+72
-27
lines changed

12 files changed

+72
-27
lines changed

.github/workflows/build-dev.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ name: build-dev
22

33
on:
44
push:
5-
branches:
6-
- '**'
5+
branches-ignore:
6+
- 'main'
77
tags-ignore:
88
- '**'
9+
paths:
10+
- '.github/workflows/build-dev.yml'
11+
- 'overlay/**'
12+
- 'Dockerfile'
13+
- 'VERSION'
914

1015
jobs:
1116
main:
@@ -14,6 +19,12 @@ jobs:
1419
-
1520
name: Checkout code
1621
uses: actions/checkout@v2
22+
-
23+
name: Read image version
24+
uses: bencgreen/read-file-action@v1
25+
with:
26+
path: ./VERSION
27+
id: version
1728
-
1829
name: Set up QEMU
1930
uses: docker/setup-qemu-action@v1
@@ -35,6 +46,7 @@ jobs:
3546
platforms: linux/amd64,linux/arm/v7,linux/arm64
3647
tags: |
3748
bcgdesign/nginx-webdav:dev
49+
bcgdesign/nginx-webdav:${{ steps.version.outputs.content }}
3850
-
3951
name: Image digest
4052
run: echo ${{ steps.docker_build.outputs.digest }}

.github/workflows/build-main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
paths:
1010
- '.github/workflows/build-main.yml'
1111
- 'overlay/**'
12+
- 'Dockerfile'
1213
- 'VERSION'
1314

1415
jobs:

Dockerfile

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
1-
FROM bcgdesign/nginx:alpine-3.13-1.4.2
1+
FROM bcgdesign/nginx:alpine-3.13-2.0.0
22

33
LABEL maintainer="Ben Green <[email protected]>" \
44
org.label-schema.name="Nginx WebDAV" \
55
org.label-schema.version="latest" \
66
org.label-schema.vendor="Ben Green" \
77
org.label-schema.schema-version="1.0"
88

9-
ARG NGINX_VERSION
10-
119
ENV \
1210
# set to "r" or "rw" to enable read-only / read-write access
13-
DAV_ACCESS="r" \
11+
WEBDAV_ACCESS="r" \
1412
# set to "PUT DELETE MKCOL COPY MOVE" (or any variation) to enable full write access
15-
DAV_METHODS="off"
16-
17-
ARG NGINX_VERSION=1.18.0-r13
18-
RUN apk -U upgrade \
19-
&& apk add \
20-
nginx-mod-http-dav-ext=${NGINX_VERSION} \
21-
&& rm -rf /var/cache/apk/* /www/* /tmp/*
13+
WEBDAV_METHODS="off"
2214

2315
COPY ./overlay /
16+
COPY ./NGINX_BUILD /tmp/VERSION
17+
18+
RUN bcg-install

Dockerfile-automated

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ ARG NGINX_VERSION
1010

1111
ENV \
1212
# set to "r" or "rw" to enable read-only / read-write access
13-
DAV_ACCESS="r" \
13+
WEBDAV_ACCESS="r" \
1414
# set to "PUT DELETE MKCOL COPY MOVE" (or any variation) to enable full write access
15-
DAV_METHODS="off"
15+
WEBDAV_METHODS="off"
1616

1717
ARG NGINX_VERSION=1.18.0-r13
1818
RUN apk -U upgrade \

NGINX_BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.18.0-r13

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ By default files are served read-only - change two environment variables to enab
2020

2121
## Environment Variables
2222

23-
| Variable | Values | Description | Default |
24-
| ------------- | ----------- | ---------------------------------------------------------- | ------- |
25-
| `DAV_ACCESS` | 'r' or 'rw' | Set to 'r' for read-only or 'rw' for read/write access. | r |
26-
| `DAV_METHODS` | string | For full write access set to 'PUT DELETE MKCOL COPY MOVE'. | off |
23+
| Variable | Values | Description | Default |
24+
| ---------------- | ----------- | ---------------------------------------------------------- | ------- |
25+
| `WEBDAV_ACCESS` | 'r' or 'rw' | Set to 'r' for read-only or 'rw' for read/write access. | r |
26+
| `WEBDAV_METHODS` | string | For full write access set to 'PUT DELETE MKCOL COPY MOVE'. | off |
2727

2828
## Authors
2929

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.1
1+
2.0.0

overlay/etc/templates/localhost.conf.esh renamed to overlay/etc/bcg/templates/localhost.conf.esh

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ server {
22
listen 80;
33
listen [::]:80;
44

5-
root /www;
5+
root <%= ${NGINX_WWW} %>;
66

77
autoindex on;
88

9-
dav_access all:<%= "${DAV_ACCESS}" %>;
10-
dav_methods <%= "${DAV_METHODS}" %>;
11-
dav_ext_methods PROPFIND OPTIONS;
9+
dav_access all:<%= "${WEBDAV_ACCESS}" %>;
10+
dav_methods <%= "${WEBDAV_METHODS}" %>;
11+
dav_ext_methods <%= "${WEBDAV_EXT_METHODS}" %>;
1212

1313
client_body_temp_path /tmp;
1414

overlay/etc/cont-init.d/20-env

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/with-contenv sh
2+
3+
set -euo pipefail
4+
export BCG_E=`basename ${0}`
5+
6+
7+
#======================================================================================================================
8+
# Add environment variables.
9+
#======================================================================================================================
10+
11+
bcg-env "WEBDAV_EXT_METHODS" "PROPFIND OPTIONS"
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#!/usr/bin/with-contenv sh
22

33
set -euo pipefail
4+
export BCG_E=`basename ${0}`
45

56

67
#======================================================================================================================
7-
# Config is re-written every time in case environment variables have been changed
8+
# Config is re-written every time in case environment variables have been changed.
89
#======================================================================================================================
910

1011
bcg-echo "Writing Nginx WebDAV config..."
11-
esh -o /etc/nginx/sites/localhost.conf \
12-
/etc/templates/localhost.conf.esh
12+
esh -o ${NGINX_LOCALHOST_CONF} \
13+
${BCG_TEMPLATES}/localhost.conf.esh
1314
bcg-done
File renamed without changes.

overlay/tmp/install

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
set -euo pipefail
4+
export BCG_E=`basename ${0}`
5+
6+
7+
#======================================================================================================================
8+
# Get Nginx Version.
9+
#======================================================================================================================
10+
11+
cd /tmp
12+
13+
VERSION=$(cat VERSION)
14+
bcg-debug "Nginx version ${VERSION}."
15+
16+
17+
#======================================================================================================================
18+
# Install Nginx WebDAV extension and dependencies.
19+
#======================================================================================================================
20+
21+
bcg-echo "Installing Nginx v${VERSION} WebDAV extension..."
22+
apk add --no-cache \
23+
nginx-mod-http-dav-ext=${VERSION}
24+
bcg-done

0 commit comments

Comments
 (0)