Skip to content

Commit

Permalink
Merge pull request #424 from nanobox-io/feature/server
Browse files Browse the repository at this point in the history
Feature/server
  • Loading branch information
lyondhill authored Apr 10, 2017
2 parents 05971a9 + ecda613 commit 7ccdb1a
Show file tree
Hide file tree
Showing 95 changed files with 2,980 additions and 675 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 2.1.0 (April 7, 2017)

FEATURES:
- Make a major change to the way nanobox runs. When running nanobox now creates a nanobox server
This change fixes the quality of life of most users because it should only ask for passwords once
- VPN now runs under the server
- All administrative commands (dns add, sharing etc.) now run through the server


## 2.0.4 (March 6, 2017)

BUG FIXES:
Expand Down
3 changes: 3 additions & 0 deletions boxfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ run.config:
image: nanobox/build
engine: golang
engine.config:
# runtime set to the older version until
# this issue is fixed https://github.com/Microsoft/go-winio/issues/41
runtime: go-1.7
package: github.com/nanobox-io/nanobox
dev_packages:
- py27-awscli
Expand Down
7 changes: 5 additions & 2 deletions commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (
"github.com/spf13/cobra"

"github.com/nanobox-io/nanobox/commands/registry"
"github.com/nanobox-io/nanobox/util/config"
"github.com/nanobox-io/nanobox/commands/server"
"github.com/nanobox-io/nanobox/models"
"github.com/nanobox-io/nanobox/util/config"
"github.com/nanobox-io/nanobox/util/display"
"github.com/nanobox-io/nanobox/util/mixpanel"
"github.com/nanobox-io/nanobox/util/update"
Expand Down Expand Up @@ -39,6 +40,7 @@ var (
Short: "",
Long: ``,
PersistentPreRun: func(ccmd *cobra.Command, args []string) {

// report the command usage to mixpanel
mixpanel.Report(strings.Replace(ccmd.CommandPath(), "nanobox ", "", 1))

Expand Down Expand Up @@ -77,7 +79,7 @@ var (
if config.CIMode {
lumber.Level(lumber.INFO)
display.Summary = false
display.Level = "info"
display.Level = "info"
}

},
Expand Down Expand Up @@ -126,6 +128,7 @@ func init() {
NanoboxCmd.AddCommand(DnsCmd)
NanoboxCmd.AddCommand(LogCmd)
NanoboxCmd.AddCommand(VersionCmd)
NanoboxCmd.AddCommand(server.ServerCmd)

// hidden subcommands
NanoboxCmd.AddCommand(EnvCmd)
Expand Down
1 change: 1 addition & 0 deletions commands/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func destroyFunc(ccmd *cobra.Command, args []string) {

if len(args) == 0 {
display.CommandErr(env.Destroy(envModel))
return
}

_, _, name := helpers.Endpoint(envModel, args, 2)
Expand Down
1 change: 0 additions & 1 deletion commands/dns/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/spf13/cobra"

// "github.com/nanobox-io/nanobox/commands/steps"
"github.com/nanobox-io/nanobox/helpers"
"github.com/nanobox-io/nanobox/models"
app_dns "github.com/nanobox-io/nanobox/processors/app/dns"
Expand Down
1 change: 0 additions & 1 deletion commands/dns/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/spf13/cobra"

// "github.com/nanobox-io/nanobox/commands/steps"
"github.com/nanobox-io/nanobox/helpers"
"github.com/nanobox-io/nanobox/models"
app_dns "github.com/nanobox-io/nanobox/processors/app/dns"
Expand Down
1 change: 0 additions & 1 deletion commands/dns/remove_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/spf13/cobra"

// "github.com/nanobox-io/nanobox/commands/steps"
"github.com/nanobox-io/nanobox/helpers"
"github.com/nanobox-io/nanobox/models"
app_dns "github.com/nanobox-io/nanobox/processors/app/dns"
Expand Down
3 changes: 1 addition & 2 deletions commands/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ A namespaced collection of hidded subcommands used primarily as share provisioni
//
func init() {
// hidden subcommands
EnvCmd.AddCommand(env.ShareCmd)
EnvCmd.AddCommand(env.BridgeCmd)
EnvCmd.AddCommand(env.ServerCmd)
}
67 changes: 0 additions & 67 deletions commands/env/bridge.go

This file was deleted.

67 changes: 67 additions & 0 deletions commands/env/server.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package env

import (
"github.com/spf13/cobra"

"github.com/nanobox-io/nanobox/processors/server"
"github.com/nanobox-io/nanobox/util/display"
)

var (

// ServerCmd ...
ServerCmd = &cobra.Command{
Hidden: true,
Use: "server",
Short: "Server control",
Long: ``,
}

// ServerStartCmd ...
ServerStartCmd = &cobra.Command{
Hidden: true,
Use: "start",
Short: "Start the server",
Long: ``,
Run: serverStartFn,
}

// ServerStopCmd ...
ServerStopCmd = &cobra.Command{
Hidden: true,
Use: "stop",
Short: "Stop the server",
Long: ``,
Run: serverStopFn,
}

// ServerTeadownCmd ...
ServerTeadownCmd = &cobra.Command{
Hidden: true,
Use: "teardown",
Short: "Teardown the server",
Long: ``,
Run: serverTeardownFn,
}
)

//
func init() {
ServerCmd.AddCommand(ServerStartCmd)
ServerCmd.AddCommand(ServerStopCmd)
ServerCmd.AddCommand(ServerTeadownCmd)
}

func serverStartFn(ccmd *cobra.Command, args []string) {
display.CommandErr(server.Setup())
}

func serverStopFn(ccmd *cobra.Command, args []string) {

display.CommandErr(server.Stop())
}

func serverTeardownFn(ccmd *cobra.Command, args []string) {

display.CommandErr(server.Teardown())
}
85 changes: 0 additions & 85 deletions commands/env/share.go

This file was deleted.

7 changes: 7 additions & 0 deletions commands/server/registry.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package server

var registeredRPCs = []interface{}{}

func Register(i interface{}) {
registeredRPCs = append(registeredRPCs, i)
}
Loading

0 comments on commit 7ccdb1a

Please sign in to comment.