fix(mount): M-03 — output webdav credentials and manual mount instructions for linux
This commit is contained in:
@@ -108,6 +108,10 @@ sanctum.exe mount --path "C:\Pfad\tresor.sanctum" --no-open
|
|||||||
```
|
```
|
||||||
- **Automatischer Slot-Unlock**: Sanctum prüft das eingegebene Passwort gegen alle Slots und bindet automatisch den entsprechenden Tresor ein (Slot 0 Decoy oder Slot 1 Hidden Vault).
|
- **Automatischer Slot-Unlock**: Sanctum prüft das eingegebene Passwort gegen alle Slots und bindet automatisch den entsprechenden Tresor ein (Slot 0 Decoy oder Slot 1 Hidden Vault).
|
||||||
- **Windows Explorer**: Das gemountete Laufwerk wird standardmäßig im Explorer geöffnet (abschaltbar via `--no-open` oder `--stealth`).
|
- **Windows Explorer**: Das gemountete Laufwerk wird standardmäßig im Explorer geöffnet (abschaltbar via `--no-open` oder `--stealth`).
|
||||||
|
- **Linux & WebDAV-Integration**: Auf Linux startet Sanctum das WebDAV-VFS auf `127.0.0.1` mit lokaler Session-Token-Authentifizierung. Im Terminal werden direkt die Zugangsdaten und passende Mount-Befehle ausgegeben:
|
||||||
|
- **Benutzer**: `sanctum` | **Passwort**: Dynamisches Session-Token (Hex)
|
||||||
|
- `gio mount dav://sanctum@127.0.0.1:8443/`
|
||||||
|
- `mount -t davfs -o username=sanctum http://127.0.0.1:8443/ /mnt/sanctum`
|
||||||
- **System-Tray**: Ein Schild-Icon im Windows Infobereich erlaubt Statusabfrage und direktes Aushängen.
|
- **System-Tray**: Ein Schild-Icon im Windows Infobereich erlaubt Statusabfrage und direktes Aushängen.
|
||||||
- **Beenden**: `Ctrl+C` im Terminal oder Rechtsklick im Tray -> "Aushängen & Beenden" führt einen sauberen Unmount, Speicher-Compaction und WAL-Checkpoint durch.
|
- **Beenden**: `Ctrl+C` im Terminal oder Rechtsklick im Tray -> "Aushängen & Beenden" führt einen sauberen Unmount, Speicher-Compaction und WAL-Checkpoint durch.
|
||||||
|
|
||||||
|
|||||||
+48
-10
@@ -375,16 +375,8 @@ pub async fn mount_container(
|
|||||||
);
|
);
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
{
|
{
|
||||||
println!(
|
for line in format_linux_mount_instructions(bound_port, &session_token, mount_point) {
|
||||||
" • gio Befehl: gio mount dav://127.0.0.1:{}/",
|
println!("{}", line);
|
||||||
bound_port
|
|
||||||
);
|
|
||||||
if let Some(mp) = mount_point {
|
|
||||||
println!(
|
|
||||||
" • davfs2: mount -t davfs http://127.0.0.1:{}/ {}",
|
|
||||||
bound_port,
|
|
||||||
mp.display()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(secs) = idle_timeout {
|
if let Some(secs) = idle_timeout {
|
||||||
@@ -657,6 +649,36 @@ pub fn is_loopback_host(host_str: &str) -> bool {
|
|||||||
matches!(host_part, "127.0.0.1" | "localhost" | "::1")
|
matches!(host_part, "127.0.0.1" | "localhost" | "::1")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Erzeugt die plattformspezifischen Linux-Mount-Anweisungen und Authentifizierungsdaten (M-03).
|
||||||
|
pub fn format_linux_mount_instructions(
|
||||||
|
port: u16,
|
||||||
|
token: &str,
|
||||||
|
mount_point: Option<&std::path::Path>,
|
||||||
|
) -> Vec<String> {
|
||||||
|
let mut lines = Vec::new();
|
||||||
|
lines.push(format!(
|
||||||
|
" • WebDAV-Auth: Benutzer: sanctum | Token: {}",
|
||||||
|
token
|
||||||
|
));
|
||||||
|
lines.push(format!(
|
||||||
|
" • gio Befehl: echo {} | gio mount dav://sanctum@127.0.0.1:{}/",
|
||||||
|
token, port
|
||||||
|
));
|
||||||
|
if let Some(mp) = mount_point {
|
||||||
|
lines.push(format!(
|
||||||
|
" • davfs2: mount -t davfs -o username=sanctum http://127.0.0.1:{}/ {}",
|
||||||
|
port,
|
||||||
|
mp.display()
|
||||||
|
));
|
||||||
|
} else {
|
||||||
|
lines.push(format!(
|
||||||
|
" • davfs2: mount -t davfs -o username=sanctum http://127.0.0.1:{}/ /mnt/sanctum",
|
||||||
|
port
|
||||||
|
));
|
||||||
|
}
|
||||||
|
lines
|
||||||
|
}
|
||||||
|
|
||||||
/// Maximale Anzahl gleichzeitiger Verbindungen zum lokalen WebDAV-Endpunkt (Schutz gegen Socket-Exhaustion).
|
/// Maximale Anzahl gleichzeitiger Verbindungen zum lokalen WebDAV-Endpunkt (Schutz gegen Socket-Exhaustion).
|
||||||
const MAX_CONCURRENT_DAV_CONNECTIONS: usize = 64;
|
const MAX_CONCURRENT_DAV_CONNECTIONS: usize = 64;
|
||||||
|
|
||||||
@@ -948,4 +970,20 @@ mod tests {
|
|||||||
// Leeres Token darf niemals matchen
|
// Leeres Token darf niemals matchen
|
||||||
assert!(!uri_contains_token(&uri_clean, ""));
|
assert!(!uri_contains_token(&uri_clean, ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_m03_format_linux_mount_instructions() {
|
||||||
|
let token = "fedcba9876543210fedcba9876543210";
|
||||||
|
let instructions = format_linux_mount_instructions(
|
||||||
|
8443,
|
||||||
|
token,
|
||||||
|
Some(std::path::Path::new("/mnt/secure")),
|
||||||
|
);
|
||||||
|
|
||||||
|
let all_text = instructions.join("\n");
|
||||||
|
assert!(all_text.contains("Benutzer: sanctum"));
|
||||||
|
assert!(all_text.contains(token));
|
||||||
|
assert!(all_text.contains("gio mount dav://sanctum@127.0.0.1:8443/"));
|
||||||
|
assert!(all_text.contains("mount -t davfs -o username=sanctum http://127.0.0.1:8443/ /mnt/secure"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user