diff options
Diffstat (limited to 'hst')
| -rw-r--r-- | hst/container.go | 8 | ||||
| -rw-r--r-- | hst/template.go | 24 | ||||
| -rw-r--r-- | hst/template_test.go | 2 |
3 files changed, 19 insertions, 15 deletions
diff --git a/hst/container.go b/hst/container.go index 1ee9e839..c385344c 100644 --- a/hst/container.go +++ b/hst/container.go @@ -1,6 +1,8 @@ package hst import ( + "time" + "hakurei.app/container/seccomp" ) @@ -10,8 +12,10 @@ type ( // container hostname Hostname string `json:"hostname,omitempty"` - // do not interrupt and wait for initial process during termination - ImmediateTermination bool `json:"immediate_termination,omitempty"` + // duration to wait for after interrupting a container's initial process in nanoseconds; + // a negative value causes the container to be terminated immediately on cancellation + WaitDelay time.Duration `json:"wait_delay,omitempty"` + // extra seccomp flags SeccompFlags seccomp.ExportFlag `json:"seccomp_flags"` // extra seccomp presets diff --git a/hst/template.go b/hst/template.go index 60af2ebc..3ab9c277 100644 --- a/hst/template.go +++ b/hst/template.go @@ -57,18 +57,18 @@ func Template() *Config { Groups: []string{"video", "dialout", "plugdev"}, Container: &ContainerConfig{ - Hostname: "localhost", - Devel: true, - Userns: true, - Net: true, - Device: true, - ImmediateTermination: true, - SeccompFlags: seccomp.AllowMultiarch, - SeccompPresets: seccomp.PresetExt, - SeccompCompat: true, - Tty: true, - Multiarch: true, - MapRealUID: true, + Hostname: "localhost", + Devel: true, + Userns: true, + Net: true, + Device: true, + WaitDelay: -1, + SeccompFlags: seccomp.AllowMultiarch, + SeccompPresets: seccomp.PresetExt, + SeccompCompat: true, + Tty: true, + Multiarch: true, + MapRealUID: true, // example API credentials pulled from Google Chrome // DO NOT USE THESE IN A REAL BROWSER Env: map[string]string{ diff --git a/hst/template_test.go b/hst/template_test.go index a9b92262..8761b7d4 100644 --- a/hst/template_test.go +++ b/hst/template_test.go @@ -80,7 +80,7 @@ func TestTemplate(t *testing.T) { ], "container": { "hostname": "localhost", - "immediate_termination": true, + "wait_delay": -1, "seccomp_flags": 1, "seccomp_presets": 1, "seccomp_compat": true, |
