aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal
AgeCommit message (Collapse)Author
2024-10-11app: integrate bwrap into environment setupOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-11shim: use bwrap config as it isOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-11app: migrate to new shim implementationOphestra Umiker
Both machinectl and sudo launch methods launch shim as shim is now responsible for setting up the sandbox. Various app structures are adapted to accommodate bwrap configuration and mediated wayland access. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-11shim: new shim implementationOphestra Umiker
This implementation of shim accepts configuration as a gob stream over a unix socket, with support for mediating access to wayland via WAYLAND_SOCKET fd. All configuration is now included in the payload, and child is started inside bwrap configured with supplied bwrap.Config. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-11verbose: overridable prefixOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-10app: tag ACL operations for revertOphestra Umiker
ACL operations are now tagged with the enablement causing them. At the end of child process's life, enablements of all remaining launchers are resolved and inverted. This allows Wait to only revert operations targeting resources no longer required by other launchers. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-10app: hardlink sockets to process-specific share local to XDG_RUNTIME_DIROphestra Umiker
This avoids adding ACLs to the PulseAudio directory. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-10state/simple: prefix store pathOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-10app: remove bubblewrap launch methodOphestra Umiker
Launch methods serve the primary purpose of setting UID in the init namespace, which bubblewrap does not do. Furthermore, all applications will start within a bubblewrap sandbox once it has been implemented. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-09dbus/run: support running xdg-dbus-proxy in a restrictive bubblewrap sandboxOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-07dbus: use name resolved by exec.CommandOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-29verbose: test verbose behaviourOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-29dbus: configurable xdg-dbus-proxy outputOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-29dbus: toggleable xdg-dbus-proxy outputOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-25dbus: use generalised helper.Helper for xdg-dbus-proxyOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-24app: improve dbus proxy verbose messagesOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-22state: round printed uptime to the secondOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-22app: clean up interactions and handle all application state and setup/teardownOphestra Umiker
There was an earlier attempt of cleaning up the app package however it ended up creating even more of a mess and the code structure largely still looked like Ego with state setup scattered everywhere and a bunch of ugly hacks had to be implemented to keep track of all of them. In this commit the entire app package is rewritten to track everything that has to do with an app in one thread safe value. In anticipation of the client/server split also made changes: - Console messages are cleaned up to be consistent - State tracking is fully rewritten to be cleaner and usable for multiple process and client/server - Encapsulate errors to easier identify type of action causing the error as well as additional info - System-level setup operations is grouped in a way that can be collectively committed/reverted and gracefully handles errors returned by each operation - Resource sharing is made more fine-grained with PID-scoped resources whenever possible, a few remnants (X11, Wayland, PulseAudio) will be addressed when a generic proxy is available - Application setup takes a JSON-friendly config struct and deterministically generates system setup operations Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-17exit: move final and early code to internal packageOphestra Umiker
Exit cleanup state information is now stored in a dedicated struct and built up using methods of that struct. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-16move acl and xcb binding packages to top levelOphestra Umiker
These packages are reasonably clean and do not interact with other packages. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-16final: refactor for removal of system package and reduction of interactions ↵Ophestra Umiker
to state package State query command has been moved to main where it belongs, "system" information are now fetched in app.New and stored in *App with accessors for relevant values. Exit (cleanup-related) functions are separated into its dedicated "final" package. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-12verbose: remove system package interactionOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-12app: handle launch method in New functionOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-09app/run: empty launcher environmentOphestra Umiker
The launcher process should not receive the child's environment. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-09app/dbus: accept system bus configOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-09app/dbus: set dbusAddress earlyOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-09app/dbus: manage dbus proxy and pass address to childOphestra Umiker
This commit adds code that starts and registers the D-Bus proxy, as well as cleanup code that tracks and closes the daemon once our child exits. A few more flags were added to pass D-Bus config to xdg-dbus-proxy. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-09app: treat display server variable unset as fatalOphestra Umiker
This is yet another remnant of Ego, as Ego unconditionally shares these resources and the absence of them are ignored and warned about in verbose logging. In our case they are individually opt-in so silently dropping them while the enablement is still set makes very little sense. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-09app/run: remove bare launch optionOphestra Umiker
This flag serves no use and is only a leftover from Ego. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-08state/print: collect and output state information of all usersOphestra Umiker
The -state flag now outputs state of all users. The old behaviour can be accessed via the -state-current flag, user is selected via -u. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-08clean up setup/launcher code and enable better control over sharesOphestra Umiker
In the past Wayland, X and PulseAudio are shared unconditionally. This can unnecessarily increase attack surface as some of these resources might not be needed at all. This commit moves all environment preparation code to the internal app package and selectively call them based on flags. An "enablements" bitfield is introduced tracking all enabled shares. This value is registered after successful child process launch and stored in launcher states. Code responsible for running the child process is isolated to its own app/run file and cleaned up. Launch method selection is also extensively cleaned up. The internal state/track readLaunchers function now takes uid as an argument. Launcher state is now printed using text/tabwriter and argv is only emitted when verbose. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-04app/launch: set argv when launching shellOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-04rename to fortify and restructureOphestra Umiker
More sandbox features will be added and this will no longer track ego's features and behaviour. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>