From dcd8eddeb2530b8e02fc786edfd73bccd01925a8 Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Fri, 20 Mar 2020 17:47:18 +0100 Subject: [PATCH] updated to webfused 0.2.0 --- Dockerfile | 14 +++++++++++--- README.md | 5 +++-- webfused.conf | 21 +++++++++++++++++++++ 3 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 webfused.conf diff --git a/Dockerfile b/Dockerfile index 96af5dd..dce2c25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,9 @@ RUN set -x \ openssl \ libssl-dev \ uuid-dev \ - wget + wget \ + libconfig-dev \ + libpam0g-dev COPY www /var/www @@ -106,7 +108,7 @@ RUN set -x \ && make "$PARALLELMFLAGS" install \ && rm -rf "$builddir" -ARG WEBFUSED_VERSION=0.1.0 +ARG WEBFUSED_VERSION=0.2.0 RUN set -x \ && builddir="/tmp/out" \ && mkdir -p "$builddir" \ @@ -116,10 +118,16 @@ RUN set -x \ && cd "webfused-$WEBFUSED_VERSION" \ && mkdir .build \ && cd .build \ - && cmake ".." \ + && cmake -DWITHOUT_TESTS=ON ".." \ && make "$PARALLELMFLAGS" install \ && rm -rf "$builddir" +COPY webfused.conf /etc + +ARG USERID=1000 +RUN set -x \ + && useradd -u "$USERID" -ms /bin/bash user + EXPOSE 8080 ENTRYPOINT ["dumb-init", "--"] \ No newline at end of file diff --git a/README.md b/README.md index a114ed3..cd1ce30 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,13 @@ Example of webfuse. docker run -p 8080:8080 --rm -it \ --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined \ + --user `id -u` \ webfuse bash - webfused -m /tmp -d /var/www -p 8080 + webfused -f /etc/webfused.conf Open a webbrowser and visit http://localhost:8080 and follow the instruction on the screen. Then open another terminal and connect to the container. docker exec -it bash - cat /tmp/test/default/hello.txt + cat /tmp/test/hello.txt diff --git a/webfused.conf b/webfused.conf new file mode 100644 index 0000000..906fd72 --- /dev/null +++ b/webfused.conf @@ -0,0 +1,21 @@ +# Webfuse deamon configuration file + +version = { major = 1, minor = 0 } + +server: +{ + vhost_name = "localhost" + port = 8080 + document_root = "/var/www" +} + +filesystems: +( + {name = "test", mount_point = "/tmp/test" } +) + +log: +{ + provider: "stderr" + level: "all" +}