Spaces:
Running
Running
Upload 2 files
Browse files- Dockerfile +11 -0
- start.mjs +20 -0
Dockerfile
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM node:20-alpine
|
2 |
+
|
3 |
+
WORKDIR /app
|
4 |
+
|
5 |
+
RUN npm install @filen/webdav@latest
|
6 |
+
|
7 |
+
COPY . .
|
8 |
+
|
9 |
+
EXPOSE 1900
|
10 |
+
|
11 |
+
CMD ["node", "start.mjs"]
|
start.mjs
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Proxy mode, multi user
|
2 |
+
|
3 |
+
import { WebDAVServer } from "@filen/webdav"
|
4 |
+
|
5 |
+
const hostname = "0.0.0.0"
|
6 |
+
const port = 1900
|
7 |
+
const https = false
|
8 |
+
const server = new WebDAVServer({
|
9 |
+
hostname,
|
10 |
+
port,
|
11 |
+
https,
|
12 |
+
// Omit the user object
|
13 |
+
authMode: "basic" // Only basic auth is supported in proxy mode
|
14 |
+
})
|
15 |
+
|
16 |
+
await server.start()
|
17 |
+
|
18 |
+
console.log(
|
19 |
+
`WebDAV server started on ${https ? "https" : "http"}://${hostname === "127.0.0.1" ? "local.webdav.filen.io" : hostname}:${port}`
|
20 |
+
)
|