GithubHelp home page GithubHelp logo

docker-webdav's Introduction

Supported tags

Quick reference

This image runs an easily configurable WebDAV server with Apache.

You can configure the authentication type, the authentication of multiple users, or to run with a self-signed SSL certificate. If you want a Let's Encrypt certificate, see an example of how to do that here.

Usage

Basic WebDAV server

This example starts a WebDAV server on port 80. It can only be accessed with a single username and password.

When using unencrypted HTTP, use Digest authentication (instead of Basic) to avoid sending plaintext passwords in the clear.

To make sure your data doesn't get deleted, you'll probably want to create a persistent storage volume (-v vol-webdav:/var/lib/dav) or bind mount a directory (-v /path/to/directory:/var/lib/dav):

docker run --restart always -v /srv/dav:/var/lib/dav \
    -e AUTH_TYPE=Digest -e USERNAME=alice -e PASSWORD=secret1234 \
    --publish 80:80 -d bytemark/webdav

Via Docker Compose:

version: '3'
services:
  webdav:
    image: bytemark/webdav
    restart: always
    ports:
      - "80:80"
    environment:
      AUTH_TYPE: Digest
      USERNAME: alice
      PASSWORD: secret1234
    volumes:
      - /srv/dav:/var/lib/dav

Secure WebDAV with SSL

We recommend you use a reverse proxy (eg, Traefik) to handle SSL certificates. You can see an example of how to do that here.

If you're happy with a self-signed SSL certificate, specify -e SSL_CERT=selfsigned and the container will generate one for you.

docker run --restart always -v /srv/dav:/var/lib/dav \
    -e AUTH_TYPE=Basic -e USERNAME=test -e PASSWORD=test \
    -e SSL_CERT=selfsigned --publish 443:443 -d bytemark/webdav

If you bind mount a certificate chain to /cert.pem and a private key to /privkey.pem, the container will use that instead!

Authenticate multiple clients

Specifying USERNAME and PASSWORD only supports a single user. If you want to have lots of different logins for various users, bind mount your own file to /user.passwd and the container will use that instead.

If using Basic authentication, run the following commands:

touch user.passwd
htpasswd -B user.passwd alice
htpasswd -B user.passwd bob

If using Digest authentication, run the following commands. (NB: The default REALM is WebDAV. If you specify your own REALM, you'll need to run htdigest again with the new name.)

touch user.passwd
htdigest user.passwd WebDAV alice
htdigest user.passwd WebDAV bob

Once you've created your own user.passwd, bind mount it into your container with -v /path/to/user.passwd:/user.passwd.

Environment variables

All environment variables are optional. You probably want to at least specify USERNAME and PASSWORD (or bind mount your own authentication file to /user.passwd) otherwise nobody will be able to access your WebDAV server!

  • SERVER_NAMES: Comma-separated list of domains (eg, example.com,www.example.com). The first is set as the ServerName, and the rest (if any) are set as ServerAlias. The default is localhost.
  • LOCATION: The URL path for WebDAV (eg, if set to /webdav then clients should connect to example.com/webdav). The default is /.
  • AUTH_TYPE: Apache authentication type to use. This can be Basic (best choice for HTTPS) or Digest (best choice for HTTP). The default is Basic.
  • REALM: Sets AuthName, an identifier that is displayed to clients when they connect. The default is WebDAV.
  • USERNAME: Authenticate with this username (and the password below). This is ignored if you bind mount your own authentication file to /user.passwd.
  • PASSWORD: Authenticate with this password (and the username above). This is ignored if you bind mount your own authentication file to /user.passwd.
  • ANONYMOUS_METHODS: Comma-separated list of HTTP request methods (eg, GET,POST,OPTIONS,PROPFIND). Clients can use any method you specify here without authentication. Set to ALL to disable authentication. The default is to disallow any anonymous access.
  • SSL_CERT: Set to selfsigned to generate a self-signed certificate and enable Apache's SSL module. If you specify SERVER_NAMES, the first domain is set as the Common Name.

docker-webdav's People

Contributors

boonen avatar ianeiloart avatar jamielinux avatar pcammish 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-webdav's Issues

Really support architectures other than amd64

I was trying to run this on my raspberry pi 4 using docker-compose.

This is the error that I get:

standard_init_linux.go:228: exec user process caused: exec format error

Based on some initial searching, it looks like it's because of an incorrect architecture of the image.

I used the docker manifest to find out what architectures this image supports:

docker manifest inspect --verbose bytemark/webdav:latest

❯ docker manifest inspect --verbose bytemark/webdav:latest
{
        "Ref": "docker.io/bytemark/webdav:latest",
        "Descriptor": {
                "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                "digest": "sha256:21eed0df1238d17766080425f9ef46da2c1130e3e3aa9eaf36794d2a72e7c616",
                "size": 1989,
                "platform": {
                        "architecture": "amd64",
                        "os": "linux"
                }
        },
        "SchemaV2Manifest": {
                "schemaVersion": 2,
                "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                "config": {
                        "mediaType": "application/vnd.docker.container.image.v1+json",
                        "size": 9327,
                        "digest": "sha256:c124350447bb537f4d4c5dc11cdaba36514a6bfc87849369e3f1f1fac99288d9"
                },
                "layers": [
                        {
                                "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                "size": 2206931,
                                "digest": "sha256:4fe2ade4980c2dda4fc95858ebb981489baec8c1e4bd282ab1c3560be8ff9bde"
                        },
                        {
                                "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                "size": 1250,
                                "digest": "sha256:42101a4e4c4e87a675d887d6ae4d470a2ac9e1a944641f6be9e6deaa94d9bd3e"
                        },
                        {
                                "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                "size": 147,
                                "digest": "sha256:73eadb9961ffcaea4b38b93d524510b20b1f2ca02632019b4d8f03db3a7a380c"
                        },
                        {
                                "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                "size": 28322442,
                                "digest": "sha256:830983fb5ec2bff731ddde5c140ed82347f121b2db486d769a8679bcf97d3d64"
                        },
                        {
                                "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                "size": 293,
                                "digest": "sha256:78fb51bbfc274598464d48a6e867d19363e2deda93e1db1c26b5bd00e2036598"
                        },
                        {
                                "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                "size": 1168,
                                "digest": "sha256:a39c1a5fbc6f6fef2bf9ea8168fa8da44b4c2505f3e59692cfd717cd570d5636"
                        },
                        {
                                "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                "size": 1660081,
                                "digest": "sha256:1f4c3ea2abf9e947059e2ca985bce633257a491cf03520cfdea8deed15bb18c2"
                        },
                        {
                                "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                "size": 1596,
                                "digest": "sha256:ce5492a1029f017d4dc9b768e62427913e2ffa0ef674e2c604da3e5ebfdc17f0"
                        }
                ]
        }
}

Based on the README, this image should support all architectures supported by httpd.

docker manifest inspect --verbose httpd:latest

❯ docker manifest inspect --verbose httpd:latest
[
        {
                "Ref": "docker.io/library/httpd:latest@sha256:7280c780e026f3073f2570cbf3cbe044dacd9bd90c7094f1c6e0e687444c9cec",
                "Descriptor": {
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "digest": "sha256:7280c780e026f3073f2570cbf3cbe044dacd9bd90c7094f1c6e0e687444c9cec",
                        "size": 1365,
                        "platform": {
                                "architecture": "amd64",
                                "os": "linux"
                        }
                },
                "SchemaV2Manifest": {
                        "schemaVersion": 2,
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "config": {
                                "mediaType": "application/vnd.docker.container.image.v1+json",
                                "size": 9043,
                                "digest": "sha256:a8ea074f4566addcd01f9745397f32be471df4a4abf200f0f10c885ed14b1d28"
                        },
                        "layers": [
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 31366257,
                                        "digest": "sha256:5eb5b503b37671af16371272f9c5313a3e82f1d0756e14506704489ad9900803"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 178,
                                        "digest": "sha256:a43a76ccc96739928c7e884f2210dde01ae5b1fd8822f8cdd56e6ba64ec3125a"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 915365,
                                        "digest": "sha256:942bd346e7f719d26e022dfc42eea7e1fa5cf9ad60ec80ed0ef79ded05288be6"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 24127846,
                                        "digest": "sha256:cdb155854ae6a9e25834459a7c9dfc7be157a2ebfca5adbdb036aeea43ce3128"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 297,
                                        "digest": "sha256:10c4d45228bf56285a1e2c828d60e34d8413ee80e1abd738ef190be843d9dc1e"
                                }
                        ]
                }
        },
        {
                "Ref": "docker.io/library/httpd:latest@sha256:038cb9bcb719a82d392550589d2fc9020c9730ef6063ffec2bbdd84be0865c57",
                "Descriptor": {
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "digest": "sha256:038cb9bcb719a82d392550589d2fc9020c9730ef6063ffec2bbdd84be0865c57",
                        "size": 1365,
                        "platform": {
                                "architecture": "arm",
                                "os": "linux",
                                "variant": "v5"
                        }
                },
                "SchemaV2Manifest": {
                        "schemaVersion": 2,
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "config": {
                                "mediaType": "application/vnd.docker.container.image.v1+json",
                                "size": 9054,
                                "digest": "sha256:61dcf3a36223f83e02842ec7859a119e8221e73b6a5ad2eb74ded103b6bae2ec"
                        },
                        "layers": [
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 28909638,
                                        "digest": "sha256:247ff78919074ec9db7cccd537dd6eb4d7e2788013b7ef07443e345d91c8a588"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 177,
                                        "digest": "sha256:a6ce3297dd515ef5b1624ae57f5cc57e006ab0058e71c5d73a2743eb3d0dc688"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 839545,
                                        "digest": "sha256:934eaa550a6b6773526091299e785250ea63c526131b4a86f3db8efddda745d4"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 23364445,
                                        "digest": "sha256:8d0259654bf51bb37433a1c5b408aed770c86a8e83c22045c6e1385b70252f2c"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 299,
                                        "digest": "sha256:79f99211e41befa5f09accb40d40d2691faa5d636b125eb9a0d52ab6d422b7af"
                                }
                        ]
                }
        },
        {
                "Ref": "docker.io/library/httpd:latest@sha256:777ddebefaf12dc606c2ec12b518b4f111e3817abd7976290ca4bbeca52745d7",
                "Descriptor": {
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "digest": "sha256:777ddebefaf12dc606c2ec12b518b4f111e3817abd7976290ca4bbeca52745d7",
                        "size": 1365,
                        "platform": {
                                "architecture": "arm",
                                "os": "linux",
                                "variant": "v7"
                        }
                },
                "SchemaV2Manifest": {
                        "schemaVersion": 2,
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "config": {
                                "mediaType": "application/vnd.docker.container.image.v1+json",
                                "size": 9056,
                                "digest": "sha256:d9d8a725c2f36871d894fe6f065d2a2bca3f304308e15099648adbc8ba251239"
                        },
                        "layers": [
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 26564933,
                                        "digest": "sha256:aaef1f1162ec03e01b5b955d41da400544ec2374093ae3dbc330ab2bb36df3e1"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 178,
                                        "digest": "sha256:8d8fcbe065d889c6c6af04106170507e4664521c4b6762fa5b8b64c67e696684"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 786511,
                                        "digest": "sha256:8fae2b81f24945fcabdcd47f4e53f0f74a2db1224b5ab8c64ecb9e6b0687942b"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 22965512,
                                        "digest": "sha256:386cd1037b439ca9d96f0e3f30377a58b4a469ff654a7ec6d1dc29beb2c93cd2"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 300,
                                        "digest": "sha256:52f90c55897748abfb0b827c6925b1595d798c1198d01545825e0b2ca220b8ef"
                                }
                        ]
                }
        },
        {
                "Ref": "docker.io/library/httpd:latest@sha256:d7ad4d74d22d3cca7919ea474af57ada24155c365e32e8c778e9d9b02aefd6f9",
                "Descriptor": {
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "digest": "sha256:d7ad4d74d22d3cca7919ea474af57ada24155c365e32e8c778e9d9b02aefd6f9",
                        "size": 1365,
                        "platform": {
                                "architecture": "arm64",
                                "os": "linux",
                                "variant": "v8"
                        }
                },
                "SchemaV2Manifest": {
                        "schemaVersion": 2,
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "config": {
                                "mediaType": "application/vnd.docker.container.image.v1+json",
                                "size": 9058,
                                "digest": "sha256:b03352b171b7bb0f8d2691bc28ab9a18f4285c870832deb5e1242d11e166385d"
                        },
                        "layers": [
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 30056774,
                                        "digest": "sha256:8998bd30e6a1204d13403045766edbe14f941b52087465f5d140ab63c8b113bf"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 146,
                                        "digest": "sha256:3cc735bb8fe091f9f0510b3c997626fa9780a269c8bb1225750a4c3f75754a33"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 705441,
                                        "digest": "sha256:672cbef436b355401b113da1020802660b6eee1f2a0b3996e315859521bd4e91"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 24053137,
                                        "digest": "sha256:c4f7a252eb36464c0c468e6fd911f355fd786170e226b9ad6c2ca62e160293cd"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 297,
                                        "digest": "sha256:a5de1d7c1247e76cf0337e879450b394b37a0037f7b53f1228c4806eb6c4d35a"
                                }
                        ]
                }
        },
        {
                "Ref": "docker.io/library/httpd:latest@sha256:ac5c0f32204904a23598a5dcead0441e4e4695ac97f9b2a9a6ef225f2d09ab95",
                "Descriptor": {
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "digest": "sha256:ac5c0f32204904a23598a5dcead0441e4e4695ac97f9b2a9a6ef225f2d09ab95",
                        "size": 1365,
                        "platform": {
                                "architecture": "386",
                                "os": "linux"
                        }
                },
                "SchemaV2Manifest": {
                        "schemaVersion": 2,
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "config": {
                                "mediaType": "application/vnd.docker.container.image.v1+json",
                                "size": 9040,
                                "digest": "sha256:c463a1e55e1e26febad186647d97ad0612f19262c9ce5f1ddcba5c61f9137efb"
                        },
                        "layers": [
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 32377406,
                                        "digest": "sha256:86933886b1754aba091548cf031a9bca88cdce9bb4fc1f28bb38b61594c2c2c7"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 176,
                                        "digest": "sha256:eb542d79199ffc18df0ce4e72ebc0f4e91b690e8d756ccf5a1f659e2df40c231"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 966747,
                                        "digest": "sha256:8eb48a9dd2530a576a47d4595fcc2b6756e6d829a791050d3b61c8541857c05f"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 23976432,
                                        "digest": "sha256:e6c738e7475365de8bfc82a81cf0698154678ebf0a78a479a8a0c56cf4077c3c"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 298,
                                        "digest": "sha256:78ca1faceda08350bc7b74595545c7211b961215e4e3f68fb661f238e5b6f5a4"
                                }
                        ]
                }
        },
        {
                "Ref": "docker.io/library/httpd:latest@sha256:54538666c080d5c3dda0c176beadeafe23e535f05ce5535da15f4299438b8729",
                "Descriptor": {
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "digest": "sha256:54538666c080d5c3dda0c176beadeafe23e535f05ce5535da15f4299438b8729",
                        "size": 1365,
                        "platform": {
                                "architecture": "mips64le",
                                "os": "linux"
                        }
                },
                "SchemaV2Manifest": {
                        "schemaVersion": 2,
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "config": {
                                "mediaType": "application/vnd.docker.container.image.v1+json",
                                "size": 9043,
                                "digest": "sha256:df77be0fda5b24ba7d0dff7e48434ba3c72a15318650ca7fef3ea0c92a18d056"
                        },
                        "layers": [
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 29632834,
                                        "digest": "sha256:266e7d2b59483859eaa1711d2afeb25ea4458eeb36b3e909372930db1f834d7f"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 147,
                                        "digest": "sha256:88640c6db5b9cdfe639046a9bd5b75f92dbdff5edfccae0f309e5a0de9dcab11"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 887359,
                                        "digest": "sha256:4b4aa235d267e9ef28f357b242afb2a7ee9ed99336db78b65e49e50bf83953c6"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 24205619,
                                        "digest": "sha256:8a2341a594919d5869d31ee38905ec851060f95bd589af29bdee3488e2c13164"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 299,
                                        "digest": "sha256:aca126b607ebcf225fd5641b7f1dbef5efd8a17635f3135e4e98041c90d30f1b"
                                }
                        ]
                }
        },
        {
                "Ref": "docker.io/library/httpd:latest@sha256:b1c556b9add1f213e0e4b59308bc44fc082bb5b45545de1bbf4c01eadb38eee2",
                "Descriptor": {
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "digest": "sha256:b1c556b9add1f213e0e4b59308bc44fc082bb5b45545de1bbf4c01eadb38eee2",
                        "size": 1366,
                        "platform": {
                                "architecture": "ppc64le",
                                "os": "linux"
                        }
                },
                "SchemaV2Manifest": {
                        "schemaVersion": 2,
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "config": {
                                "mediaType": "application/vnd.docker.container.image.v1+json",
                                "size": 9042,
                                "digest": "sha256:fea3ef00c241f6e4c75a08ec4819d502e403ba52f53b092cc657c0fc09f49202"
                        },
                        "layers": [
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 35273030,
                                        "digest": "sha256:3149ee4a73508a4c39107d64a3fdc1b021626a22a0ac95e62fa0cea49ab77fba"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 178,
                                        "digest": "sha256:318d5e59d9fc6d6908ffb00a9a60a75d409ea9ab34b67cafe9c4a9002d489995"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 1026519,
                                        "digest": "sha256:ba62b49283161c3e94501d6f4c4cf14a206d0b8fe83fce3fca2b24baa79a2cc5"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 25213119,
                                        "digest": "sha256:18302813a3ccbd487e00445ad9790b178faaf7a9dd5a06025db8f68bc9a88e55"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 297,
                                        "digest": "sha256:623ab7dd7242bf62016728bfe722e1d62dffa596b7484e770e57431c91232d64"
                                }
                        ]
                }
        },
        {
                "Ref": "docker.io/library/httpd:latest@sha256:e4329ee45464eadb8f68116b976c96975bcd77cfb89e78a93d3cbbf5498ab79f",
                "Descriptor": {
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "digest": "sha256:e4329ee45464eadb8f68116b976c96975bcd77cfb89e78a93d3cbbf5498ab79f",
                        "size": 1365,
                        "platform": {
                                "architecture": "s390x",
                                "os": "linux"
                        }
                },
                "SchemaV2Manifest": {
                        "schemaVersion": 2,
                        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                        "config": {
                                "mediaType": "application/vnd.docker.container.image.v1+json",
                                "size": 9040,
                                "digest": "sha256:89787f806bb8331e16e9bb3bf620b008da77edcf0d84150ade31d872dbfcd86e"
                        },
                        "layers": [
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 29647071,
                                        "digest": "sha256:70bed29526f8483937e4d2540d19256d30786007c7c321e717e00d2e74700380"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 177,
                                        "digest": "sha256:97b59618d57a5e7552c0c69288e91c4b28aa747949bc2dd5c0559bb6b1c56880"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 910496,
                                        "digest": "sha256:c4050eda4086487621abf055816399d0db2bd5ece2ba50ecdad560587495e920"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 24033121,
                                        "digest": "sha256:9e3ec95729d9d0e59ef69de132254795c31e88b60b9d97a63238bd1ae2d08240"
                                },
                                {
                                        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                        "size": 299,
                                        "digest": "sha256:fde80fa497e397c91fb8ce1ff3007deb1335d83674ac5c167fb2ee88bcc3abb8"
                                }
                        ]
                }
        }
]

Does it support Symbolic Links

Good day! Thank you for your container webdav-server, it set ups very easy. I was wondering if it has support of symbolic links. I found "Options Indexes FollowSymLinks" in "dav.conf", but i cannot see symbolic link through my webdav-client or browser, though I do have them in my filesystem.

Share multiple folders?

Is anyone able to tell how to add multiple folder paths to the WebDAV landing page?

Thanks
Stefan

413 - request too large

When I try to upload a 200MB file, I get this response.
Would be nice, if we could get an environment variable to set our desired maximum file size.

Edit: now after avoiding my nginx reverse proxy, I was able to upload bigger files, so maybe I messed it up with the nginx setup :D so I think this works already and is not needed anymore

Unable to delete via client

I can start the container, and in the container the default user has access to write and delete to the location exposed to web dav. I assume that means that the container has the permissions it requires?

But when I connect with a client, either windows mapped drive, or ios, they can both read the contents of the webdav folder, but any type of delete will gather a 403 error.

I've tried playing with the dav.conf to add limit, and limitexcept, but no joy.

The error in the docker log is as follows:

192.168.10.211 - - [07/Jan/2019:22:10:50 +0000] "DELETE /MyPDF.pdf HTTP/1.1" 401 381 "-" "Microsoft-WebDAV-MiniRedir/6.1.7601"

[Mon Jan 07 22:10:50.672112 2019] [dav:error] [pid 11:tid 1989401928] [client 192.168.10.211:54185] Could not DELETE /MyPDF.pdf.  [403, #0]

Docker Compose as follows:

webdav:
    container_name: webdav
    hostname: webdav
    environment:
      - TZ=Pacific/Auckland
      - AUTH_TYPE=Digest
      - USERNAME=user
      - PASSWORD=password
    image: bytemark/webdav
    ports:
      - "8085:80"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - /media/pdfs:/var/lib/dav/data

httpd: Syntax error on line 159 of /usr/local/apache2/conf/httpd.conf: Cannot load modules/mod_ssl.so into server: Error relocating /usr/local/apache2/modules/mod_ssl.so: SSL_CTX_set_post_handshake_auth: symbol not found

I receive following error with following compose file.

httpd: Syntax error on line 159 of /usr/local/apache2/conf/httpd.conf: Cannot load modules/mod_ssl.so into server: Error relocating /usr/local/apache2/modules/mod_ssl.so: SSL_CTX_set_post_handshake_auth: symbol not found

docker file that generated this error... is as follows. I have tried to use my self signed sertificate by mounting /cert.pem and /privkey.pem I received the same error.

version: '3'
services:
webdav:
image: bytemark/webdav
restart: always
ports:
- "8080:80"
environment:
AUTH_TYPE: Basic
SSL_CERT: selfsigned
SERVER_NAMES: xxx.yyy.com
volumes:
- /storage/pool/webdav:/var/lib/dav
- /storage/pool/dockdder/auth/user.passwd:/user.passwd

Starting the container changes folders owners

Hi,
When I start this docker container the owner of the folders shared using volumes in my Ubuntu server changes to 82:82. Is this a wanted behavior?

I am using this docker-compose.yml :

mediabox-webdav:
    image: bytemark/webdav
    container_name: mediabox-webdav
    environment:
      - USERNAME=${WEBDAV_USERNAME}
      - PASSWORD=${WEBDAV_PASSWORD}
    volumes:
      - /mediabox:/var/lib/dav/data/mediabox
      - /downloads:/var/lib/dav/data/downloads
    restart: unless-stopped

The owner of both /mediabox and /downloads becomes 82:82,is there a way to avoid this and keep the original owner?

Unable to delete locked file

Hi,
I try to delete locked file with actual lock token and receive:
Status code: 424, description: Failed Dependency

server log:
172.17.0.1 - - [21/Apr/2020:13:05:34 +0000] "LOCK /logs/hello3.txt HTTP/1.1" 401 381 "-" "NAX/1.0"
172.17.0.1 - alice [21/Apr/2020:13:05:34 +0000] "LOCK /logs/hello3.txt HTTP/1.1" 200 372 "-" "NAX/1.0"
172.17.0.1 - - [21/Apr/2020:13:05:34 +0000] "DELETE /logs/hello3.txt HTTP/1.1" 401 381 "-" "NAX/1.0"
172.17.0.1 - alice [21/Apr/2020:13:05:34 +0000] "DELETE /logs/hello3.txt HTTP/1.1" 424 572 "-" "NAX/1.0"
[Tue Apr 21 13:05:34.575278 2020] [dav:error] [pid 11:tid 139649092442856] [client 172.17.0.1:36712] Could not DELETE /logs/hello3.txt due to a failed precondition (e.g. locks). [424, #0]
[Tue Apr 21 13:05:34.575327 2020] [dav:error] [pid 11:tid 139649092442856] [client 172.17.0.1:36712] An error occurred on another resource, preventing the requested operation on this resource. [424, #0]

Same operation works done with another WebDav server (IIS WebDAV). Server works within docker with default settings.

webdav fails after docker build

I am looking for a hint how to fix the below ...

I cloned the latest bits.
I build the Dockerfile: docker build -t my-webdav .
and run it using docker-compose.yml
I left the config files as is & set USERNAME, PASSWORD and AUTH_TYPE in my docker-compose.yml

I can mount the webdav share ok and see the files & folders that I put on the filesystem for test.
I can not create files or folders. When I try that I get the errors below.

[Wed Feb 13 20:27:42.239529 2019] [dav_fs:crit] [pid 14:tid 140442075208464] (20019)DSO load failed: AH00576: The DBM driver could not be loaded
[Wed Feb 13 20:27:42.239560 2019] [dav:error] [pid 14:tid 140442075208464] [client 192.168.2.70:40760] The locks could not be queried for verification against a possible "If:" header. [500, #0]
[Wed Feb 13 20:27:42.239568 2019] [dav:error] [pid 14:tid 140442075208464] [client 192.168.2.70:40760] Could not open the lock database. [500, #400]
[Wed Feb 13 20:27:42.239571 2019] [dav:error] [pid 14:tid 140442075208464] (20019)DSO load failed: [client 192.168.2.70:40760] Could not open property database. [500, #1]
192.168.2.70 - henri [13/Feb/2019:20:27:42 +0000] "MKCOL /test/ HTTP/1.1" 500 528 "-" "davfs2/1.5.4 neon/0.30.2"

Notes: on the webdav-share:/var/lib/dav I see

  • data folder
  • DavLock
    Not created are these (I found these on the working machine using bytemark/webdav image):
  • DavLock.dir
  • DavLock.pag

PS: The prebuild bytemark/webdav image works fine on my machine but I want to modify it a bit.

What about supporting a READ_ONLY mode

Hi,
thanks for this "generic" container. I wanted to expose a read only directory via web-dav but fail whewn it comes to the line: chown -R www-data:www-data "/var/lib/dav" in the docker-entrypoint.sh. Not sure if there are other pitfalls for this "mode"?

Kind regards, Andreas.

httpd log level not working

Deployed on my unraid host.

Step by step:

  1. Open Apache configuration file
vi /usr/local/apache2/conf/httpd.conf
  1. Change LogLevel config like this:
LogLevel alert
  1. Save&quit vi, restart docker container.

It's not woking!

image

乱码问题

您好,现在部署后出现乱码,发现是没有申明utf8导致的,请问在哪里修改?

Can it support load balancing?

Can it support load balancing? For example, I hava two servers which use the same disk, and then I use docker start webdav service on each server, when I lock a.txt file on a server, can server b know the lock information of a.txt?

SSL selfsigned httpd: Syntax error

There is an error during the creation of the container when using SSL.
I'm using docker-compose to start the container, this is my docker-compose.yml file:

version: '3'
services:
webdav:
image: bytemark/webdav
ports:
- "443:443"
environment:
- SSL_CERT=selfsigned
volumes:
- ./dav:/var/lib/dav
- ./user.passwd:/user.passwd

and this is the docker-compose up log:

webdav_1 | Generating a RSA private key
webdav_1 | ............................+++++
webdav_1 | .....................................................................................................+++++
webdav_1 | writing new private key to '/privkey.pem'
webdav_1 | -----
webdav_1 | httpd: Syntax error on line 159 of /usr/local/apache2/conf/httpd.conf: Cannot load modules/mod_ssl.so into server: Error relocating /usr/local/apache2/modules/mod_ssl.so: SSL_CTX_set_post_handshake_auth: symbol not found
webdav_1 exited with code 1

Question, hosting files along with webdav

I would like to host a site on the same domain as webdav. It appears your configuration supports this. I don't mind that the html files are public. Is this as simple as aliasing the webdav path and allowing html? Here is my failed attempt, I get access denied for the public www directory. A simple tip or example would go a long ways, this is very difficult for me to debug on the Apache side. Thank you!

--- a/2.4/conf/conf-available/dav.conf
+++ b/2.4/conf/conf-available/dav.conf
@@ -1,5 +1,5 @@
 DavLockDB "/var/lib/dav/DavLock"
-Alias / "/var/lib/dav/data/"
+Alias /data "/var/lib/dav/data/"
 <Directory "/var/lib/dav/data/">
   Dav On
   Options Indexes FollowSymLinks
diff --git a/2.4/conf/sites-available/default.conf b/2.4/conf/sites-available/default.conf
index e309338..d39bb1e 100644
--- a/2.4/conf/sites-available/default.conf
+++ b/2.4/conf/sites-available/default.conf
@@ -1,9 +1,13 @@
 <VirtualHost *:80>
   ServerName localhost
   DocumentRoot "/var/www/html/"
-  <Directory "/var/www/html/">
-    Require all denied
-  </Directory>
+
+  Alias /site "/var/www/html"
+  # <Directory "/var/www/html/">
+  #   Require all denied
+  # </Directory>
+

Exposing an existing directory

I want to allow access to an existing directory using webdav, but when I specify the path to that directory as the volume, webdav creates a new data directory in there, and that's where a webdav client can add/edit files. Is it possible to give webdav access to the directory that I specify so that clients can edit files that are already in there?

Add User-Agent match for Windows 10 client

As fixed in #11, the Windows 10 client has problems with 301 redirects issued by the Apache server. This is what happens:

  • Windows requests PROPFIND /Foldername without the trailing slash after /Foldername
  • Apache returns a 301 response to /Foldername/, which causes various errors in Windows, like not being able to create folders. In short: Windows can't deal with 301 redirects in WebDAV properly.

By adding an entry to the BrowserMatch list for ^Microsoft-WebDAV-MiniRedir (the Windows 10 WebDAV client), the problem is resolved with redirect-carefully. Please consider merging PR #11 to resolve this issue for Windows 10 users.

how to authorize multiple user to different folder?

Hi, my scenario is I have several users, and I expect each user own his own folder, something like this:
/data/user1 --- can only read & write by user1
/data/user2 --- can only read & write by user2

is this possible?
thanks~

Explain config

Hello,

I try to config a webdev server with docker.
My docker-compose.yml

`
version: '3.1'

services:
webdav:
image: bytemark/webdav
restart: always
ports:
- "8080:80"
environment:
AUTH_TYPE: Digest
USERNAME: "famille"
PASSWORD: "xxxxxxx"
volumes:
- /data/docker/transmission/downloads:/var/lib/dav
restart: 'always'
networks:
pt_internal:
`

My /data/docker/transmission/downloads
drwxr-xr-x 2 82 82 4096 mai 14 19:03 complete/ drwxr-xr-x 2 82 82 4096 mai 17 02:51 data/ -rw-r--r-- 1 82 82 0 mai 17 02:51 DavLock drwxr-xr-x 3 82 82 4096 mai 16 02:43 incomplete/ -rw-r--r-- 1 82 82 0 mai 17 02:34 index.htm -rw-r--r-- 1 82 82 0 mai 17 02:53 test.txt drwxr-xr-x 2 82 82 4096 mai 11 04:35 torrents/

When I browse my site I have:
Index of/

and nothing.
Can you explain me where is my error please

Dangerous setup command

Host system file permissions easily can be destroyed when system folder mapped to webdav.
This line is dangerous: chown -R www-data:www-data "/var/lib/dav"

Support CORS

How can I easily set Access-Control-Allow-Origin header in Apache webdav config?
Maybe we can have SUPPORT_CORS boolean environment and add (Access-Control-Allow-Origin: *) rule to the response header.
And OPTIONS request needs to be not Authenticated - it is for initial CORS preflight request and if its need Authentication for OPTIONS the error will be:

Access to XMLHttpRequest at 'http://localhost:9988/' from origin 'http://localhost:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

The reson for this is HTTP 401 status from preflight request

curl -XOPTIONS -H "Access-Control-Request-Method: GET" -H "Origin: http://localhost:8000" --head http://localhost:9988/webdav/server
HTTP/1.1 401 Unauthorized
Date: Wed, 06 Jul 2022 15:03:32 GMT
Server: Apache/2.4.37 (Unix)
Access-Control-Allow-Origin: http://localhost:8000
Access-Control-Allow-Methods: GET, HEAD, POST, PUT, OPTIONS, MOVE, DELETE, COPY, LOCK, UNLOCK, PROPFIND
Access-Control-Allow-Headers: origin, content-type, cache-control, accept, authorization, if-match, destination, overwrite
WWW-Authenticate: Basic realm="WebDAV"
Content-Length: 381
Content-Type: text/html; charset=iso-8859-1

ldap

is there a way to get LDAP support?

Using Nginx

I want to use this container behind an Nginx server but I am not able to configure Nginx properly.

I have the following server block in Nginx:

      server {
            server_name mydomain.com;

            location /calendar {
            #   proxy_set_header   Host  -; # maybe set host header somehow?
               proxy_pass http://127.0.0.1:90/;
            }



    listen 443 ssl; # managed by Certbot
    ssl_certificate ...
    ssl_certificate_key ...
    include ...
    ssl_dhparam ...

}

and I adapted the docker-compose.yml file in the following way:

version: '3'
services:
  webdav:
    image: bytemark/webdav
    restart: always
    ports:
      - "127.0.0.1:90:80"
    environment:
      AUTH_TYPE: Digest
      USERNAME: alice
      PASSWORD: secret1234
    volumes:
      - data:/var/lib/dav
volumes:
  data:

When I make a request to https://mydomain.com/calendar I always get following error:

webdav_1 | [Thu Jul 08 18:53:16.605133 2021] [auth_digest:error] [pid 38:tid 139699229092584] [client 192.168.176.1:38338] AH01786: uri mismatch - </calendar> does not match request-uri </>, referer: http://mydomain.com/calendar
I suppose it has something to do with the host header bc. Apache seems to get the uri /calendar from it.

Having the davlock file under the mapped volume can be problematic.

Apache requires that the davlock file is writable by the user and group of the httpd process. In my case, the volume maps to a samba share which gave it a different UID. This caused a cryptic error on startup.

My workaround was to map the /var/lib/dav/data directory instead, which is not what the docs specified. It might be useful to have the docs explain this subtlety.

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.