Oz version in config file, bash completion flag for oz cli, small naming fixes

master
xSmurf 10 years ago
parent db133785d5
commit c9b661f46b

@ -24,6 +24,7 @@ type Config struct {
EnvironmentVars []string `json:"environment_vars"` EnvironmentVars []string `json:"environment_vars"`
} }
const OzVersion = "0.0.1"
const DefaultConfigPath = "/etc/oz/oz.conf" const DefaultConfigPath = "/etc/oz/oz.conf"
func NewDefaultConfig() *Config { func NewDefaultConfig() *Config {

@ -31,7 +31,7 @@ type ProxyConfig struct {
// Optional: Destination address // Optional: Destination address
// In client mode: the host side address to connect to // In client mode: the host side address to connect to
// In server mode: the container side address to bind to // In server mode: the sandbox side address to bind to
// If left empty, localhost is used // If left empty, localhost is used
Destination string Destination string
} }

@ -55,6 +55,8 @@ func runApplication() {
app.Usage = "command line interface to Oz sandboxes" app.Usage = "command line interface to Oz sandboxes"
app.Author = "Subgraph" app.Author = "Subgraph"
app.Email = "info@subgraph.com" app.Email = "info@subgraph.com"
app.Version = OzVersion
app.EnableBashCompletion = true
app.Commands = []cli.Command{ app.Commands = []cli.Command{
{ {
Name: "profiles", Name: "profiles",
@ -78,7 +80,7 @@ func runApplication() {
}, },
{ {
Name: "shell", Name: "shell",
Usage: "start a shell in a running container", Usage: "start a shell in a running sandbox",
Action: handleShell, Action: handleShell,
}, },
{ {
@ -129,11 +131,11 @@ func handleLaunch(c *cli.Context) {
func handleList(c *cli.Context) { func handleList(c *cli.Context) {
sboxes, err := daemon.ListSandboxes() sboxes, err := daemon.ListSandboxes()
if err != nil { if err != nil {
fmt.Printf("Error listing running containers: %v\n", err) fmt.Printf("Error listing running sandboxes: %v\n", err)
os.Exit(1) os.Exit(1)
} }
if len(sboxes) == 0 { if len(sboxes) == 0 {
fmt.Println("No running containers") fmt.Println("No running sandboxes")
return return
} }
for _, sb := range sboxes { for _, sb := range sboxes {

@ -18,15 +18,15 @@ type Profile struct {
Watchdog string Watchdog string
// Optional wrapper binary to use when launching command (ex: tsocks) // Optional wrapper binary to use when launching command (ex: tsocks)
Wrapper string Wrapper string
// If true launch one container per instance, otherwise run all instances in same container // If true launch one sandbox per instance, otherwise run all instances in same sandbox
Multi bool Multi bool
// Disable mounting of sys and proc inside the container // Disable mounting of sys and proc inside the sandbox
NoSysProc bool NoSysProc bool
// Disable bind mounting of default directories (etc,usr,bin,lib,lib64) // Disable bind mounting of default directories (etc,usr,bin,lib,lib64)
// Also disables default blacklist items (/sbin, /usr/sbin, /usr/bin/sudo) // Also disables default blacklist items (/sbin, /usr/sbin, /usr/bin/sudo)
// Normally not used // Normally not used
NoDefaults bool NoDefaults bool
// Allow bind mounting of files passed as arguments inside the container // Allow bind mounting of files passed as arguments inside the sandbox
AllowFiles bool `json:"allow_files"` AllowFiles bool `json:"allow_files"`
// List of paths to bind mount inside jail // List of paths to bind mount inside jail
Whitelist []WhitelistItem Whitelist []WhitelistItem
@ -65,7 +65,7 @@ type EnvVar struct {
Value string Value string
} }
// Container network definition // Sandbox network definition
type NetworkProfile struct { type NetworkProfile struct {
// One of empty, host, bridge // One of empty, host, bridge
Nettype string `json:"type"` Nettype string `json:"type"`

Loading…
Cancel
Save