aboutsummaryrefslogtreecommitdiffhomepage
path: root/hst
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-26 00:52:49 +0900
committerOphestra <cat@gensokyo.uk>2025-08-26 00:56:10 +0900
commitc9facb746b7be0f2d8f6b9b2227340ba2ec12060 (patch)
tree7a48ac5212b45908ecc5df7b08a0fc75c54fc7db /hst
parent878b66022e7573ca89fd1fbc266133c7776a98dd (diff)
hst/config: remove data field, rename dir to home
There is no reason to give the home directory special treatment, as this behaviour can be quite confusing. The home directory also does not necessarily require its own mount point, it could be provided by a parent or simply be ephemeral. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst')
-rw-r--r--hst/config.go9
-rw-r--r--hst/hst.go3
-rw-r--r--hst/hst_test.go3
3 files changed, 6 insertions, 9 deletions
diff --git a/hst/config.go b/hst/config.go
index 7ee25878..ee216faa 100644
--- a/hst/config.go
+++ b/hst/config.go
@@ -42,11 +42,10 @@ type (
Username string `json:"username,omitempty"`
// absolute path to shell
Shell *container.Absolute `json:"shell"`
- // absolute path to home directory in the init mount namespace
- Data *container.Absolute `json:"data"`
- // directory to enter and use as home in the container mount namespace, nil for Data
- Dir *container.Absolute `json:"dir,omitempty"`
- // extra acl ops, dispatches before container init
+ // directory to enter and use as home in the container mount namespace
+ Home *container.Absolute `json:"home"`
+
+ // extra acl ops to perform before setuid
ExtraPerms []*ExtraPermConfig `json:"extra_perms,omitempty"`
// numerical application id, used for init user namespace credentials
diff --git a/hst/hst.go b/hst/hst.go
index 57049049..6549450c 100644
--- a/hst/hst.go
+++ b/hst/hst.go
@@ -65,8 +65,7 @@ func Template() *Config {
Username: "chronos",
Shell: container.AbsFHSRun.Append("current-system/sw/bin/zsh"),
- Data: container.AbsFHSVarLib.Append("hakurei/u0/org.chromium.Chromium"),
- Dir: container.MustAbs("/data/data/org.chromium.Chromium"),
+ Home: container.MustAbs("/data/data/org.chromium.Chromium"),
ExtraPerms: []*ExtraPermConfig{
{Path: container.AbsFHSVarLib.Append("hakurei/u0"), Ensure: true, Execute: true},
{Path: container.AbsFHSVarLib.Append("hakurei/u0/org.chromium.Chromium"), Read: true, Write: true, Execute: true},
diff --git a/hst/hst_test.go b/hst/hst_test.go
index b36e8d2c..04057212 100644
--- a/hst/hst_test.go
+++ b/hst/hst_test.go
@@ -61,8 +61,7 @@ func TestTemplate(t *testing.T) {
},
"username": "chronos",
"shell": "/run/current-system/sw/bin/zsh",
- "data": "/var/lib/hakurei/u0/org.chromium.Chromium",
- "dir": "/data/data/org.chromium.Chromium",
+ "home": "/data/data/org.chromium.Chromium",
"extra_perms": [
{
"ensure": true,