diff --git a/README.md b/README.md index 653d51e8..2fbaf806 100644 --- a/README.md +++ b/README.md @@ -99,13 +99,13 @@ RUST_LOG=debug cargo run - Search across files and folders - Favorites and recent files - Responsive grid/list views +- WebDAV support for desktop and mobile sync ## What's Next I'm working on these when I have time: - File sharing via links -- WebDAV for desktop sync - Basic versioning - Mobile app improvements diff --git a/static/profile.html b/static/profile.html index 682e36e8..d6c8bcd5 100644 --- a/static/profile.html +++ b/static/profile.html @@ -208,6 +208,23 @@

Storage

+ +
+

WebDAV Connection

+

+ Connect your desktop or mobile device to OxiCloud using WebDAV for seamless file synchronization. +

+
+
Server URL
+
+
+
+ + Setup Guide +
+
+
+

Change Password

@@ -240,6 +257,10 @@

Change Password

return { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' }; } +function getWebDAVUrl() { + return window.location.protocol + '//' + window.location.host + '/webdav/'; +} + function formatBytes(bytes) { if (bytes === 0) return '0 B'; const k = 1024, sizes = ['B', 'KB', 'MB', 'GB', 'TB']; @@ -302,6 +323,9 @@

Change Password

bar.className = 'storage-fill ' + (pct > 90 ? 'red' : pct > 70 ? 'orange' : 'green'); document.getElementById('p-storage-text').textContent = formatBytes(used) + ' / ' + (quota > 0 ? formatBytes(quota) : 'Unlimited'); + // WebDAV URL + document.getElementById('webdav-url').textContent = getWebDAVUrl(); + // Hide change password for OIDC-only users if (user.auth_provider && user.auth_provider !== 'local') { document.getElementById('password-section').style.display = 'none'; @@ -377,6 +401,31 @@

Change Password

return false; } +function copyWebDAVUrl() { + const statusEl = document.getElementById('webdav-copy-status'); + + navigator.clipboard.writeText(getWebDAVUrl()).then(() => { + // Create success message safely + const alertDiv = document.createElement('div'); + alertDiv.className = 'alert alert-success'; + alertDiv.innerHTML = ' '; + const successText = document.createTextNode('WebDAV URL copied to clipboard'); + alertDiv.appendChild(successText); + statusEl.innerHTML = ''; + statusEl.appendChild(alertDiv); + setTimeout(() => { statusEl.innerHTML = ''; }, 3000); + }).catch(err => { + // Create error message safely to prevent XSS + const alertDiv = document.createElement('div'); + alertDiv.className = 'alert alert-error'; + alertDiv.innerHTML = ' Failed to copy: '; + const errorText = document.createTextNode(err.message); + alertDiv.appendChild(errorText); + statusEl.innerHTML = ''; + statusEl.appendChild(alertDiv); + }); +} + init(); diff --git a/static/webdav-setup.html b/static/webdav-setup.html new file mode 100644 index 00000000..aa0d74a3 --- /dev/null +++ b/static/webdav-setup.html @@ -0,0 +1,305 @@ + + + + + +WebDAV Setup Guide — OxiCloud + + + + + + +
+
+ + + OxiCloud + + · WebDAV Setup +
+ +
+ +
+ +
+

WebDAV Setup Guide

+

+ WebDAV allows you to connect your OxiCloud storage to your computer or mobile device + as if it were a local drive. Access your files from any WebDAV-compatible application, + including File Explorer (Windows), Finder (macOS), and many mobile apps. +

+ +
+
+ + Your WebDAV URL +
+

+
+ +

Quick Setup

+

Select your platform to see step-by-step instructions:

+ +
+
+

Windows

+

Windows 10/11 File Explorer

+
+
+

macOS

+

Finder connection

+
+
+

Linux

+

GNOME, KDE, or command line

+
+
+

Mobile

+

iOS and Android apps

+
+
+
+ + +
+

Windows Setup

+ +

Method 1: Add Network Location

+
    +
  1. Open File Explorer
  2. +
  3. Right-click on This PC and select Add a network location
  4. +
  5. Click Next
  6. +
  7. Select Choose a custom network location and click Next
  8. +
  9. Enter your WebDAV URL (shown above)
  10. +
  11. Enter your OxiCloud username and password when prompted
  12. +
  13. Give the connection a name (e.g., "OxiCloud")
  14. +
  15. Click Finish
  16. +
+ +

Method 2: Map Network Drive

+
    +
  1. Open File Explorer
  2. +
  3. Click This PC in the left sidebar
  4. +
  5. Click Map network drive in the toolbar
  6. +
  7. Choose a drive letter
  8. +
  9. Enter your WebDAV URL
  10. +
  11. Check Connect using different credentials
  12. +
  13. Click Finish and enter your credentials
  14. +
+ +
+
+ + Windows Troubleshooting +
+

+ If connection fails, you may need to enable Basic Authentication. + Open Registry Editor and navigate to:
+ HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters
+ Set BasicAuthLevel to 2 and restart the WebClient service. +

+
+
+ + +
+

macOS Setup

+ +

Using Finder

+
    +
  1. Open Finder
  2. +
  3. From the menu bar, click GoConnect to Server (or press Cmd + K)
  4. +
  5. Enter your WebDAV URL (shown above)
  6. +
  7. Click Connect
  8. +
  9. Enter your OxiCloud username and password
  10. +
  11. Click Connect again
  12. +
+

Your OxiCloud storage will appear as a mounted drive in Finder's sidebar.

+
+ + +
+

Linux Setup

+ +

GNOME (Nautilus/Files)

+
    +
  1. Open Files (Nautilus)
  2. +
  3. Press Ctrl + L to show the location bar
  4. +
  5. Enter: davs://[your-server]/webdav/
  6. +
  7. Press Enter
  8. +
  9. Enter your credentials when prompted
  10. +
+ +

KDE (Dolphin)

+
    +
  1. Open Dolphin
  2. +
  3. In the address bar, enter: webdavs://[your-server]/webdav/
  4. +
  5. Enter your credentials when prompted
  6. +
+ +

Command Line (davfs2)

+
# Install davfs2
+sudo apt-get install davfs2
+
+# Create mount point
+sudo mkdir /mnt/oxicloud
+
+# Mount WebDAV
+sudo mount -t davfs https://[your-server]/webdav/ /mnt/oxicloud
+
+ + +
+

Mobile Setup

+ +

iOS

+

+ iOS doesn't have native WebDAV support in Files app. Use a third-party app like: +

+
    +
  • Documents by Readdle (free)
  • +
  • FE File Explorer (free with in-app purchases)
  • +
  • WebDAV Navigator (paid)
  • +
+

+ In any of these apps, add a new connection using your WebDAV URL and credentials. +

+ +

Android

+

Recommended apps:

+
    +
  • Solid Explorer — supports WebDAV natively
  • +
  • FX File Explorer — free with WebDAV support
  • +
  • Total Commander with WebDAV plugin
  • +
+

+ Add a new WebDAV connection in the app's settings using your URL and credentials. +

+
+ + +
+

Authentication

+

When connecting to WebDAV, use your OxiCloud credentials:

+
    +
  • Server URL:
  • +
  • Username: Your OxiCloud username
  • +
  • Password: Your OxiCloud password
  • +
+
+
+ + Security Note +
+

+ Always use https:// (not http://) to ensure your connection is encrypted. +

+
+
+ + +
+ Back to Profile +
+
+ + + +