Skip to content

Commit

Permalink
Branch name and HTTPS updates
Browse files Browse the repository at this point in the history
  • Loading branch information
danhunsaker committed Jun 19, 2023
1 parent 7450280 commit 9bece63
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:

build:
runs-on: ubuntu-latest
# add static once all the static checks pass
# this will likely require an extensive refactor
needs: test
if: github.event_name != 'pull_request'
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Use "microbox [command] --help" for more information about a command.
### Documentation

- Microbox documentation is available at [docs.microbox.cloud](https://docs.microbox.cloud/).
- Guides for popular languages, frameworks and services are available at [guides.microbox.cloud](http://guides.microbox.cloud).
- Guides for popular languages, frameworks and services are available at [guides.microbox.cloud](https://guides.microbox.cloud).


## Contributing
Expand Down
2 changes: 1 addition & 1 deletion util/odin/odin.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
MICROBOX = "https://api.microbox.cloud/v1/"
WYCROBOX = "https://api.xn-box-wyc.cloud/v1/"
DEV = "http://api.microbox.local:8080/v1/"
SIM = "http://api.microbox.test/v1/"
SIM = "https://api.microbox.test/v1/"
)

var (
Expand Down
30 changes: 15 additions & 15 deletions util/provider/dockermachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func init() {

// Valid ensures docker-machine is installed and available
func (machine DockerMachine) Valid() (error, []string) {
var masterErr error // will hold a collection of any errors hit
var mainErr error // will hold a collection of any errors hit

missingParts := []string{}

Expand All @@ -49,25 +49,25 @@ func (machine DockerMachine) Valid() (error, []string) {
// append rather than return here so that we can check everything before erroring.
// otherwise a user could error multiple times, learning about one problem at a time.
missingParts = append(missingParts, "vboxmanage")
masterErr = fmt.Errorf("missing vboxmanage - %q", err.Error())
mainErr = fmt.Errorf("missing vboxmanage - %q", err.Error())
}
// check output for errors/instruction
if bytes.Contains(out, []byte("WARNING")) {
if masterErr == nil {
masterErr = fmt.Errorf("vboxmanage gave warning - \n%s", out)
if mainErr == nil {
mainErr = fmt.Errorf("vboxmanage gave warning - \n%s", out)
} else {
masterErr = fmt.Errorf("%s - vboxmanage gave warning - \n%s", masterErr.Error(), out)
mainErr = fmt.Errorf("%s - vboxmanage gave warning - \n%s", mainErr.Error(), out)
}
}

// return early if we are running native mounts
config, _ := models.LoadConfig()

if config.MountType == "native" {
if len(missingParts) == 0 && masterErr == nil {
if len(missingParts) == 0 && mainErr == nil {
return nil, missingParts
}
return masterErr, missingParts
return mainErr, missingParts
}

// net share checking
Expand All @@ -76,23 +76,23 @@ func (machine DockerMachine) Valid() (error, []string) {
out, err := exec.Command("netstat", "-tln").CombinedOutput()
if err != nil {
missingParts = append(missingParts, "nfs-kernel-server")
if masterErr == nil {
masterErr = fmt.Errorf("failed to check for netfs - %s", err.Error())
if mainErr == nil {
mainErr = fmt.Errorf("failed to check for netfs - %s", err.Error())
} else {
masterErr = fmt.Errorf("%s - failed to check for netfs - %s", masterErr.Error(), err.Error())
mainErr = fmt.Errorf("%s - failed to check for netfs - %s", mainErr.Error(), err.Error())
}
} else if !bytes.Contains(out, []byte("2049")) {
missingParts = append(missingParts, "nfs-kernel-server")
if masterErr == nil {
masterErr = fmt.Errorf("missing or not running netfs")
if mainErr == nil {
mainErr = fmt.Errorf("missing or not running netfs")
} else {
masterErr = fmt.Errorf("%s - missing or not running netfs", masterErr.Error())
mainErr = fmt.Errorf("%s - missing or not running netfs", mainErr.Error())
}
}

if err := exec.Command("exportfs").Run(); err != nil {
missingParts = append(missingParts, "exportfs")
masterErr = fmt.Errorf("%s - missing exportfs - %q", masterErr.Error(), err.Error())
mainErr = fmt.Errorf("%s - missing exportfs - %q", mainErr.Error(), err.Error())
}

case "darwin":
Expand All @@ -105,7 +105,7 @@ func (machine DockerMachine) Valid() (error, []string) {

}

return masterErr, missingParts
return mainErr, missingParts
}

func (machine DockerMachine) Status() string {
Expand Down
2 changes: 1 addition & 1 deletion util/update/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func Run(path string) error {
if !strings.Contains(path, "microbox-update") {
fmt.Printf("\nUpdated to version: %s\n\n", getCurrentVersion(path))
fmt.Println("Check out the release notes here:")
fmt.Println("https://github.com/mu-box/microbox/blob/master/CHANGELOG.md")
fmt.Println("https://github.com/mu-box/microbox/blob/main/CHANGELOG.md")
}

return update.Save()
Expand Down

4 comments on commit 9bece63

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠ gofmt failed (.)

commands/deploy.go
 	}{}
 )
 
-//
 func init() {
 	DeployCmd.Flags().BoolVarP(&deployCmdFlags.skipCompile, "skip-compile", "", false, "skip compiling the app")
 	DeployCmd.Flags().BoolVarP(&deployCmdFlags.force, "force", "", false, "force the deploy even if you have used this build on a previous deploy")
commands/dev/stop.go
 	steps.Build("dev stop", stopCheck, stopFn)
 }
 
-//
 // stopFn ...
 func stopFn(ccmd *cobra.Command, args []string) {
 	// TODO: check the app and return some message
commands/dns.go
 	}
 )
 
-//
 func init() {
 	DnsCmd.AddCommand(dns.AddCmd)
 	DnsCmd.AddCommand(dns.RemoveCmd)
commands/env.go
 	}
 )
 
-//
 func init() {
 	// hidden subcommands
 	EnvCmd.AddCommand(env.ServerCmd)
commands/env/server.go
 	}
 )
 
-//
 func init() {
 	ServerCmd.AddCommand(ServerStartCmd)
 	ServerCmd.AddCommand(ServerStopCmd)
commands/evar.go
 	}
 )
 
-//
 func init() {
 	EvarCmd.AddCommand(evar.AddCmd)
 	EvarCmd.AddCommand(evar.LoadCmd)
commands/login.go
 	}{}
 )
 
-//
 func init() {
 	LoginCmd.Flags().StringVarP(&loginCmdFlags.username, "username", "u", "", "username")
 	LoginCmd.Flags().StringVarP(&loginCmdFlags.password, "password", "p", "", "password")
commands/remote.go
 	}
 )
 
-//
 func init() {
 	RemoteCmd.AddCommand(RemoteAddCmd)
 	RemoteCmd.AddCommand(RemoteListCmd)
commands/tunnel.go
 	}{}
 )
 
-//
 func init() {
 	TunnelCmd.Flags().StringVarP(&portMap, "port", "p", "", "Specify a local[:destination] port to listen on and connect to.")
 }
generators/router/router.go
 	"github.com/mu-box/microbox/models"
 )
 
-//
 func loadBoxfile(appModel *models.App) boxfile.Boxfile {
 	return boxfile.New([]byte(appModel.DeployedBoxfile))
 }
generators/router/routes.go
 
 // buildRoutes ...
 //
-// Route struct {
-// 	// defines match characteristics
-// 	SubDomain string `json:"subdomain"` // subdomain to match on - "admin"
-// 	Domain    string `json:"domain"`    // domain to match on - "myapp.com"
-// 	Path      string `json:"path"`      // route to match on - "/admin"
-// 	// defines actions
-// 	Targets []string `json:"targets"` // ips of servers - ["http://127.0.0.1:8080/app1","http://127.0.0.2"] (optional)
-// 	FwdPath string   `json:"fwdpath"` // path to forward to targets - "/goadmin" incoming req: test.com/admin -> 127.0.0.1/goadmin (optional)
-// 	Page    string   `json:"page"`    // page to serve instead of routing to targets - "<HTML>We are fixing it</HTML>" (optional)
-// }
+//	Route struct {
+//		// defines match characteristics
+//		SubDomain string `json:"subdomain"` // subdomain to match on - "admin"
+//		Domain    string `json:"domain"`    // domain to match on - "myapp.com"
+//		Path      string `json:"path"`      // route to match on - "/admin"
+//		// defines actions
+//		Targets []string `json:"targets"` // ips of servers - ["http://127.0.0.1:8080/app1","http://127.0.0.2"] (optional)
+//		FwdPath string   `json:"fwdpath"` // path to forward to targets - "/goadmin" incoming req: test.com/admin -> 127.0.0.1/goadmin (optional)
+//		Page    string   `json:"page"`    // page to serve instead of routing to targets - "<HTML>We are fixing it</HTML>" (optional)
+//	}
 func buildComponentRoutes(boxfile boxfile.Boxfile, component *models.Component) []portal.Route {
 	portalRoutes := []portal.Route{}
 	boxRoutes, ok := boxfile.Value("routes").([]string)
processors/clean.go
 	"github.com/mu-box/microbox/util/locker"
 )
 
-//
 func Clean(envModels []*models.Env) error {
 	locker.GlobalLock()
 	defer locker.GlobalUnlock()
processors/code/setup.go
 	"github.com/mu-box/microbox/util/hookit"
 )
 
-//
 func Setup(appModel *models.App, componentModel *models.Component, warehouseConfig WarehouseConfig) error {
 	// generate the missing component data
 	if err := componentModel.Generate(appModel, "code"); err != nil {
processors/deploy.go
 	"github.com/mu-box/microbox/util/odin"
 )
 
-//
 func Deploy(envModel *models.Env, deployConfig DeployConfig) error {
 
 	appID := deployConfig.App
processors/platform/portal.go
 	return nil
 }
 
-//
 func portalClient(appModel *models.App) portal.PortalClient {
 	return portal.New(appModel.LocalIPs["env"]+":8443", "123")
 }
util/display/characters.go
 
 package display
 
-//  ...
+// ...
 var (
 	TaskSpinner  = []string{`⣷`, `⣯`, `⣟`, `⡿`, `⢿`, `⣻`, `⣽`, `⣾`}
 	TaskComplete = `✓`
util/provider/dockermachine.go
 	return nil
 }
 
-//
 func (machine DockerMachine) RemoveEnvDir(id string) error {
 	if id == "" {
 		return fmt.Errorf("invalid env id")
util/provider/native.go
 	return cmd.CombinedOutput()
 }
 
-//
 func (native Native) RemoveEnvDir(id string) error {
 	if id == "" {
 		return nil

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠ gocyclo failed (.)

6 function(s) exceeding a complexity of 15

Show Detail
27 odin doRequest util/odin/odin.go:326:1
25 processors ConfigureSet processors/configure_set.go:10:1
21 main main main.go:33:1
19 env Setup processors/env/setup.go:21:1
18 models (*Config).makeValid models/config.go:48:1
16 util OsArchDetect util/os.go:85:1
Average: 3.4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠ goimports failed (.)

commands/deploy.go
 	}{}
 )
 
-//
 func init() {
 	DeployCmd.Flags().BoolVarP(&deployCmdFlags.skipCompile, "skip-compile", "", false, "skip compiling the app")
 	DeployCmd.Flags().BoolVarP(&deployCmdFlags.force, "force", "", false, "force the deploy even if you have used this build on a previous deploy")
commands/dev/stop.go
 	steps.Build("dev stop", stopCheck, stopFn)
 }
 
-//
 // stopFn ...
 func stopFn(ccmd *cobra.Command, args []string) {
 	// TODO: check the app and return some message
commands/dns.go
 	}
 )
 
-//
 func init() {
 	DnsCmd.AddCommand(dns.AddCmd)
 	DnsCmd.AddCommand(dns.RemoveCmd)
commands/env.go
 	}
 )
 
-//
 func init() {
 	// hidden subcommands
 	EnvCmd.AddCommand(env.ServerCmd)
commands/env/server.go
 	}
 )
 
-//
 func init() {
 	ServerCmd.AddCommand(ServerStartCmd)
 	ServerCmd.AddCommand(ServerStopCmd)
commands/evar.go
 	}
 )
 
-//
 func init() {
 	EvarCmd.AddCommand(evar.AddCmd)
 	EvarCmd.AddCommand(evar.LoadCmd)
commands/login.go
 	}{}
 )
 
-//
 func init() {
 	LoginCmd.Flags().StringVarP(&loginCmdFlags.username, "username", "u", "", "username")
 	LoginCmd.Flags().StringVarP(&loginCmdFlags.password, "password", "p", "", "password")
commands/remote.go
 	}
 )
 
-//
 func init() {
 	RemoteCmd.AddCommand(RemoteAddCmd)
 	RemoteCmd.AddCommand(RemoteListCmd)
commands/tunnel.go
 	}{}
 )
 
-//
 func init() {
 	TunnelCmd.Flags().StringVarP(&portMap, "port", "p", "", "Specify a local[:destination] port to listen on and connect to.")
 }
generators/router/router.go
 	"github.com/mu-box/microbox/models"
 )
 
-//
 func loadBoxfile(appModel *models.App) boxfile.Boxfile {
 	return boxfile.New([]byte(appModel.DeployedBoxfile))
 }
generators/router/routes.go
 
 // buildRoutes ...
 //
-// Route struct {
-// 	// defines match characteristics
-// 	SubDomain string `json:"subdomain"` // subdomain to match on - "admin"
-// 	Domain    string `json:"domain"`    // domain to match on - "myapp.com"
-// 	Path      string `json:"path"`      // route to match on - "/admin"
-// 	// defines actions
-// 	Targets []string `json:"targets"` // ips of servers - ["http://127.0.0.1:8080/app1","http://127.0.0.2"] (optional)
-// 	FwdPath string   `json:"fwdpath"` // path to forward to targets - "/goadmin" incoming req: test.com/admin -> 127.0.0.1/goadmin (optional)
-// 	Page    string   `json:"page"`    // page to serve instead of routing to targets - "<HTML>We are fixing it</HTML>" (optional)
-// }
+//	Route struct {
+//		// defines match characteristics
+//		SubDomain string `json:"subdomain"` // subdomain to match on - "admin"
+//		Domain    string `json:"domain"`    // domain to match on - "myapp.com"
+//		Path      string `json:"path"`      // route to match on - "/admin"
+//		// defines actions
+//		Targets []string `json:"targets"` // ips of servers - ["http://127.0.0.1:8080/app1","http://127.0.0.2"] (optional)
+//		FwdPath string   `json:"fwdpath"` // path to forward to targets - "/goadmin" incoming req: test.com/admin -> 127.0.0.1/goadmin (optional)
+//		Page    string   `json:"page"`    // page to serve instead of routing to targets - "<HTML>We are fixing it</HTML>" (optional)
+//	}
 func buildComponentRoutes(boxfile boxfile.Boxfile, component *models.Component) []portal.Route {
 	portalRoutes := []portal.Route{}
 	boxRoutes, ok := boxfile.Value("routes").([]string)
processors/clean.go
 	"github.com/mu-box/microbox/util/locker"
 )
 
-//
 func Clean(envModels []*models.Env) error {
 	locker.GlobalLock()
 	defer locker.GlobalUnlock()
processors/code/setup.go
 	"github.com/mu-box/microbox/util/hookit"
 )
 
-//
 func Setup(appModel *models.App, componentModel *models.Component, warehouseConfig WarehouseConfig) error {
 	// generate the missing component data
 	if err := componentModel.Generate(appModel, "code"); err != nil {
processors/deploy.go
 	"github.com/mu-box/microbox/util/odin"
 )
 
-//
 func Deploy(envModel *models.Env, deployConfig DeployConfig) error {
 
 	appID := deployConfig.App
processors/platform/portal.go
 	return nil
 }
 
-//
 func portalClient(appModel *models.App) portal.PortalClient {
 	return portal.New(appModel.LocalIPs["env"]+":8443", "123")
 }
util/display/characters.go
 
 package display
 
-//  ...
+// ...
 var (
 	TaskSpinner  = []string{`⣷`, `⣯`, `⣟`, `⡿`, `⢿`, `⣻`, `⣽`, `⣾`}
 	TaskComplete = `✓`
util/provider/dockermachine.go
 	return nil
 }
 
-//
 func (machine DockerMachine) RemoveEnvDir(id string) error {
 	if id == "" {
 		return fmt.Errorf("invalid env id")
util/provider/native.go
 	return cmd.CombinedOutput()
 }
 
-//
 func (native Native) RemoveEnvDir(id string) error {
 	if id == "" {
 		return nil

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠ Failure Summary

  • misspell: fail
  • fmt: fail
  • vet: fail
  • cyclo: fail
  • imports: fail
  • ineffassign: fail
  • errcheck: fail
  • sec: fail
  • shadow: fail
  • staticcheck: fail

Please sign in to comment.