Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: Trying to get webdav working #23

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FROM arm64v8/alpine:3.13 AS runner

RUN apk update
RUN apk add --no-cache tini
RUN apk add --no-cache lighttpd
RUN apk add --no-cache lighttpd lighttpd-mod_webdav lighttpd-mod_auth
RUN apk add --no-cache coreutils
RUN apk add --no-cache curl
COPY --from=builder /root/filebrowser/filebrowser /usr/local/bin/filebrowser
Expand Down
5 changes: 5 additions & 0 deletions docker_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ if [ "$1" = "reset-root-user" ]; then
exit 0
fi

rm /root/passwd.dav || true
htpasswd -cb /root/passwd.dav test test
chmod 640 /root/passwd.dav
mkdir /root/webdav

health-check.sh &

lighttpd -f /etc/lighttpd/httpd.conf
Expand Down
2 changes: 1 addition & 1 deletion filebrowser
Submodule filebrowser updated 135 files
34 changes: 26 additions & 8 deletions httpd.conf
Original file line number Diff line number Diff line change
@@ -1,39 +1,57 @@
server.modules = (
"mod_auth",
"mod_authn_file",
"mod_proxy",
"mod_setenv",
"mod_accesslog",
"mod_evasive",
"mod_openssl",
"mod_webdav",
)

accesslog.filename = "/var/log/lighttpd/access.log"

server.errorlog-use-syslog = "enable"
server.port = 80
server.document-root = "/root/www"
server.stream-request-body = 2
server.stream-response-body = 2
ssl.read-ahead = "disable"


$HTTP["url"] =~ "^/api" {
setenv.add-response-header = (
"Cache-Control" => "no-store"
)
} else {
setenv.add-response-header = (
"X-Consulate-App-ID" => "filebrowser",
"X-Consulate-App-Version" => "2.14.1.1"
"X-Consulate-App-Version" => "2.21.1"
)
}
$HTTP["url"] =~ "^/api/login" {
server.kbytes-per-second = 1
evasive.max-conns-per-ip = 1
}

proxy.server = (
"" => (
"80" => (
"host" => "127.0.0.1",
"port" => 8080

$HTTP["url"] =~ "^/webdav($|/)" {
server.document-root = "/root/webdav/"
webdav.activate = "enable"
webdav.is-readonly = "disable"
dir-listing.activate = "enable"
webdav.sqlite-db-name = "/root/lighttpd.webdav_lock.db"
#auth.backend = "htpasswd"
#auth.backend.htpasswd.userfile = "/root/passwd.dav"
#auth.require = ( "" => ( "method" => "basic",
# "realm" => "webdav",
# "require" => "valid-user" ) )
} else {
proxy.server = (
"" => (
"80" => (
"host" => "127.0.0.1",
"port" => 8080
)
)
)
)
}
32 changes: 25 additions & 7 deletions httpd.conf.template
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
server.modules = (
"mod_auth",
"mod_authn_file",
"mod_proxy",
"mod_setenv",
"mod_accesslog",
"mod_evasive",
"mod_openssl",
"mod_webdav",
)

accesslog.filename = "/var/log/lighttpd/access.log"

server.errorlog-use-syslog = "enable"
server.port = 80
server.document-root = "/root/www"
server.stream-request-body = 2
server.stream-response-body = 2
ssl.read-ahead = "disable"


$HTTP["url"] =~ "^/api" {
setenv.add-response-header = (
"Cache-Control" => "no-store"
Expand All @@ -29,11 +33,25 @@ $HTTP["url"] =~ "^/api/login" {
evasive.max-conns-per-ip = 1
}

proxy.server = (
"" => (
"80" => (
"host" => "127.0.0.1",
"port" => 8080

$HTTP["url"] =~ "^/webdav($|/)" {
server.document-root = "/root/webdav/"
webdav.activate = "enable"
webdav.is-readonly = "disable"
dir-listing.activate = "enable"
webdav.sqlite-db-name = "/root/lighttpd.webdav_lock.db"
#auth.backend = "htpasswd"
#auth.backend.htpasswd.userfile = "/root/passwd.dav"
#auth.require = ( "" => ( "method" => "basic",
# "realm" => "webdav",
# "require" => "valid-user" ) )
} else {
proxy.server = (
"" => (
"80" => (
"host" => "127.0.0.1",
"port" => 8080
)
)
)
)
}