Skip to content

Conversation

@zhiqing0205
Copy link

No description provided.

zhiqing0205 and others added 2 commits September 15, 2025 16:28
- Add docker-compose.yml with non-standard port 3456
- Update README.md and README_en.md with detailed Docker Compose instructions
- Provide clear setup steps for both pre-built image and source build options
@pubuzhixing8
Copy link
Contributor

Hi @zhiqing0205, thank you for your hard work, could you explain the background or what the PR does? a little context would help!

To be honest, I don't know what the WebDAV is, I need to study it.

@NaoCoding
Copy link
Member

To be honest Idk what is WebDAV too xd

@pubuzhixing8
Copy link
Contributor

Welcome to join our discord group https://discord.gg/H8nFP4wp @zhiqing0205 .

@zhiqing0205
Copy link
Author

Hi! Thanks for taking the time to look at the PR — let me give a bit of context on the WebDAV part.

What is WebDAV?

WebDAV (Web Distributed Authoring and Versioning) is an extension to HTTP that lets you treat any compliant server (Nextcloud, ownCloud, many cloud drives, even NAS devices) as a remote
filesystem. Through standard HTTP verbs it supports reading, writing, listing, renaming, and deleting files. That makes it a handy, vendor-neutral protocol for syncing documents without
introducing another proprietary backend.

Why introduce WebDAV here?

The goal was to add “bring‑your‑own storage” syncing so Drawnix users can:

  1. Keep using the browser’s offline mode if they never authenticate.
  2. Enter a shared password to unlock sync.
  3. Save boards or load .drawnix files from a storage location they control.

WebDAV gives us that storage layer without building/hosting a bespoke database. Users can point Drawnix to their existing WebDAV endpoint (cloud drive, self-hosted service, etc.) and we just store
JSON files there.

To keep credentials secure and avoid CORS issues, the PR adds a lightweight sync gateway (still bundled with the app) that proxies all WebDAV traffic. The browser talks to /api/* on the same
origin, so nothing leaks to the client.

What changed in the codebase?

  • Added the gateway (apps/server/index.js) with endpoints for auth, syncing, listing, renaming, and deleting files.
  • Reworked the front-end sync module to talk to that gateway instead of the old IndexedDB/local-storage flow.
  • Overhauled the sync dialog UI: collapsible settings, password gate, paginated file list, rename/delete actions, better error feedback.
  • Updated documentation, .env.example, Docker files, and added a redeploy.sh helper script.

How to use the new functionality

  1. Fill out .env (or environment variables) with:
    • SYNC_PASSWORD_HASH: SHA-256 hash of the password users must type in.
    • WEBDAV_URL, optional username/password, base path, etc.
  2. Run docker compose up -d --build.
  3. Open Drawnix in the browser, click App Menu → Sync & Files, enter the shared password, and the dialog will unlock:
    • Save the current board back to WebDAV.
    • Page through remote .drawnix snapshots.
    • Rename or delete files.
    • Adjust WebDAV settings (URL, credentials, label, main file) and reapply.

Happy to provide a quick Loom or additional documentation if it helps. Let me know what else you’d like to see in the PR!

@pubuzhixing8
Copy link
Contributor

@zhiqing0205 Thanks for your contribution, we don't have enough time to ensure this pr and WebDAV is necessary, so do't mind we close it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants