Closed kkoyung closed 1 month ago
Side note: The default value of "Sync Folder Path" of webdav sync is super-productivity
, and it is appended to the base url to form the destination of webdav sync (correct me if I'm wrong). However, new users might not have the directory super-productivity/
on their webdav server, and receive http error 409 on their first synchronization. It's the result of directly submitting PUT request at super-productivity/MAIN.json
while the directory super-productivity/
does not exist. New users have to manual create the directory super-productivity
through their webdav client before synchronizing. I think super-productivity should first fire a MKCOL request to create the target directory before synchronizing if it does not exist. This can improve the user experience.
Thank you very much for this! This is a really great addition! :)
@kkoyung do you happen to have a configuration file for webdav.yaml to resolve cors issues?
@kkoyung do you happen to have a configuration file for webdav.yaml to resolve cors issues?
@billge Using the provided docker-compose.yaml, both the super-productivity web app and the webdav server serve under same endpoint at the published port 80. It shouldn't have any CORS issue, since they are supposed to share the same domain name.
Of course, you can configure the webdav server to ensure no CORS issue. Check out the example configuration in the README.md from hacdias/webdav repository.
Here is the snippet from that readme file.
# CORS configuration
cors:
# Whether or not CORS configuration should be applied. Default is 'false'.
enabled: true
credentials: true
allowed_headers:
- Depth
allowed_hosts:
- http://localhost:8080
allowed_methods:
- GET
exposed_headers:
- Content-Length
- Content-Range
If you still have CORS issues, feel free to ask for help.
I saw @johannesjo mentioned in a comment that he is interested in bundling a webdav server to the super-productivity docker container. So... I made a prototype of it.
Description
This patch provides an optional way to integrate an external WebDAV server so that the super-productivity container can serve as a WebDAV server with base url http://localhost/webdav/ . It includes the following changes:
Replace the default nginx config file Besides serving the web app, the new nginx config file also forwards all the requests with paths starting with "/webdav/" to a backend WebDAV server specified by the environment variable WEBDAV_BACKEND. Note that during forwarding, the path prefix "/webdav" will be removed.
Use hacdias/webdav as default WebDAV backend server The docker-compose.yaml provides an example setup to use the docker image hacdias/webdav as the WebDAV backend server. An example for the configuration of the WebDAV server is also provided in webdav.yaml.
Issues Resolved
2309 #3513
Check List
Remark
The docker-compose.yaml simply points to the docker image "johannesjo/super-productivity:latest" on Docker Hub, which does not contain this patch. You need to change it to the locally built image during testing.