hst: rename net and abstract fields
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m12s
Test / Hakurei (push) Successful in 3m8s
Test / Hpkg (push) Successful in 4m2s
Test / Sandbox (race detector) (push) Successful in 4m25s
Test / Hakurei (race detector) (push) Successful in 5m3s
Test / Flake checks (push) Successful in 1m22s
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m12s
Test / Hakurei (push) Successful in 3m8s
Test / Hpkg (push) Successful in 4m2s
Test / Sandbox (race detector) (push) Successful in 4m25s
Test / Hakurei (race detector) (push) Successful in 5m3s
Test / Flake checks (push) Successful in 1m22s
This makes more sense and matches the container library. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
5db0714072
commit
a3988c1a77
@ -98,7 +98,8 @@ func printShowInstance(
|
|||||||
}
|
}
|
||||||
writeFlag("userns", params.Userns)
|
writeFlag("userns", params.Userns)
|
||||||
writeFlag("devel", params.Devel)
|
writeFlag("devel", params.Devel)
|
||||||
writeFlag("net", params.Net)
|
writeFlag("net", params.HostNet)
|
||||||
|
writeFlag("abstract", params.HostAbstract)
|
||||||
writeFlag("device", params.Device)
|
writeFlag("device", params.Device)
|
||||||
writeFlag("tty", params.Tty)
|
writeFlag("tty", params.Tty)
|
||||||
writeFlag("mapuid", params.MapRealUID)
|
writeFlag("mapuid", params.MapRealUID)
|
||||||
|
@ -41,7 +41,7 @@ func Test_printShowInstance(t *testing.T) {
|
|||||||
Groups: video, dialout, plugdev
|
Groups: video, dialout, plugdev
|
||||||
Data: /var/lib/hakurei/u0/org.chromium.Chromium
|
Data: /var/lib/hakurei/u0/org.chromium.Chromium
|
||||||
Hostname: localhost
|
Hostname: localhost
|
||||||
Flags: userns devel net device tty mapuid autoetc
|
Flags: userns devel net abstract device tty mapuid autoetc
|
||||||
Root: /var/lib/hakurei/base/org.debian (2)
|
Root: /var/lib/hakurei/base/org.debian (2)
|
||||||
Etc: /etc/
|
Etc: /etc/
|
||||||
Path: /run/current-system/sw/bin/chromium
|
Path: /run/current-system/sw/bin/chromium
|
||||||
@ -120,7 +120,7 @@ App
|
|||||||
Groups: video, dialout, plugdev
|
Groups: video, dialout, plugdev
|
||||||
Data: /var/lib/hakurei/u0/org.chromium.Chromium
|
Data: /var/lib/hakurei/u0/org.chromium.Chromium
|
||||||
Hostname: localhost
|
Hostname: localhost
|
||||||
Flags: userns devel net device tty mapuid autoetc
|
Flags: userns devel net abstract device tty mapuid autoetc
|
||||||
Root: /var/lib/hakurei/base/org.debian (2)
|
Root: /var/lib/hakurei/base/org.debian (2)
|
||||||
Etc: /etc/
|
Etc: /etc/
|
||||||
Path: /run/current-system/sw/bin/chromium
|
Path: /run/current-system/sw/bin/chromium
|
||||||
@ -267,7 +267,8 @@ App
|
|||||||
"seccomp_compat": true,
|
"seccomp_compat": true,
|
||||||
"devel": true,
|
"devel": true,
|
||||||
"userns": true,
|
"userns": true,
|
||||||
"net": true,
|
"host_net": true,
|
||||||
|
"host_abstract": true,
|
||||||
"tty": true,
|
"tty": true,
|
||||||
"multiarch": true,
|
"multiarch": true,
|
||||||
"env": {
|
"env": {
|
||||||
@ -415,7 +416,8 @@ App
|
|||||||
"seccomp_compat": true,
|
"seccomp_compat": true,
|
||||||
"devel": true,
|
"devel": true,
|
||||||
"userns": true,
|
"userns": true,
|
||||||
"net": true,
|
"host_net": true,
|
||||||
|
"host_abstract": true,
|
||||||
"tty": true,
|
"tty": true,
|
||||||
"multiarch": true,
|
"multiarch": true,
|
||||||
"env": {
|
"env": {
|
||||||
@ -617,7 +619,8 @@ func Test_printPs(t *testing.T) {
|
|||||||
"seccomp_compat": true,
|
"seccomp_compat": true,
|
||||||
"devel": true,
|
"devel": true,
|
||||||
"userns": true,
|
"userns": true,
|
||||||
"net": true,
|
"host_net": true,
|
||||||
|
"host_abstract": true,
|
||||||
"tty": true,
|
"tty": true,
|
||||||
"multiarch": true,
|
"multiarch": true,
|
||||||
"env": {
|
"env": {
|
||||||
|
@ -26,9 +26,9 @@ type appInfo struct {
|
|||||||
// passed through to [hst.Config]
|
// passed through to [hst.Config]
|
||||||
Userns bool `json:"userns,omitempty"`
|
Userns bool `json:"userns,omitempty"`
|
||||||
// passed through to [hst.Config]
|
// passed through to [hst.Config]
|
||||||
Net bool `json:"net,omitempty"`
|
HostNet bool `json:"net,omitempty"`
|
||||||
// passed through to [hst.Config]
|
// passed through to [hst.Config]
|
||||||
Abstract bool `json:"abstract,omitempty"`
|
HostAbstract bool `json:"abstract,omitempty"`
|
||||||
// passed through to [hst.Config]
|
// passed through to [hst.Config]
|
||||||
Device bool `json:"dev,omitempty"`
|
Device bool `json:"dev,omitempty"`
|
||||||
// passed through to [hst.Config]
|
// passed through to [hst.Config]
|
||||||
@ -85,14 +85,14 @@ func (app *appInfo) toHst(pathSet *appPathSet, pathname *container.Absolute, arg
|
|||||||
Groups: app.Groups,
|
Groups: app.Groups,
|
||||||
|
|
||||||
Container: &hst.ContainerConfig{
|
Container: &hst.ContainerConfig{
|
||||||
Hostname: formatHostname(app.Name),
|
Hostname: formatHostname(app.Name),
|
||||||
Devel: app.Devel,
|
Devel: app.Devel,
|
||||||
Userns: app.Userns,
|
Userns: app.Userns,
|
||||||
Net: app.Net,
|
HostNet: app.HostNet,
|
||||||
Abstract: app.Abstract,
|
HostAbstract: app.HostAbstract,
|
||||||
Device: app.Device,
|
Device: app.Device,
|
||||||
Tty: app.Tty || flagDropShell,
|
Tty: app.Tty || flagDropShell,
|
||||||
MapRealUID: app.MapRealUID,
|
MapRealUID: app.MapRealUID,
|
||||||
Filesystem: []hst.FilesystemConfigJSON{
|
Filesystem: []hst.FilesystemConfigJSON{
|
||||||
{FilesystemConfig: &hst.FSBind{Source: pathSet.nixPath.Append("store"), Target: pathNixStore}},
|
{FilesystemConfig: &hst.FSBind{Source: pathSet.nixPath.Append("store"), Target: pathNixStore}},
|
||||||
{FilesystemConfig: &hst.FSBind{Source: pathSet.metaPath, Target: hst.AbsTmp.Append("app")}},
|
{FilesystemConfig: &hst.FSBind{Source: pathSet.metaPath, Target: hst.AbsTmp.Append("app")}},
|
||||||
|
@ -45,7 +45,7 @@ func withNixDaemon(
|
|||||||
Container: &hst.ContainerConfig{
|
Container: &hst.ContainerConfig{
|
||||||
Hostname: formatHostname(app.Name) + "-" + action,
|
Hostname: formatHostname(app.Name) + "-" + action,
|
||||||
Userns: true, // nix sandbox requires userns
|
Userns: true, // nix sandbox requires userns
|
||||||
Net: net,
|
HostNet: net,
|
||||||
SeccompFlags: seccomp.AllowMultiarch,
|
SeccompFlags: seccomp.AllowMultiarch,
|
||||||
Tty: dropShell,
|
Tty: dropShell,
|
||||||
Filesystem: []hst.FilesystemConfigJSON{
|
Filesystem: []hst.FilesystemConfigJSON{
|
||||||
|
@ -78,9 +78,9 @@ type (
|
|||||||
// allow userns creation in container
|
// allow userns creation in container
|
||||||
Userns bool `json:"userns,omitempty"`
|
Userns bool `json:"userns,omitempty"`
|
||||||
// share host net namespace
|
// share host net namespace
|
||||||
Net bool `json:"net,omitempty"`
|
HostNet bool `json:"host_net,omitempty"`
|
||||||
// share abstract unix socket scope
|
// share abstract unix socket scope
|
||||||
Abstract bool `json:"abstract,omitempty"`
|
HostAbstract bool `json:"host_abstract,omitempty"`
|
||||||
// allow dangerous terminal I/O
|
// allow dangerous terminal I/O
|
||||||
Tty bool `json:"tty,omitempty"`
|
Tty bool `json:"tty,omitempty"`
|
||||||
// allow multiarch
|
// allow multiarch
|
||||||
|
@ -79,7 +79,8 @@ func Template() *Config {
|
|||||||
Hostname: "localhost",
|
Hostname: "localhost",
|
||||||
Devel: true,
|
Devel: true,
|
||||||
Userns: true,
|
Userns: true,
|
||||||
Net: true,
|
HostNet: true,
|
||||||
|
HostAbstract: true,
|
||||||
Device: true,
|
Device: true,
|
||||||
WaitDelay: -1,
|
WaitDelay: -1,
|
||||||
SeccompFlags: seccomp.AllowMultiarch,
|
SeccompFlags: seccomp.AllowMultiarch,
|
||||||
|
@ -90,7 +90,8 @@ func TestTemplate(t *testing.T) {
|
|||||||
"seccomp_compat": true,
|
"seccomp_compat": true,
|
||||||
"devel": true,
|
"devel": true,
|
||||||
"userns": true,
|
"userns": true,
|
||||||
"net": true,
|
"host_net": true,
|
||||||
|
"host_abstract": true,
|
||||||
"tty": true,
|
"tty": true,
|
||||||
"multiarch": true,
|
"multiarch": true,
|
||||||
"env": {
|
"env": {
|
||||||
|
@ -27,7 +27,7 @@ var testCasesNixos = []sealTestCase{
|
|||||||
Shell: m("/run/current-system/sw/bin/zsh"),
|
Shell: m("/run/current-system/sw/bin/zsh"),
|
||||||
|
|
||||||
Container: &hst.ContainerConfig{
|
Container: &hst.ContainerConfig{
|
||||||
Userns: true, Net: true, MapRealUID: true, Env: nil, AutoEtc: true,
|
Userns: true, HostNet: true, MapRealUID: true, Env: nil, AutoEtc: true,
|
||||||
Filesystem: []hst.FilesystemConfigJSON{
|
Filesystem: []hst.FilesystemConfigJSON{
|
||||||
f(&hst.FSBind{Source: m("/bin")}),
|
f(&hst.FSBind{Source: m("/bin")}),
|
||||||
f(&hst.FSBind{Source: m("/usr/bin/")}),
|
f(&hst.FSBind{Source: m("/usr/bin/")}),
|
||||||
|
@ -32,8 +32,8 @@ func newContainer(s *hst.ContainerConfig, os sys.State, prefix string, uid, gid
|
|||||||
SeccompFlags: s.SeccompFlags,
|
SeccompFlags: s.SeccompFlags,
|
||||||
SeccompPresets: s.SeccompPresets,
|
SeccompPresets: s.SeccompPresets,
|
||||||
RetainSession: s.Tty,
|
RetainSession: s.Tty,
|
||||||
HostNet: s.Net,
|
HostNet: s.HostNet,
|
||||||
HostAbstract: s.Abstract,
|
HostAbstract: s.HostAbstract,
|
||||||
|
|
||||||
// the container is canceled when shim is requested to exit or receives an interrupt or termination signal;
|
// the container is canceled when shim is requested to exit or receives an interrupt or termination signal;
|
||||||
// this behaviour is implemented in the shim
|
// this behaviour is implemented in the shim
|
||||||
|
@ -238,11 +238,11 @@ func (seal *outcome) finalise(ctx context.Context, sys sys.State, config *hst.Co
|
|||||||
}
|
}
|
||||||
|
|
||||||
conf := &hst.ContainerConfig{
|
conf := &hst.ContainerConfig{
|
||||||
Userns: true,
|
Userns: true,
|
||||||
Net: true,
|
HostNet: true,
|
||||||
Abstract: true,
|
HostAbstract: true,
|
||||||
Tty: true,
|
Tty: true,
|
||||||
AutoEtc: true,
|
AutoEtc: true,
|
||||||
|
|
||||||
AutoRoot: container.AbsFHSRoot,
|
AutoRoot: container.AbsFHSRoot,
|
||||||
RootFlags: container.BindWritable,
|
RootFlags: container.BindWritable,
|
||||||
|
@ -131,14 +131,14 @@ in
|
|||||||
wait_delay
|
wait_delay
|
||||||
devel
|
devel
|
||||||
userns
|
userns
|
||||||
net
|
|
||||||
abstract
|
|
||||||
device
|
device
|
||||||
tty
|
tty
|
||||||
multiarch
|
multiarch
|
||||||
env
|
env
|
||||||
;
|
;
|
||||||
map_real_uid = app.mapRealUid;
|
map_real_uid = app.mapRealUid;
|
||||||
|
host_net = app.hostNet;
|
||||||
|
host_abstract = app.hostAbstract;
|
||||||
|
|
||||||
filesystem =
|
filesystem =
|
||||||
let
|
let
|
||||||
|
@ -179,10 +179,10 @@ in
|
|||||||
tty = mkEnableOption "access to the controlling terminal";
|
tty = mkEnableOption "access to the controlling terminal";
|
||||||
multiarch = mkEnableOption "multiarch kernel-level support";
|
multiarch = mkEnableOption "multiarch kernel-level support";
|
||||||
|
|
||||||
net = mkEnableOption "network access" // {
|
hostNet = mkEnableOption "share host net namespace" // {
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
abstract = mkEnableOption "abstract unix domain socket access";
|
hostAbstract = mkEnableOption "share abstract unix socket scope";
|
||||||
|
|
||||||
nix = mkEnableOption "nix daemon access";
|
nix = mkEnableOption "nix daemon access";
|
||||||
mapRealUid = mkEnableOption "mapping to priv-user uid";
|
mapRealUid = mkEnableOption "mapping to priv-user uid";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user