aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/state
AgeCommit message (Collapse)Author
2025-10-30internal/store: rename from stateOphestra
This reduces collision with local variable names, and generally makes sense for the new store package, since it no longer specifies the state struct. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-29internal/outcome: rename from appOphestra
This is less ambiguous, and more accurately describes the purpose of the package. 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-03-27state/multi: fix backend cache population raceOphestra
This race is never able to happen since no caller concurrently requests the same aid yet. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-03-25app: run in native sandboxOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-16fmsg: implement suspend in writerOphestra
This removes the requirement to call fmsg.Exit on every exit path, and enables direct use of the "log" package. However, fmsg.BeforeExit is still encouraged when possible to catch exit on suspended output. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-14state/join: use Join method when availableOphestra
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>
2024-12-21fortify: clean up ps formatting codeOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-20state: store join utilOphestra
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-19state: expose aids and use instance id as keyOphestra Umiker
Fortify state store instances was specific to aids due to outdated design decisions carried over from the ego rewrite. That no longer makes sense in the current application, so the interface now enables a single store object to manage all transient state. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-12-19state: rename simple store implementationOphestra 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-10-26fmsg: support temporarily withholding outputOphestra Umiker
Trying to print to a shared stdout is a terrible idea. This change makes it possible to withhold output for the lifetime of the sandbox. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-21fmsg: produce all output through fmsgOphestra Umiker
The behaviour of print functions from package fmt is not thread safe. Functions provided by fmsg wrap around Logger methods. This makes prefix much cleaner and makes it easy to deal with future changes to logging. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-20migrate to git.ophivana.moe/security/fortifyOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-18state: store launch method instead of launcher pathOphestra Umiker
Launcher path is constant for each launch method on the same system. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-16system: move enablements from state packageOphestra Umiker
This removes the unnecessary import of the state package. 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-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-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-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-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-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>