From c9facb746b7be0f2d8f6b9b2227340ba2ec12060 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 26 Aug 2025 00:52:49 +0900 Subject: 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 --- hst/config.go | 9 ++++----- hst/hst.go | 3 +-- hst/hst_test.go | 3 +-- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'hst') 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, -- cgit v1.3.1