-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a native WebDAV plugin #647
Conversation
f5dc246
to
e92c9c9
Compare
We use the same root folder for app and files backup. App backup usually creates the root folder, but if only storage backup is used, it will be missing and needs to be created.
This is especially useful for WebDAV storage where the user can supply whatever URL and before proceeding, we need to know whether that URL and the provided credentials are actually working.
Mostly renaming for clarity.
in preparation for generalization
and allow changing them dynamically. So far plugins were injected into the dependency graph and couldn't be changed at runtime, only their config could. Now we have the infrastructure in place to really allow for more than one plugin.
including ViewModel and StoragePluginManager logic
this is important, so we don't allow more than one backup running at the same time and not swapping out the storage while one is running. Previously, we had some bare bones tracking, but nothing precise.
it may be WebDAV now
app/src/main/java/com/stevesoltys/seedvault/plugins/StoragePluginManager.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/stevesoltys/seedvault/plugins/StoragePluginManager.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/stevesoltys/seedvault/settings/SettingsManager.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/stevesoltys/seedvault/plugins/webdav/WebDavStorage.kt
Show resolved
Hide resolved
app/src/main/java/com/stevesoltys/seedvault/plugins/webdav/WebDavStoragePlugin.kt
Show resolved
Hide resolved
app/src/main/java/com/stevesoltys/seedvault/storage/WebDavStoragePlugin.kt
Outdated
Show resolved
Hide resolved
Feel free to merge whenever. LGTM. |
|
||
fun getConfig(): WebDavConfig { | ||
assumeFalse(System.getenv("NEXTCLOUD_URL").isNullOrEmpty()) | ||
return WebDavConfig( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option could be something like WireMock if we didn't want to actually depend on an external service for tests.
But this is probably easier and likely provides better coverage anyways..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I had considered mocking the HTTP interactions, but this gets us to low-level DAV and XML details, I didn't want to get into. That is why we are using a DAV library after all. I also thought about some built-in WebDAV capable webserver only used for tests, but couldn't find anything sane and easy, so I went with testing against a real server.
This MR does the following:
Closes #317