Giter VIP home page Giter VIP logo

docker-webdav's Introduction

Docker WebDAV image

A tiny image running gliderlabs/docker-alpine Linux and Lighttpd.

Usage

docker run --restart=always -d
	-p 0.0.0.0:80:80 \
	--hostname=webdav \
	--name=webdav \
	-v /<host_directory_to_share>:/webdav \
	jgeusebroek/webdav

By default the WebDAV server is password protected with user webdav and password vadbew which obviously isn't really secure. This can easily be overwritten, by creating a config directory on the host with an htpasswd file and mounting this as a volume on /config.

-v /<host_config_directory>:/config

You could use an online htpasswd generator like https://www.transip.nl/htpasswd/ to create the password hashes when you don't have a machine with the htpasswd package. (Hint: The package is apache2-utils)

You can also provide a list of IP's in the form of a regular expression which are then whitelisted. See below.

Optional environment variables

  • USER_UID User ID of the lighttpd daemon account (default: 2222).
  • USER_GID Group ID of the lighttpd daemon account (default: 2222).
  • WHITELIST Regexp for a list of IP's (default: none). Example: -e WHITELIST='192.168.1.*|172.16.1.2'
  • READWRITE When this is set to true, the WebDAV share can be written to (default: False). Example: -e READWRITE=true

IMPORTANT: Should you use a persistent config volume, the WHITELIST and READWRITE variables will only have effect the first time. I.e., when you don't have a (custom) configuration yet.

License

MIT / BSD

Author Information

Jeroen Geusebroek

docker-webdav's People

Contributors

jgeusebroek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docker-webdav's Issues

Start fails if group already exists

Hey,

I'm running your container in a NAS environment where the desired GID is 100. This results in

+ addgroup -g 100 webdav
addgroup: gid '100' in use
+ adduser -G webdav -D -H -u 1026 webdav
adduser: unknown group webdav
+ chown webdav /var/log/lighttpd
chown: unknown user webdav

So the lighttpd does not start here. Can you please create a check if the group already exists? Thanks!

password not matching

  • I've mounted htpasswd to /config in container and pass doesn't match
  • I've even tried the default credentials ( webdav:davbew ) still no match:
==> /var/log/lighttpd/error.log <==
2017-05-03 14:28:48: (mod_auth.c.500) password doesn't match for /files username: webdav, IP: 172.17.0.1

==> /var/log/lighttpd/access.log <==
172.17.0.1 localhost:8081 - [03/May/2017:14:28:50 +0000] "GET /files HTTP/1.1" 401 351 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36 OPR/44.0.2510.1218"

==> /var/log/lighttpd/error.log <==
2017-05-03 14:28:50: (mod_auth.c.500) password doesn't match for /files username: , IP: 172.17.0.1

'403 - forbidden' access in a arm32v6 version of your build

Hi.

I built arm/alpine version of your webdav image, importing a "arm32v6/alpine:latest", which is literaly the only line i changed in your Dockerfile with also the removing of the package version (build date) since there are not the same in the armf repository.

FROM arm32v6/alpine:latest
ENV PACKAGE_LIST="lighttpd lighttpd-mod_webdav lighttpd-mod_auth"
RUN apk add --no-cache ${PACKAGE_LIST}
VOLUME [ "/config", "/webdav" ]
ADD files/* /etc/lighttpd/
ADD ./entrypoint.sh /entrypoint.sh
EXPOSE 80
RUN chmod u+x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

Everything build fine fine...

Then I start the container with :

docker run
--restart=always
--name webdav_container_1
-d
-p 0.0.0.0:80:80
-e WHITELIST='192...*'
-e READWRITE=true
--hostname=webdav
--mount source=just_created_volume,target=/webdav
piriou/rpi-alpine-webdav

The only difference here being the --mount source=just_created_volume,target=/webdav instead of -v /my/host/folder:/webdav in your run command in order to contain data in a volume easy to backup.

But once the container is started, my webdav client tell me access is not authorized .

I guess it's a permission issue but i cannot figure out how to fix it.

I don't know neither if the error is related to the volume i mounted or if it come from your config files or your entrypoint.sh script.

Any idea how to fix that ?

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.