Skip to content

Support unified backend URL with derived WebDAV path#52

Merged
TheZupZup merged 1 commit intomainfrom
claude/unified-backend-url-XOeqr
May 3, 2026
Merged

Support unified backend URL with derived WebDAV path#52
TheZupZup merged 1 commit intomainfrom
claude/unified-backend-url-XOeqr

Conversation

@TheZupZup
Copy link
Copy Markdown
Owner

Summary

This change enables the mobile app to work with a single backend URL behind a reverse proxy, while maintaining backward compatibility with legacy two-port deployments. The WebDAV URL is now automatically derived by appending /webdav to the base API URL, but advanced users can still explicitly set a separate WebDAV URL to support the old setup.

Key Changes

  • Unified URL derivation: Added ServerUrl.deriveWebdavUrl() static method that appends /webdav to a base URL, with safeguards against double-appending and trailing slash handling
  • AppState WebDAV management:
    • Added webdavUrl getter that returns either the user-set override or the derived value
    • Added isWebdavUrlDerived getter to indicate whether the WebDAV URL is auto-derived (for UI hints)
    • Added setWebdavUrlOverride() method to allow users to pin a specific WebDAV URL
  • Preferences persistence:
    • New kPrefsWebdavUrlOverride key stores explicit WebDAV URL overrides
    • init() now restores both the API URL and any saved WebDAV override
    • Blank/whitespace-only overrides are treated as "no override" to prevent empty URLs
  • Documentation: Added comprehensive README section with reverse proxy examples (Nginx, Caddy, Cloudflare Tunnel) showing how to set up a unified backend URL

Implementation Details

  • The derivation logic is idempotent — if /webdav is already present in the URL, it won't be appended again (backward compatibility for users who manually saved the full WebDAV path)
  • Path-prefixed reverse proxies (e.g., https://example.com/nexanote) are supported correctly
  • All changes are covered by comprehensive unit tests covering the happy path, legacy two-port deployments, preference persistence, and edge cases

https://claude.ai/code/session_018YM8mCt7xe7Yg3put3rtbB

Lets users enter a single base URL (e.g. https://nexanote.example.com)
and have the WebDAV URL derived as base + "/webdav" — pairs with a
reverse-proxy deployment that routes / → API (8766) and /webdav →
WebDAV (8765). The two ports still work directly, so existing setups
are unchanged.

Backward compat: an optional webdav_url_override SharedPreferences key
pins the WebDAV URL explicitly for legacy two-port deployments. Blank
overrides are treated as "no override" so a stale empty pref does not
stick.

README adds Nginx / Caddy / Cloudflare Tunnel reverse-proxy snippets.
@TheZupZup TheZupZup merged commit 666abb7 into main May 3, 2026
1 check passed
@TheZupZup TheZupZup deleted the claude/unified-backend-url-XOeqr branch May 3, 2026 06:12
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.

2 participants