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
+9 -4
View File
@@ -196,16 +196,21 @@ pub async fn handle_login_submit(
base_url = %base_url,
"Login Flow v2: flow completed successfully"
);
// Redirect to nc:// deep link so the Nextcloud mobile app receives
// the credentials via Android/iOS intent. Desktop clients use polling
// instead, so they will pick up the result from the poll endpoint.
let nc_url = format!(
"nc://login/server:{}&user:{}&password:{}",
base_url, current_user.username, app_password
);
axum::response::Redirect::to(&nc_url).into_response()
} else {
tracing::error!(
user = %current_user.username,
"Login Flow v2: complete() returned false — flow token not found"
);
return axum::response::Redirect::to("/nextcloud-error.html?type=session-expired")
.into_response();
axum::response::Redirect::to("/nextcloud-error.html?type=session-expired").into_response()
}
html_with_csp(include_str!("../../../static/nextcloud-success.html"))
}
/// GET /login/v2/flow/{token}/oidc — Start an OIDC authorization flow that is