fix(nc): enable Nextcloud Android app connectivity and uploads

- Add /remote.php/dav discovery endpoint for Android app server detection
- Add /index.php/204 connectivity check endpoint (returns 204 No Content)
- Redirect login flow to nc:// deep link for mobile credential delivery
- Support GET/HEAD on folders (NC clients use as existence checks)
- Recursive MKCOL to create missing parent directories
- Fix single-file PROPFIND returning empty multistatus response
- Strip instance suffix from preview fileId (e.g. "00000326ocnca")
- Add recommendations stub endpoint
This commit is contained in:
Jared Wolff
2026-03-05 20:42:30 -05:00
parent 3fc408d72d
commit d8eecbd9ca
6 changed files with 180 additions and 42 deletions
+4 -2
View File
@@ -37,8 +37,10 @@ pub async fn handle_preview(
user: CurrentUser,
Query(params): Query<PreviewParams>,
) -> impl IntoResponse {
// Parse the Nextcloud file ID (numeric) to get the OxiCloud UUID
let nc_file_id: i64 = match params.file_id.parse() {
// Parse the Nextcloud file ID — the NC app may append an instance suffix
// (e.g. "00000326ocnca"), so strip non-digit characters first.
let numeric_part: String = params.file_id.chars().take_while(|c| c.is_ascii_digit()).collect();
let nc_file_id: i64 = match numeric_part.parse() {
Ok(id) => id,
Err(_) => {
return Response::builder()