hst/config: remove seccomp bit fields
All checks were successful
Test / Create distribution (push) Successful in 1m12s
Test / Sandbox (push) Successful in 2m46s
Test / Hpkg (push) Successful in 4m40s
Test / Sandbox (race detector) (push) Successful in 4m50s
Test / Hakurei (race detector) (push) Successful in 5m51s
Test / Hakurei (push) Successful in 2m36s
Test / Flake checks (push) Successful in 1m41s

These serve little purpose and are not friendly for use from other languages.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
Ophestra 2025-09-29 07:07:16 +09:00
parent 44ba7a5f02
commit 1ba1cb8865
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
7 changed files with 24 additions and 49 deletions

View File

@ -259,8 +259,6 @@ App
"container": { "container": {
"hostname": "localhost", "hostname": "localhost",
"wait_delay": -1, "wait_delay": -1,
"seccomp_flags": 1,
"seccomp_presets": 1,
"seccomp_compat": true, "seccomp_compat": true,
"devel": true, "devel": true,
"userns": true, "userns": true,
@ -415,8 +413,6 @@ App
"container": { "container": {
"hostname": "localhost", "hostname": "localhost",
"wait_delay": -1, "wait_delay": -1,
"seccomp_flags": 1,
"seccomp_presets": 1,
"seccomp_compat": true, "seccomp_compat": true,
"devel": true, "devel": true,
"userns": true, "userns": true,
@ -625,8 +621,6 @@ func Test_printPs(t *testing.T) {
"container": { "container": {
"hostname": "localhost", "hostname": "localhost",
"wait_delay": -1, "wait_delay": -1,
"seccomp_flags": 1,
"seccomp_presets": 1,
"seccomp_compat": true, "seccomp_compat": true,
"devel": true, "devel": true,
"userns": true, "userns": true,

View File

@ -6,7 +6,6 @@ import (
"os" "os"
"hakurei.app/container" "hakurei.app/container"
"hakurei.app/container/seccomp"
"hakurei.app/hst" "hakurei.app/hst"
"hakurei.app/system/dbus" "hakurei.app/system/dbus"
) )
@ -92,6 +91,7 @@ func (app *appInfo) toHst(pathSet *appPathSet, pathname *container.Absolute, arg
Device: app.Device, Device: app.Device,
Tty: app.Tty || flagDropShell, Tty: app.Tty || flagDropShell,
MapRealUID: app.MapRealUID, MapRealUID: app.MapRealUID,
Multiarch: app.Multiarch,
Filesystem: []hst.FilesystemConfigJSON{ Filesystem: []hst.FilesystemConfigJSON{
{FilesystemConfig: &hst.FSBind{Target: container.AbsFHSEtc, Source: pathSet.cacheDir.Append("etc"), Special: true}}, {FilesystemConfig: &hst.FSBind{Target: container.AbsFHSEtc, Source: pathSet.cacheDir.Append("etc"), Special: true}},
{FilesystemConfig: &hst.FSBind{Source: pathSet.nixPath.Append("store"), Target: pathNixStore}}, {FilesystemConfig: &hst.FSBind{Source: pathSet.nixPath.Append("store"), Target: pathNixStore}},
@ -113,12 +113,6 @@ func (app *appInfo) toHst(pathSet *appPathSet, pathname *container.Absolute, arg
{Ensure: true, Path: pathSet.baseDir, Read: true, Write: true, Execute: true}, {Ensure: true, Path: pathSet.baseDir, Read: true, Write: true, Execute: true},
}, },
} }
if app.Multiarch {
config.Container.SeccompFlags |= seccomp.AllowMultiarch
}
if app.Bluetooth {
config.Container.SeccompFlags |= seccomp.AllowBluetooth
}
return config return config
} }

View File

@ -6,7 +6,6 @@ import (
"strings" "strings"
"hakurei.app/container" "hakurei.app/container"
"hakurei.app/container/seccomp"
"hakurei.app/hst" "hakurei.app/hst"
) )
@ -46,7 +45,7 @@ func withNixDaemon(
Hostname: formatHostname(app.Name) + "-" + action, Hostname: formatHostname(app.Name) + "-" + action,
Userns: true, // nix sandbox requires userns Userns: true, // nix sandbox requires userns
HostNet: net, HostNet: net,
SeccompFlags: seccomp.AllowMultiarch, Multiarch: true,
Tty: dropShell, Tty: dropShell,
Filesystem: []hst.FilesystemConfigJSON{ Filesystem: []hst.FilesystemConfigJSON{
{FilesystemConfig: &hst.FSBind{Target: container.AbsFHSEtc, Source: pathSet.cacheDir.Append("etc"), Special: true}}, {FilesystemConfig: &hst.FSBind{Target: container.AbsFHSEtc, Source: pathSet.cacheDir.Append("etc"), Special: true}},
@ -84,7 +83,7 @@ func withCacheDir(
Container: &hst.ContainerConfig{ Container: &hst.ContainerConfig{
Hostname: formatHostname(app.Name) + "-" + action, Hostname: formatHostname(app.Name) + "-" + action,
SeccompFlags: seccomp.AllowMultiarch, Multiarch: true,
Tty: dropShell, Tty: dropShell,
Filesystem: []hst.FilesystemConfigJSON{ Filesystem: []hst.FilesystemConfigJSON{
{FilesystemConfig: &hst.FSBind{Target: container.AbsFHSEtc, Source: workDir.Append(container.FHSEtc), Special: true}}, {FilesystemConfig: &hst.FSBind{Target: container.AbsFHSEtc, Source: workDir.Append(container.FHSEtc), Special: true}},

View File

@ -4,7 +4,6 @@ import (
"time" "time"
"hakurei.app/container" "hakurei.app/container"
"hakurei.app/container/seccomp"
"hakurei.app/system/dbus" "hakurei.app/system/dbus"
) )
@ -66,10 +65,6 @@ type (
// a negative value causes the container to be terminated immediately on cancellation // a negative value causes the container to be terminated immediately on cancellation
WaitDelay time.Duration `json:"wait_delay,omitempty"` WaitDelay time.Duration `json:"wait_delay,omitempty"`
// extra seccomp flags
SeccompFlags seccomp.ExportFlag `json:"seccomp_flags"`
// extra seccomp presets
SeccompPresets seccomp.FilterPreset `json:"seccomp_presets"`
// disable project-specific filter extensions // disable project-specific filter extensions
SeccompCompat bool `json:"seccomp_compat,omitempty"` SeccompCompat bool `json:"seccomp_compat,omitempty"`
// allow ptrace and friends // allow ptrace and friends

View File

@ -7,7 +7,6 @@ import (
"os" "os"
"hakurei.app/container" "hakurei.app/container"
"hakurei.app/container/seccomp"
"hakurei.app/system/dbus" "hakurei.app/system/dbus"
) )
@ -113,8 +112,6 @@ func Template() *Config {
HostAbstract: true, HostAbstract: true,
Device: true, Device: true,
WaitDelay: -1, WaitDelay: -1,
SeccompFlags: seccomp.AllowMultiarch,
SeccompPresets: seccomp.PresetExt,
SeccompCompat: true, SeccompCompat: true,
Tty: true, Tty: true,
Multiarch: true, Multiarch: true,

View File

@ -166,8 +166,6 @@ func TestTemplate(t *testing.T) {
"container": { "container": {
"hostname": "localhost", "hostname": "localhost",
"wait_delay": -1, "wait_delay": -1,
"seccomp_flags": 1,
"seccomp_presets": 1,
"seccomp_compat": true, "seccomp_compat": true,
"devel": true, "devel": true,
"userns": true, "userns": true,

View File

@ -33,8 +33,6 @@ func newContainer(
params := &container.Params{ params := &container.Params{
Hostname: s.Hostname, Hostname: s.Hostname,
SeccompFlags: s.SeccompFlags,
SeccompPresets: s.SeccompPresets,
RetainSession: s.Tty, RetainSession: s.Tty,
HostNet: s.HostNet, HostNet: s.HostNet,
HostAbstract: s.HostAbstract, HostAbstract: s.HostAbstract,