Support unified backend URL with derived WebDAV path#52
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
/webdavto the base API URL, but advanced users can still explicitly set a separate WebDAV URL to support the old setup.Key Changes
ServerUrl.deriveWebdavUrl()static method that appends/webdavto a base URL, with safeguards against double-appending and trailing slash handlingwebdavUrlgetter that returns either the user-set override or the derived valueisWebdavUrlDerivedgetter to indicate whether the WebDAV URL is auto-derived (for UI hints)setWebdavUrlOverride()method to allow users to pin a specific WebDAV URLkPrefsWebdavUrlOverridekey stores explicit WebDAV URL overridesinit()now restores both the API URL and any saved WebDAV overrideImplementation Details
/webdavis already present in the URL, it won't be appended again (backward compatibility for users who manually saved the full WebDAV path)https://example.com/nexanote) are supported correctlyhttps://claude.ai/code/session_018YM8mCt7xe7Yg3put3rtbB