Skip to content

Getting WebDAV door from the API#98

Merged
hailihu merged 5 commits into
masterfrom
14-ada-get-api-url-from-a-webdav-door-and-vice-versa
Jul 14, 2025
Merged

Getting WebDAV door from the API#98
hailihu merged 5 commits into
masterfrom
14-ada-get-api-url-from-a-webdav-door-and-vice-versa

Conversation

@onnozweers
Copy link
Copy Markdown
Contributor

This commit adds a function get_webdav_door that allows Ada to get the URL of a WebDAV door from the API.

Ada does not know about WebDAV doors; it only knows the API's URL.

There are two ways you can ask the API for a WebDAV door. Both methods are implemented. If the first method fails, the second will be tried.

Testing this function may be a bit difficult, because it is not used yet. I tested it by calling get_webdav_door "$api" just before the call to api_call. To test the second method, I commented out the first return command in get_webdav_door.

With this function, we can start implementing uploads and downloads into Ada.

I'd also like to implement get_api_from_webdav. That would allow users to provide a WebDAV URL if they don 't know the address of the API. But that is less urgent.

This commit adds a function `get_webdav_door` that allows Ada to get the URL of a WebDAV door from the API.

Ada does not know about WebDAV doors; it only knows the API's URL.

There are two ways you can ask the API for a WebDAV door. Both methods are implemented.
If the first method fails, the second will be tried.

Testing this function may be a bit difficult, because it is not used yet.
I tested it by calling `get_webdav_door "$api"` just before the call to `api_call`.
To test the second method, I commented out the first `return` command in `get_webdav_door`.

With this function, we can start implementing uploads and downloads into Ada.

I'd also like to implement get_api_from_webdav. That would allow users to provide a WebDAV URL
if they don 't know the address of the API. But that is less urgent.
@onnozweers onnozweers requested a review from hailihu June 19, 2025 20:40
@onnozweers onnozweers linked an issue Jun 19, 2025 that may be closed by this pull request
@onnozweers
Copy link
Copy Markdown
Contributor Author

onnozweers commented Jul 2, 2025

Some improvements:

  • First, try to read a WebDAV door from an Rclone config file, if one is specified with --tokenfile
  • Write debug messages to stderr
  • Write error message if no webdav door can be found

…bDAV found

* The WebDAV door should be sent to stdout, that means that any other output should be sent to stderr to keep them separate.
* It's nice to print an error message when no WebDAV door could be found. This includes a hint to try with --debug, to speed up troubleshooting.
@hailihu
Copy link
Copy Markdown
Contributor

hailihu commented Jul 14, 2025

Looks good. Let's add tests in a new PR later.

@hailihu hailihu merged commit c899e42 into master Jul 14, 2025
1 check passed
@hailihu hailihu deleted the 14-ada-get-api-url-from-a-webdav-door-and-vice-versa branch July 14, 2025 12:17
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.

Ada: get API URL from a WebDAV door and vice versa

2 participants