aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd
AgeCommit message (Collapse)Author
2025-11-10treewide: reject impossible user-supplied fdOphestra
These are all trusted user input, however this check reduces the likelihood of hard to debug errors. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-10cmd/hakurei: expose current instance identifierOphestra
This writes the 16-byte instance identifier to file descriptor specified by --identifier-fd if set, and closes the file. This enables safely obtaining the new instance's identifier. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-05treewide: fit test untyped int literals in 32-bitOphestra
This enables hakurei test suite to run on 32-bit targets. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-04hst/grp_pwd: specify new uid formatOphestra
This leaves slots available for additional uid ranges in Rosa OS. This breaks all existing installations! Users are required to fix ownership manually. Closes #18. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-03cmd/hakurei/print: handle nil configOphestra
There is nothing to print in this case, and such a nil check is missing. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-03cmd/hpkg/test: print share directoryOphestra
This is more useful now that state is tracked here. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-03message: rename NewMsg to NewOphestra
Should have done this when relocating this from container. Now is a good time to rename it before v0.3.x. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-03hst/config: make identifier omitemptyOphestra
This is an optional field. Serialise it as such. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-03cmd/hakurei/print: use new store interfaceOphestra
This removes the final uses of the compat interfaces. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02cmd/hakurei/print: serialise array for psOphestra
Wanted to do this for a long time, since the key is redundant. This also makes it easier to migrate to the new store interface. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02cmd/hakurei/parse: use new store interfaceOphestra
This greatly reduces overhead. The iterator also significantly cleans up the usage code. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02internal/outcome: track state in TMPDIROphestra
The SharePath is a more stable path than RunDirPath, since it is available all the time and should remain consistent. This also fits better into the intended use case of XDG_RUNTIME_DIR. Closes #17. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-30internal/store: rename compat interfaceOphestra
The new store implementation will be exported as Store. Signed-off-by: Ophestra <cat@gensokyo.uk>
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-10-29internal/env: relocate from appOphestra
This package is much cleaner to stub independently, and makes no sense to lump into app. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-26internal/app/state: use absolute pathnamesOphestra
This is less error-prone and fits better into internal/app which already uses check.Absolute for all pathnames. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-26treewide: update doc commentsOphestra
Some internal/app/state types were relocated to hst as part of the API. This change updates doc comments referring to them. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-25internal/app/state: use internal/lockedfileOphestra
This is a pretty solid implementation backed by robust tests, with a much cleaner interface. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-24cmd/hakurei: short identifier from lower halfOphestra
The upper half is now a nanosecond timestamp. Lower half is still random bytes, so use lower half for short identifier. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-24hst/instance: embed config structOphestra
This makes the resulting json easier to parse since it can now be deserialised into the config struct. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-23hst/instance: store priv side pidOphestra
This can receive signals, so is more useful to the caller. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-23hst/instance: define instance stateOphestra
This is now part of the hst API. This change also improves identifier generation and serialisation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-23cmd/hsu: reduce excessive test rangeOphestra
This is quite a simple piece of code, this many test cases is excessive and wastes time in the integration vm. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-22internal/app/shim: use syscall dispatcherOphestra
This enables instrumented testing of the shim. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-22cmd/hsu: run in locked threadOphestra
Goroutine scheduling is not helpful in the setuid wrapper, it is not particularly harmful but lock here anyway. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21hst/container: flags string representationOphestra
This is useful for a user-facing representation other than JSON. This also gets rid of the ugly, outdated flags string builder in cmd/hakurei. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21cmd/hakurei/parse: close config fdOphestra
This is cleaner than relying on the finalizer. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21cmd/hakurei/json: friendly error messagesOphestra
This change handles errors returned by encoding/json and prints significantly cleaner messages. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21hst: expose version stringOphestra
The hst API is tied to this version string. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21internal: clean up build stringsOphestra
These names are less ambiguous and should be understandable without reading the source code. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-19hst/container: optional runtime and tmpdir sharingOphestra
Sharing and persisting these directories do not always make sense. Make it optional here. Closes #16. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-18internal/app/hsu: remove wrapper methodOphestra
This was added to reduce the size of diffs. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-14hst/config: hold acl struct by valueOphestra
Doc comments are also reworded for clarity. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-14hst/container: pack boolean optionsOphestra
The memory saving is relatively insignificant, however this increases serialisation efficiency. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-13treewide: parallel testsOphestra
Most tests already had no global state, however parallel was never enabled. This change enables it for all applicable tests. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-11hst: rename /.hakurei constantOphestra
This provides disambiguation from fhs.AbsTmp. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-11hst: remove template bind nix storeOphestra
This does not add anything meaningful to the template, since there are already prior examples showing src-only bind ops. Remove this since it causes confusion by covering the previous mount point targeting /nix/store. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-11hst: use plausible overlay templateOphestra
The current value is copied from a test case, and does not resemble its intended use case. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-09message: relocate from containerOphestra
This package is quite useful. This change allows it to be imported without importing container. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-08cmd/hsu: check against setgid bitOphestra
The getgroups behaviour is already checked for, but it never hurts to be more careful in a setuid program. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-07container/fhs: move pathname constantsOphestra
This allows referencing FHS pathnames without importing container. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-07container/check: move absolute pathnameOphestra
This allows use of absolute pathname values without importing container. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-07hst/dbus: move dbus config structOphestra
This allows holding a xdg-dbus-proxy configuration without importing system/dbus. It also makes more sense in the project structure since the config struct is part of the hst API however the rest of the implementation is not. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-07hst/config: move container fields from toplevelOphestra
This change also moves pd behaviour to cmd/hakurei, as this does not belong in the hst API. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-05hst: reword and move constantsOphestra
These values are considered part of the stable, exported API, so move them to hst. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-03internal/app: declutter and merge small filesOphestra
This should make internal/app easier to work with for the upcoming params to shim. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-30internal/app/paths: defer extra formattingOphestra
This reduces payload size for params to shim. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-29internal/app/paths: do not print messagesOphestra
This change was missed while merging the rest of the logging changes. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-29hst/config: remove seccomp bit fieldsOphestra
These serve little purpose and are not friendly for use from other languages. Signed-off-by: Ophestra <cat@gensokyo.uk>