Skip to content

Commit 41ecb13

Browse files
committed
refactor(server): migrate from bytemark/webdav to hacdias/webdav
- Replace unmaintained bytemark/webdav (Apache-based) with actively maintained ghcr.io/hacdias/webdav (lightweight Go binary) - Credentials now in config.yml (gitignored) instead of .env - Add config.yml.example as setup template - Fix WEBDAV_PORT env var not being used (incorporates fix from #67) - Set debug: false and clean CORS config for production use - Update READMEs (DE + EN) with new setup instructions - Keep notes-data/ volume path for backward compatibility - Was production tested on long-term by me Supersedes #67
1 parent f2d6f5d commit 41ecb13

6 files changed

Lines changed: 103 additions & 36 deletions

File tree

server/.env.example

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
# WebDAV Credentials
2-
WEBDAV_USERNAME=noteuser
3-
WEBDAV_PASSWORD=your_secure_password_here
4-
5-
# Optional: Custom port
1+
# Optional: Custom port (default: 8080)
62
# WEBDAV_PORT=8080

server/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Environment
22
.env
33

4+
# Config (contains credentials — copy from config.yml.example)
5+
config.yml
6+
47
# Data
58
notes-data/
69
logs/

server/README.en.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
**🌍 Languages:** [Deutsch](README.md) · **English**
44

5+
> Based on [hacdias/webdav](https://github.com/hacdias/webdav) — a lightweight, actively maintained WebDAV server.
6+
57
---
68

79
## Quick Start
810

911
```bash
10-
# 1. Adjust environment variables
11-
cp .env.example .env
12-
nano .env
12+
# 1. Create config and set credentials
13+
cp config.yml.example config.yml
14+
nano config.yml
1315

1416
# 2. Start server
1517
docker-compose up -d
@@ -34,9 +36,20 @@ ip addr show | grep "inet " | grep -v 127.0.0.1
3436

3537
## Credentials
3638

37-
Default (see `.env`):
38-
- Username: `noteuser`
39-
- Password: See `.env` file
39+
Credentials are set in `config.yml` (not committed to git):
40+
```yaml
41+
users:
42+
- username: noteuser
43+
password: your_secure_password
44+
```
45+
46+
## Custom Port (optional)
47+
48+
Default port is `8080`. To change it:
49+
```bash
50+
cp .env.example .env
51+
# Set WEBDAV_PORT in .env
52+
```
4053

4154
## Management
4255

@@ -53,19 +66,18 @@ docker-compose restart
5366
# Stop
5467
docker-compose down
5568
56-
# Update
57-
docker-compose pull
58-
docker-compose up -d
69+
# Update image
70+
docker-compose pull && docker-compose up -d
5971
```
6072

6173
## Data Location
6274

63-
Your notes are stored in: `./data/`
75+
Your notes are stored in: `./notes-data/`
6476

6577
**Backup:**
6678
```bash
6779
# Create backup
68-
tar -czf notes-backup-$(date +%Y%m%d).tar.gz data/
80+
tar -czf notes-backup-$(date +%Y%m%d).tar.gz notes-data/
6981
7082
# Restore backup
7183
tar -xzf notes-backup-YYYYMMDD.tar.gz

server/README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
**🌍 Sprachen:** **Deutsch** · [English](README.en.md)
44

5+
> Basiert auf [hacdias/webdav](https://github.com/hacdias/webdav) — leichtgewichtiger, aktiv gewarteter WebDAV-Server.
6+
57
---
68

79
## Quick Start
810

911
```bash
10-
# 1. Umgebungsvariablen anpassen
11-
cp .env.example .env
12-
nano .env
12+
# 1. Konfiguration anlegen und Zugangsdaten setzen
13+
cp config.yml.example config.yml
14+
nano config.yml
1315

1416
# 2. Server starten
1517
docker-compose up -d
@@ -34,9 +36,20 @@ ip addr show | grep "inet " | grep -v 127.0.0.1
3436

3537
## Credentials
3638

37-
Standard (siehe `.env`):
38-
- Username: `noteuser`
39-
- Password: Siehe `.env` Datei
39+
Zugangsdaten werden in `config.yml` gesetzt (wird nicht ins Git eingecheckt):
40+
```yaml
41+
users:
42+
- username: noteuser
43+
password: dein_sicheres_passwort
44+
```
45+
46+
## Port anpassen (optional)
47+
48+
Standardmäßig läuft der Server auf Port `8080`. Zum Ändern:
49+
```bash
50+
cp .env.example .env
51+
# WEBDAV_PORT in .env setzen
52+
```
4053

4154
## Management
4255

@@ -53,6 +66,9 @@ docker-compose restart
5366
# Stoppen
5467
docker-compose down
5568
69+
# Image aktualisieren
70+
docker-compose pull && docker-compose up -d
71+
5672
# Komplett löschen (inkl. Daten)
5773
docker-compose down -v
5874
```

server/config.yml.example

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
address: 0.0.0.0
2+
port: 8080
3+
4+
# Directory for WebDAV storage (mapped via docker-compose volume)
5+
directory: /data
6+
7+
# Default permissions (R=Read, C=Create, U=Update, D=Delete)
8+
permissions: CRUD
9+
10+
debug: false
11+
12+
log:
13+
format: console
14+
colors: false
15+
outputs:
16+
- stderr
17+
18+
# CORS configuration — only needed if accessing via a web browser/app
19+
# cors:
20+
# enabled: true
21+
# credentials: true
22+
# allowed_headers:
23+
# - Depth
24+
# - Content-Type
25+
# - Authorization
26+
# allowed_hosts:
27+
# - http://localhost:8080
28+
# allowed_methods:
29+
# - GET
30+
# - HEAD
31+
# - POST
32+
# - PUT
33+
# - DELETE
34+
# - OPTIONS
35+
# - PROPFIND
36+
# - PROPPATCH
37+
# - MKCOL
38+
# - COPY
39+
# - MOVE
40+
41+
# Users — change username and password before starting!
42+
users:
43+
- username: noteuser
44+
password: your_secure_password_here
45+
permissions: CRUD
46+
# Add more users if needed:
47+
# - username: user2
48+
# password: another_secure_password
49+
# permissions: CRUD

server/docker-compose.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@ version: '3.8'
22

33
services:
44
webdav:
5-
image: bytemark/webdav
5+
image: ghcr.io/hacdias/webdav:latest
66
container_name: simple-notes-webdav
77
restart: unless-stopped
88
ports:
9-
- "8080:80"
10-
environment:
11-
AUTH_TYPE: Basic
12-
USERNAME: ${WEBDAV_USERNAME}
13-
PASSWORD: ${WEBDAV_PASSWORD}
9+
- "${WEBDAV_PORT:-8080}:8080"
1410
volumes:
15-
- ./notes-data:/var/lib/dav/data
16-
- ./logs:/var/log/apache2
17-
networks:
18-
- notes-network
19-
20-
networks:
21-
notes-network:
22-
driver: bridge
11+
- ./config.yml:/config.yml:ro
12+
- ./notes-data:/data
13+
command: -c /config.yml

0 commit comments

Comments
 (0)