aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-10-13 02:39:27 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-10-13 02:39:27 +0900
commit65a5f8fb08421f8fb031d4e21a2c460d218616c6 (patch)
treece4c59bf917f9fa46de4d6a3a016ba830dac004d /internal/app
parentaee96b0fdf5e8272f36ee67eecfbf423c0aad0b6 (diff)
app/config: map bwrap tmpfs in app config
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'internal/app')
-rw-r--r--internal/app/config.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/app/config.go b/internal/app/config.go
index b8e2f479..4c21d8be 100644
--- a/internal/app/config.go
+++ b/internal/app/config.go
@@ -54,6 +54,8 @@ type SandboxConfig struct {
Env map[string]string `json:"env"`
// sandbox host filesystem access
Filesystem []*FilesystemConfig `json:"filesystem"`
+ // tmpfs mount points to mount last
+ Tmpfs []bwrap.TmpfsConfig `json:"tmpfs"`
}
type FilesystemConfig struct {
@@ -121,6 +123,10 @@ func (s *SandboxConfig) Bwrap() *bwrap.Config {
}
}
+ for _, tmpfs := range s.Tmpfs {
+ conf.Tmpfs = append(conf.Tmpfs, bwrap.PermConfig[bwrap.TmpfsConfig]{Path: tmpfs, Last: true})
+ }
+
return conf
}
@@ -157,6 +163,9 @@ func Template() *Config {
{Src: "/data/user/0", Dst: "/data/data", Write: true, Must: true},
{Src: "/var/tmp", Write: true},
},
+ Tmpfs: []bwrap.TmpfsConfig{
+ {Size: 8 * 1024, Dir: "/var/run/nscd"},
+ },
},
SystemBus: &dbus.Config{
See: nil,