Commit Graph

311 Commits

Author SHA1 Message Date
Leon Bösche
847a8de414 Refactor moveUserFileHandler to store user files directly in WebDAV root, removing unnecessary path prefix 2026-01-13 22:31:58 +01:00
Leon Bösche
c00c1e273d Add context.mounted checks in file explorer for safer file and folder operations 2026-01-13 22:26:45 +01:00
Leon Bösche
47e94995b5 Refactor viewmodels and enhance security documentation; remove unused viewmodels, add path sanitization, and implement rate limiting 2026-01-13 22:11:02 +01:00
Leon Bösche
804e994e76 Add architecture, deployment, and development documentation for b0esche.cloud 2026-01-13 19:34:46 +01:00
Leon Bösche
294b28d1a8 Add docs, scripts, and update README
- Added docs/AUTH.md with authentication system documentation
- Added server scripts (auto-deploy, backup, monitor, webhook-server)
- Updated README with deployment info and project structure
- Added gitignore for backup archives
2026-01-13 19:28:16 +01:00
Leon Bösche
233f1dd315 Refactor upload snackbar code for improved readability and maintainability 2026-01-13 16:50:09 +01:00
Leon Bösche
d2c26e6203 Style upload progress snackbar with accent color (nyan) 2026-01-13 16:49:17 +01:00
Leon Bösche
37e0520af0 Add file metadata display in viewer and upload progress snackbar
- Backend: Add modified_by column to files table
- Backend: Track who modified files via WOPI PutFile
- Backend: Return fileInfo (name, size, lastModified, modifiedByName) in view response
- Flutter: Update DocumentCapabilities model with FileInfo
- Flutter: Display actual last modified date and user in document viewer
- Flutter: Show upload progress snackbar with percentage that auto-dismisses on completion
2026-01-13 16:48:25 +01:00
Leon Bösche
6ce43a3c9b Add last modified tracking: show 'Last modified: date by username' in document viewer
- Added modified_by column to files table
- Updated WOPI PutFile to track who modified the file
- Updated view handlers to return file metadata (name, size, lastModified, modifiedByName)
- Updated Flutter models and UI to display last modified info
2026-01-13 16:45:57 +01:00
Leon Bösche
6943e95479 Fix WOPI: Use correct WebDAV path for org files (/orgs/{orgId}/ prefix) 2026-01-13 16:10:57 +01:00
Leon Bösche
2e1096a9ad Add id attribute to form field to fix autofill warning 2026-01-13 15:48:20 +01:00
Leon Bösche
8d9db29db2 Fix WOPI: Use config for Nextcloud URL instead of hardcoded nc.b0esche.cloud 2026-01-13 15:25:04 +01:00
Leon Bösche
afeb7a35ad Replace deprecated dart:html with package:web
- Updated document_viewer.dart to use web.HTMLIFrameElement/HTMLDivElement
- Updated file_explorer.dart to use web.HTMLAnchorElement for downloads
- Added web and http packages to pubspec.yaml
2026-01-13 14:52:12 +01:00
Leon Bösche
70039a8288 Fix Collabora WOPI: Put WOPISrc in URL query param, not form body 2026-01-13 14:50:24 +01:00
Leon Bösche
634aa521bd Refactor index.html: Clean up preload link formatting and improve console warning suppression 2026-01-13 14:38:59 +01:00
Leon Bösche
749672509b Fix Collabora: Fetch versioned editor URL from discovery endpoint
- Added getCollaboraEditorURL() to fetch correct /browser/{version}/cool.html path
- Cache discovery response for 5 minutes to avoid repeated requests
- Fixed 'Invalid URI' error caused by version mismatch
2026-01-13 14:38:08 +01:00
Leon Bösche
20e9ae3e4d Suppress Flutter web deprecation warnings (v8BreakIterator, async XMLHttpRequest) 2026-01-13 14:34:18 +01:00
Leon Bösche
3738b346e3 Remove docker-compose-server.yml from .gitignore 2026-01-13 14:05:06 +01:00
Leon Bösche
0aa281ac09 Add .gitignore for docker-compose-server.yml and update WOPISrc URL handling in collaboraProxyHandler 2026-01-13 14:01:02 +01:00
Leon Bösche
8baaad2c08 Fix Collabora form submission: remove iframe target and use _self to bypass CSP 2026-01-13 12:59:49 +01:00
Leon Bösche
19825763ad Fix Collabora endpoint: use /browser/dist/cool.html instead of /loleaflet/dist/loleaflet.html 2026-01-13 12:46:56 +01:00
Leon Bösche
c16cd49237 Use /loleaflet/dist/loleaflet.html - standard Collabora Online WOPI endpoint 2026-01-13 00:28:34 +01:00
Leon Bösche
57eea172a2 Revert to form POST submission to /cool/dist/cool.html (correct WOPI pattern)
- Collabora Online requires POST request with WOPISrc in form body
- GET requests with query parameters cause 400 Bad Request
- Using modern /cool/ endpoint with form submission to iframe
2026-01-13 00:13:21 +01:00
Leon Bösche
d255f40a8c Try Collabora path /cool/dist/cool.html (newer naming convention) 2026-01-12 17:25:53 +01:00
Leon Bösche
d59a655f0f Fix Collabora path from /loleaflet to /lool (correct endpoint) 2026-01-12 17:11:50 +01:00
Leon Bösche
509983b4ff Fix: Update Collabora proxy to load editor in iframe with WOPISrc in query string 2026-01-12 16:58:39 +01:00
Leon Bösche
5fb08d8831 Improve Collabora proxy: add load event listener and relax iframe sandbox for form submission
- Use window load event to ensure form element exists before submission
- Add allow-popups-to-escape-sandbox for cross-origin form POSTs
- Add allow-presentation for better compatibility
- Improved error logging for debugging form submission issues
2026-01-12 16:51:16 +01:00
Leon Bösche
18f5b3f98b Fix: Use form POST submission for Collabora (not GET query string)
- Collabora requires POST request to /loleaflet/dist/loleaflet.html
- WOPISrc must be in request body as form parameter
- Form targets iframe by name for proper document loading
- Matches WOPI/Collabora standard integration pattern
2026-01-12 16:46:11 +01:00
Leon Bösche
d58137716f Fix: Collabora proxy should load iframe with WOPISrc in query string, not form submission
- Changed from form POST submission to direct iframe load
- WOPISrc goes in Collabora URL query string, not as form parameter
- This matches Collabora's expected request format for WOPI integration
2026-01-12 16:40:35 +01:00
Leon Bösche
18138dde01 Fix: Remove X-Frame-Options header from Collabora proxy to allow iframe loading
- The collaboraProxyHandler endpoint is intentionally meant to load in an iframe
- X-Frame-Options: SAMEORIGIN was blocking cross-origin iframe loads
- Removed the header to allow the Flutter web frontend to embed the proxy page
2026-01-12 16:34:05 +01:00
Leon Bösche
6db2bf077d Fix: Clean up whitespace in document viewer and WOPI handler files 2026-01-12 16:10:40 +01:00
Leon Bösche
42ee3057bf Fix: Collabora proxy handler - create WOPI session inline instead of calling non-existent function 2026-01-12 16:10:04 +01:00
Leon Bösche
350eb27e30 Clarify Collabora proxy token handling for iframe cross-origin requests 2026-01-12 16:08:35 +01:00
Leon Bösche
2ded9b00f9 idle 2026-01-12 16:00:27 +01:00
Leon Bösche
2daa9e9855 Fix: Use JavaScript in head to submit form for Collabora POST
- Inject script element into head that creates and submits form
- Script executes immediately when loaded, doesn't rely on Future callbacks
- Form targets iframe by name, WOPISrc in body not query params
- This ensures form submission happens reliably before any async operations
2026-01-12 15:58:08 +01:00
Leon Bösche
2fa5f0441a Fix: Create form in parent document to POST to Collabora iframe
- Data URL iframe form submission was blocked by CORS
- New approach: create iframe in viewport, form in document body
- Form targets iframe by name, submits WOPISrc to loleaflet.html via POST
- Form submission happens in parent document context, not sandboxed iframe
- This avoids CORS issues and ensures form actually submits
2026-01-12 15:53:05 +01:00
Leon Bösche
64690231c2 Fix: Refactor Collabora iframe creation for improved readability and maintainability 2026-01-12 15:44:57 +01:00
Leon Bösche
0ee3b32ef3 Fix: Use data URL iframe with auto-submitting form for Collabora POST
- Create iframe with data URL containing HTML page
- HTML page has form that auto-submits to loleaflet.html with WOPISrc in body
- This ensures POST request instead of GET
- Form submits within iframe context, not affected by parent page JavaScript
2026-01-12 15:34:43 +01:00
Leon Bösche
99419748bb Fix: Pass WOPISrc directly to form submission, don't build URL with query params
- Remove URL building with query parameters that was causing GET requests
- Pass WOPISrc directly to _buildCollaboraIframe function
- JavaScript now creates form with POST method and WOPISrc in body
- This ensures Collabora receives POST not GET request
2026-01-12 15:28:50 +01:00
Leon Bösche
89f55471ce Fix: Use JavaScript form submission for Collabora POST request
- Collabora expects POST to loleaflet.html with WOPISrc in body, not GET
- Previous Dart form.submit() wasn't executing reliably
- Use ScriptElement to inject and execute form submission JavaScript
- This bypasses Dart's HTML layer limitations and ensures form POSTs properly
- Unique viewType names with timestamp to avoid registration conflicts
2026-01-12 15:22:40 +01:00
Leon Bösche
ef60983534 Fix: Refactor Collabora iframe setup for improved readability and maintainability 2026-01-12 10:26:25 +01:00
Leon Bösche
8e06e7e17d Fix: Update Collabora iframe to use POST method for WOPISrc submission 2026-01-12 10:26:17 +01:00
Leon Bösche
0b822af438 Fix: Use proper URL building for Collabora WOPISrc parameter
- Changed from manual string concatenation to Uri.parse().replace(queryParameters: ...)
- This properly encodes the WOPISrc while maintaining encoding through iframe.src
- Fixes Collabora 'WOPISrc validation error: unencoded WOPISrc' warning
- Uri API ensures query parameters are properly percent-encoded
2026-01-12 10:12:58 +01:00
Leon Bösche
69cf328972 Fix Collabora 400 error by properly URL-encoding WOPISrc parameter
- WOPISrc is a full URL that needs URL encoding when passed as query param
- Use Uri.encodeComponent() to properly encode the WOPISrc value
- Simplify iframe setup to just use the properly constructed URL
- This fixes the 400 Bad Request from Collabora when loading documents
2026-01-12 09:50:41 +01:00
Leon Bösche
181fb0af93 Fix Collabora iframe loading and sandbox security
- Reverted to direct iframe src approach instead of form submission
- This avoids 'Form submission canceled' error
- Removed allow-same-origin from sandbox to improve security
- Added allow-popups-to-escape-sandbox for Collabora functionality
- Use direct URL with WOPISrc parameter instead of POST form
2026-01-12 01:47:52 +01:00
Leon Bösche
7bd1ab16da Fix Collabora Online loading using form-based POST instead of URL params
- Collabora's loleaflet.html expects WOPISrc as POST parameter, not URL query param
- Changed from iframe with src= to form submission approach
- Extract WOPISrc from URL and pass as hidden form input
- This avoids 400 Bad Request from Collabora when using GET with URL params
2026-01-12 01:40:10 +01:00
Leon Bösche
d52307c792 Implement Collabora Online iframe viewer with WOPI integration
- Added dart:html and dart:ui_web imports for iframe support
- Created _buildCollaboraIframe() method to register and display iframe
- Set proper sandbox and allow attributes for Collabora functionality
- Full-screen iframe embedding of Collabora Online document editor
- Replaces placeholder UI with actual document viewing capability
2026-01-12 01:30:53 +01:00
Leon Bösche
dbbad29f2f Fix: Standardize formatting of WOPICheckFileInfoResponse struct fields 2026-01-12 01:18:32 +01:00
Leon Bösche
ec25f06ea3 Fix: Refactor code for improved readability and consistency in document viewer and signup form 2026-01-12 01:18:08 +01:00
Leon Bösche
36db2daabd Fix: Clean up wopi.go file completely 2026-01-12 01:17:41 +01:00