aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/app.go
AgeCommit message (Collapse)Author
2025-07-03app: remove split implementationOphestra
It is completely nonsensical and highly error-prone to have multiple implementations of this in the same build. This should be switched at compile time instead therefore the split packages are pointless. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-07-02cmd/hakurei: move to cmdOphestra
Having it at the project root never made sense since the "ego" name was deprecated. This change finally addresses it. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-06-25treewide: rename to hakureiOphestra
Fortify makes little sense for a container tool. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-04-12app/instance: wrap internal implementationOphestra
This reduces the scope of the fst package, which was growing questionably large. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-04-12app: rename app implementation packageOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-03-25app: run in native sandboxOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-21app: separate instance from process stateOphestra
This works better for the implementation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-19app: defer system.I revertOphestra
Just returning an error after a successful call of commit will leave garbage behind with no way for the caller to clean them. This change ensures revert is always called after successful commit with at least per-process state enabled. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-19app: separate appSeal finalise methodOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-19app: merge seal with sysOphestra
The existence of the appSealSys struct was an implementation detail obsolete since system.I was integrated in 084cd84f36a1d608541b4aa4e1e95334395d8953. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-19app: embed appSeal in app structOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-19app: store values with string representationOphestra
Improves code readability without changing memory layout. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-18app: separate interface from implementationOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-18sys: rename from linuxOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-16internal: move shim and init into appOphestra
This structure makes more sense, as both processes are part of an app's lifecycle. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-08helper/proc: move package out of internalOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-21state: store config in separate gob streamOphestra
This enables early serialisation of config. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-17proc/priv/shim: merge shim into main programOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-15app: expose single run methodOphestra
App is no longer just a simple [exec.Cmd] wrapper, so exposing these steps separately no longer makes sense and actually hinders proper error handling, cleanup and cancellation. This change removes the five-second wait when the shim dies before receiving the payload, and provides caller the ability to gracefully stop execution of the confined process. Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-20migrate to git.gensokyo.uk/security/fortifyOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-12-18fst: rename from fipcOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-12-18fipc: export config structOphestra Umiker
Also store full config as part of state. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-16app: integrate fsuOphestra Umiker
This removes the dependency on external user switchers like sudo/machinectl and decouples fortify user ids from the passwd database. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-02cmd: shim and init into separate binariesOphestra Umiker
This change also fixes a deadlock when shim fails to connect and complete the setup. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-27shim: user switcher process management structOphestra Umiker
This change moves all user switcher and shim management to the shim package and withholds output while shim is alive. This also eliminated all exit scenarios where revert is skipped. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-23internal: wrap calls to os standard library functionsOphestra Umiker
This change helps tests stub out and simulate OS behaviour during the sealing process. This also removes dependency on XDG_RUNTIME_DIR as the internal.System implementation provided to App provides a compat directory inside the tmpdir-based share when XDG_RUNTIME_DIR is unavailable. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-21shim: abort setup on failed start and process exitOphestra Umiker
Shim setup listens on a socket in the process share, if shim setup hasn't happened on exit revert will fail. This change makes sure shim setup is aborted on a doomed launch. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-21app: move wayland mediation to shim packageOphestra Umiker
Values used in the Wayland mediation implementation is stored in various struct fields strewn across multiple app structs and checks are messy and confusing. This commit unifies them into a single struct and access it using much better looking methods. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-20app: move app ID to app structOphestra Umiker
App ID is inherent to App, and it makes no sense to generate it as part of the app sealing process. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-16app: port app to use the system packageOphestra Umiker
This commit does away with almost all baggage left over from the Ego port. Error wrapping also got simplified. All API changes happens to be internal which means no changes to main except renaming of the BaseError type. 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-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>