Crates.io | flatpak-unsandbox |
lib.rs | flatpak-unsandbox |
version | 0.1.0 |
source | src |
created_at | 2024-05-21 00:28:59.617093 |
updated_at | 2024-05-21 00:28:59.617093 |
description | Run your flatpak app outside of the sandbox. |
homepage | https://ryanabx.github.io/flatpak-unsandbox |
repository | https://github.com/ryanabx/flatpak-unsandbox |
max_upload_size | |
id | 1246328 |
size | 7,952 |
This rust crate allows rust flatpak apps to run themselves outside of the sandbox.
NOTE: you must have the
--talk-name=org.freedesktop.Flatpak
permission enabled and already that is the biggest hole in the sandbox we can make. Use this library with extreme caution.
Apps that must run on the host, and have no other choice.
Apps that need to run a specific part of its functionality on the host
Apps that modify and use the host's flatpak installations: (for example, Flatrun)
Apps that aren't built by the packager, and have otherwise no way to package the app under Flatpak's sandboxing (very rare).
Apps that require system services
WARNING: Packaging these apps through flatpak might be a bad idea because we can't ensure dependencies exist on the host system!
Run your program unflatpaked
// src/main.rs
fn main() -> Result<(), MyError> {
if flatpak_unsandbox::unsandbox(None)? {
return Ok(())
}
// Unsandboxed functionality here...
}
Run another program unflatpaked
// src/main.rs
fn main() -> Result<(), MyError> {
// Sandboxed functionality
// Ensure this other program ran
if !flatpak_unsandbox::unsandbox(Some(Program::new(
"/libexec/my-agent-program", None)
))? {
return Ok(())
}
// More sandboxed functionality here...
}
Not much needs to be updated for this crate, but if there are issues with it, you may submit a bug report or attempt to fix the issue and make a PR!