From e815e20e1ffcc63d9bdef74fb6c621ccfdc3b05b Mon Sep 17 00:00:00 2001 From: Hennik Hunsaker Date: Fri, 18 Feb 2022 05:46:03 -0700 Subject: [PATCH] Updates to the new name(space)s, and some cleanup Static tests are expected to fail at the moment. Further cleanup is required, but some issues are either false positives, or will need more extensive rewrites/refactors to address. Hopefully most of the most egregious issues are already addressed, though. Oh, and we also move frorm Travis to GitHub Actions. Huzzah! --- .github/workflows/ci.yml | 87 +++ .gitignore | 6 +- .travis.yml | 30 - CHANGELOG.md | 19 +- LICENSE | 2 +- Makefile | 80 ++- README.md | 58 +- boxfile.yml | 2 +- commands/build.go | 16 +- commands/clean.go | 10 +- commands/commands.go | 111 ++-- commands/compile.go | 12 +- commands/configure.go | 12 +- commands/console.go | 22 +- commands/deploy.go | 20 +- commands/destroy.go | 21 +- commands/dev/start.go | 19 +- commands/dev/stop.go | 14 +- commands/dns.go | 2 +- commands/dns/add.go | 10 +- commands/dns/list.go | 14 +- commands/dns/remove.go | 10 +- commands/dns/remove_all.go | 10 +- commands/env.go | 2 +- commands/env/server.go | 4 +- commands/evar.go | 2 +- commands/evar/add.go | 14 +- commands/evar/list.go | 14 +- commands/evar/load.go | 20 +- commands/evar/remove.go | 16 +- commands/implode.go | 12 +- commands/info.go | 12 +- commands/inspect.go | 4 +- commands/log.go | 18 +- commands/login.go | 16 +- commands/logout.go | 6 +- commands/registry/registry.go | 3 +- commands/remote.go | 12 +- commands/run.go | 20 +- commands/server/server.go | 38 +- commands/server/svc_unix.go | 1 + commands/server/svc_windows.go | 6 +- commands/sim/start.go | 18 +- commands/sim/stop.go | 10 +- commands/start.go | 16 +- commands/status.go | 6 +- commands/steps/run.go | 2 +- commands/stop.go | 10 +- commands/tunnel.go | 14 +- commands/update.go | 8 +- commands/version.go | 6 +- generators/containers/bridge.go | 8 +- generators/containers/build.go | 18 +- generators/containers/compile.go | 18 +- generators/containers/component.go | 6 +- .../containers/containers_internal_test.go | 2 +- generators/containers/containers_test.go | 12 +- generators/containers/dev.go | 20 +- generators/containers/environment.go | 2 +- generators/containers/publish.go | 18 +- generators/hooks/build/dev.go | 6 +- generators/hooks/build/publish.go | 2 +- generators/hooks/build/user.go | 6 +- generators/hooks/code/configure.go | 8 +- generators/hooks/code/deploy.go | 4 +- generators/hooks/code/fetch.go | 2 +- generators/hooks/component/component.go | 4 +- generators/hooks/component/configure.go | 2 +- generators/hooks/component/plan.go | 2 +- generators/hooks/component/start.go | 2 +- generators/hooks/component/update.go | 2 +- generators/router/certs.go | 4 +- generators/router/router.go | 4 +- generators/router/routes.go | 6 +- generators/router/services.go | 10 +- go.mod | 52 ++ go.sum | 84 +++ helpers/endpoint.go | 2 +- helpers/odin.go | 6 +- main.go | 32 +- manifest.xml | 4 +- models/app.go | 7 +- models/auth.go | 6 +- models/component.go | 2 +- models/db.go | 8 +- models/db_test.go | 4 +- models/env.go | 2 +- models/tunnel.go | 2 +- models/version.go | 8 +- processors/app/deploy.go | 24 +- processors/app/destroy.go | 24 +- processors/app/dns/add.go | 10 +- processors/app/dns/list.go | 4 +- processors/app/dns/remove.go | 12 +- processors/app/dns/remove_all.go | 10 +- processors/app/evar/add.go | 8 +- processors/app/evar/list.go | 2 +- processors/app/evar/remove.go | 6 +- processors/app/info.go | 6 +- processors/app/setup.go | 12 +- processors/app/start.go | 10 +- processors/app/stop.go | 23 +- processors/build.go | 14 +- processors/clean.go | 10 +- processors/code/build.go | 24 +- processors/code/code.go | 12 +- processors/code/compile.go | 16 +- processors/code/destroy.go | 10 +- processors/code/publish.go | 30 +- processors/code/setup.go | 18 +- processors/code/sync.go | 12 +- processors/compile.go | 12 +- processors/component/clean.go | 8 +- processors/component/component.go | 8 +- processors/component/destroy.go | 10 +- processors/component/setup.go | 18 +- processors/component/start.go | 8 +- processors/component/start_all.go | 6 +- processors/component/stop.go | 8 +- processors/component/stop_all.go | 6 +- processors/component/sync.go | 8 +- processors/configure.go | 58 +- processors/configure_set.go | 2 +- processors/console.go | 20 +- processors/deploy.go | 18 +- processors/env/console.go | 10 +- processors/env/destroy.go | 24 +- processors/env/mount.go | 10 +- processors/env/setup.go | 16 +- processors/env/share/add.go | 4 +- processors/env/share/remove.go | 4 +- processors/env/unmount.go | 12 +- processors/evar/add.go | 10 +- processors/evar/list.go | 8 +- processors/evar/remove.go | 10 +- processors/implode.go | 26 +- processors/log/log.go | 32 +- processors/login.go | 28 +- processors/logout.go | 8 +- processors/platform/mist.go | 10 +- processors/platform/platform.go | 8 +- processors/platform/portal.go | 8 +- processors/platform/provision.go | 6 +- processors/platform/setup.go | 6 +- processors/platform/stop.go | 6 +- processors/provider/bridge/bridge.go | 9 +- processors/provider/bridge/setup.go | 27 +- processors/provider/bridge/start.go | 2 +- processors/provider/bridge/stop.go | 2 +- processors/provider/bridge/teardown.go | 6 +- processors/provider/destroy.go | 8 +- processors/provider/init.go | 8 +- processors/provider/setup.go | 16 +- processors/provider/stop.go | 12 +- processors/remote/add.go | 16 +- processors/remote/list.go | 2 +- processors/remote/remove.go | 6 +- processors/run.go | 36 +- processors/server/setup.go | 30 +- processors/server/start.go | 10 +- processors/server/stop.go | 20 +- processors/server/teardown.go | 20 +- processors/start.go | 6 +- processors/status.go | 4 +- processors/stop.go | 65 ++- processors/submit_log.go | 16 +- processors/tunnel.go | 18 +- processors/update.go | 14 +- scripts/build.sh | 30 +- scripts/upload.sh | 2 +- staticcheck.conf | 1 + updater/main.go | 24 +- util/config/config_internal_test.go | 13 +- util/config/dirs.go | 13 +- util/config/files.go | 2 +- util/config/vars.go | 16 +- util/console/console.go | 12 +- util/dhcp/dhcp.go | 12 +- util/dhcp/dhcp_test.go | 30 +- util/display/characters.go | 7 +- util/display/characters_windows.go | 7 +- util/display/command_error.go | 44 +- util/display/display.go | 2 +- util/display/docker_percent.go | 2 +- util/display/logs.go | 6 +- util/display/messages.go | 56 +- util/display/privilege_unix.go | 1 + util/display/privilege_windows.go | 1 + util/display/prompt.go | 2 +- util/display/prompt_unix.go | 1 + util/display/prompt_windows.go | 1 + util/display/summary.go | 4 +- util/dns/dns.go | 14 +- util/dns/dns_unix.go | 1 + util/dns/dns_windows.go | 1 + util/error.go | 2 +- util/exec.go | 4 +- util/hookit/hookit.go | 10 +- util/locker/global.go | 2 +- util/locker/local.go | 8 +- util/locker/locker_internal_test.go | 4 +- util/{nanoagent => microagent}/connect.go | 6 +- util/{nanoagent => microagent}/console.go | 12 +- util/{nanoagent => microagent}/ssh.go | 9 +- util/{nanoagent => microagent}/tunnel.go | 10 +- util/mixpanel/mixpanel.go | 4 +- util/odin/odin.go | 36 +- util/os.go | 100 +++- util/provider/bridge/bridge.go | 3 +- util/provider/bridge/start.go | 4 +- util/provider/bridge/stop.go | 2 +- util/provider/dockermachine.go | 102 ++-- util/provider/dockermachine_mount.go | 24 +- util/provider/dockermachine_mount_unix.go | 3 +- util/provider/dockermachine_mount_windows.go | 8 +- util/provider/native.go | 20 +- util/provider/provider.go | 4 +- util/provider/share/rpc.go | 2 +- util/provider/share/share_darwin.go | 8 +- util/provider/share/share_linux.go | 4 +- util/provider/share/share_test.go | 10 +- util/provider/share/share_windows.go | 8 +- util/service/remove_unix.go | 3 +- util/service/service_linux.go | 8 +- util/service/start_unix.go | 3 +- util/service/stop_unix.go | 3 +- util/terminal_size.go | 1 + util/update/check.go | 14 +- util/update/name.go | 5 +- util/update/name_windows.go | 4 +- util/update/run.go | 10 +- util/update/update.go | 8 +- util/util.go | 4 +- util/util_test.go | 4 +- util/util_unix.go | 7 +- util/util_windows.go | 5 +- util/vbox/vbox_unix.go | 1 + util/vbox/vbox_windows.go | 1 + util/watch/crawl_internal_test.go | 8 +- util/watch/notify_internal_test.go | 8 +- util/watch/watch.go | 28 +- vendor/vendor.json | 535 ------------------ 242 files changed, 1782 insertions(+), 1962 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml create mode 100644 go.mod create mode 100644 go.sum create mode 100644 staticcheck.conf rename util/{nanoagent => microagent}/connect.go (78%) rename util/{nanoagent => microagent}/console.go (88%) rename util/{nanoagent => microagent}/ssh.go (87%) rename util/{nanoagent => microagent}/tunnel.go (91%) delete mode 100644 vendor/vendor.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..5c6e20b0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,87 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + static: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Run the checks + uses: danhunsaker/golang-github-actions@main + with: + run: misspell,fmt,vet,cyclo,imports,ineffassign,errcheck,sec,shadow,staticcheck + ignore-defer: true + flags: '{"sec": "-exclude=G104"}' + token: ${{ secrets.GITHUB_TOKEN }} + env: + PATH: '/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-go@v2 + with: + go-version: '^1.17' + + - name: Setup dependencies + run: | + go get -t ./... + + - name: Run the tests + run: go test -v ./... + + build: + runs-on: ubuntu-latest + needs: test + if: github.event_name != 'pull_request' + # These permissions are needed to interact with GitHub's OIDC Token endpoint. + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v2 + + # the default image for act doesn't include this tool, but the actual GHA environment does... + - name: (LOCAL ONLY) Install AWS CLI + if: github.actor == 'nektos/act' + run: | + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + unzip -q awscliv2.zip + sudo ./aws/install + + - uses: actions/setup-go@v2 + with: + go-version: '^1.17' + + - name: Setup dependencies + run: | + go install github.com/mitchellh/gox@latest + go get -t ./... + + - name: Build + run: | + ./scripts/build.sh + + - name: Configure AWS credentials for publication + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/s3-write + role-duration-seconds: 1200 + aws-region: us-east-1 + + - name: Publish + run: | + ./scripts/upload.sh diff --git a/.gitignore b/.gitignore index a17f237a..3d985f6a 100644 --- a/.gitignore +++ b/.gitignore @@ -26,8 +26,8 @@ _testmain.go # Project specific files .DS_Store TODO -nanobox -nanobox-* +microbox +microbox-* updater/updater updater/updater-* .build @@ -36,3 +36,5 @@ Icon .sync nb.setup vendor/*/ +.env +.secrets diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8f4fda85..00000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -sudo: required - -language: go - -# ~1 hour is too long to wait for an osx container, plus docker/dependencies -dist: trusty - -go: - - 1.9 - -before_install: - - docker version - - ifconfig - - sudo -H pip install awscli - -install: - - go get github.com/kardianos/govendor - - go get github.com/mitchellh/gox - - govendor sync - -script: - - govendor test +local -v - -after_success: - - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) - - 'if [ "$BRANCH" == "master" ]; then - ./scripts/build.sh; - ./scripts/upload.sh; - curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Travis-API-Version: 3" -H "Authorization: token ${TRAVIS_TOKEN}" -d "{\"request\":{\"branch\":\"master\"}}" https://api.travis-ci.org/repo/nanobox-io%2Fnanobox-installers/requests; - fi' \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 55827554..7f7b3928 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,14 @@ -## 2.3.1 (unreleased) +## 2.4.0 (unreleased) FEATURES: + - Switch to the microbox name and namespaces for all future distribution + - Build for all the same os/arch combos as Docker itself + - Switch from vendored dependencies to go modules - Allow `-v` and `--version` to print version [#612](https://github.com/nanobox-io/nanobox/pull/612) - Make nanobox-server service able to survive reboots [#612](https://github.com/nanobox-io/nanobox/pull/612) - Add dns alias' to run and dry-run containers [#592](https://github.com/nanobox-io/nanobox/pull/592) - Support service configuration enhancements [#586](https://github.com/nanobox-io/nanobox/pull/586) - - Support password protected ssh keys [#576](https://github.com/nanobox-io/nanobox/pull/576)[#580](https://github.com/nanobox-io/nanobox/pull/580)[#582](https://github.com/nanobox-io/nanobox/pull/582) + - Support password protected ssh keys [#576](https://github.com/nanobox-io/nanobox/pull/576) [#580](https://github.com/nanobox-io/nanobox/pull/580) [#582](https://github.com/nanobox-io/nanobox/pull/582) - Untrack vendored files [#567](https://github.com/nanobox-io/nanobox/pull/567) BUG FIXES: @@ -14,7 +17,7 @@ BUG FIXES: - Fix panic on linux if nfs isn't running [#601](https://github.com/nanobox-io/nanobox/pull/601) - Handle `nanobox-update` not being in global path [#596](https://github.com/nanobox-io/nanobox/pull/596) - Fix fast notify watcher warning typos [#594](https://github.com/nanobox-io/nanobox/pull/594) - - Update `--help` docs for cli [#593](https://github.com/nanobox-io/nanobox/pull/593)[#598](https://github.com/nanobox-io/nanobox/pull/598) + - Update `--help` docs for cli [#593](https://github.com/nanobox-io/nanobox/pull/593) [#598](https://github.com/nanobox-io/nanobox/pull/598) - Only pull `nanobox/*` images on `update-images` [#591](https://github.com/nanobox-io/nanobox/pull/591) - Only add valid, un-password protected ssh keys [#572](https://github.com/nanobox-io/nanobox/pull/572) - Fix regression and allow multiple apps on osx [#571](https://github.com/nanobox-io/nanobox/pull/571) @@ -24,8 +27,8 @@ BUG FIXES: ## 2.3.0 (Sept 1, 2017) FEATURES: - - Support setting custom tunnel destination port [#561](https://github.com/nanobox-io/nanobox/pull/561)[#564](https://github.com/nanobox-io/nanobox/pull/564) - - Support streaming production logs [#549](https://github.com/nanobox-io/nanobox/pull/549)[#562](https://github.com/nanobox-io/nanobox/pull/562) + - Support setting custom tunnel destination port [#561](https://github.com/nanobox-io/nanobox/pull/561) [#564](https://github.com/nanobox-io/nanobox/pull/564) + - Support streaming production logs [#549](https://github.com/nanobox-io/nanobox/pull/549) [#562](https://github.com/nanobox-io/nanobox/pull/562) - Allow either username or email address for login [#565](https://github.com/nanobox-io/nanobox/pull/565) BUG FIXES: @@ -42,7 +45,7 @@ FEATURES: - Support loading evars from files [#535](https://github.com/nanobox-io/nanobox/pull/535) - Unify removing evars (case insensitivity) [#539](https://github.com/nanobox-io/nanobox/pull/535) - Add universal versioning [#506](https://github.com/nanobox-io/nanobox/pull/506) - - Add suggestions for common problems [#515](https://github.com/nanobox-io/nanobox/pull/515)[#517](https://github.com/nanobox-io/nanobox/pull/517)[#521](https://github.com/nanobox-io/nanobox/pull/521) + - Add suggestions for common problems [#515](https://github.com/nanobox-io/nanobox/pull/515) [#517](https://github.com/nanobox-io/nanobox/pull/517) [#521](https://github.com/nanobox-io/nanobox/pull/521) BUG FIXES: - Check for boxfile and validate in separate steps [#512](https://github.com/nanobox-io/nanobox/pull/512) @@ -88,14 +91,14 @@ FEATURES: BUG FIXES: - Add idempotency to linux systemd service start [#399](https://github.com/nanobox-io/nanobox/pull/399) - - Fix an issue where the dev container disappeard unexpectedly [#402](https://github.com/nanobox-io/nanobox/pull/402) + - Fix an issue where the dev container disappeared unexpectedly [#402](https://github.com/nanobox-io/nanobox/pull/402) - Fix an issue that caused us to pull s3 for updates every time [#396](https://github.com/nanobox-io/nanobox/pull/396) - Fix an issue with /etc/exports on osx [#392](https://github.com/nanobox-io/nanobox/pull/392) FEATURES: - Make linux startup system more flexable [#397](https://github.com/nanobox-io/nanobox/pull/397) - Optimize display of summarized test [#395](https://github.com/nanobox-io/nanobox/pull/395) - - Add a check in for boxfile existance [#388](https://github.com/nanobox-io/nanobox/pull/388) + - Add a check in for boxfile existence [#388](https://github.com/nanobox-io/nanobox/pull/388) ## 2.0.3 (February 23, 2017) diff --git a/LICENSE b/LICENSE index 270b749c..958ff38e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Nanobox +Copyright (c) 2019 Microbox Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile index d19be82a..189686f3 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ -TAG=`git describe --always --tags --abbrev=0 | tr -d "[v\r\n]"` -COMMIT=`git rev-parse --short HEAD | tr -d "[ \r\n\']"` -BUILD_DATE=`date -u +%y%m%dT%H%M` -GITSTATUS='$(shell git status 2> /dev/null | tail -n1)' -DIRTY="$(shell [ $(GITSTATUS) = 'no changes added to commit (use "git add" and/or "git commit -a")' ] && echo -n "*")" -GO_LDFLAGS="-s -X github.com/nanobox-io/nanobox/util/odin.apiKey=$(API_KEY) -X github.com/nanobox-io/nanobox/models.nanoVersion=$(TAG) -X github.com/nanobox-io/nanobox/models.nanoCommit=$(COMMIT)$(DIRTY) -X github.com/nanobox-io/nanobox/models.nanoBuild=$(BUILD_DATE)" +TAG=$(shell git describe --always --tags --abbrev=0 | tr -d "[v\r\n]") +TAGDIR=$(shell echo $(TAG) | sed -E 's/([0-9]+)\..+/v\1/') +COMMIT=$(shell git rev-parse --short HEAD | tr -d "[ \r\n\']") +BUILD_DATE=$(shell date -u +%Y%m%dT%H%M%S) +GITSTATUS=$(shell git status 2> /dev/null | tail -n1) +DIRTY=$(shell [ "$(GITSTATUS)" = 'nothing to commit, working tree clean' ] || echo -n "+") +GO_LDFLAGS="-s -X github.com/mu-box/microbox/util/odin.apiKey=$(API_KEY) -X github.com/mu-box/microbox/models.microVersion=$(TAG) -X github.com/mu-box/microbox/models.microCommit=$(COMMIT)$(DIRTY) -X github.com/mu-box/microbox/models.microBuild=$(BUILD_DATE)" -default: build +default: all local: linux windows darwin @@ -13,29 +14,62 @@ clean: @echo "Cleaning old builds" @rm -rf "./.build" +all: build + # go get github.com/mitchellh/gox build: clean - @echo "Building nanobox" - @gox -ldflags=$(GO_LDFLAGS) -osarch "darwin/amd64 linux/amd64 windows/amd64" -output="./.build/v2/{{.OS}}/{{.Arch}}/nanobox" - @echo -en "Nanobox Version $(TAG)-$(BUILD_DATE) ($(COMMIT))" > ./.build/v2/version - @echo "Building nanobox-update" - @cd ./updater && gox -osarch "darwin/amd64 linux/amd64 windows/amd64" -ldflags="-s" -output="../.build/v2/{{.OS}}/{{.Arch}}/nanobox-update" + @echo "Building microbox" + @gox -ldflags=$(GO_LDFLAGS) -osarch "darwin/amd64 darwin/arm64 linux/amd64 linux/arm linux/arm64 linux/s390x windows/amd64" -output="./.build/$(TAGDIR)/{{.OS}}/{{.Arch}}/microbox" + @echo -n "Microbox Version $(TAG)-$(BUILD_DATE) ($(COMMIT)$(DIRTY))" > ./.build/$(TAGDIR)/version + @echo "Building microbox-update" + @cd ./updater && gox -osarch "darwin/amd64 darwin/arm64 linux/amd64 linux/arm linux/arm64 linux/s390x windows/amd64" -ldflags="-s" -output="../.build/$(TAGDIR)/{{.OS}}/{{.Arch}}/microbox-update" + + +native: + @echo "Building microbox (native os/arch)" + @go build -ldflags=$(GO_LDFLAGS) -o microbox + + +linux: linux-amd64 linux-arm32 linux-arm64 linux-s390x + +linux-amd64: + @echo "Building microbox-linux-amd64" + @GOOS=linux GOARCH=amd64 go build -ldflags=$(GO_LDFLAGS) -o microbox-linux-amd64 + +linux-arm32: + @echo "Building microbox-linux-arm32" + @GOOS=linux GOARCH=arm go build -ldflags=$(GO_LDFLAGS) -o microbox-linux-arm32 + +linux-arm64: + @echo "Building microbox-linux-arm64" + @GOOS=linux GOARCH=arm64 go build -ldflags=$(GO_LDFLAGS) -o microbox-linux-arm64 + +linux-s390x: + @echo "Building microbox-linux-s390x" + @GOOS=linux GOARCH=s390x go build -ldflags=$(GO_LDFLAGS) -o microbox-linux-s390x + + +windows: windows-amd64 + +windows-amd64: + @echo "Building microbox-windows-amd64" + @GOOS=windows GOARCH=amd64 go build -ldflags=$(GO_LDFLAGS) -o microbox-windows-amd64 + + +darwin: darwin-amd64 darwin-arm64 -linux: - @echo "Building nanobox-linux" - @GOOS=linux go build -ldflags=$(GO_LDFLAGS) -o nanobox-linux +darwin-amd64: + @echo "Building microbox-darwin-amd64" + @GOOS=darwin GOARCH=amd64 go build -ldflags=$(GO_LDFLAGS) -o microbox-darwin-amd64 -windows: - @echo "Building nanobox-windows" - @GOOS=windows go build -ldflags=$(GO_LDFLAGS) -o nanobox-windows +darwin-arm64: + @echo "Building microbox-darwin-arm64" + @GOOS=darwin GOARCH=arm64 go build -ldflags=$(GO_LDFLAGS) -o microbox-darwin-arm64 -darwin: - @echo "Building nanobox-darwin" - @GOOS=darwin go build -ldflags=$(GO_LDFLAGS) -o nanobox-darwin # go get github.com/kardianos/govendor test: - @govendor test +local -v + @go test -v ./... -.PHONY: fmt test clean build linux windows darwin +.PHONY: test clean all build native linux windows windows-amd64 darwin darwin-amd64 darwin-arm64 diff --git a/README.md b/README.md index 18738431..c698f6ec 100644 --- a/README.md +++ b/README.md @@ -1,84 +1,84 @@ -[![nanoboxdesktop logo](http://nano-assets.gopagoda.io/readme-headers/nanoboxdesktop.png)](http://nanobox.io/open-source#nanoboxdesktop) -[![Build Status](https://travis-ci.org/nanobox-io/nanobox.svg)](https://travis-ci.org/nanobox-io/nanobox) +[![microboxdesktop logo](http://assets.microbox.rocks/readme-headers/microboxdesktop.png)](http://microbox.cloud/open-source#microboxdesktop) +[![Build Status](https://travis-ci.org/mu-box/microbox.svg)](https://travis-ci.org/mu-box/microbox) -## Nanobox +## Microbox -[Nanobox](https://nanobox.io/) automates the creation of isolated, repeatable environments for local and production applications. When developing locally, Nanobox provisions your app's infrastructure inside of a virtual machine (VM) and mounts your local codebase into the VM. Any changes made to your codebase are reflected inside the virtual environment. +[Microbox](https://microbox.cloud/) automates the creation of isolated, repeatable environments for local and production applications. When developing locally, Microbox provisions your app's infrastructure inside of a virtual machine (VM) and mounts your local codebase into the VM. Any changes made to your codebase are reflected inside the virtual environment. -Once code is built and tested locally, Nanobox provisions and deploys an identical infrastructure on a production platform. +Once code is built and tested locally, Microbox provisions and deploys an identical infrastructure on a production platform. ## How It Works -Nanobox uses [Virtual Box](http://virtualbox.org) and [Docker](https://www.docker.com/) to create virtual development environments on your local machine. App configuration is handled in the [boxfile.yml](https://docs.nanobox.io/boxfile/), a small yaml config file used to provision and configure your apps' environments both locally and in production. +Microbox uses [Virtual Box](http://virtualbox.org) and [Docker](https://www.docker.com/) to create virtual development environments on your local machine. App configuration is handled in the [boxfile.yml](https://docs.microbox.cloud/boxfile/), a small yaml config file used to provision and configure your apps' environments both locally and in production. -## Why Nanobox? +## Why Microbox? -Nanobox allows you to stop configuring environments and just code. It guarantees that any project you start will work the same for anyone else collaborating on the project. When it's time to launch the project, you'll know that your production app will work, because it already works locally. +Microbox allows you to stop configuring environments and just code. It guarantees that any project you start will work the same for anyone else collaborating on the project. When it's time to launch the project, you'll know that your production app will work, because it already works locally. ### Installation -By using the [Nanobox installer](https://nanobox.io/download). *(Recommended)* .The installer includes all required dependencies (Virtual Box & Docker). +By using the [Microbox installer](https://microbox.cloud/download). *(Recommended)* .The installer includes all required dependencies (Virtual Box & Docker). ### Usage ``` Usage: - nanobox [flags] - nanobox [command] + microbox [flags] + microbox [command] Available Commands: - configure Configure Nanobox. + configure Configure Microbox. run Start your local development environment. build-runtime Build your app's runtime. compile-app Compile your application. deploy Deploy your application to a live remote or a dry-run environment. console Open an interactive console inside a component. remote Manage application remotes. - status Display the status of your Nanobox VM & apps. - login Authenticate your nanobox client with your nanobox.io account. - logout Remove your nanobox.io api token from your local nanobox client. + status Display the status of your Microbox VM & apps. + login Authenticate your microbox client with your microbox.cloud account. + logout Remove your microbox.cloud api token from your local microbox client. clean Clean out any apps that no longer exist. info Show information about the specified environment. tunnel Create a secure tunnel between your local machine & a live component. - implode Remove all Nanobox-created containers, files, & data. - destroy Destroy the current project and remove it from Nanobox. - start Start the Nanobox virtual machine. - stop Stop the Nanobox virtual machine. + implode Remove all Microbox-created containers, files, & data. + destroy Destroy the current project and remove it from Microbox. + start Start the Microbox virtual machine. + stop Stop the Microbox virtual machine. update-images Updates docker images. evar Manage environment variables. dns Manage dns aliases for local applications. log Streams application logs. - version Show the current Nanobox version. - server Start a dedicated nanobox server + version Show the current Microbox version. + server Start a dedicated microbox server Flags: --debug In the event of a failure, drop into debug context - -h, --help help for nanobox + -h, --help help for microbox -t, --trace Increases display output and sets level to trace -v, --verbose Increases display output and sets level to debug -Use "nanobox [command] --help" for more information about a command. +Use "microbox [command] --help" for more information about a command. ``` ### Documentation -- Nanobox documentation is available at [docs.nanobox.io](https://docs.nanobox.io/). -- Guides for popular languages, frameworks and services are avaialble at [guides.nanobox.io](http://guides.nanobox.io). +- 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). ## Contributing -Contributing to Nanobox is easy. Just follow these [contribution guidelines](https://docs.nanobox.io/contributing/). -Nanobox uses [govendor](https://github.com/kardianos/govendor#the-vendor-tool-for-go) to vendor dependencies. Use `govendor sync` to restore dependencies. +Contributing to Microbox is easy. Just follow these [contribution guidelines](https://docs.microbox.cloud/contributing/). +Microbox uses [govendor](https://github.com/kardianos/govendor#the-vendor-tool-for-go) to vendor dependencies. Use `govendor sync` to restore dependencies. ### Contact -For help using Nanobox or if you have any questions/suggestions, please reach out to help@nanobox.io or find us on [slack](https://slack.nanoapp.io/). You can also [create a new issue on this project](https://github.com/nanobox-io/nanobox/issues/new). +For help using Microbox or if you have any questions/suggestions, please reach out to help@microbox.cloud or find us on [slack](https://slack.microbox.rocks/). You can also [create a new issue on this project](https://github.com/mu-box/microbox/issues/new). -[![nanobox logo](http://nano-assets.gopagoda.io/open-src/nanobox-open-src.png)](https://nanobox.io/open-source/) +[![microbox logo](http://assets.microbox.rocks/open-src/microbox-open-src.png)](https://microbox.cloud/open-source/) diff --git a/boxfile.yml b/boxfile.yml index 855ecd9a..7bbed31d 100644 --- a/boxfile.yml +++ b/boxfile.yml @@ -1,7 +1,7 @@ run.config: engine: golang engine.config: - package: github.com/nanobox-io/nanobox + package: github.com/mu-box/microbox dev_packages: - py27-awscli - coreutils diff --git a/commands/build.go b/commands/build.go index 6e4fd825..1a593abd 100644 --- a/commands/build.go +++ b/commands/build.go @@ -1,16 +1,16 @@ package commands import ( - "github.com/nanobox-io/nanobox-boxfile" + boxfile "github.com/mu-box/microbox-boxfile" "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/generators/hooks/build" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/generators/hooks/build" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) var ( diff --git a/commands/clean.go b/commands/clean.go index 9118a709..9f125b70 100644 --- a/commands/clean.go +++ b/commands/clean.go @@ -5,10 +5,10 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/util/display" ) var ( @@ -19,7 +19,7 @@ var ( Short: "Clean out any apps that no longer exist.", Long: ` Clean out any apps whose working directory no longer exists. This -will remove all associated app information from your Nanobox database. +will remove all associated app information from your Microbox database. `, PreRun: steps.Run("start"), Run: cleanFn, diff --git a/commands/commands.go b/commands/commands.go index 781a4521..46001c0d 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -1,4 +1,4 @@ -// Package commands defines the commands that nanobox can run +// Package commands defines the commands that microbox can run package commands import ( @@ -10,14 +10,14 @@ import ( "github.com/jcelliott/lumber" "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/commands/server" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/update" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/commands/server" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/update" ) var ( @@ -34,15 +34,15 @@ var ( showVersion bool endpoint string - // NanoboxCmd ... - NanoboxCmd = &cobra.Command{ - Use: "nanobox", + // MicroboxCmd ... + MicroboxCmd = &cobra.Command{ + Use: "microbox", Short: "", Long: ``, PersistentPreRun: func(ccmd *cobra.Command, args []string) { - // report the command to nanobox - processors.SubmitLog(strings.Replace(ccmd.CommandPath(), "nanobox ", "", 1)) - // mixpanel.Report(strings.Replace(ccmd.CommandPath(), "nanobox ", "", 1)) + // report the command to microbox + processors.SubmitLog(strings.Replace(ccmd.CommandPath(), "microbox ", "", 1)) + // mixpanel.Report(strings.Replace(ccmd.CommandPath(), "microbox ", "", 1)) registry.Set("debug", debugMode) @@ -62,13 +62,18 @@ var ( // alert the user if an update is needed update.Check() + if _, err := util.OsArchDetect(); err != nil { + fmt.Println(err) + os.Exit(126) // Command invoked cannot execute + } + configModel, _ := models.LoadConfig() // TODO: look into global messaging if internalCommand { registry.Set("internal", internalCommand) // setup a file logger, this will be replaced in verbose mode. - fileLogger, _ := lumber.NewAppendLogger(filepath.ToSlash(filepath.Join(config.GlobalDir(), "nanobox.log"))) + fileLogger, _ := lumber.NewAppendLogger(filepath.ToSlash(filepath.Join(config.GlobalDir(), "microbox.log"))) lumber.SetLogger(fileLogger) } else { @@ -81,9 +86,9 @@ var ( !configModel.CIMode && !strings.Contains(fullCmd, "set ci") && !strings.Contains(ccmd.CommandPath(), "server") { - // if it is not an internal command (starting the server requires privilages) - // we wont run nanobox as privilage - display.UnexpectedPrivilage() + // if it is not an internal command (starting the server requires privileges) + // we wont run microbox as privilege + display.UnexpectedPrivilege() os.Exit(1) } } @@ -110,18 +115,18 @@ var ( } ) -// init creates the list of available nanobox commands and sub commands +// init creates the list of available microbox commands and sub commands func init() { // persistent flags - NanoboxCmd.PersistentFlags().StringVarP(&endpoint, "endpoint", "e", "", "production endpoint") - NanoboxCmd.PersistentFlags().MarkHidden("endpoint") - NanoboxCmd.PersistentFlags().BoolVarP(&internalCommand, "internal", "", false, "Skip pre-requisite checks") - NanoboxCmd.PersistentFlags().MarkHidden("internal") - NanoboxCmd.PersistentFlags().BoolVarP(&debugMode, "debug", "", false, "In the event of a failure, drop into debug context") - NanoboxCmd.PersistentFlags().BoolVarP(&displayDebugMode, "verbose", "v", false, "Increases display output and sets level to debug") - NanoboxCmd.PersistentFlags().BoolVarP(&showVersion, "version", "", false, "Print version information and exit") - NanoboxCmd.PersistentFlags().BoolVarP(&displayTraceMode, "trace", "t", false, "Increases display output and sets level to trace") + MicroboxCmd.PersistentFlags().StringVarP(&endpoint, "endpoint", "e", "", "production endpoint") + MicroboxCmd.PersistentFlags().MarkHidden("endpoint") + MicroboxCmd.PersistentFlags().BoolVarP(&internalCommand, "internal", "", false, "Skip pre-requisite checks") + MicroboxCmd.PersistentFlags().MarkHidden("internal") + MicroboxCmd.PersistentFlags().BoolVarP(&debugMode, "debug", "", false, "In the event of a failure, drop into debug context") + MicroboxCmd.PersistentFlags().BoolVarP(&displayDebugMode, "verbose", "v", false, "Increases display output and sets level to debug") + MicroboxCmd.PersistentFlags().BoolVarP(&showVersion, "version", "", false, "Print version information and exit") + MicroboxCmd.PersistentFlags().BoolVarP(&displayTraceMode, "trace", "t", false, "Increases display output and sets level to trace") // log specific flags LogCmd.Flags().BoolVarP(&logRaw, "raw", "r", false, "Print raw log timestamps instead") @@ -133,31 +138,31 @@ func init() { // LogCmd.Flags().StringVarP(&logLimit, "limit", "", "", "Time to limit amount of historic logs to print") // subcommands - NanoboxCmd.AddCommand(ConfigureCmd) - NanoboxCmd.AddCommand(RunCmd) - NanoboxCmd.AddCommand(BuildCmd) - NanoboxCmd.AddCommand(CompileCmd) - NanoboxCmd.AddCommand(DeployCmd) - NanoboxCmd.AddCommand(ConsoleCmd) - NanoboxCmd.AddCommand(RemoteCmd) - NanoboxCmd.AddCommand(StatusCmd) - NanoboxCmd.AddCommand(LoginCmd) - NanoboxCmd.AddCommand(LogoutCmd) - NanoboxCmd.AddCommand(CleanCmd) - NanoboxCmd.AddCommand(InfoCmd) - NanoboxCmd.AddCommand(TunnelCmd) - NanoboxCmd.AddCommand(ImplodeCmd) - NanoboxCmd.AddCommand(DestroyCmd) - NanoboxCmd.AddCommand(StartCmd) - NanoboxCmd.AddCommand(StopCmd) - NanoboxCmd.AddCommand(UpdateCmd) - NanoboxCmd.AddCommand(EvarCmd) - NanoboxCmd.AddCommand(DnsCmd) - NanoboxCmd.AddCommand(LogCmd) - NanoboxCmd.AddCommand(VersionCmd) - NanoboxCmd.AddCommand(server.ServerCmd) + MicroboxCmd.AddCommand(ConfigureCmd) + MicroboxCmd.AddCommand(RunCmd) + MicroboxCmd.AddCommand(BuildCmd) + MicroboxCmd.AddCommand(CompileCmd) + MicroboxCmd.AddCommand(DeployCmd) + MicroboxCmd.AddCommand(ConsoleCmd) + MicroboxCmd.AddCommand(RemoteCmd) + MicroboxCmd.AddCommand(StatusCmd) + MicroboxCmd.AddCommand(LoginCmd) + MicroboxCmd.AddCommand(LogoutCmd) + MicroboxCmd.AddCommand(CleanCmd) + MicroboxCmd.AddCommand(InfoCmd) + MicroboxCmd.AddCommand(TunnelCmd) + MicroboxCmd.AddCommand(ImplodeCmd) + MicroboxCmd.AddCommand(DestroyCmd) + MicroboxCmd.AddCommand(StartCmd) + MicroboxCmd.AddCommand(StopCmd) + MicroboxCmd.AddCommand(UpdateCmd) + MicroboxCmd.AddCommand(EvarCmd) + MicroboxCmd.AddCommand(DnsCmd) + MicroboxCmd.AddCommand(LogCmd) + MicroboxCmd.AddCommand(VersionCmd) + MicroboxCmd.AddCommand(server.ServerCmd) // hidden subcommands - NanoboxCmd.AddCommand(EnvCmd) - NanoboxCmd.AddCommand(InspectCmd) + MicroboxCmd.AddCommand(EnvCmd) + MicroboxCmd.AddCommand(InspectCmd) } diff --git a/commands/compile.go b/commands/compile.go index f542b977..3064dc32 100644 --- a/commands/compile.go +++ b/commands/compile.go @@ -5,12 +5,12 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) var ( diff --git a/commands/configure.go b/commands/configure.go index 4b6b9426..ee84d980 100644 --- a/commands/configure.go +++ b/commands/configure.go @@ -6,10 +6,10 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/util/display" ) var ( @@ -17,10 +17,10 @@ var ( // ConfigureCmd ... ConfigureCmd = &cobra.Command{ Use: "configure", - Short: "Configure Nanobox.", + Short: "Configure Microbox.", Long: ` Walks through a series of question prompts that modify your local -Nanobox configuration (~/.nanobox/config.yml). +Microbox configuration (~/.microbox/config.yml). `, Run: configureFn, Aliases: []string{"config"}, diff --git a/commands/console.go b/commands/console.go index 9cefe1a0..ac21e06c 100644 --- a/commands/console.go +++ b/commands/console.go @@ -6,15 +6,15 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/processors/env" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/console" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/processors/env" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/console" + "github.com/mu-box/microbox/util/display" ) var ( @@ -48,7 +48,7 @@ func consoleFn(ccmd *cobra.Command, args []string) { Wrong number of arguments (expecting 1 got %v). Run the command again with the name of the component you wish to console into: -ex: nanobox console dry-run web.site +ex: microbox console dry-run web.site `, len(args)) return @@ -60,7 +60,7 @@ ex: nanobox console dry-run web.site Message: "Console to local code node not valid", Code: "USER", Stack: []string{"failed to console"}, - Suggest: "It appears you are trying to console to a local code node. Please use `nanobox run` instead.", + Suggest: "It appears you are trying to console to a local code node. Please use `microbox run` instead.", }) return } diff --git a/commands/deploy.go b/commands/deploy.go index 57957c63..fe80e577 100644 --- a/commands/deploy.go +++ b/commands/deploy.go @@ -5,17 +5,17 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/processors/app" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/processors/app" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" // added because we need its steps - _ "github.com/nanobox-io/nanobox/commands/sim" + _ "github.com/mu-box/microbox/commands/sim" ) var ( @@ -56,7 +56,7 @@ func deployFn(ccmd *cobra.Command, args []string) { case "local": switch name { case "dev": - fmt.Println("deploying is not necessary in this context, 'nanobox run' instead") + fmt.Println("deploying is not necessary in this context, 'microbox run' instead") return case "sim": steps.Run("sim start")(ccmd, args) diff --git a/commands/destroy.go b/commands/destroy.go index 6bac7b59..e9910604 100644 --- a/commands/destroy.go +++ b/commands/destroy.go @@ -2,15 +2,16 @@ package commands import ( "fmt" + "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/app" - "github.com/nanobox-io/nanobox/processors/env" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/app" + "github.com/mu-box/microbox/processors/env" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) var ( @@ -18,9 +19,9 @@ var ( // DestroyCmd ... DestroyCmd = &cobra.Command{ Use: "destroy", - Short: "Destroy the current project and remove it from Nanobox.", + Short: "Destroy the current project and remove it from Microbox.", Long: ` -Destroys the current project and removes it from Nanobox – destroying +Destroys the current project and removes it from Microbox – destroying the filesystem mount, associated dns aliases, and local app data. `, PreRun: steps.Run("start"), @@ -32,7 +33,7 @@ the filesystem mount, associated dns aliases, and local app data. func destroyFunc(ccmd *cobra.Command, args []string) { envModel, err := models.FindEnvByID(config.EnvID()) if err != nil { - fmt.Println("This project doesn't exist on nanobox.") + fmt.Println("This project doesn't exist on microbox.") return } diff --git a/commands/dev/start.go b/commands/dev/start.go index 609eea8a..21c8b7f1 100644 --- a/commands/dev/start.go +++ b/commands/dev/start.go @@ -2,17 +2,18 @@ package dev import ( "fmt" - "github.com/nanobox-io/golang-docker-client" + + docker "github.com/mu-box/golang-docker-client" "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/app" - "github.com/nanobox-io/nanobox/processors/env" - "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - util_provider "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/app" + "github.com/mu-box/microbox/processors/env" + "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + util_provider "github.com/mu-box/microbox/util/provider" ) func init() { diff --git a/commands/dev/stop.go b/commands/dev/stop.go index ee201068..5a804d54 100644 --- a/commands/dev/stop.go +++ b/commands/dev/stop.go @@ -1,15 +1,15 @@ package dev import ( - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - container_generator "github.com/nanobox-io/nanobox/generators/containers" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/app" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + container_generator "github.com/mu-box/microbox/generators/containers" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/app" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) func init() { diff --git a/commands/dns.go b/commands/dns.go index fc9c1a90..8f73fa71 100644 --- a/commands/dns.go +++ b/commands/dns.go @@ -3,7 +3,7 @@ package commands import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/dns" + "github.com/mu-box/microbox/commands/dns" ) var ( diff --git a/commands/dns/add.go b/commands/dns/add.go index 20ed71e6..00cbc6ff 100644 --- a/commands/dns/add.go +++ b/commands/dns/add.go @@ -5,11 +5,11 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - app_dns "github.com/nanobox-io/nanobox/processors/app/dns" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + app_dns "github.com/mu-box/microbox/processors/app/dns" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) // AddCmd ... diff --git a/commands/dns/list.go b/commands/dns/list.go index f03ad4df..90561649 100644 --- a/commands/dns/list.go +++ b/commands/dns/list.go @@ -5,12 +5,12 @@ 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" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + // "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + app_dns "github.com/mu-box/microbox/processors/app/dns" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) // ListCmd ... @@ -26,7 +26,7 @@ var ListCmd = &cobra.Command{ func listFn(ccmd *cobra.Command, args []string) { env, _ := models.FindEnvByID(config.EnvID()) - args, location, name := helpers.Endpoint(env, args, 0) + _, location, name := helpers.Endpoint(env, args, 0) switch location { case "local": diff --git a/commands/dns/remove.go b/commands/dns/remove.go index bd303199..d7ffcdd6 100644 --- a/commands/dns/remove.go +++ b/commands/dns/remove.go @@ -5,11 +5,11 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - app_dns "github.com/nanobox-io/nanobox/processors/app/dns" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + app_dns "github.com/mu-box/microbox/processors/app/dns" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) // RemoveCmd ... diff --git a/commands/dns/remove_all.go b/commands/dns/remove_all.go index 5e536b5d..0e6c108c 100644 --- a/commands/dns/remove_all.go +++ b/commands/dns/remove_all.go @@ -5,11 +5,11 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - app_dns "github.com/nanobox-io/nanobox/processors/app/dns" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + app_dns "github.com/mu-box/microbox/processors/app/dns" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) // RemoveAllCmd ... diff --git a/commands/env.go b/commands/env.go index 86419da6..1b9e95c8 100644 --- a/commands/env.go +++ b/commands/env.go @@ -3,7 +3,7 @@ package commands import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/env" + "github.com/mu-box/microbox/commands/env" ) var ( diff --git a/commands/env/server.go b/commands/env/server.go index c074b258..8d3f83ac 100644 --- a/commands/env/server.go +++ b/commands/env/server.go @@ -3,8 +3,8 @@ package env import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/processors/server" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/processors/server" + "github.com/mu-box/microbox/util/display" ) var ( diff --git a/commands/evar.go b/commands/evar.go index 0af575da..de176f1c 100644 --- a/commands/evar.go +++ b/commands/evar.go @@ -3,7 +3,7 @@ package commands import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/evar" + "github.com/mu-box/microbox/commands/evar" ) var ( diff --git a/commands/evar/add.go b/commands/evar/add.go index 037cc7f1..be011a49 100644 --- a/commands/evar/add.go +++ b/commands/evar/add.go @@ -8,13 +8,13 @@ import ( "github.com/jcelliott/lumber" "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - app_evar "github.com/nanobox-io/nanobox/processors/app/evar" - production_evar "github.com/nanobox-io/nanobox/processors/evar" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + app_evar "github.com/mu-box/microbox/processors/app/evar" + production_evar "github.com/mu-box/microbox/processors/evar" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) // AddCmd ... diff --git a/commands/evar/list.go b/commands/evar/list.go index 9cb6764a..654ef908 100644 --- a/commands/evar/list.go +++ b/commands/evar/list.go @@ -6,13 +6,13 @@ import ( "github.com/jcelliott/lumber" "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - app_evar "github.com/nanobox-io/nanobox/processors/app/evar" - production_evar "github.com/nanobox-io/nanobox/processors/evar" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + app_evar "github.com/mu-box/microbox/processors/app/evar" + production_evar "github.com/mu-box/microbox/processors/evar" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) // ListCmd ... diff --git a/commands/evar/load.go b/commands/evar/load.go index 44115ba8..fc3c534d 100644 --- a/commands/evar/load.go +++ b/commands/evar/load.go @@ -8,14 +8,14 @@ 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_evar "github.com/nanobox-io/nanobox/processors/app/evar" - production_evar "github.com/nanobox-io/nanobox/processors/evar" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + app_evar "github.com/mu-box/microbox/processors/app/evar" + production_evar "github.com/mu-box/microbox/processors/evar" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) // LoadCmd loads variables from a file. @@ -26,12 +26,12 @@ var LoadCmd = &cobra.Command{ The alias must be used when loading variables for a production app. If you would like to load variables for a different app, please add -it as a remote as follows: 'nanobox remote add '. +it as a remote as follows: 'microbox remote add '. You may then perform the 'load' again, specifying that alias.`, Run: loadFn, } -// loadFn parses a specified file and adds the contained variables to nanobox. +// loadFn parses a specified file and adds the contained variables to microbox. // Read in the file, strip out 'export ', parse, add resulting vars func loadFn(ccmd *cobra.Command, args []string) { // parse the evars excluding the context diff --git a/commands/evar/remove.go b/commands/evar/remove.go index 60d44072..65e3a007 100644 --- a/commands/evar/remove.go +++ b/commands/evar/remove.go @@ -6,13 +6,13 @@ 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_evar "github.com/nanobox-io/nanobox/processors/app/evar" - production_evar "github.com/nanobox-io/nanobox/processors/evar" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + app_evar "github.com/mu-box/microbox/processors/app/evar" + production_evar "github.com/mu-box/microbox/processors/evar" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) // RemoveCmd removes an evar. @@ -23,7 +23,7 @@ var RemoveCmd = &cobra.Command{ The alias must be used when removing variables from a production app. If you would like to remove variables from a different app, please add -it as a remote as follows: 'nanobox remote add '. +it as a remote as follows: 'microbox remote add '. You may then perform the 'rm' again, specifying that alias.`, Run: removeFn, } diff --git a/commands/implode.go b/commands/implode.go index 1e1a9a8b..f9b32587 100644 --- a/commands/implode.go +++ b/commands/implode.go @@ -3,9 +3,9 @@ package commands import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/util/display" ) var ( @@ -13,10 +13,10 @@ var ( // ImplodeCmd ... ImplodeCmd = &cobra.Command{ Use: "implode", - Short: "Remove all Nanobox-created containers, files, & data.", + Short: "Remove all Microbox-created containers, files, & data.", Long: ` -Removes the Nanobox container, all projects, filesystem mounts, -& local data. All that will remain is nanobox binaries. +Removes the Microbox container, all projects, filesystem mounts, +& local data. All that will remain is microbox binaries. `, Run: implodeFn, } diff --git a/commands/info.go b/commands/info.go index 8592731d..2ed78262 100644 --- a/commands/info.go +++ b/commands/info.go @@ -5,11 +5,11 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/app" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/app" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) var ( @@ -30,7 +30,7 @@ specify which environment you would like information about. func infoFn(ccmd *cobra.Command, args []string) { env, _ := models.FindEnvByID(config.EnvID()) - args, location, name := helpers.Endpoint(env, args, 0) + _, location, name := helpers.Endpoint(env, args, 0) switch location { case "local": diff --git a/commands/inspect.go b/commands/inspect.go index aae90b3c..cc2f2048 100644 --- a/commands/inspect.go +++ b/commands/inspect.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) type ( @@ -17,7 +17,7 @@ var ( // InspectCmd ... InspectCmd = &cobra.Command{ Use: "inspect", - Short: "Show element from the nanobox database.", + Short: "Show element from the microbox database.", Long: ``, Run: inspectFunc, Hidden: true, diff --git a/commands/log.go b/commands/log.go index 760ae5f9..a42fc13b 100644 --- a/commands/log.go +++ b/commands/log.go @@ -5,13 +5,13 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/log" - "github.com/nanobox-io/nanobox/processors/platform" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/log" + "github.com/mu-box/microbox/processors/platform" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) var ( @@ -26,7 +26,7 @@ var ( LogCmd = &cobra.Command{ Use: "log [dry-run|remote-alias]", Short: "Streams application logs.", - Long: "'remote-alias' is the alias for your app, given on `nanobox remote add app-name alias`", + Long: "'remote-alias' is the alias for your app, given on `microbox remote add app-name alias`", Run: logFn, } ) @@ -44,7 +44,7 @@ func logFn(ccmd *cobra.Command, args []string) { fmt.Printf(` -------------------------------------------------------- Watching 'local' not yet implemented. You can watch your -logs inside a terminal running 'nanobox run'. +logs inside a terminal running 'microbox run'. -------------------------------------------------------- `) diff --git a/commands/login.go b/commands/login.go index 3ddee7f5..c39c9493 100644 --- a/commands/login.go +++ b/commands/login.go @@ -3,10 +3,10 @@ package commands import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/util/display" ) var ( @@ -14,11 +14,11 @@ var ( // LoginCmd ... LoginCmd = &cobra.Command{ Use: "login", - Short: "Authenticate your nanobox client with your nanobox.io account.", + Short: "Authenticate your microbox client with your microbox.cloud account.", Long: ` -Authenticate with your nanobox account by passing the username and password in or using the following environment variables: -NANOBOX_USERNAME -NANOBOX_PASSWORD +Authenticate with your microbox account by passing the username and password in or using the following environment variables: +MICROBOX_USERNAME +MICROBOX_PASSWORD `, Run: loginFn, } diff --git a/commands/logout.go b/commands/logout.go index bfc83904..91871109 100644 --- a/commands/logout.go +++ b/commands/logout.go @@ -3,8 +3,8 @@ package commands import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/util/display" ) var ( @@ -12,7 +12,7 @@ var ( // LogoutCmd ... LogoutCmd = &cobra.Command{ Use: "logout", - Short: "Remove your nanobox.io api token from your local nanobox client.", + Short: "Remove your microbox.cloud api token from your local microbox client.", Long: ``, Run: logoutFn, } diff --git a/commands/registry/registry.go b/commands/registry/registry.go index 467264b5..a5e47aa7 100644 --- a/commands/registry/registry.go +++ b/commands/registry/registry.go @@ -1,8 +1,9 @@ package registry import ( - "github.com/spf13/viper" "time" + + "github.com/spf13/viper" ) var v = viper.New() diff --git a/commands/remote.go b/commands/remote.go index 2b8000b2..a5b6ee7d 100644 --- a/commands/remote.go +++ b/commands/remote.go @@ -5,11 +5,11 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/remote" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/remote" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) var ( @@ -20,7 +20,7 @@ var ( Short: "Manage application remotes.", Long: ` Manages connections between your local codebase and -remote, live applications created with Nanobox. +remote, live applications created with Microbox. `, PreRun: steps.Run("login"), } diff --git a/commands/run.go b/commands/run.go index 7a8505c0..c08a3958 100644 --- a/commands/run.go +++ b/commands/run.go @@ -5,16 +5,16 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/processors/app" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/console" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/processors/app" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/console" + "github.com/mu-box/microbox/util/display" // imported because we need its steps added - _ "github.com/nanobox-io/nanobox/commands/dev" + _ "github.com/mu-box/microbox/commands/dev" ) // RunCmd ... @@ -22,10 +22,10 @@ var RunCmd = &cobra.Command{ Use: "run", Short: "Start your local development environment.", Long: ` -Starts your local development enviroment and opens an +Starts your local development environment and opens an interactive console inside the environment. -You can also pass a command into 'run'. Nanobox will +You can also pass a command into 'run'. Microbox will run the command without dropping you into a console in your local environment. `, diff --git a/commands/server/server.go b/commands/server/server.go index 5814fb6e..e147f649 100644 --- a/commands/server/server.go +++ b/commands/server/server.go @@ -13,19 +13,19 @@ import ( "github.com/jcelliott/lumber" "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/update" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/update" ) var ServerCmd = &cobra.Command{ Use: "server", - Short: "Start a dedicated nanobox server", + Short: "Start a dedicated microbox server", Long: ``, Run: serverFnc, } -const name = "nanobox-server" +const name = "microbox-server" func serverFnc(ccmd *cobra.Command, args []string) { if !util.IsPrivileged() { @@ -37,7 +37,7 @@ func serverFnc(ccmd *cobra.Command, args []string) { // set the logger on linux and osx to go to /var/log if runtime.GOOS != "windows" { - fileLogger, err := lumber.NewTruncateLogger("/var/log/nanobox.log") + fileLogger, err := lumber.NewTruncateLogger("/var/log/microbox.log") if err != nil { fmt.Printf("logging error:%s\n", err) } @@ -45,7 +45,7 @@ func serverFnc(ccmd *cobra.Command, args []string) { lumber.SetLogger(fileLogger) } - lumber.Info("Starting nanobox server...") + lumber.Info("Starting microbox server...") // fire up the service manager (only required on windows) go svcStart() @@ -59,7 +59,7 @@ func serverFnc(ccmd *cobra.Command, args []string) { err := startTAP() if err != nil { lumber.Info("Failed to load tap driver - %s", err.Error()) - // err 102 for nanobox means kext failed to load + // err 102 for microbox means kext failed to load os.Exit(102) } lumber.Info("Tap driver loaded.") @@ -77,7 +77,7 @@ func serverFnc(ccmd *cobra.Command, args []string) { return } - lumber.Info("Nanobox server listening") + lumber.Info("Microbox server listening") // listen for new connections forever for { @@ -92,24 +92,24 @@ func serverFnc(ccmd *cobra.Command, args []string) { // updateUpdater used to be a temporary means to update everyone's updater, // but it is quite useful so we will leave it in. Maybe in the future we'll -// try updating nanobox itself prior to starting. +// try updating microbox itself prior to starting. func updateUpdater() { - lumber.Info("Updating nanobox-update") - update.Name = strings.Replace(update.Name, "nanobox", "nanobox-update", 1) - update.TmpName = strings.Replace(update.TmpName, "nanobox", "nanobox-update", 1) + lumber.Info("Updating microbox-update") + update.Name = strings.Replace(update.Name, "microbox", "microbox-update", 1) + update.TmpName = strings.Replace(update.TmpName, "microbox", "microbox-update", 1) - // this gets the path to nanobox (assumes nanobox-update is at same location) - lumber.Info("Attempting to find nanobox - %s", os.Args[0]) + // this gets the path to microbox (assumes microbox-update is at same location) + lumber.Info("Attempting to find microbox - %s", os.Args[0]) path, err := exec.LookPath(os.Args[0]) if err != nil { - lumber.Info("Failed to find nanobox - %s", err.Error()) + lumber.Info("Failed to find microbox - %s", err.Error()) return } - path = strings.Replace(path, "nanobox", "nanobox-update", 1) + path = strings.Replace(path, "microbox", "microbox-update", 1) lumber.Info("Updating - %s", path) err = update.Run(path) if err != nil { - lumber.Info("Failed to update `nanobox-update` - %s", err.Error()) + lumber.Info("Failed to update `microbox-update` - %s", err.Error()) return } lumber.Info("Update complete") @@ -131,7 +131,7 @@ func ClientRun(funcName string, args interface{}, response interface{}) error { return nil } -// the tap driver needs to be loaded anytime nanobox is running the vpn (always on osx) +// the tap driver needs to be loaded anytime microbox is running the vpn (always on osx) func startTAP() error { if runtime.GOOS != "darwin" { return nil diff --git a/commands/server/svc_unix.go b/commands/server/svc_unix.go index 0dbe2432..fc2c7a1a 100644 --- a/commands/server/svc_unix.go +++ b/commands/server/svc_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package server diff --git a/commands/server/svc_windows.go b/commands/server/svc_windows.go index f86268d3..93099530 100644 --- a/commands/server/svc_windows.go +++ b/commands/server/svc_windows.go @@ -12,9 +12,9 @@ import ( var elog debug.Log -type nanoboxServer struct{} +type microboxServer struct{} -func (ns *nanoboxServer) Execute(args []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (ssec bool, errno uint32) { +func (ns *microboxServer) Execute(args []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (ssec bool, errno uint32) { elog.Info(1, fmt.Sprintf("execute called")) const cmdsAccepted = svc.AcceptStop | svc.AcceptShutdown changes <- svc.Status{State: svc.Running, Accepts: cmdsAccepted} @@ -51,7 +51,7 @@ func svcStart() { defer elog.Close() elog.Info(1, fmt.Sprintf("starting %s service", name)) - err = svc.Run(name, &nanoboxServer{}) + err = svc.Run(name, µboxServer{}) if err != nil { elog.Error(1, fmt.Sprintf("%s service failed: %v", name, err)) return diff --git a/commands/sim/start.go b/commands/sim/start.go index b897a587..e68e8f31 100644 --- a/commands/sim/start.go +++ b/commands/sim/start.go @@ -3,17 +3,17 @@ package sim import ( "fmt" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/app" - "github.com/nanobox-io/nanobox/processors/env" - "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - util_provider "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/app" + "github.com/mu-box/microbox/processors/env" + "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + util_provider "github.com/mu-box/microbox/util/provider" ) func init() { diff --git a/commands/sim/stop.go b/commands/sim/stop.go index 420cc386..188feb50 100644 --- a/commands/sim/stop.go +++ b/commands/sim/stop.go @@ -4,11 +4,11 @@ import ( // "fmt" "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/app" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/app" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) func init() { diff --git a/commands/start.go b/commands/start.go index ee025eaa..1e580a92 100644 --- a/commands/start.go +++ b/commands/start.go @@ -3,12 +3,12 @@ package commands import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/processors/provider/bridge" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/provider" - "github.com/nanobox-io/nanobox/util/service" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/processors/provider/bridge" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/provider" + "github.com/mu-box/microbox/util/service" ) var ( @@ -16,7 +16,7 @@ var ( // StartCmd ... StartCmd = &cobra.Command{ Use: "start", - Short: "Start the Nanobox virtual machine.", + Short: "Start the Microbox virtual machine.", Long: ``, Run: startFn, } @@ -36,5 +36,5 @@ func startCheck() bool { if provider.BridgeRequired() { bridgeReady = bridge.Connected() } - return provider.IsReady() && service.Running("nanobox-server") && bridgeReady + return provider.IsReady() && service.Running("microbox-server") && bridgeReady } diff --git a/commands/status.go b/commands/status.go index 80dbaf01..8fdb6607 100644 --- a/commands/status.go +++ b/commands/status.go @@ -3,8 +3,8 @@ package commands import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/util/display" ) var ( @@ -12,7 +12,7 @@ var ( // StatusCmd ... StatusCmd = &cobra.Command{ Use: "status", - Short: "Display the status of your Nanobox VM & apps.", + Short: "Display the status of your Microbox VM & apps.", Long: ``, Run: statusFn, } diff --git a/commands/steps/run.go b/commands/steps/run.go index b7feddb9..5b311f9f 100644 --- a/commands/steps/run.go +++ b/commands/steps/run.go @@ -3,7 +3,7 @@ package steps import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/registry" + "github.com/mu-box/microbox/commands/registry" ) func Run(stepNames ...string) func(ccmd *cobra.Command, args []string) { diff --git a/commands/stop.go b/commands/stop.go index de9cb0ac..5f23fcca 100644 --- a/commands/stop.go +++ b/commands/stop.go @@ -3,9 +3,9 @@ package commands import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/util/display" ) var ( @@ -13,9 +13,9 @@ var ( // StopCmd ... StopCmd = &cobra.Command{ Use: "stop", - Short: "Stop the Nanobox virtual machine.", + Short: "Stop the Microbox virtual machine.", Long: ` -Stops the Nanobox virtual machine as well as +Stops the Microbox virtual machine as well as any running local or dry-run environments. `, Run: stopFn, diff --git a/commands/tunnel.go b/commands/tunnel.go index 3688c6fb..3cb62e3d 100644 --- a/commands/tunnel.go +++ b/commands/tunnel.go @@ -7,12 +7,12 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) var ( @@ -56,7 +56,7 @@ func tunnelFn(ccmd *cobra.Command, args []string) { Wrong number of arguments (expecting 1 got %d). Run the command again with the name of the component you would like to tunnel into: -ex: nanobox tunnel +ex: microbox tunnel `, len(args)) diff --git a/commands/update.go b/commands/update.go index e1f58840..639c9df4 100644 --- a/commands/update.go +++ b/commands/update.go @@ -3,9 +3,9 @@ package commands import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/commands/steps" - "github.com/nanobox-io/nanobox/processors" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/steps" + "github.com/mu-box/microbox/processors" + "github.com/mu-box/microbox/util/display" ) var ( @@ -13,7 +13,7 @@ var ( UpdateCmd = &cobra.Command{ Use: "update-images", Short: "Updates docker images.", - // Short: "Updates docker images and checks to see if the nanobox binary needs an update.", + // Short: "Updates docker images and checks to see if the microbox binary needs an update.", Long: ``, PreRun: steps.Run("start"), Run: updateFn, diff --git a/commands/version.go b/commands/version.go index 05884a36..e729efa0 100644 --- a/commands/version.go +++ b/commands/version.go @@ -5,15 +5,15 @@ import ( "github.com/spf13/cobra" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) var ( - // VersionCmd prints the nanobox version. + // VersionCmd prints the microbox version. VersionCmd = &cobra.Command{ Use: "version", - Short: "Show the current Nanobox version.", + Short: "Show the current Microbox version.", Long: ``, PersistentPreRun: func(ccmd *cobra.Command, args []string) {}, Run: versionFn, diff --git a/generators/containers/bridge.go b/generators/containers/bridge.go index 65a67ce8..bac1785b 100644 --- a/generators/containers/bridge.go +++ b/generators/containers/bridge.go @@ -1,16 +1,16 @@ package containers import ( - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - "github.com/nanobox-io/nanobox/util/dhcp" + "github.com/mu-box/microbox/util/dhcp" ) // BridgeConfig generates the container configuration for a component container func BridgeConfig() docker.ContainerConfig { return docker.ContainerConfig{ Name: BridgeName(), - Image: "nanobox/bridge", + Image: "mubox/bridge", Network: "virt", IP: reserveIP(), RestartPolicy: "always", @@ -20,7 +20,7 @@ func BridgeConfig() docker.ContainerConfig { // BridgeName returns the name of the component container func BridgeName() string { - return "nanobox_bridge" + return "microbox_bridge" } // reserveIP reserves a local IP for the build container diff --git a/generators/containers/build.go b/generators/containers/build.go index c28542f3..3660cc46 100644 --- a/generators/containers/build.go +++ b/generators/containers/build.go @@ -3,11 +3,11 @@ package containers import ( "fmt" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/provider" ) // BuildConfig generate the container configuration for the build container @@ -37,15 +37,15 @@ func BuildConfig(image string) docker.ContainerConfig { // fmt.Sprintf("%s%s/build:/mnt/build", provider.HostMntDir(), env), // fmt.Sprintf("%s%s/deploy:/mnt/deploy", provider.HostMntDir(), env), // fmt.Sprintf("%s%s/cache:/mnt/cache", provider.HostMntDir(), env), - fmt.Sprintf("nanobox_%s_build:/mnt/build", env), - fmt.Sprintf("nanobox_%s_deploy:/mnt/deploy", env), - fmt.Sprintf("nanobox_%s_cache:/mnt/cache", env), + fmt.Sprintf("microbox_%s_build:/mnt/build", env), + fmt.Sprintf("microbox_%s_deploy:/mnt/deploy", env), + fmt.Sprintf("microbox_%s_cache:/mnt/cache", env), }, RestartPolicy: "no", } // Some CI's have an old kernel and require us to use the virtual network - // this is only in effect for CI's because it automatically reserves an ip on our nanobox + // this is only in effect for CI's because it automatically reserves an ip on our microbox // virtual network and we could have IP conflicts configModel, _ := models.LoadConfig() if configModel.CIMode { @@ -60,5 +60,5 @@ func BuildConfig(image string) docker.ContainerConfig { // BuildName returns the name of the build container func BuildName() string { - return fmt.Sprintf("nanobox_%s_build", config.EnvID()) + return fmt.Sprintf("microbox_%s_build", config.EnvID()) } diff --git a/generators/containers/compile.go b/generators/containers/compile.go index e08ee28b..71baa106 100644 --- a/generators/containers/compile.go +++ b/generators/containers/compile.go @@ -3,11 +3,11 @@ package containers import ( "fmt" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/provider" ) // CompileConfig generate the container configuration for the build container @@ -34,15 +34,15 @@ func CompileConfig(image string) docker.ContainerConfig { // fmt.Sprintf("%s%s/build:/data", provider.HostMntDir(), env), // fmt.Sprintf("%s%s/app:/mnt/app", provider.HostMntDir(), env), // fmt.Sprintf("%s%s/cache:/mnt/cache", provider.HostMntDir(), env), - fmt.Sprintf("nanobox_%s_build:/data", env), - fmt.Sprintf("nanobox_%s_app:/mnt/app", env), - fmt.Sprintf("nanobox_%s_cache:/mnt/cache", env), + fmt.Sprintf("microbox_%s_build:/data", env), + fmt.Sprintf("microbox_%s_app:/mnt/app", env), + fmt.Sprintf("microbox_%s_cache:/mnt/cache", env), }, RestartPolicy: "no", } // Some CI's have an old kernel and require us to use the virtual network - // this is only in effect for CI's because it automatically reserves an ip on our nanobox + // this is only in effect for CI's because it automatically reserves an ip on our microbox // virtual network and we could have IP conflicts configModel, _ := models.LoadConfig() if configModel.CIMode { @@ -57,5 +57,5 @@ func CompileConfig(image string) docker.ContainerConfig { // CompileName returns the name of the build container func CompileName() string { - return fmt.Sprintf("nanobox_%s_compile", config.EnvID()) + return fmt.Sprintf("microbox_%s_compile", config.EnvID()) } diff --git a/generators/containers/component.go b/generators/containers/component.go index 34ec937c..926e11ba 100644 --- a/generators/containers/component.go +++ b/generators/containers/component.go @@ -3,9 +3,9 @@ package containers import ( "fmt" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) // ComponentConfig generates the container configuration for a component container @@ -26,5 +26,5 @@ func ComponentConfig(componentModel *models.Component) docker.ContainerConfig { // ComponentName returns the name of the component container func ComponentName(componentModel *models.Component) string { - return fmt.Sprintf("nanobox_%s_%s", componentModel.AppID, componentModel.Name) + return fmt.Sprintf("microbox_%s_%s", componentModel.AppID, componentModel.Name) } diff --git a/generators/containers/containers_internal_test.go b/generators/containers/containers_internal_test.go index 14da133f..e5a305c4 100644 --- a/generators/containers/containers_internal_test.go +++ b/generators/containers/containers_internal_test.go @@ -3,7 +3,7 @@ package containers import ( "testing" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" ) func TestSetProxyVars(t *testing.T) { diff --git a/generators/containers/containers_test.go b/generators/containers/containers_test.go index 53ab6f51..f6c0060e 100644 --- a/generators/containers/containers_test.go +++ b/generators/containers/containers_test.go @@ -4,9 +4,9 @@ import ( "net" "testing" - "github.com/nanobox-io/nanobox/generators/containers" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/dhcp" + "github.com/mu-box/microbox/generators/containers" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/dhcp" ) func TestBuildConfig(t *testing.T) { @@ -38,7 +38,7 @@ func TestComponentConfig(t *testing.T) { result := containers.ComponentConfig(componentModel) if result.Image != "imagename" || result.IP != "1.2.3.4" || - result.Name != "nanobox_2_name" { + result.Name != "microbox_2_name" { t.Errorf("bad results") } } @@ -55,8 +55,8 @@ func TestPublishConfig(t *testing.T) { func TestDevConfig(t *testing.T) { appModel := &models.App{EnvID: "1", ID: "2"} result := containers.DevConfig(appModel) - if result.Image != "nanobox/build" || - result.Name != "nanobox_2" { + if result.Image != "mubox/build" || + result.Name != "microbox_2" { // TODO: add checks for the binds // TODO: add lib dir check t.Errorf("bad results") diff --git a/generators/containers/dev.go b/generators/containers/dev.go index 236e8ede..bd8e67be 100644 --- a/generators/containers/dev.go +++ b/generators/containers/dev.go @@ -5,12 +5,12 @@ import ( "os" "runtime" - "github.com/nanobox-io/golang-docker-client" - "github.com/nanobox-io/nanobox-boxfile" + docker "github.com/mu-box/golang-docker-client" + boxfile "github.com/mu-box/microbox-boxfile" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/provider" ) // DevConfig generate the container configuration for the build container @@ -20,7 +20,7 @@ func DevConfig(appModel *models.App) docker.ContainerConfig { image := boxfile.Node("run.config").StringValue("image") if image == "" { - image = "nanobox/build" + image = "mubox/build" } code := fmt.Sprintf("%s%s/code:/app", provider.HostShareDir(), appModel.EnvID) @@ -30,7 +30,7 @@ func DevConfig(appModel *models.App) docker.ContainerConfig { } config := docker.ContainerConfig{ - Name: fmt.Sprintf("nanobox_%s", appModel.ID), + Name: fmt.Sprintf("microbox_%s", appModel.ID), Image: image, // this will need to be configurable some time Network: "virt", IP: appModel.LocalIPs["env"], @@ -38,8 +38,8 @@ func DevConfig(appModel *models.App) docker.ContainerConfig { code, // fmt.Sprintf("%s%s/build:/data", provider.HostMntDir(), appModel.EnvID), // fmt.Sprintf("%s%s/cache:/mnt/cache", provider.HostMntDir(), appModel.EnvID), - fmt.Sprintf("nanobox_%s_build:/data", appModel.EnvID), - fmt.Sprintf("nanobox_%s_cache:/mnt/cache", appModel.EnvID), + fmt.Sprintf("microbox_%s_build:/data", appModel.EnvID), + fmt.Sprintf("microbox_%s_cache:/mnt/cache", appModel.EnvID), }, RestartPolicy: "no", } @@ -72,5 +72,5 @@ func DevConfig(appModel *models.App) docker.ContainerConfig { // DevName returns the name of the build container func DevName() string { - return fmt.Sprintf("nanobox_%s_dev", config.EnvID()) + return fmt.Sprintf("microbox_%s_dev", config.EnvID()) } diff --git a/generators/containers/environment.go b/generators/containers/environment.go index c504e168..cb42c826 100644 --- a/generators/containers/environment.go +++ b/generators/containers/environment.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" ) func setProxyVars(config *docker.ContainerConfig) { diff --git a/generators/containers/publish.go b/generators/containers/publish.go index a9f82340..1ad97834 100644 --- a/generators/containers/publish.go +++ b/generators/containers/publish.go @@ -3,11 +3,11 @@ package containers import ( "fmt" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/config" - // "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/config" + // "github.com/mu-box/microbox/util/provider" ) // PublishConfig generate the container configuration for the build container @@ -21,15 +21,15 @@ func PublishConfig(image string) docker.ContainerConfig { // fmt.Sprintf("%s%s/app:/mnt/app", provider.HostMntDir(), env), // fmt.Sprintf("%s%s/cache:/mnt/cache", provider.HostMntDir(), env), // fmt.Sprintf("%s%s/deploy:/mnt/deploy", provider.HostMntDir(), env), - fmt.Sprintf("nanobox_%s_app:/mnt/app", env), - fmt.Sprintf("nanobox_%s_cache:/mnt/cache", env), - fmt.Sprintf("nanobox_%s_deploy:/mnt/deploy", env), + fmt.Sprintf("microbox_%s_app:/mnt/app", env), + fmt.Sprintf("microbox_%s_cache:/mnt/cache", env), + fmt.Sprintf("microbox_%s_deploy:/mnt/deploy", env), }, RestartPolicy: "no", } // Some CI's have an old kernel and require us to use the virtual network - // this is only in effect for CI's because it automatically reserves an ip on our nanobox + // this is only in effect for CI's because it automatically reserves an ip on our microbox // virtual network and we could have IP conflicts configModel, _ := models.LoadConfig() if configModel.CIMode { @@ -44,5 +44,5 @@ func PublishConfig(image string) docker.ContainerConfig { // PublishName returns the name of the build container func PublishName() string { - return fmt.Sprintf("nanobox_%s_publish", config.EnvID()) + return fmt.Sprintf("microbox_%s_publish", config.EnvID()) } diff --git a/generators/hooks/build/dev.go b/generators/hooks/build/dev.go index 84a303e3..af287285 100644 --- a/generators/hooks/build/dev.go +++ b/generators/hooks/build/dev.go @@ -3,8 +3,8 @@ package build import ( "encoding/json" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/dns" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/dns" ) func DevPayload(appModel *models.App) string { @@ -15,7 +15,7 @@ func DevPayload(appModel *models.App) string { rtn := map[string]interface{}{} rtn["env"] = evars rtn["boxfile"] = appModel.DeployedBoxfile - rtn["dns_entries"] = dns.List(" by nanobox") + rtn["dns_entries"] = dns.List(" by microbox") bytes, _ := json.Marshal(rtn) return string(bytes) } diff --git a/generators/hooks/build/publish.go b/generators/hooks/build/publish.go index 28ef2820..4cdea119 100644 --- a/generators/hooks/build/publish.go +++ b/generators/hooks/build/publish.go @@ -3,7 +3,7 @@ package build import ( "encoding/json" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) type WarehouseConfig struct { diff --git a/generators/hooks/build/user.go b/generators/hooks/build/user.go index be5efc42..2f500daf 100644 --- a/generators/hooks/build/user.go +++ b/generators/hooks/build/user.go @@ -13,9 +13,9 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) // UserPayload returns a string for the user hook payload diff --git a/generators/hooks/code/configure.go b/generators/hooks/code/configure.go index 36533d55..111ad76d 100644 --- a/generators/hooks/code/configure.go +++ b/generators/hooks/code/configure.go @@ -3,9 +3,9 @@ package code import ( "encoding/json" - "github.com/nanobox-io/nanobox-boxfile" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/dns" + boxfile "github.com/mu-box/microbox-boxfile" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/dns" ) type ( @@ -71,7 +71,7 @@ func ConfigurePayload(appModel *models.App, componentModel *models.Component) st StopTimeout: boxfile.Node(componentModel.Name).Value("stop_timeout"), StopForce: boxfile.Node(componentModel.Name).Value("stop_force"), CronJobs: boxfile.Node(componentModel.Name).Value("cron"), - DnsEntries: dns.List(" by nanobox"), + DnsEntries: dns.List(" by microbox"), } bytes, err := json.Marshal(pload) diff --git a/generators/hooks/code/deploy.go b/generators/hooks/code/deploy.go index 22582677..b51e57f2 100644 --- a/generators/hooks/code/deploy.go +++ b/generators/hooks/code/deploy.go @@ -3,8 +3,8 @@ package code import ( "encoding/json" - "github.com/nanobox-io/nanobox-boxfile" - "github.com/nanobox-io/nanobox/models" + boxfile "github.com/mu-box/microbox-boxfile" + "github.com/mu-box/microbox/models" ) type ( diff --git a/generators/hooks/code/fetch.go b/generators/hooks/code/fetch.go index 90889f3b..b100e355 100644 --- a/generators/hooks/code/fetch.go +++ b/generators/hooks/code/fetch.go @@ -3,7 +3,7 @@ package code import ( "encoding/json" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) type ( diff --git a/generators/hooks/component/component.go b/generators/hooks/component/component.go index 6f47469b..14c5e03b 100644 --- a/generators/hooks/component/component.go +++ b/generators/hooks/component/component.go @@ -3,9 +3,9 @@ package component import ( "fmt" - "github.com/nanobox-io/nanobox-boxfile" + boxfile "github.com/mu-box/microbox-boxfile" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) // componentConfig returns the config data from the component boxfile diff --git a/generators/hooks/component/configure.go b/generators/hooks/component/configure.go index 38474986..e86fcde6 100644 --- a/generators/hooks/component/configure.go +++ b/generators/hooks/component/configure.go @@ -3,7 +3,7 @@ package component import ( "encoding/json" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) // member ... diff --git a/generators/hooks/component/plan.go b/generators/hooks/component/plan.go index c6a4ecb9..897f37a0 100644 --- a/generators/hooks/component/plan.go +++ b/generators/hooks/component/plan.go @@ -3,7 +3,7 @@ package component import ( "encoding/json" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) // PlanPayload returns a string for the user hook payload diff --git a/generators/hooks/component/start.go b/generators/hooks/component/start.go index 21c7abe5..5d1d4e67 100644 --- a/generators/hooks/component/start.go +++ b/generators/hooks/component/start.go @@ -3,7 +3,7 @@ package component import ( "encoding/json" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) type startPayload struct { diff --git a/generators/hooks/component/update.go b/generators/hooks/component/update.go index e1ed8e9f..7a38ebe7 100644 --- a/generators/hooks/component/update.go +++ b/generators/hooks/component/update.go @@ -3,7 +3,7 @@ package component import ( "encoding/json" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) type updatePayload struct { diff --git a/generators/router/certs.go b/generators/router/certs.go index 52f2cfc8..6d69163f 100644 --- a/generators/router/certs.go +++ b/generators/router/certs.go @@ -10,9 +10,9 @@ import ( "math/big" "time" - "github.com/nanobox-io/golang-portal-client" + portal "github.com/mu-box/golang-portal-client" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) func BuildCert(appModel *models.App) ([]portal.CertBundle, error) { diff --git a/generators/router/router.go b/generators/router/router.go index 3a528445..3bbc75fe 100644 --- a/generators/router/router.go +++ b/generators/router/router.go @@ -1,8 +1,8 @@ package router import ( - "github.com/nanobox-io/nanobox-boxfile" - "github.com/nanobox-io/nanobox/models" + boxfile "github.com/mu-box/microbox-boxfile" + "github.com/mu-box/microbox/models" ) // diff --git a/generators/router/routes.go b/generators/router/routes.go index c3860339..00623d60 100644 --- a/generators/router/routes.go +++ b/generators/router/routes.go @@ -4,10 +4,10 @@ import ( "fmt" "strings" - "github.com/nanobox-io/golang-portal-client" - "github.com/nanobox-io/nanobox-boxfile" + portal "github.com/mu-box/golang-portal-client" + boxfile "github.com/mu-box/microbox-boxfile" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) func BuildRoutes(appModel *models.App) []portal.Route { diff --git a/generators/router/services.go b/generators/router/services.go index d05c984a..cd40eb5e 100644 --- a/generators/router/services.go +++ b/generators/router/services.go @@ -4,11 +4,11 @@ import ( "strconv" "strings" - "github.com/nanobox-io/golang-portal-client" - "github.com/nanobox-io/nanobox-boxfile" + portal "github.com/mu-box/golang-portal-client" + boxfile "github.com/mu-box/microbox-boxfile" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/display" ) // Update the ports that portal knows about. @@ -26,7 +26,7 @@ func BuildServices(appModel *models.App) []portal.Service { for _, service := range buildComponentServices(boxfile.Node(node), component) { if duplicateService(services, service) { - continue // if there is a duplicate port we will just contine + continue // if there is a duplicate port we will just continue } // add the new service to the list of services diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..7f7d85a3 --- /dev/null +++ b/go.mod @@ -0,0 +1,52 @@ +module github.com/mu-box/microbox + +go 1.17 + +require ( + github.com/boltdb/bolt v1.1.1-0.20151112151049-0b00effdd7a8 + github.com/docker/docker v1.4.2-0.20160819200957-09b929083d34 + github.com/fsnotify/fsnotify v1.3.2-0.20160816051541-f12c6236fe7b + github.com/jcelliott/lumber v0.0.0-20160324203708-dd349441af25 + github.com/lyondhill/vtclean v0.0.0-20170214195231-ea70112eba8c + github.com/mitchellh/colorstring v0.0.0-20150228181156-61164e49940b + github.com/mitchellh/go-homedir v0.0.0-20150822234538-56f508a88415 + github.com/mu-box/golang-docker-client v0.0.0-20170901184207-d1683dd8c7dd + github.com/mu-box/golang-portal-client v0.0.0-20170901184416-350613abb874 + github.com/mu-box/golang-ssh v0.0.0-20160912150335-b42e3bb3b407 + github.com/mu-box/logvac v0.1.1-0.20220117225559-b6e0df9e9085 + github.com/mu-box/microbox-boxfile v0.0.0-20170803212006-213ff24b93f4 + github.com/mu-box/mist v1.1.1-0.20220117224314-b4d1190bc7a4 + github.com/spf13/cobra v0.0.0-20160117030938-8e91712f174c + github.com/spf13/viper v0.0.0-20160111150723-a212099cbe6f + github.com/timehop/go-mixpanel v0.0.0-20150630220933-9b81eaf1f33e + golang.org/x/crypto v0.0.0-20160912150327-e311231e8319 + golang.org/x/net v0.0.0-20170824174428-57efc9c3d9f9 + golang.org/x/sys v0.0.0-20170322234810-8fd966b47dbd +) + +require ( + github.com/Azure/go-ansiterm v0.0.0-20160425224613-388960b65524 // indirect + github.com/BurntSushi/toml v0.1.1-0.20160102144748-5c4df71dfe9a // indirect + github.com/Microsoft/go-winio v0.3.8 // indirect + github.com/Sirupsen/logrus v0.8.6-0.20150724014903-11538ee6888f // indirect + github.com/docker/distribution v2.7.1+incompatible // indirect + github.com/docker/engine-api v0.4.1-0.20160908232104-4290f40c0566 // indirect + github.com/docker/go-connections v0.2.0 // indirect + github.com/docker/go-units v0.3.0 // indirect + github.com/docker/machine v0.12.2 // indirect + github.com/hashicorp/hcl v0.0.0-20160119202737-578dd9746824 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/kr/pretty v0.0.0-20150520163514-e6ac2fc51e89 // indirect + github.com/kr/text v0.0.0-20150905224508-bb797dc4fb83 // indirect + github.com/magiconair/properties v1.6.1-0.20151221213149-c81f9d71af8f // indirect + github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect + github.com/mitchellh/mapstructure v0.0.0-20150717051158-281073eb9eb0 // indirect + github.com/mu-box/microbox-golang-stylish v0.0.0-20160617201242-030019c3e9a9 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/runc v0.0.9-0.20160219032739-0107c7fb6cef // indirect + github.com/spf13/cast v0.0.0-20151218135219-ee7b3e035316 // indirect + github.com/spf13/jwalterweatherman v0.0.0-20151231185856-d00654080cdd // indirect + github.com/spf13/pflag v0.0.0-20151218134703-7f60f83a2c81 // indirect + gopkg.in/fsnotify.v1 v1.2.9 // indirect + gopkg.in/yaml.v2 v2.0.0-20151201162745-f7716cbe52ba // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..3c1e7187 --- /dev/null +++ b/go.sum @@ -0,0 +1,84 @@ +github.com/Azure/go-ansiterm v0.0.0-20160425224613-388960b65524 h1:kyo7Ce1d2RtxZBCp4y/ommREtHPeXUU2bYRJoCgyJX8= +github.com/Azure/go-ansiterm v0.0.0-20160425224613-388960b65524/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/BurntSushi/toml v0.1.1-0.20160102144748-5c4df71dfe9a h1:xrUE5z0ZdXKgezv7ImgqXATQ+tMal+fdF8fE7SE+gJA= +github.com/BurntSushi/toml v0.1.1-0.20160102144748-5c4df71dfe9a/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Microsoft/go-winio v0.3.8 h1:dvxbxtpTIjdAbx2OtL26p4eq0iEvys/U5yrsTJb3NZI= +github.com/Microsoft/go-winio v0.3.8/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= +github.com/Sirupsen/logrus v0.8.6-0.20150724014903-11538ee6888f h1:dPVEF6h8MfU+Ujc96iuvW6qZlbvz+P0z/82+svT0LqE= +github.com/Sirupsen/logrus v0.8.6-0.20150724014903-11538ee6888f/go.mod h1:rmk17hk6i8ZSAJkSDa7nOxamrG+SP4P0mm+DAvExv4U= +github.com/boltdb/bolt v1.1.1-0.20151112151049-0b00effdd7a8 h1:T3gzYI91mHUrZtbc4Kk9rNI8NpQRhEMzVA6QJ3xRcVo= +github.com/boltdb/bolt v1.1.1-0.20151112151049-0b00effdd7a8/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= +github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= +github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v1.4.2-0.20160819200957-09b929083d34 h1:WlCZW/K82TtICZXcPAQIK6cpGPbXu38vkJ2e01AawXY= +github.com/docker/docker v1.4.2-0.20160819200957-09b929083d34/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/engine-api v0.4.1-0.20160908232104-4290f40c0566 h1:S02HakxupRs+HZdHv6qfFfb6EDK+VZApNTYmVFppg7I= +github.com/docker/engine-api v0.4.1-0.20160908232104-4290f40c0566/go.mod h1:xtQCpzf4YysNZCVFfIGIm7qfLvYbxtLkEVVfKhTVOvw= +github.com/docker/go-connections v0.2.0 h1:tV+S3i76CmPRYmR3NMDUFyr2HTP+3gL+xEPy146TPig= +github.com/docker/go-connections v0.2.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.3.0 h1:69LhctGQbg0wZ2bTvwFsuPXPnhe6T2+0UMsxh+rBYZg= +github.com/docker/go-units v0.3.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/machine v0.12.2 h1:hnEiFuJKxmals/98skBZ5Oq7aWU1Ah3YKMUluQHvtLA= +github.com/docker/machine v0.12.2/go.mod h1:I8mPNDeK1uH+JTcUU7X0ZW8KiYz0jyAgNaeSJ1rCfDI= +github.com/fsnotify/fsnotify v1.3.2-0.20160816051541-f12c6236fe7b h1:clQtr7BsnoijdumdhlbbOGglPb1lIAJ3yTPjYOHlKdQ= +github.com/fsnotify/fsnotify v1.3.2-0.20160816051541-f12c6236fe7b/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/hashicorp/hcl v0.0.0-20160119202737-578dd9746824 h1:HVcjV7by+C4mSaxWw8MJO9Ig1pA1OUqwGtE+N901118= +github.com/hashicorp/hcl v0.0.0-20160119202737-578dd9746824/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jcelliott/lumber v0.0.0-20160324203708-dd349441af25 h1:EFT6MH3igZK/dIVqgGbTqWVvkZ7wJ5iGN03SVtvvdd8= +github.com/jcelliott/lumber v0.0.0-20160324203708-dd349441af25/go.mod h1:sWkGw/wsaHtRsT9zGQ/WyJCotGWG/Anow/9hsAcBWRw= +github.com/kr/pretty v0.0.0-20150520163514-e6ac2fc51e89 h1:Smt4CPhAnATQEGlX/nyqGETX4Tj8bg/7shBT5gH8d7s= +github.com/kr/pretty v0.0.0-20150520163514-e6ac2fc51e89/go.mod h1:Bvhd+E3laJ0AVkG0c9rmtZcnhV0HQ3+c3YxxqTvc/gA= +github.com/kr/text v0.0.0-20150905224508-bb797dc4fb83 h1:zIzxNaBxRxmbPPCgya4J5KccVN23qXA/V75oApRNahI= +github.com/kr/text v0.0.0-20150905224508-bb797dc4fb83/go.mod h1:sjUstKUATFIcff4qlB53Kml0wQPtJVc/3fWrmuUmcfA= +github.com/lyondhill/vtclean v0.0.0-20170214195231-ea70112eba8c h1:6szcz6CIKGLFw9fjOlpV123GQBWWzQAXpjvk5xFzkic= +github.com/lyondhill/vtclean v0.0.0-20170214195231-ea70112eba8c/go.mod h1:Ypaq4fyxvYAqjlaZ/6790j8IaX8qgpMk4npyRqR+1lA= +github.com/magiconair/properties v1.6.1-0.20151221213149-c81f9d71af8f h1:i0qIYnnNb+u80O3KUCNlVOFezoKlKg1J96/XzTILLnI= +github.com/magiconair/properties v1.6.1-0.20151221213149-c81f9d71af8f/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mitchellh/colorstring v0.0.0-20150228181156-61164e49940b h1:8l4UBG/vLryhtBKCqDISs2o7qWZ97Yobli2dISS3DCw= +github.com/mitchellh/colorstring v0.0.0-20150228181156-61164e49940b/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= +github.com/mitchellh/go-homedir v0.0.0-20150822234538-56f508a88415 h1:Ym3sGVE9r44t5QLEUo7yPvjAGzk8YqhyyAfizLo/2x4= +github.com/mitchellh/go-homedir v0.0.0-20150822234538-56f508a88415/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/mapstructure v0.0.0-20150717051158-281073eb9eb0 h1:6VeKv8nNMVKA6qmZLYnPTx0tJ//NbDj1SbubWIikJ9k= +github.com/mitchellh/mapstructure v0.0.0-20150717051158-281073eb9eb0/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mu-box/golang-docker-client v0.0.0-20170901184207-d1683dd8c7dd h1:DXzE/1MQQEM0aWb7fJLWxpFm+u03927R29RsTfk+wZI= +github.com/mu-box/golang-docker-client v0.0.0-20170901184207-d1683dd8c7dd/go.mod h1:ovvxNzYWjWiDSQ2FgxRFoBJ01XIKPgUuTKntOr+Trik= +github.com/mu-box/golang-portal-client v0.0.0-20170901184416-350613abb874 h1:K5+2v41aPTLEO7pRy67KahelsmWhBE6wANsEW/2VI54= +github.com/mu-box/golang-portal-client v0.0.0-20170901184416-350613abb874/go.mod h1:qRF+mMqBhKEMhn5mIKa4fzl1F5BaIQoZjwshTdEY31U= +github.com/mu-box/golang-ssh v0.0.0-20160912150335-b42e3bb3b407 h1:G31/TZCJRqdqpF3MbXovPw3tvPsjspHyedH9JTzXgQA= +github.com/mu-box/golang-ssh v0.0.0-20160912150335-b42e3bb3b407/go.mod h1:ZKYr775dsuT81p5GCDxYqwXR4R2UqT825teDzQeob74= +github.com/mu-box/logvac v0.1.1-0.20220117225559-b6e0df9e9085 h1:0RC5MBXtzzAiowXrB4ZQ4F3dHcGO7Ehxzk+YgjjCK18= +github.com/mu-box/logvac v0.1.1-0.20220117225559-b6e0df9e9085/go.mod h1:tNLMzpa7IdhIaBM/EbbOHIK1zHaMbcNpaeJKsytMKhk= +github.com/mu-box/microbox-boxfile v0.0.0-20170803212006-213ff24b93f4 h1:KqhKDSgc/1Ann/nfHwC3LBiAuD3kLhfAJqvwDxyaqxg= +github.com/mu-box/microbox-boxfile v0.0.0-20170803212006-213ff24b93f4/go.mod h1:3AJhyEVx57FEeR+BowCAoLh1Jh00IfW6lZc5nKi4XlE= +github.com/mu-box/microbox-golang-stylish v0.0.0-20160617201242-030019c3e9a9/go.mod h1:pxocGM+Ev1fIoxflQEIufq90i5KQkW0ULpA6/0mcujQ= +github.com/mu-box/mist v1.1.1-0.20220117224314-b4d1190bc7a4 h1:3mdJfOpDVB8D2yKaeeSX3fNxqfqA3bQ9ioEKI9tx6Ws= +github.com/mu-box/mist v1.1.1-0.20220117224314-b4d1190bc7a4/go.mod h1:HWGxRt5KMS8Mt892z5KU4iClTrfWsLXWjTZLm/AigHg= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/runc v0.0.9-0.20160219032739-0107c7fb6cef h1:C9pokjJ4MRX4lMZTxfW8NAcPCohb5pONusRERqEC/Cs= +github.com/opencontainers/runc v0.0.9-0.20160219032739-0107c7fb6cef/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/spf13/cast v0.0.0-20151218135219-ee7b3e035316 h1:ewDvguiDYTmhbP+hILV+IplQQM88stMcBcjFOPV7lSE= +github.com/spf13/cast v0.0.0-20151218135219-ee7b3e035316/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= +github.com/spf13/cobra v0.0.0-20160117030938-8e91712f174c h1:/ODmDm3R+Y64VFQ1uI4byBgBdkqSVNmMYFoSjk2ZEDE= +github.com/spf13/cobra v0.0.0-20160117030938-8e91712f174c/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/jwalterweatherman v0.0.0-20151231185856-d00654080cdd h1:9bF+yGiaGsgj11cktC7g+ir97H+vzvSvXv6asp/f0rs= +github.com/spf13/jwalterweatherman v0.0.0-20151231185856-d00654080cdd/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v0.0.0-20151218134703-7f60f83a2c81 h1:e8OMOPK+iXlzdnq5GOtSZDnw9HJi1faEKhCoEIxVUrY= +github.com/spf13/pflag v0.0.0-20151218134703-7f60f83a2c81/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v0.0.0-20160111150723-a212099cbe6f h1:T1rEZOdhsGHqU9MsaeM++g5Q89YaqJBFmA0Smj9bj6E= +github.com/spf13/viper v0.0.0-20160111150723-a212099cbe6f/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= +github.com/timehop/go-mixpanel v0.0.0-20150630220933-9b81eaf1f33e h1:ZPjKMUFz42BgHCCNLiJrcSn9AR7yHy9w+9T9tzabLCs= +github.com/timehop/go-mixpanel v0.0.0-20150630220933-9b81eaf1f33e/go.mod h1:wBJNkxs2qJ5kDg7128ujYvH0oDRcGBJ0ijXhlyMvymo= +golang.org/x/crypto v0.0.0-20160912150327-e311231e8319 h1:omlN+qS1UZ1L8O+V8NDVP3xLbdNZNiQhRmsncKhLTxk= +golang.org/x/crypto v0.0.0-20160912150327-e311231e8319/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/net v0.0.0-20170824174428-57efc9c3d9f9 h1:5dWUD2H++BOa8+DJzqUYOpTtpAWE6OZZJWhf1BgJR48= +golang.org/x/net v0.0.0-20170824174428-57efc9c3d9f9/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sys v0.0.0-20170322234810-8fd966b47dbd h1:JY0hXVDqgct7/fqe7CkIIBT8Vm6oGUSyu/zmdOWz/3w= +golang.org/x/sys v0.0.0-20170322234810-8fd966b47dbd/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +gopkg.in/fsnotify.v1 v1.2.9 h1:sQ4u2nqc93srqGq6uKE2mzSxC2XJF34qBut5caJJUQw= +gopkg.in/fsnotify.v1 v1.2.9/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/yaml.v2 v2.0.0-20151201162745-f7716cbe52ba h1:zs5kJPNmBQxScpRIdp+2eZySRHFWheLSbXfME4zAxgw= +gopkg.in/yaml.v2 v2.0.0-20151201162745-f7716cbe52ba/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= diff --git a/helpers/endpoint.go b/helpers/endpoint.go index 80cafad2..05d98b43 100644 --- a/helpers/endpoint.go +++ b/helpers/endpoint.go @@ -1,6 +1,6 @@ package helpers -import "github.com/nanobox-io/nanobox/models" +import "github.com/mu-box/microbox/models" func Endpoint(envModel *models.Env, args []string, maxArgs int) ([]string, string, string) { if len(args) == 0 { diff --git a/helpers/odin.go b/helpers/odin.go index 90ddb391..2dd16168 100644 --- a/helpers/odin.go +++ b/helpers/odin.go @@ -6,8 +6,8 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/odin" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/odin" ) // Validates an app exists and is accessible on odin @@ -32,7 +32,7 @@ func ValidateOdinApp(slug string) error { // All other scenarios fmt.Printf("\n%s\n\n", err.Error()) - return util.ErrorAppend(err, "Failed to communicate with nanobox") + return util.ErrorAppend(err, "Failed to communicate with microbox") } return nil diff --git a/main.go b/main.go index 4797c817..77a7bfa5 100644 --- a/main.go +++ b/main.go @@ -1,10 +1,10 @@ -// Nanobox automates the creation of isolated, repeatable environments for local -// and production applications. When developing locally, Nanobox provisions your +// Microbox automates the creation of isolated, repeatable environments for local +// and production applications. When developing locally, Microbox provisions your // app's infrastructure inside of a virtual machine (VM) and mounts your local // codebase into the VM. Any changes made to your codebase are reflected inside // the virtual environment. // -// Once code is built and tested locally, Nanobox provisions and deploys an +// Once code is built and tested locally, Microbox provisions and deploys an // identical infrastructure on a production platform. package main @@ -19,20 +19,20 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/commands" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors" - proc_provider "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/commands" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors" + proc_provider "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/provider" ) // main func main() { // setup a file logger, this will be replaced in verbose mode. - fileLogger, err := lumber.NewTruncateLogger(filepath.ToSlash(filepath.Join(config.GlobalDir(), "nanobox.log"))) + fileLogger, err := lumber.NewTruncateLogger(filepath.ToSlash(filepath.Join(config.GlobalDir(), "microbox.log"))) if err != nil { fmt.Println("logging error:", err) } @@ -51,7 +51,7 @@ func main() { os.Args[1] == "log" || os.Args[1] == "login" || os.Args[1] == "logout") { - err := commands.NanoboxCmd.Execute() + err := commands.MicroboxCmd.Execute() if err != nil { fmt.Println(err) os.Exit(1) @@ -85,7 +85,7 @@ func main() { // so it has to be done at the beginning even if we dont need it providerName := configModel.Provider - // make sure nanobox has all the necessry parts + // make sure microbox has all the necessry parts if !strings.Contains(command, " config") && !strings.Contains(command, " server") { err, missingParts := provider.Valid() if err != nil { @@ -112,13 +112,13 @@ func main() { lumber.Fatal(fmt.Sprintf("Cause of failure: %v", r)) lumber.Fatal(fmt.Sprintf("Error output:\n%v\n", string(stack))) lumber.Close() - fmt.Println("Nanobox encountered an unexpected error. Please see ~/.nanobox/nanobox.log and submit the issue to us.") + fmt.Println("Microbox encountered an unexpected error. Please see ~/.microbox/microbox.log and submit the issue to us.") os.Exit(1) } }() // - commands.NanoboxCmd.Execute() + commands.MicroboxCmd.Execute() } func badTerminal() bool { diff --git a/manifest.xml b/manifest.xml index 24e46bee..06ebfcca 100644 --- a/manifest.xml +++ b/manifest.xml @@ -2,10 +2,10 @@ -Nanobox +Microbox diff --git a/models/app.go b/models/app.go index 7e9fbb37..11721b79 100644 --- a/models/app.go +++ b/models/app.go @@ -3,7 +3,7 @@ package models import ( "fmt" - "github.com/nanobox-io/nanobox/util/config" + "github.com/mu-box/microbox/util/config" ) // App ... @@ -130,10 +130,7 @@ func AllApps() ([]*App, error) { return apps, fmt.Errorf("failed to load env apps: %s", err.Error()) } - for _, app := range envApps { - // append to the apps that we'll return - apps = append(apps, app) - } + apps = append(apps, envApps...) } return apps, nil diff --git a/models/auth.go b/models/auth.go index 46536a0e..14e5f3cb 100644 --- a/models/auth.go +++ b/models/auth.go @@ -6,7 +6,7 @@ import ( // Auth ... type Auth struct { - Endpoint string // nanobox, bonesalt, dev, sim + Endpoint string // microbox, wycrobox, dev, sim Key string // api_token from dashboard } @@ -32,10 +32,10 @@ func (a *Auth) Delete() error { return DeleteAuth(a.Endpoint) } -// LoadAuth loads the default (nanobox) auth entry +// LoadAuth loads the default (microbox) auth entry func LoadAuth() (*Auth, error) { auth := &Auth{ - Endpoint: "nanobox", + Endpoint: "microbox", } if err := get("auths", auth.Endpoint, &auth); err != nil { diff --git a/models/component.go b/models/component.go index bb1b91fa..9958a50e 100644 --- a/models/component.go +++ b/models/component.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/nanobox-io/nanobox/util" + "github.com/mu-box/microbox/util" ) type ( diff --git a/models/db.go b/models/db.go index 2c625592..9dce6b2d 100644 --- a/models/db.go +++ b/models/db.go @@ -7,11 +7,11 @@ import ( "path/filepath" "github.com/boltdb/bolt" - "github.com/nanobox-io/nanobox/util/config" + "github.com/mu-box/microbox/util/config" ) var ( - // DB is the path to the local nanobox database + // DB is the path to the local microbox database DB = filepath.ToSlash(filepath.Join(config.GlobalDir(), "data.db")) ) @@ -83,7 +83,7 @@ func get(bucket, id string, v interface{}) error { // Fetch the value value := bucket.Get([]byte(id)) - if value == nil || len(value) == 0 { + if len(value) == 0 { return fmt.Errorf("no record found") } @@ -184,7 +184,7 @@ func getAll(bucket string, v interface{}) error { // Fetch the values and append them to the elements array for _, key := range keys { value := bucket.Get([]byte(key)) - if value == nil || len(value) == 0 { + if len(value) == 0 { return fmt.Errorf("no record found") } elements = append(elements, value) diff --git a/models/db_test.go b/models/db_test.go index a682b680..97e6f6a6 100644 --- a/models/db_test.go +++ b/models/db_test.go @@ -10,8 +10,8 @@ type data struct { } func init() { - // initialize the db in the .nanobox directory - DB = "/tmp/nanobox-test.db" + // initialize the db in the .microbox directory + DB = "/tmp/microbox-test.db" } func TestPut(t *testing.T) { diff --git a/models/env.go b/models/env.go index 67ef0e42..62bf3408 100644 --- a/models/env.go +++ b/models/env.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/nanobox-io/nanobox/util/config" + "github.com/mu-box/microbox/util/config" ) // Env ... diff --git a/models/tunnel.go b/models/tunnel.go index e37f8eb0..ae0edecd 100644 --- a/models/tunnel.go +++ b/models/tunnel.go @@ -12,7 +12,7 @@ type ( TunnelInfo struct { Name string `json:"name,omitempty"` // component name being tunneled to Token string `json:"token,omitempty"` // token to complete the tunnel - URL string `json:"url,omitempty"` // url/ip of nanoagent + URL string `json:"url,omitempty"` // url/ip of microagent Port int `json:"port,omitempty"` // port to tunnel to. *must* omitempty. odin will use whatever port is passed (if 0, don't send) } ) diff --git a/models/version.go b/models/version.go index 49d26cf8..bbabf3a6 100644 --- a/models/version.go +++ b/models/version.go @@ -4,11 +4,11 @@ import "fmt" var ( // will be set with build flags, defaults for one-off `go build` - nanoVersion string = "0.0.0" // git tag - nanoCommit string = "custom" // commit id of build - nanoBuild string = "now" // date of build + microVersion string = "0.0.0" // git tag + microCommit string = "custom" // commit id of build + microBuild string = "now" // date of build ) func VersionString() string { - return fmt.Sprintf("Nanobox Version %s-%s (%s)", nanoVersion, nanoBuild, nanoCommit) + return fmt.Sprintf("Microbox Version %s-%s (%s)", microVersion, microBuild, microCommit) } diff --git a/processors/app/deploy.go b/processors/app/deploy.go index 928f87f5..a4121945 100644 --- a/processors/app/deploy.go +++ b/processors/app/deploy.go @@ -1,17 +1,17 @@ package app import ( - "github.com/nanobox-io/nanobox-boxfile" - - generator "github.com/nanobox-io/nanobox/generators/hooks/code" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/code" - "github.com/nanobox-io/nanobox/processors/component" - "github.com/nanobox-io/nanobox/processors/platform" - "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/hookit" + boxfile "github.com/mu-box/microbox-boxfile" + + generator "github.com/mu-box/microbox/generators/hooks/code" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/code" + "github.com/mu-box/microbox/processors/component" + "github.com/mu-box/microbox/processors/platform" + "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/hookit" ) // Deploy ... @@ -78,7 +78,7 @@ func finalizeDeploy(appModel *models.App) error { } display.StopTask() - // update nanoagent portal + // update microagent portal display.StartTask("Updating router") if err := platform.UpdatePortal(appModel); err != nil { display.ErrorTask() diff --git a/processors/app/destroy.go b/processors/app/destroy.go index c74e205e..6951397e 100644 --- a/processors/app/destroy.go +++ b/processors/app/destroy.go @@ -6,16 +6,16 @@ import ( "strings" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" - - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/app/dns" - "github.com/nanobox-io/nanobox/processors/component" - "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/dhcp" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/locker" + docker "github.com/mu-box/golang-docker-client" + + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/app/dns" + "github.com/mu-box/microbox/processors/component" + "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/dhcp" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/locker" ) // Destroy removes the app from the provider and the database @@ -48,7 +48,7 @@ func Destroy(appModel *models.App) error { defer display.CloseContext() // remove the dev container if there is one - docker.ContainerRemove(fmt.Sprintf("nanobox_%s", appModel.ID)) + docker.ContainerRemove(fmt.Sprintf("microbox_%s", appModel.ID)) // destroy the associated components if err := destroyComponents(appModel); err != nil { @@ -122,7 +122,7 @@ func cleanImages() { for _, image := range images { for _, tag := range image.RepoTags { // if there is a tag that is not our build and it is one of ours.. try removing it (without force) - if tag != "" && !strings.HasPrefix(tag, "nanobox/build") && strings.HasPrefix(tag, "nanobox/") { + if tag != "" && !strings.HasPrefix(tag, "mubox/build") && strings.HasPrefix(tag, "mubox/") { tag = strings.Replace(tag, ":latest", "", 1) docker.ImageRemove(tag, false) } diff --git a/processors/app/dns/add.go b/processors/app/dns/add.go index fafa3495..9d43a15d 100644 --- a/processors/app/dns/add.go +++ b/processors/app/dns/add.go @@ -5,11 +5,11 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/server" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/dns" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/server" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/dns" ) var AppSetup func(envModel *models.Env, appModel *models.App, name string) error diff --git a/processors/app/dns/list.go b/processors/app/dns/list.go index 1d140489..433a7011 100644 --- a/processors/app/dns/list.go +++ b/processors/app/dns/list.go @@ -3,8 +3,8 @@ package dns import ( "fmt" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/dns" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/dns" ) // List lists all dns entries for an app diff --git a/processors/app/dns/remove.go b/processors/app/dns/remove.go index 05dd639e..9a481f1e 100644 --- a/processors/app/dns/remove.go +++ b/processors/app/dns/remove.go @@ -5,11 +5,11 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/server" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/dns" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/server" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/dns" ) // Remove removes a dns entry from the local hosts file @@ -35,7 +35,7 @@ func Remove(a *models.App, name string) error { // remove the entry if err := dns.Remove(entry); err != nil { lumber.Error("dns:Remove:dns.Remove(%s): %s", entry, err.Error()) - return util.ErrorAppend(err, "unable to add dns entry: %s") + return util.ErrorAppend(err, "unable to add dns entry: %s", err) } display.Info("\n%s %s removed\n", display.TaskComplete, name) diff --git a/processors/app/dns/remove_all.go b/processors/app/dns/remove_all.go index 9fe6bb95..c5e7e7e7 100644 --- a/processors/app/dns/remove_all.go +++ b/processors/app/dns/remove_all.go @@ -5,11 +5,11 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/server" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/dns" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/server" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/dns" ) // RemoveAll removes all dns entries for an app diff --git a/processors/app/evar/add.go b/processors/app/evar/add.go index a244d33b..8e5412ee 100644 --- a/processors/app/evar/add.go +++ b/processors/app/evar/add.go @@ -3,10 +3,10 @@ package evar import ( "fmt" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/app" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/app" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) func Add(envModel *models.Env, appModel *models.App, evars map[string]string) error { diff --git a/processors/app/evar/list.go b/processors/app/evar/list.go index 1e32a21c..ec74ca8b 100644 --- a/processors/app/evar/list.go +++ b/processors/app/evar/list.go @@ -3,7 +3,7 @@ package evar import ( "fmt" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) func List(appModel *models.App) error { diff --git a/processors/app/evar/remove.go b/processors/app/evar/remove.go index 844d1dd0..5cf19022 100644 --- a/processors/app/evar/remove.go +++ b/processors/app/evar/remove.go @@ -3,9 +3,9 @@ package evar import ( "fmt" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) func Remove(appModel *models.App, keys []string) error { diff --git a/processors/app/info.go b/processors/app/info.go index 90a3cc5b..259b01a7 100644 --- a/processors/app/info.go +++ b/processors/app/info.go @@ -4,9 +4,9 @@ import ( "fmt" "strings" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/dns" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/dns" ) // Info ... diff --git a/processors/app/setup.go b/processors/app/setup.go index 1db9bd85..ec7318d1 100644 --- a/processors/app/setup.go +++ b/processors/app/setup.go @@ -3,12 +3,12 @@ package app import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/app/dns" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/dhcp" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/locker" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/app/dns" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/dhcp" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/locker" ) func init() { diff --git a/processors/app/start.go b/processors/app/start.go index 6185d414..e4d49217 100644 --- a/processors/app/start.go +++ b/processors/app/start.go @@ -3,11 +3,11 @@ package app import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/component" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/locker" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/component" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/locker" ) // Start will start all services associated with an app diff --git a/processors/app/stop.go b/processors/app/stop.go index 8dfaac1e..517c2feb 100644 --- a/processors/app/stop.go +++ b/processors/app/stop.go @@ -5,15 +5,16 @@ import ( // "net" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" - - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/component" - process_provider "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/util" - // "github.com/nanobox-io/nanobox/util/dhcp" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/locker" + docker "github.com/mu-box/golang-docker-client" + + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/component" + process_provider "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/util" + + // "github.com/mu-box/microbox/util/dhcp" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/locker" ) // Stop will stop all services associated with an app @@ -65,7 +66,7 @@ func Stop(appModel *models.App) error { func stopDevContainer(appModel *models.App) error { // grab the container info - container, err := docker.GetContainer(fmt.Sprintf("nanobox_%s", appModel.ID)) + container, err := docker.GetContainer(fmt.Sprintf("microbox_%s", appModel.ID)) if err != nil { // if we cant get the container it may have been removed by someone else // just return here @@ -86,7 +87,7 @@ func stopDevContainer(appModel *models.App) error { // if err := dhcp.ReturnIP(net.ParseIP(ip)); err != nil { // lumber.Error("dev:console:teardown:dhcp.ReturnIP(%s): %s", ip, err) - // lumber.Error("An error occurred durring dev console teadown:%s", err.Error()) + // lumber.Error("An error occurred during dev console teadown:%s", err.Error()) // return util.ErrorAppend(err, "failed to return unused IP back to pool") // } return nil diff --git a/processors/build.go b/processors/build.go index c391dd29..87deb8e5 100644 --- a/processors/build.go +++ b/processors/build.go @@ -1,17 +1,17 @@ package processors import ( - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/code" - "github.com/nanobox-io/nanobox/processors/env" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/locker" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/code" + "github.com/mu-box/microbox/processors/env" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/locker" ) // Build sets up the environment and runs a code build func Build(envModel *models.Env) error { - // by aquiring a local lock we are only allowing + // by acquiring a local lock we are only allowing // one build to happen at a time locker.LocalLock() defer locker.LocalUnlock() diff --git a/processors/clean.go b/processors/clean.go index e18c20e0..4e3a9aaa 100644 --- a/processors/clean.go +++ b/processors/clean.go @@ -1,11 +1,11 @@ package processors import ( - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/env" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/locker" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/env" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/locker" ) // diff --git a/processors/code/build.go b/processors/code/build.go index d96b2fce..b7bced6f 100644 --- a/processors/code/build.go +++ b/processors/code/build.go @@ -5,16 +5,16 @@ import ( "time" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" - "github.com/nanobox-io/nanobox-boxfile" - - container_generator "github.com/nanobox-io/nanobox/generators/containers" - hook_generator "github.com/nanobox-io/nanobox/generators/hooks/build" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/hookit" + docker "github.com/mu-box/golang-docker-client" + boxfile "github.com/mu-box/microbox-boxfile" + + container_generator "github.com/mu-box/microbox/generators/containers" + hook_generator "github.com/mu-box/microbox/generators/hooks/build" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/hookit" ) // Build builds the codebase that can then be deployed @@ -70,7 +70,7 @@ func Build(envModel *models.Env) error { // ensure we stop the container when we're done if err := docker.ContainerRemove(container_generator.BuildName()); err != nil { - return util.ErrorAppend(err, "unable to remove docker contianer") + return util.ErrorAppend(err, "unable to remove docker container") } return nil @@ -87,7 +87,7 @@ func prepareBuildEnvironment(containerID string) error { if strings.Contains(out, "argument list too long") { display.TooManyKeys() if err2, ok := err.(util.Err); ok { - err2.Suggest = "You may have too many ssh keys, please specify the one you need with `nanobox config set ssh-key ~/.ssh/id_rsa`" + err2.Suggest = "You may have too many ssh keys, please specify the one you need with `microbox config set ssh-key ~/.ssh/id_rsa`" err2.Output = out err2.Code = "1001" return util.ErrorAppend(err2, "failed to run the (build)user hook") diff --git a/processors/code/code.go b/processors/code/code.go index 0716ad8d..f427337c 100644 --- a/processors/code/code.go +++ b/processors/code/code.go @@ -5,12 +5,12 @@ import ( "time" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" - "github.com/nanobox-io/nanobox-boxfile" + docker "github.com/mu-box/golang-docker-client" + boxfile "github.com/mu-box/microbox-boxfile" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) // these constants represent different potential names a service can have @@ -62,7 +62,7 @@ func buildImage() string { // then let's set the default if the user hasn't specified if image == "" { - image = "nanobox/build" + image = "mubox/build" } return image diff --git a/processors/code/compile.go b/processors/code/compile.go index 1f38b519..41c5b7a7 100644 --- a/processors/code/compile.go +++ b/processors/code/compile.go @@ -5,15 +5,15 @@ import ( "time" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - container_generator "github.com/nanobox-io/nanobox/generators/containers" - hook_generator "github.com/nanobox-io/nanobox/generators/hooks/build" + container_generator "github.com/mu-box/microbox/generators/containers" + hook_generator "github.com/mu-box/microbox/generators/hooks/build" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/hookit" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/hookit" ) // Compile builds the codebase that can then be deployed @@ -70,7 +70,7 @@ func prepareCompileEnvironment(containerID string) error { // handle 'exec failed: argument list too long' error if strings.Contains(out, "argument list too long") { if err2, ok := err.(util.Err); ok { - err2.Suggest = "You may have too many ssh keys, please specify the one you need with `nanobox config set ssh-key ~/.ssh/id_rsa`" + err2.Suggest = "You may have too many ssh keys, please specify the one you need with `microbox config set ssh-key ~/.ssh/id_rsa`" err2.Output = out err2.Code = "1001" return util.ErrorAppend(err2, "failed to run the (compile)user hook") diff --git a/processors/code/destroy.go b/processors/code/destroy.go index 8d104e2a..aec67a9b 100644 --- a/processors/code/destroy.go +++ b/processors/code/destroy.go @@ -5,11 +5,11 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/dhcp" - "github.com/nanobox-io/nanobox/util/display" + docker "github.com/mu-box/golang-docker-client" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/dhcp" + "github.com/mu-box/microbox/util/display" ) // Destroy destroys a code component from the app diff --git a/processors/code/publish.go b/processors/code/publish.go index 5c95afc6..0fc5b28f 100644 --- a/processors/code/publish.go +++ b/processors/code/publish.go @@ -4,15 +4,15 @@ import ( "strings" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" - - container_generator "github.com/nanobox-io/nanobox/generators/containers" - "github.com/nanobox-io/nanobox/generators/hooks/build" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/hookit" + docker "github.com/mu-box/golang-docker-client" + + container_generator "github.com/mu-box/microbox/generators/containers" + "github.com/mu-box/microbox/generators/hooks/build" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/hookit" ) // Publish ... @@ -63,11 +63,11 @@ func Publish(envModel *models.Env, WarehouseConfig WarehouseConfig) error { lumber.Error("code:Publish:build.UserPayload()") return util.ErrorAppend(err, "unable to retrieve user payload") } - if out, err := hookit.DebugExec(container.ID, "user", payload, "info"); err != nil { + if out, err1 := hookit.DebugExec(container.ID, "user", payload, "info"); err1 != nil { // handle 'exec failed: argument list too long' error if strings.Contains(out, "argument list too long") { - if err2, ok := err.(util.Err); ok { - err2.Suggest = "You may have too many ssh keys, please specify the one you need with `nanobox config set ssh-key ~/.ssh/id_rsa`" + if err2, ok := err1.(util.Err); ok { + err2.Suggest = "You may have too many ssh keys, please specify the one you need with `microbox config set ssh-key ~/.ssh/id_rsa`" err2.Output = out err2.Code = "1001" return util.ErrorAppend(err2, "failed to run the (publish)user hook") @@ -89,12 +89,12 @@ func Publish(envModel *models.Env, WarehouseConfig WarehouseConfig) error { display.ErrorTask() return util.ErrorAppend(err, "unable to retrieve user payload") } - if out, err := hookit.DebugExec(container.ID, "publish", payload, "info"); err != nil { - if err2, ok := err.(util.Err); ok { + if out, err1 := hookit.DebugExec(container.ID, "publish", payload, "info"); err1 != nil { + if err2, ok := err1.(util.Err); ok { err2.Output = out return util.ErrorAppend(err2, "failed to run the (publish)publish hook") } - return util.ErrorAppend(err, "failed to run the (publish)publish hook") + return util.ErrorAppend(err1, "failed to run the (publish)publish hook") } display.StopTask() diff --git a/processors/code/setup.go b/processors/code/setup.go index eaf75e6d..8fe54ad0 100644 --- a/processors/code/setup.go +++ b/processors/code/setup.go @@ -4,15 +4,15 @@ import ( "time" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" - - container_generator "github.com/nanobox-io/nanobox/generators/containers" - hook_generator "github.com/nanobox-io/nanobox/generators/hooks/code" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/dhcp" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/hookit" + docker "github.com/mu-box/golang-docker-client" + + container_generator "github.com/mu-box/microbox/generators/containers" + hook_generator "github.com/mu-box/microbox/generators/hooks/code" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/dhcp" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/hookit" ) // diff --git a/processors/code/sync.go b/processors/code/sync.go index 3f235a85..39cf4e3f 100644 --- a/processors/code/sync.go +++ b/processors/code/sync.go @@ -2,12 +2,12 @@ package code import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox-boxfile" + boxfile "github.com/mu-box/microbox-boxfile" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/locker" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/locker" ) // Sync syncronizes an app's code components with the boxfile config @@ -94,7 +94,7 @@ func codeComponentModels(appModel *models.App) []*models.Component { image := box.Node(componentName).StringValue("image") if image == "" { - image = "nanobox/code" + image = "mubox/code" } componentModel := &models.Component{ diff --git a/processors/compile.go b/processors/compile.go index 98886879..9cd08a91 100644 --- a/processors/compile.go +++ b/processors/compile.go @@ -1,16 +1,16 @@ package processors import ( - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/code" - "github.com/nanobox-io/nanobox/processors/env" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/locker" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/code" + "github.com/mu-box/microbox/processors/env" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/locker" ) // Compile sets up the environment and runs a code build func Compile(envModel *models.Env) error { - // by aquiring a local lock we are only allowing + // by acquiring a local lock we are only allowing // one build to happen at a time locker.LocalLock() defer locker.LocalUnlock() diff --git a/processors/component/clean.go b/processors/component/clean.go index e4e6b84e..5663b843 100644 --- a/processors/component/clean.go +++ b/processors/component/clean.go @@ -4,11 +4,11 @@ import ( "strings" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) // Clean purges any components in a dirty or incomplete state diff --git a/processors/component/component.go b/processors/component/component.go index c38f3140..e2215b11 100644 --- a/processors/component/component.go +++ b/processors/component/component.go @@ -4,10 +4,10 @@ package component import ( "fmt" - "github.com/nanobox-io/golang-docker-client" - "github.com/nanobox-io/nanobox-boxfile" + docker "github.com/mu-box/golang-docker-client" + boxfile "github.com/mu-box/microbox-boxfile" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) // isComponentRunning returns true if a service is already running @@ -31,7 +31,7 @@ func componentImage(component *models.Component) (string, error) { // the only way image can be empty is if it's a platform service if image == "" { - image = fmt.Sprintf("nanobox/%s", component.Name) + image = fmt.Sprintf("mubox/%s", component.Name) } return image, nil diff --git a/processors/component/destroy.go b/processors/component/destroy.go index c55137bb..7bbb0255 100644 --- a/processors/component/destroy.go +++ b/processors/component/destroy.go @@ -4,12 +4,12 @@ import ( "net" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/dhcp" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/dhcp" + "github.com/mu-box/microbox/util/display" ) // Destroy destroys a component from the provider and database diff --git a/processors/component/setup.go b/processors/component/setup.go index 3ab0438e..14a359cb 100644 --- a/processors/component/setup.go +++ b/processors/component/setup.go @@ -4,15 +4,15 @@ import ( "time" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" - - container_generator "github.com/nanobox-io/nanobox/generators/containers" - hook_generator "github.com/nanobox-io/nanobox/generators/hooks/component" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/dhcp" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/hookit" + docker "github.com/mu-box/golang-docker-client" + + container_generator "github.com/mu-box/microbox/generators/containers" + hook_generator "github.com/mu-box/microbox/generators/hooks/component" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/dhcp" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/hookit" ) // Setup sets up the component container and model data diff --git a/processors/component/start.go b/processors/component/start.go index 042a5ec3..b05b1314 100644 --- a/processors/component/start.go +++ b/processors/component/start.go @@ -2,11 +2,11 @@ package component import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) // Start starts the component services diff --git a/processors/component/start_all.go b/processors/component/start_all.go index b5281f5f..d7991492 100644 --- a/processors/component/start_all.go +++ b/processors/component/start_all.go @@ -3,9 +3,9 @@ package component import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) // StartAll starts all app components diff --git a/processors/component/stop.go b/processors/component/stop.go index 418dc5a0..ad516349 100644 --- a/processors/component/stop.go +++ b/processors/component/stop.go @@ -2,11 +2,11 @@ package component import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) // Stop stops the component's docker container diff --git a/processors/component/stop_all.go b/processors/component/stop_all.go index d8ab2947..5f2a0e13 100644 --- a/processors/component/stop_all.go +++ b/processors/component/stop_all.go @@ -3,9 +3,9 @@ package component import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) // StopAll stops all app components diff --git a/processors/component/sync.go b/processors/component/sync.go index 185236c0..ea6d4658 100644 --- a/processors/component/sync.go +++ b/processors/component/sync.go @@ -2,11 +2,11 @@ package component import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox-boxfile" + boxfile "github.com/mu-box/microbox-boxfile" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) // Sync syncronizes an app's components with the boxfile config diff --git a/processors/configure.go b/processors/configure.go index 4337b655..aaf275ed 100644 --- a/processors/configure.go +++ b/processors/configure.go @@ -7,14 +7,14 @@ import ( "runtime" "time" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" ) var configured bool func Configure() error { - var os string + var os, arch string // make sure to only run configure one time if configured { @@ -22,26 +22,33 @@ func Configure() error { } configured = true - v, err := util.OsDetect() - if err == nil { + if v, err := util.OsDetect(); err != nil { + return err + } else { os = v } + if v, err := util.ArchDetect(); err != nil { + return err + } else { + arch = v + } + if os == "high sierra" && !models.HasRead() { // warn about high sierra hasRead := stringAsker(` -------------------------------------------------------------------------------- + WARNING: + -+ MacOS High Sierra introduces breaking changes to Nanobox! ++ MacOS High Sierra introduces breaking changes to Microbox! + + Please ensure you have read the following guides before continuing: -+ https://content.nanobox.io/installing-nanobox-on-macos-high-sierra/ ++ https://microbox.rocks/installing-microbox-on-macos-high-sierra/ -------------------------------------------------------------------------------- Have you already read the guide? y/n`, map[string]string{"y": "yes", "n": "no"}) if hasRead == "no" { - exec.Command("open", "https://content.nanobox.io/installing-nanobox-on-macos-high-sierra/").Start() + exec.Command("open", "https://microbox.rocks/installing-microbox-on-macos-high-sierra/").Start() return fmt.Errorf("\nEnding configure, please read the guide and try again.\n") } models.DoneRead() @@ -58,38 +65,40 @@ Have you already read the guide? y/n`, map[string]string{"y": "yes", "n": "no"}) } fmt.Print(` -CONFIGURE NANOBOX +CONFIGURE MICROBOX --------------------------------------------------------------- Please answer the following questions so we can customize your -nanobox configuration. Feel free to update your config at any -time by running: 'nanobox configure' +microbox configuration. Feel free to update your config at any +time by running: 'microbox configure' -(Learn more at : https://docs.nanobox.io/local-config/configure-nanobox/) +(Learn more at : https://docs.microbox.cloud/local-config/configure-microbox/) `) defer func() { - fmt.Println(` + fmt.Print(` ** ********* -*************** [√] Nanobox successfully Configured! +*************** [√] Microbox successfully Configured! :: ********* :: ------------------------------------------------------------ -" ::: *** ::: " Change these settings at any time via : 'nanobox configure' +" ::: *** ::: " Change these settings at any time via : 'microbox configure' "" ::: "" "" " "" " `) }() - // ask about provider - config.Provider = stringAsker(` -How would you like to run nanobox? + // docker-machine provider uses VirtualBox at the moment, which doesn't work on anything but amd64, and adds unnecessary overhead on Linux + if os == "linux" || arch != "amd64" { + config.Provider = "native" + } else { + // ask about provider + config.Provider = stringAsker(` +How would you like to run microbox? a) Inside a lightweight VM b) Via Docker Native - Note : Mac users, we strongly recommend choosing (a) until Docker Native - resolves an issue causing slow speeds : http://bit.ly/2jYFfWQ - Answer: `, map[string]string{"a": "docker-machine", "b": "native"}) + } // if provider == docker-machine ask more questions if config.Provider == "native" { @@ -113,7 +122,8 @@ How many GB of RAM would you like to make available to the VM (2-4)? Answer: `, 8) - if os != "high sierra" { + // Don't offer netfs on High Sierra or above + if os == "sierra" || os == "windows" { // ask about mount types config.MountType = stringAsker(` Would you like to enable netfs for faster filesystem access (y/n)? @@ -136,7 +146,7 @@ func stringAsker(text string, answers map[string]string) string { result, ok := answers[answer] for !ok { - fmt.Println("Invalid response, please try again:") + fmt.Print("\nInvalid response, please try again:\n") fmt.Print(text) fmt.Scanln(&answer) result, ok = answers[answer] @@ -151,7 +161,7 @@ func intAsker(text string, max int) int { fmt.Scanln(&answer) for answer > max { - fmt.Println("\nInvalid response, please try again:\n") + fmt.Print("\nInvalid response, please try again:\n") fmt.Print(text) fmt.Scanln(&answer) } diff --git a/processors/configure_set.go b/processors/configure_set.go index 3c1d33b8..71a0ef62 100644 --- a/processors/configure_set.go +++ b/processors/configure_set.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) func ConfigureSet(key, val string) error { diff --git a/processors/console.go b/processors/console.go index 7a994446..913b9ad2 100644 --- a/processors/console.go +++ b/processors/console.go @@ -3,13 +3,13 @@ package processors import ( "strings" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/nanoagent" - "github.com/nanobox-io/nanobox/util/odin" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/microagent" + "github.com/mu-box/microbox/util/odin" ) func Console(envModel *models.Env, consoleConfig ConsoleConfig) error { @@ -25,7 +25,7 @@ func Console(envModel *models.Env, consoleConfig ConsoleConfig) error { appID = remote.ID } - // set odins endpoint if the arguement is passed + // set odins endpoint if the argument is passed if endpoint := registry.GetString("endpoint"); endpoint != "" { odin.SetEndpoint(endpoint) } @@ -61,11 +61,11 @@ func Console(envModel *models.Env, consoleConfig ConsoleConfig) error { switch protocol { case "docker": - if err := nanoagent.Console(key, location); err != nil { + if err := microagent.Console(key, location); err != nil { return util.ErrorAppend(err, "failed to connect to remote console session") } case "ssh": - if err := nanoagent.SSH(key, location); err != nil { + if err := microagent.SSH(key, location); err != nil { return util.ErrorAppend(err, "failed to connect to remote ssh server") } } diff --git a/processors/deploy.go b/processors/deploy.go index ff86e6c6..68cf4900 100644 --- a/processors/deploy.go +++ b/processors/deploy.go @@ -3,13 +3,13 @@ package processors import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/code" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/odin" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/code" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/odin" ) // @@ -74,7 +74,7 @@ func getWarehouseConfig(envModel *models.Env, appID string) (warehouseConfig cod token, url, err := odin.GetWarehouse(appID) if err != nil { lumber.Error("deploy:setWarehouseToken:GetWarehouse(%s): %s", appID, err.Error()) - err = util.ErrorAppend(err, "failed to fetch warehouse information from nanobox") + err = util.ErrorAppend(err, "failed to fetch warehouse information from microbox") return } @@ -82,7 +82,7 @@ func getWarehouseConfig(envModel *models.Env, appID string) (warehouseConfig cod prevBuild, err := odin.GetPreviousBuild(appID) if err != nil { lumber.Error("deploy:setWarehouseToken:GetPreviousBuild(%s): %s", appID, err.Error()) - err = util.ErrorAppend(err, "failed to query previous deploys from nanobox") + err = util.ErrorAppend(err, "failed to query previous deploys from microbox") return } diff --git a/processors/env/console.go b/processors/env/console.go index 76789823..9c818b64 100644 --- a/processors/env/console.go +++ b/processors/env/console.go @@ -3,11 +3,11 @@ package env import ( "time" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/console" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/console" + "github.com/mu-box/microbox/util/display" ) // Console ... diff --git a/processors/env/destroy.go b/processors/env/destroy.go index 6d9657c4..3a4fc70b 100644 --- a/processors/env/destroy.go +++ b/processors/env/destroy.go @@ -4,14 +4,14 @@ import ( "fmt" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/app" - "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/locker" - util_provider "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/app" + "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/locker" + util_provider "github.com/mu-box/microbox/util/provider" ) // Destroy brings down the environment setup @@ -52,11 +52,11 @@ func Destroy(env *models.Env) error { } // remove volumes - docker.VolumeRemove(fmt.Sprintf("nanobox_%s_app", env.ID)) - docker.VolumeRemove(fmt.Sprintf("nanobox_%s_cache", env.ID)) - docker.VolumeRemove(fmt.Sprintf("nanobox_%s_mount", env.ID)) - docker.VolumeRemove(fmt.Sprintf("nanobox_%s_deploy", env.ID)) - docker.VolumeRemove(fmt.Sprintf("nanobox_%s_build", env.ID)) + docker.VolumeRemove(fmt.Sprintf("microbox_%s_app", env.ID)) + docker.VolumeRemove(fmt.Sprintf("microbox_%s_cache", env.ID)) + docker.VolumeRemove(fmt.Sprintf("microbox_%s_mount", env.ID)) + docker.VolumeRemove(fmt.Sprintf("microbox_%s_deploy", env.ID)) + docker.VolumeRemove(fmt.Sprintf("microbox_%s_build", env.ID)) // remove the environment if err := env.Delete(); err != nil { diff --git a/processors/env/mount.go b/processors/env/mount.go index 0a6717b1..89620da1 100644 --- a/processors/env/mount.go +++ b/processors/env/mount.go @@ -4,11 +4,11 @@ import ( "fmt" "path/filepath" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/provider" ) // Mount sets up the env mounts diff --git a/processors/env/setup.go b/processors/env/setup.go index 9a7bf04d..fd4d98c7 100644 --- a/processors/env/setup.go +++ b/processors/env/setup.go @@ -7,14 +7,14 @@ import ( "time" "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox-boxfile" - - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - util_provider "github.com/nanobox-io/nanobox/util/provider" + boxfile "github.com/mu-box/microbox-boxfile" + + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + util_provider "github.com/mu-box/microbox/util/provider" ) // Setup sets up the provider and the env mounts diff --git a/processors/env/share/add.go b/processors/env/share/add.go index 54a43ccc..829a087b 100644 --- a/processors/env/share/add.go +++ b/processors/env/share/add.go @@ -3,8 +3,8 @@ package share import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/provider/share" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/provider/share" ) // Add adds a share share to the workstation diff --git a/processors/env/share/remove.go b/processors/env/share/remove.go index 83b0115e..1ac00681 100644 --- a/processors/env/share/remove.go +++ b/processors/env/share/remove.go @@ -3,8 +3,8 @@ package share import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/provider/share" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/provider/share" ) // Remove removes a share share from the workstation diff --git a/processors/env/unmount.go b/processors/env/unmount.go index a1c38012..4f034deb 100644 --- a/processors/env/unmount.go +++ b/processors/env/unmount.go @@ -3,17 +3,17 @@ package env import ( "path/filepath" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/provider" ) // Unmount unmounts the env shares func Unmount(env *models.Env) error { - // break early if there is still an environemnt using the mounts + // break early if there is still an environment using the mounts if mountsInUse(env) { return nil } diff --git a/processors/evar/add.go b/processors/evar/add.go index 8dce2337..0cc76f3b 100644 --- a/processors/evar/add.go +++ b/processors/evar/add.go @@ -3,10 +3,10 @@ package evar import ( "fmt" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/odin" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/odin" ) func Add(envModel *models.Env, appID string, evars map[string]string) error { @@ -20,7 +20,7 @@ func Add(envModel *models.Env, appID string, evars map[string]string) error { appID = remote.ID } - // set odins endpoint if the arguement is passed + // set odins endpoint if the argument is passed if endpoint := registry.GetString("endpoint"); endpoint != "" { odin.SetEndpoint(endpoint) } diff --git a/processors/evar/list.go b/processors/evar/list.go index f1194b95..0a82f35b 100644 --- a/processors/evar/list.go +++ b/processors/evar/list.go @@ -3,9 +3,9 @@ package evar import ( "fmt" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/odin" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/odin" ) func List(envModel *models.Env, appID string) error { @@ -18,7 +18,7 @@ func List(envModel *models.Env, appID string) error { appID = remote.ID } - // set odins endpoint if the arguement is passed + // set odins endpoint if the argument is passed if endpoint := registry.GetString("endpoint"); endpoint != "" { odin.SetEndpoint(endpoint) } diff --git a/processors/evar/remove.go b/processors/evar/remove.go index a6167e1d..d2b05ceb 100644 --- a/processors/evar/remove.go +++ b/processors/evar/remove.go @@ -3,10 +3,10 @@ package evar import ( "fmt" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/odin" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/odin" ) func Remove(envModel *models.Env, appID string, keys []string) error { @@ -20,7 +20,7 @@ func Remove(envModel *models.Env, appID string, keys []string) error { appID = remote.ID } - // set odins endpoint if the arguement is passed + // set odins endpoint if the argument is passed if endpoint := registry.GetString("endpoint"); endpoint != "" { odin.SetEndpoint(endpoint) } diff --git a/processors/implode.go b/processors/implode.go index bc26eaf8..872c7d38 100644 --- a/processors/implode.go +++ b/processors/implode.go @@ -4,21 +4,21 @@ import ( "fmt" "os" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/env" - "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/processors/server" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - util_provider "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/env" + "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/processors/server" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + util_provider "github.com/mu-box/microbox/util/provider" ) -// Implode destroys the provider and cleans nanobox off of the system +// Implode destroys the provider and cleans microbox off of the system func Implode() error { - display.OpenContext("Imploding Nanobox") + display.OpenContext("Imploding Microbox") defer display.CloseContext() // remove all environments @@ -40,13 +40,13 @@ func Implode() error { return util.ErrorAppend(err, "failed to implode the provider") } - // check to see if we need to uninstall nanobox + // check to see if we need to uninstall microbox // or just remove apps if registry.GetBool("full-implode") { // teardown the server + //lint:ignore SA9003 if we cant tear down the server dont worry about it if err := server.Teardown(); err != nil { - // if we cant tear down the server dont worry about it // return util.ErrorAppend(err, "failed to remove server") } diff --git a/processors/log/log.go b/processors/log/log.go index 78007746..38e8075e 100644 --- a/processors/log/log.go +++ b/processors/log/log.go @@ -13,17 +13,17 @@ import ( "time" "github.com/jcelliott/lumber" - "github.com/nanopack/logvac/core" - "github.com/nanopack/mist/core" + logvac "github.com/mu-box/logvac/core" + mist "github.com/mu-box/mist/core" "golang.org/x/net/websocket" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/odin" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/odin" ) // Tail tails production logs for an app. @@ -39,7 +39,7 @@ func Tail(envModel *models.Env, app string, logOpts models.LogOpts) error { appID = remote.ID } - // set odins endpoint if the arguement is passed + // set odins endpoint if the argument is passed if endpoint := registry.GetString("endpoint"); endpoint != "" { odin.SetEndpoint(endpoint) } @@ -82,7 +82,7 @@ func Print(envModel *models.Env, app string, logOpts models.LogOpts) error { appID = remote.ID } - // set odins endpoint if the arguement is passed + // set odins endpoint if the argument is passed if endpoint := registry.GetString("endpoint"); endpoint != "" { odin.SetEndpoint(endpoint) } @@ -101,7 +101,7 @@ func Print(envModel *models.Env, app string, logOpts models.LogOpts) error { token, url, err := odin.GetComponent(appID, "logger") if err != nil { lumber.Error("deploy:setMistToken:GetMist(%s): %s", appID, err.Error()) - err = util.ErrorAppend(err, "failed to fetch logvac information from nanobox") + err = util.ErrorAppend(err, "failed to fetch logvac information from microbox") return err } @@ -123,7 +123,7 @@ func getMistConfig(envModel *models.Env, appID string) (*MistConfig, error) { token, url, err := odin.GetComponent(appID, "pusher") if err != nil { lumber.Error("deploy:setMistToken:GetMist(%s): %s", appID, err.Error()) - err = util.ErrorAppend(err, "failed to fetch mist information from nanobox") + err = util.ErrorAppend(err, "failed to fetch mist information from microbox") return nil, err } @@ -153,7 +153,7 @@ func mistListen(token, url string, logOpts models.LogOpts) error { signal.Notify(sigChan, os.Interrupt) signal.Notify(sigChan, os.Kill) - // if `-f` wasn't explicity called, print what we are doing + // if `-f` wasn't explicitly called, print what we are doing if !logFollow { fmt.Printf(` Connected to streaming logs: @@ -164,7 +164,7 @@ waiting for output... `) } - // loop waiting for messages or signals if we recieve a kill signal quit + // loop waiting for messages or signals if we receive a kill signal quit // messages will be displayed // msgChan := client.Messages() for { @@ -182,7 +182,7 @@ waiting for output... var messageChan chan mist.Message func newMistClient(token, address string) (*websocket.Conn, error) { - origin := "https://nanoapp.localhost" + origin := "https://microapp.localhost" url := "wss://" + address + ":1446/subscribe/websocket?X-AUTH-TOKEN=" + token config, err := websocket.NewConfig(url, origin) diff --git a/processors/login.go b/processors/login.go index a9853914..8abf9f64 100644 --- a/processors/login.go +++ b/processors/login.go @@ -4,18 +4,18 @@ import ( "fmt" "os" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/odin" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/odin" ) // Process ... func Login(username, password, endpoint string) error { // request Username/Password if missing - if username == "" && os.Getenv("NANOBOX_USERNAME") != "" { - username = os.Getenv("NANOBOX_USERNAME") + if username == "" && os.Getenv("MICROBOX_USERNAME") != "" { + username = os.Getenv("MICROBOX_USERNAME") } if username == "" { @@ -26,25 +26,25 @@ func Login(username, password, endpoint string) error { username = user } - if password == "" && os.Getenv("NANOBOX_PASSWORD") != "" { - password = os.Getenv("NANOBOX_PASSWORD") + if password == "" && os.Getenv("MICROBOX_PASSWORD") != "" { + password = os.Getenv("MICROBOX_PASSWORD") } if password == "" { // ReadPassword prints Password: already - pass, err := display.ReadPassword("Nanobox") + pass, err := display.ReadPassword("Microbox") if err != nil { return util.ErrorAppend(err, "failed to read password") } password = pass } - if endpoint == "" && os.Getenv("NANOBOX_ENDPOINT") != "" { - endpoint = os.Getenv("NANOBOX_ENDPOINT") + if endpoint == "" && os.Getenv("MICROBOX_ENDPOINT") != "" { + endpoint = os.Getenv("MICROBOX_ENDPOINT") } if endpoint == "" { - endpoint = "nanobox" + endpoint = "microbox" } // set the odin endpoint @@ -53,8 +53,8 @@ func Login(username, password, endpoint string) error { // verify that the user exists token, err := odin.Auth(username, password) if err != nil { - fmt.Println(`! The username/password was incorrect, but we're continuing on. - To reattempt authentication, run 'nanobox login'. + fmt.Print(`! The username/password was incorrect, but we're continuing on. + To reattempt authentication, run 'microbox login'. `) return nil } diff --git a/processors/logout.go b/processors/logout.go index 46210655..59fce36e 100644 --- a/processors/logout.go +++ b/processors/logout.go @@ -3,16 +3,16 @@ package processors import ( "fmt" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) // Process ... func Logout(endpoint string) error { if endpoint == "" { - endpoint = "nanobox" + endpoint = "microbox" } // lookup the auth by the endpoint diff --git a/processors/platform/mist.go b/processors/platform/mist.go index edfd6287..5d19429e 100644 --- a/processors/platform/mist.go +++ b/processors/platform/mist.go @@ -6,11 +6,11 @@ import ( "os/signal" "time" - "github.com/nanopack/mist/clients" + "github.com/mu-box/mist/clients" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) // MistListen ... @@ -48,7 +48,7 @@ waiting for output... `) - // loop waiting for messages or signals if we recieve a kill signal quit + // loop waiting for messages or signals if we receive a kill signal quit // messages will be displayed for { select { diff --git a/processors/platform/platform.go b/processors/platform/platform.go index 1aa49bf2..31dfe529 100644 --- a/processors/platform/platform.go +++ b/processors/platform/platform.go @@ -26,21 +26,21 @@ var setupComponents = []PlatformComponent{ { label: "Logger", name: "logvac", - image: "nanobox/logvac", + image: "mubox/logvac", }, { label: "Message Bus", name: "mist", - image: "nanobox/mist", + image: "mubox/mist", }, { label: "Router", name: "portal", - image: "nanobox/portal", + image: "mubox/portal", }, { label: "Storage", name: "hoarder", - image: "nanobox/hoarder", + image: "mubox/hoarder", }, } diff --git a/processors/platform/portal.go b/processors/platform/portal.go index d2b67682..b30f50b2 100644 --- a/processors/platform/portal.go +++ b/processors/platform/portal.go @@ -5,10 +5,10 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-portal-client" - generator "github.com/nanobox-io/nanobox/generators/router" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" + portal "github.com/mu-box/golang-portal-client" + generator "github.com/mu-box/microbox/generators/router" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" ) // UpdatePortal ... diff --git a/processors/platform/provision.go b/processors/platform/provision.go index 46bc2d44..a6024cb5 100644 --- a/processors/platform/provision.go +++ b/processors/platform/provision.go @@ -1,9 +1,9 @@ package platform import ( - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/component" - "github.com/nanobox-io/nanobox/util" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/component" + "github.com/mu-box/microbox/util" ) // provisionComponent will provision an individual component diff --git a/processors/platform/setup.go b/processors/platform/setup.go index 4d72c282..7f792674 100644 --- a/processors/platform/setup.go +++ b/processors/platform/setup.go @@ -1,9 +1,9 @@ package platform import ( - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) // Setup provisions platform components needed for an app setup diff --git a/processors/platform/stop.go b/processors/platform/stop.go index 9a183a5d..176becc9 100644 --- a/processors/platform/stop.go +++ b/processors/platform/stop.go @@ -3,9 +3,9 @@ package platform import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/component" - "github.com/nanobox-io/nanobox/util" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/component" + "github.com/mu-box/microbox/util" ) // Stop stops all platform components diff --git a/processors/provider/bridge/bridge.go b/processors/provider/bridge/bridge.go index 8c007224..8f98f496 100644 --- a/processors/provider/bridge/bridge.go +++ b/processors/provider/bridge/bridge.go @@ -3,12 +3,13 @@ package bridge import ( "fmt" "path/filepath" + // "runtime" "net" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/dhcp" - "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/dhcp" + "github.com/mu-box/microbox/util/provider" ) func BridgeConfig() string { @@ -65,7 +66,7 @@ func Connected() bool { return false } - // look throught the interfaces on the system + // look through the interfaces on the system for _, i := range interfaces { addrs, err := i.Addrs() if err != nil { diff --git a/processors/provider/bridge/setup.go b/processors/provider/bridge/setup.go index c680b60a..73817545 100644 --- a/processors/provider/bridge/setup.go +++ b/processors/provider/bridge/setup.go @@ -9,15 +9,16 @@ import ( "time" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" - - container_generator "github.com/nanobox-io/nanobox/generators/containers" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - // "github.com/nanobox-io/nanobox/util/fileutil" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/hookit" - "github.com/nanobox-io/nanobox/util/locker" + docker "github.com/mu-box/golang-docker-client" + + container_generator "github.com/mu-box/microbox/generators/containers" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + + // "github.com/mu-box/microbox/util/fileutil" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/hookit" + "github.com/mu-box/microbox/util/locker" ) var keys map[string]string @@ -81,13 +82,13 @@ func setupContainer() error { display.StartTask("Setting up container") // run the configure hook - if _, err := hookit.DebugExec(container.ID, "configure", "{\"platform\":\"local\",\"config\":{}}", "info"); err != nil { - return util.ErrorAppend(err, "failed to run configure hook") + if _, err1 := hookit.DebugExec(container.ID, "configure", "{\"platform\":\"local\",\"config\":{}}", "info"); err1 != nil { + return util.ErrorAppend(err1, "failed to run configure hook") } // run the start hook - if _, err := hookit.DebugExec(container.ID, "start", "{}", "info"); err != nil { - return util.ErrorAppend(err, "failed to run start hook") + if _, err1 := hookit.DebugExec(container.ID, "start", "{}", "info"); err1 != nil { + return util.ErrorAppend(err1, "failed to run start hook") } // run the start hook diff --git a/processors/provider/bridge/start.go b/processors/provider/bridge/start.go index 99a36e73..a14784b3 100644 --- a/processors/provider/bridge/start.go +++ b/processors/provider/bridge/start.go @@ -1,7 +1,7 @@ package bridge import ( - "github.com/nanobox-io/nanobox/util/provider/bridge" + "github.com/mu-box/microbox/util/provider/bridge" ) // ask the server to start the bridge diff --git a/processors/provider/bridge/stop.go b/processors/provider/bridge/stop.go index 4dd1a9c6..783dafe9 100644 --- a/processors/provider/bridge/stop.go +++ b/processors/provider/bridge/stop.go @@ -1,7 +1,7 @@ package bridge import ( - "github.com/nanobox-io/nanobox/util/provider/bridge" + "github.com/mu-box/microbox/util/provider/bridge" ) // ask the server to stop the bridge diff --git a/processors/provider/bridge/teardown.go b/processors/provider/bridge/teardown.go index 724f4541..e316c558 100644 --- a/processors/provider/bridge/teardown.go +++ b/processors/provider/bridge/teardown.go @@ -2,10 +2,10 @@ package bridge import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - container_generator "github.com/nanobox-io/nanobox/generators/containers" - "github.com/nanobox-io/nanobox/util" + container_generator "github.com/mu-box/microbox/generators/containers" + "github.com/mu-box/microbox/util" ) func Teardown() error { diff --git a/processors/provider/destroy.go b/processors/provider/destroy.go index eff863ca..75fccd9b 100644 --- a/processors/provider/destroy.go +++ b/processors/provider/destroy.go @@ -3,10 +3,10 @@ package provider import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/processors/provider/bridge" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/locker" - "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/processors/provider/bridge" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/locker" + "github.com/mu-box/microbox/util/provider" ) // Destroy destroys the provider diff --git a/processors/provider/init.go b/processors/provider/init.go index cba0323f..d00ae8c3 100644 --- a/processors/provider/init.go +++ b/processors/provider/init.go @@ -4,11 +4,11 @@ import ( "time" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/provider" ) // Init initializes the docker client for the provider diff --git a/processors/provider/setup.go b/processors/provider/setup.go index 1099526d..202dffc4 100644 --- a/processors/provider/setup.go +++ b/processors/provider/setup.go @@ -5,13 +5,13 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/provider/bridge" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/dhcp" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/locker" - "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/provider/bridge" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/dhcp" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/locker" + "github.com/mu-box/microbox/util/provider" ) // Setup sets up the provider (launch VM, etc) @@ -37,7 +37,7 @@ func Setup() error { return nil } - display.OpenContext("Starting Nanobox") + display.OpenContext("Starting Microbox") // create the provider (VM) if err := util.Retry(provider.Create, 3, 20*time.Second); err != nil { diff --git a/processors/provider/stop.go b/processors/provider/stop.go index 12302ee3..1fb465c8 100644 --- a/processors/provider/stop.go +++ b/processors/provider/stop.go @@ -3,11 +3,11 @@ package provider import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/processors/provider/bridge" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/locker" - "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/processors/provider/bridge" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/locker" + "github.com/mu-box/microbox/util/provider" ) // Stop stops the provider (stops the VM) @@ -15,7 +15,7 @@ func Stop() error { locker.GlobalLock() defer locker.GlobalUnlock() - display.OpenContext("Stopping Nanobox") + display.OpenContext("Stopping Microbox") defer display.CloseContext() // stop the vpn diff --git a/processors/remote/add.go b/processors/remote/add.go index 66e5b660..2c503c77 100644 --- a/processors/remote/add.go +++ b/processors/remote/add.go @@ -3,12 +3,12 @@ package remote import ( "fmt" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/odin" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/odin" ) func Add(envModel *models.Env, appName, alias string) error { @@ -29,9 +29,9 @@ func Add(envModel *models.Env, appName, alias string) error { } endpoint := registry.GetString("endpoint") - // set the endpoint to nanobox if it's missing + // set the endpoint to microbox if it's missing if endpoint == "" { - endpoint = "nanobox" + endpoint = "microbox" } // set the odin endpoint diff --git a/processors/remote/list.go b/processors/remote/list.go index d9abf5a2..86292225 100644 --- a/processors/remote/list.go +++ b/processors/remote/list.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) // List ... diff --git a/processors/remote/remove.go b/processors/remote/remove.go index e5643370..501843b6 100644 --- a/processors/remote/remove.go +++ b/processors/remote/remove.go @@ -3,9 +3,9 @@ package remote import ( "fmt" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) // Remove ... diff --git a/processors/run.go b/processors/run.go index e73ee87e..c84cd3e2 100644 --- a/processors/run.go +++ b/processors/run.go @@ -6,21 +6,21 @@ import ( "time" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" - "github.com/nanobox-io/nanobox-boxfile" - - container_generator "github.com/nanobox-io/nanobox/generators/containers" - build_generator "github.com/nanobox-io/nanobox/generators/hooks/build" - - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/env" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/console" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/hookit" - "github.com/nanobox-io/nanobox/util/locker" - "github.com/nanobox-io/nanobox/util/provider" - "github.com/nanobox-io/nanobox/util/watch" + docker "github.com/mu-box/golang-docker-client" + boxfile "github.com/mu-box/microbox-boxfile" + + container_generator "github.com/mu-box/microbox/generators/containers" + build_generator "github.com/mu-box/microbox/generators/hooks/build" + + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/env" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/console" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/hookit" + "github.com/mu-box/microbox/util/locker" + "github.com/mu-box/microbox/util/provider" + "github.com/mu-box/microbox/util/watch" ) // Run a code container with your runtime installed @@ -41,7 +41,7 @@ func Run(envModel *models.Env, appModel *models.App, consoleConfig console.Conso // create a dummy component using the appname component := &models.Component{ - ID: "nanobox_" + appModel.ID, + ID: "microbox_" + appModel.ID, } consoleConfig.DevIP = appModel.LocalIPs["env"] @@ -104,7 +104,7 @@ func setup(appModel *models.App) error { // handle 'exec failed: argument list too long' error if strings.Contains(out, "argument list too long") { if err2, ok := err.(util.Err); ok { - err2.Suggest = "You may have too many ssh keys, please specify the one you need with `nanobox config set ssh-key ~/.ssh/id_rsa`" + err2.Suggest = "You may have too many ssh keys, please specify the one you need with `microbox config set ssh-key ~/.ssh/id_rsa`" err2.Output = out err2.Code = "1001" return util.ErrorAppend(err2, "failed to run the (run)user hook") @@ -144,7 +144,7 @@ func teardown(appModel *models.App) error { // remove the container if err := docker.ContainerRemove(container.ID); err != nil { lumber.Error("dev:console:teardown:docker.ContainerRemove(%s): %s", container.ID, err) - // prechecking for the containers existance does not guarantee it exists + // prechecking for the containers existence does not guarantee it exists // return util.ErrorAppend(err, "failed to remove dev container") } diff --git a/processors/server/setup.go b/processors/server/setup.go index 1ea27073..23e0e847 100644 --- a/processors/server/setup.go +++ b/processors/server/setup.go @@ -5,30 +5,30 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/service" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/service" ) func Setup() error { - if service.Running("nanobox-server") { + if service.Running("microbox-server") { return nil } // run as admin if !util.IsPrivileged() { - return reExecPrivilageStart() + return reExecPrivilegeStart() } - // TEMP: we need to remove the old nanobox-vpn just incase it is left over + // TEMP: we need to remove the old microbox-vpn just incase it is left over // we will not catch errors here because if it doesnt exist or it breaks it - // should not stop us from creating the new nanobox-server - service.Stop("nanobox-vpn") - service.Remove("nanobox-vpn") + // should not stop us from creating the new microbox-server + service.Stop("microbox-vpn") + service.Remove("microbox-vpn") // create the service this call is idempotent so we shouldnt need to check - if err := service.Create("nanobox-server", []string{config.NanoboxPath(), "server"}); err != nil { + if err := service.Create("microbox-server", []string{config.MicroboxPath(), "server"}); err != nil { return err } @@ -37,16 +37,16 @@ func Setup() error { } -// reExecPrivilageStart re-execs the current process with a privileged user -func reExecPrivilageStart() error { +// reExecPrivilegeStart re-execs the current process with a privileged user +func reExecPrivilegeStart() error { display.PauseTask() defer display.ResumeTask() display.PrintRequiresPrivilege("to start the server") - cmd := fmt.Sprintf("\"%s\" env server start", config.NanoboxPath()) + cmd := fmt.Sprintf("\"%s\" env server start", config.MicroboxPath()) if err := util.PrivilegeExec(cmd); err != nil { - lumber.Error("server:reExecPrivilageStart:util.PrivilegeExec(%s): %s", cmd, err) + lumber.Error("server:reExecPrivilegeStart:util.PrivilegeExec(%s): %s", cmd, err) return err } diff --git a/processors/server/start.go b/processors/server/start.go index 6becc2e6..0dea7356 100644 --- a/processors/server/start.go +++ b/processors/server/start.go @@ -3,21 +3,21 @@ package server import ( "time" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/service" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/service" ) func Start() error { // run as admin - // the reExecPrivilageStart function is defined in the setup + // the reExecPrivilegeStart function is defined in the setup // since the service create is idempotent it is fine to only have one // start command for the server if !util.IsPrivileged() { - return reExecPrivilageStart() + return reExecPrivilegeStart() } fn := func() error { - return service.Start("nanobox-server") + return service.Start("microbox-server") } return util.Retry(fn, 3, time.Second) diff --git a/processors/server/stop.go b/processors/server/stop.go index b494f28c..ccf702b0 100644 --- a/processors/server/stop.go +++ b/processors/server/stop.go @@ -5,32 +5,32 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/service" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/service" ) func Stop() error { // run as admin if !util.IsPrivileged() { - return reExecPrivilageStop() + return reExecPrivilegeStop() } - return service.Stop("nanobox-server") + return service.Stop("microbox-server") } -// reExecPrivilageStop re-execs the current process with a privileged user -func reExecPrivilageStop() error { +// reExecPrivilegeStop re-execs the current process with a privileged user +func reExecPrivilegeStop() error { display.PauseTask() defer display.ResumeTask() display.PrintRequiresPrivilege("to stop the server") - cmd := fmt.Sprintf("\"%s\" env server stop", config.NanoboxPath()) + cmd := fmt.Sprintf("\"%s\" env server stop", config.MicroboxPath()) if err := util.PrivilegeExec(cmd); err != nil { - lumber.Error("server:reExecPrivilageStop:util.PrivilegeExec(%s): %s", cmd, err) + lumber.Error("server:reExecPrivilegeStop:util.PrivilegeExec(%s): %s", cmd, err) return err } diff --git a/processors/server/teardown.go b/processors/server/teardown.go index 0ae56758..06d5525d 100644 --- a/processors/server/teardown.go +++ b/processors/server/teardown.go @@ -5,16 +5,16 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/service" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/service" ) func Teardown() error { // run as admin if !util.IsPrivileged() { - return reExecPrivilageRemove() + return reExecPrivilegeRemove() } // make sure its stopped first @@ -22,20 +22,20 @@ func Teardown() error { return err } - return service.Remove("nanobox-server") + return service.Remove("microbox-server") } -// reExecPrivilageRemove re-execs the current process with a privileged user -func reExecPrivilageRemove() error { +// reExecPrivilegeRemove re-execs the current process with a privileged user +func reExecPrivilegeRemove() error { display.PauseTask() defer display.ResumeTask() display.PrintRequiresPrivilege("to remove the server") - cmd := fmt.Sprintf("\"%s\" env server teardown", config.NanoboxPath()) + cmd := fmt.Sprintf("\"%s\" env server teardown", config.MicroboxPath()) if err := util.PrivilegeExec(cmd); err != nil { - lumber.Error("server:reExecPrivilageRemove:util.PrivilegeExec(%s): %s", cmd, err) + lumber.Error("server:reExecPrivilegeRemove:util.PrivilegeExec(%s): %s", cmd, err) return err } diff --git a/processors/start.go b/processors/start.go index c07e9727..7ea08855 100644 --- a/processors/start.go +++ b/processors/start.go @@ -1,13 +1,13 @@ package processors import ( - "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/processors/server" + "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/processors/server" ) // Start starts the provider (VM) func Start() error { - // start the nanobox server + // start the microbox server if err := server.Setup(); err != nil { return err } diff --git a/processors/status.go b/processors/status.go index 3ca20250..181a756a 100644 --- a/processors/status.go +++ b/processors/status.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/provider" ) type status struct { diff --git a/processors/stop.go b/processors/stop.go index aff20d27..46412e54 100644 --- a/processors/stop.go +++ b/processors/stop.go @@ -3,14 +3,13 @@ package processors import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/app" - "github.com/nanobox-io/nanobox/processors/env" - "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/processors/server" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - util_provider "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/app" + "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/processors/server" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + util_provider "github.com/mu-box/microbox/util/provider" ) // Stop stops the running apps, unmounts all envs, and stops the provider @@ -77,28 +76,28 @@ func stopAllApps() error { } // unmountEnvs unmounts all of the environments -func unmountEnvs() error { - // unmount all the environments so stoping doesnt take forever - - envs, err := models.AllEnvs() - if err != nil { - display.ErrorTask() - return util.ErrorAppend(err, "failed to load all envs") - } - - if len(envs) == 0 { - return nil - } - - display.OpenContext("Removing mounts") - defer display.CloseContext() - - for _, e := range envs { - if err := env.Unmount(e); err != nil { - display.ErrorTask() - return util.ErrorAppend(err, "failed to unmount env") - } - } - - return nil -} +// func unmountEnvs() error { +// // unmount all the environments so stoping doesnt take forever +// +// envs, err := models.AllEnvs() +// if err != nil { +// display.ErrorTask() +// return util.ErrorAppend(err, "failed to load all envs") +// } +// +// if len(envs) == 0 { +// return nil +// } +// +// display.OpenContext("Removing mounts") +// defer display.CloseContext() +// +// for _, e := range envs { +// if err := env.Unmount(e); err != nil { +// display.ErrorTask() +// return util.ErrorAppend(err, "failed to unmount env") +// } +// } +// +// return nil +// } diff --git a/processors/submit_log.go b/processors/submit_log.go index 72a080a3..38c5a5fe 100644 --- a/processors/submit_log.go +++ b/processors/submit_log.go @@ -5,15 +5,15 @@ import ( "runtime" "strings" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" - "github.com/nanobox-io/nanobox/util/odin" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" + "github.com/mu-box/microbox/util/odin" ) func SubmitLog(args string) error { - // if we are running as privilage we dont submit + // if we are running as privilege we dont submit if util.IsPrivileged() { return nil } @@ -47,10 +47,10 @@ func SubmitLog(args string) error { } } - // tell nanobox + // tell microbox go odin.SubmitEvent( fmt.Sprintf("desktop/%s", args), - fmt.Sprintf("desktop command: nanobox %s", args), + fmt.Sprintf("desktop command: microbox %s", args), app, map[string]interface{}{ "os": runtime.GOOS, diff --git a/processors/tunnel.go b/processors/tunnel.go index 213fd9ec..56587b2a 100644 --- a/processors/tunnel.go +++ b/processors/tunnel.go @@ -3,13 +3,13 @@ package processors import ( "fmt" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/helpers" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/nanoagent" - "github.com/nanobox-io/nanobox/util/odin" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/helpers" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/microagent" + "github.com/mu-box/microbox/util/odin" ) func Tunnel(envModel *models.Env, tunnelConfig models.TunnelConfig) error { @@ -27,7 +27,7 @@ func Tunnel(envModel *models.Env, tunnelConfig models.TunnelConfig) error { tunnelConfig.AppName = config.AppName() } - // set odins endpoint if the arguement is passed + // set odins endpoint if the argument is passed if endpoint := registry.GetString("endpoint"); endpoint != "" { odin.SetEndpoint(endpoint) } @@ -49,7 +49,7 @@ func Tunnel(envModel *models.Env, tunnelConfig models.TunnelConfig) error { } // connect up to the session - if err := nanoagent.Tunnel(tunInfo.Token, tunInfo.URL, fmt.Sprint(tunnelConfig.ListenPort), tunnelConfig.Component); err != nil { + if err := microagent.Tunnel(tunInfo.Token, tunInfo.URL, fmt.Sprint(tunnelConfig.ListenPort), tunnelConfig.Component); err != nil { return util.ErrorAppend(err, "failed to connect to remote tunnel session") } diff --git a/processors/update.go b/processors/update.go index d5b3a0b4..bd368e28 100644 --- a/processors/update.go +++ b/processors/update.go @@ -1,4 +1,4 @@ -// This update processor updates the images on nanobox local +// This update processor updates the images on microbox local package processors @@ -7,11 +7,11 @@ import ( "time" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - process_provider "github.com/nanobox-io/nanobox/processors/provider" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + process_provider "github.com/mu-box/microbox/processors/provider" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) func Update() error { @@ -21,7 +21,7 @@ func Update() error { return util.ErrorAppend(err, "failed to init docker client") } - // update all the nanobox images + // update all the microbox images if err := pullImages(); err != nil { return util.ErrorAppend(err, "failed to pull images") } @@ -42,7 +42,7 @@ func pullImages() error { if image.Slug == "" { continue } - if !strings.Contains(image.Slug, "nanobox/") { + if !strings.Contains(image.Slug, "mubox/") { continue } display.StartTask("Pulling %s image", image.Slug) diff --git a/scripts/build.sh b/scripts/build.sh index 1285735f..84d2de37 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -13,7 +13,11 @@ getCurrTag() { echo `git describe --always --tags --abbrev=0 | tr -d "[v\r\n]"` } -BUILD_DATE=`date -u +%y%m%dT%H%M` +getTagDir() { + echo `getCurrTag | sed -E 's/([0-9]+)\..+/v\1/'` +} + +BUILD_DATE=`date -u +%Y%m%dT%H%M%S` # ^for versioning # remove any previous builds that may have failed @@ -21,24 +25,24 @@ BUILD_DATE=`date -u +%y%m%dT%H%M` echo "Cleaning up old builds..." && \ rm -rf "./.build" -printf "\nBuilding nanobox...\n" +printf "\nBuilding microbox...\n" -# build nanobox -gox -ldflags "-s -w -X github.com/nanobox-io/nanobox/util/odin.apiKey=$API_KEY \ - -X github.com/nanobox-io/nanobox/models.nanoVersion=$(getCurrTag) \ - -X github.com/nanobox-io/nanobox/models.nanoCommit=$(getCurrCommit) \ - -X github.com/nanobox-io/nanobox/models.nanoBuild=$BUILD_DATE" \ - -osarch "darwin/amd64 linux/amd64 windows/amd64" -output="./.build/v2/{{.OS}}/{{.Arch}}/nanobox" +# build microbox +gox -ldflags "-s -w -X github.com/mu-box/microbox/util/odin.apiKey=$API_KEY \ + -X github.com/mu-box/microbox/models.microVersion=$(getCurrTag) \ + -X github.com/mu-box/microbox/models.microCommit=$(getCurrCommit) \ + -X github.com/mu-box/microbox/models.microBuild=$BUILD_DATE" \ + -osarch "darwin/amd64 darwin/arm64 linux/amd64 linux/arm linux/arm64 linux/s390x windows/amd64" -output="./.build/$(getTagDir)/{{.OS}}/{{.Arch}}/microbox" printf "\nWriting version file...\n" -echo -en "Nanobox Version $(getCurrTag)-$BUILD_DATE ($(getCurrCommit))" > ./.build/v2/version +echo -n "Microbox Version $(getCurrTag)-$BUILD_DATE ($(getCurrCommit))" > ./.build/$(getTagDir)/version -printf "\nBuilding nanobox updater...\n" +printf "\nBuilding microbox updater...\n" -# change into updater directory and build nanobox updater -cd ./updater && gox -osarch "darwin/amd64 linux/amd64 windows/amd64" -ldflags="-s" -output="../.build/v2/{{.OS}}/{{.Arch}}/nanobox-update" +# change into updater directory and build microbox updater +cd ./updater && gox -osarch "darwin/amd64 darwin/arm64 linux/amd64 linux/arm linux/arm64 linux/s390x windows/amd64" -ldflags="-s" -output="../.build/$(getTagDir)/{{.OS}}/{{.Arch}}/microbox-update" #cd .. #printf "\nCompacting binaries...\n" -#upx ./.build/v2/*/amd64/nanobox* +#upx ./.build/$(getTagDir)/*/*/microbox* diff --git a/scripts/upload.sh b/scripts/upload.sh index 28119506..4a3251de 100755 --- a/scripts/upload.sh +++ b/scripts/upload.sh @@ -17,4 +17,4 @@ done # upload to AWS S3 echo "Uploading builds to S3..." -aws s3 sync ./.build/v2/ s3://tools.nanobox.io/nanobox/v2 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --region us-east-1 +aws s3 sync ./.build/v2/ s3://tools.microbox.cloud/microbox/v2 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --region us-east-1 diff --git a/staticcheck.conf b/staticcheck.conf new file mode 100644 index 00000000..790d40dd --- /dev/null +++ b/staticcheck.conf @@ -0,0 +1 @@ +checks = ["all", "-ST1000", "-ST1005", "-ST1020"] \ No newline at end of file diff --git a/updater/main.go b/updater/main.go index bce297fe..27459b36 100644 --- a/updater/main.go +++ b/updater/main.go @@ -7,12 +7,12 @@ import ( "os/exec" "runtime" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/service" - "github.com/nanobox-io/nanobox/util/update" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/service" + "github.com/mu-box/microbox/util/update" ) -// nanobox-update's version +// microbox-update's version var VERSION = "0.8.0" // todo: maybe we'll ldflag populate this too // main ... @@ -20,15 +20,15 @@ func main() { path := "" var err error - // this will write a new binary at location provided `nanobox-update newbinary` + // this will write a new binary at location provided `microbox-update newbinary` if len(os.Args) > 1 { if os.Args[1] == "version" { - fmt.Printf("nanobox-update %s\n", VERSION) + fmt.Printf("microbox-update %s\n", VERSION) return } path = os.Args[1] } else { - // get the location of the current nanobox + // get the location of the current microbox path, err = exec.LookPath(update.Name) if err != nil { fmt.Printf("Cannot find %s: %s\n", update.Name, err) @@ -53,14 +53,14 @@ func main() { } // todo: make sure removing this doesn't break things - // // make sure the .nanobox folder is created by our user + // // make sure the .microbox folder is created by our user // models.LoadUpdate() // determine the full path to the executable in case // it isn't in the path when run with sudo cmdPath, err := os.Executable() if err != nil { - fmt.Printf("Cannot find the path for nanobox-update\n") + fmt.Printf("Cannot find the path for microbox-update\n") os.Exit(1) } cmd := fmt.Sprintf("%s \"%s\"", cmdPath, path) @@ -72,13 +72,13 @@ func main() { return } - // stop the nanobox service so we can replace the nanobox binary - service.Stop("nanobox-server") + // stop the microbox service so we can replace the microbox binary + service.Stop("microbox-server") // run the update err = update.Run(path) if err != nil { - fmt.Println("error: %s", err) + fmt.Printf("error: %s\n", err) } if runtime.GOOS == "windows" { diff --git a/util/config/config_internal_test.go b/util/config/config_internal_test.go index 6200a1ad..5ad4755c 100644 --- a/util/config/config_internal_test.go +++ b/util/config/config_internal_test.go @@ -1,30 +1,31 @@ package config import ( - "github.com/mitchellh/go-homedir" "strings" "testing" + + "github.com/mitchellh/go-homedir" ) func TestGlobalDir(t *testing.T) { dir := GlobalDir() - if !strings.HasSuffix(dir, ".nanobox") { - t.Errorf("missing nanobox suffix") + if !strings.HasSuffix(dir, ".microbox") { + t.Errorf("missing microbox suffix") } } func TestLocalDir(t *testing.T) { dir := LocalDir() - // this is 'nanobox', because the boxfile is at the root level. localdir returns + // this is 'microbox', because the boxfile is at the root level. localdir returns // a parent boxfile if none is found in the current directory - if !strings.HasSuffix(dir, "nanobox") { + if !strings.HasSuffix(dir, "microbox") { t.Errorf("local dir mismatch '%s'", dir) } } func TestLocalDirName(t *testing.T) { dir := LocalDirName() - if dir != "nanobox" { + if dir != "microbox" { t.Errorf("local dir name mismatch '%s'", dir) } } diff --git a/util/config/dirs.go b/util/config/dirs.go index 55be0c5c..5d10f5a7 100644 --- a/util/config/dirs.go +++ b/util/config/dirs.go @@ -13,7 +13,7 @@ import ( "github.com/jcelliott/lumber" "github.com/mitchellh/go-homedir" - "github.com/nanobox-io/nanobox-boxfile" + boxfile "github.com/mu-box/microbox-boxfile" ) // GlobalDir ... @@ -25,7 +25,7 @@ func GlobalDir() string { return "" } - globalDir := filepath.ToSlash(filepath.Join(p, ".nanobox")) + globalDir := filepath.ToSlash(filepath.Join(p, ".microbox")) os.MkdirAll(globalDir, 0755) return globalDir @@ -47,10 +47,9 @@ func LocalDir() string { if err != nil { fmt.Printf("Failed to os.getwd - %s\n", err.Error()) return "" - } else { - return cwd } - return "" + + return cwd } } else { cwd, err = os.Getwd() @@ -142,14 +141,14 @@ func EngineDir() (string, error) { return "", nil } -// BinDir creates a directory where nanobox specific binaries can be downloaded +// BinDir creates a directory where microbox specific binaries can be downloaded // docker, dockermachine, etc func BinDir() string { // todo: maybe replace with `os.Executable()` path, err := exec.LookPath(os.Args[0]) if err != nil { if runtime.GOOS == "windows" { - return "C:\\Program Files\\Nanobox" + return "C:\\Program Files\\Microbox" } return filepath.Dir(os.Args[0]) diff --git a/util/config/files.go b/util/config/files.go index 55b00f47..42987a96 100644 --- a/util/config/files.go +++ b/util/config/files.go @@ -6,7 +6,7 @@ import ( // "os" "path/filepath" // "github.com/jcelliott/lumber" - // "github.com/nanobox-io/nanobox/util" + // "github.com/mu-box/microbox/util" ) // Boxfile ... diff --git a/util/config/vars.go b/util/config/vars.go index 0186f04f..baaa48fd 100644 --- a/util/config/vars.go +++ b/util/config/vars.go @@ -8,9 +8,9 @@ import ( "path/filepath" "runtime" - "github.com/nanobox-io/nanobox-boxfile" + boxfile "github.com/mu-box/microbox-boxfile" - "github.com/nanobox-io/nanobox/util/fileutil" + "github.com/mu-box/microbox/util/fileutil" ) // AppName ... @@ -36,21 +36,21 @@ func EnvID() string { return fmt.Sprintf("%x", md5.Sum([]byte(LocalDir()))) } -// NanoboxPath ... -func NanoboxPath() string { +// MicroboxPath ... +func MicroboxPath() string { programName, err := os.Executable() if err == nil { return programName } - // lookup the full path to nanobox + // lookup the full path to microbox path, err := exec.LookPath(os.Args[0]) if err == nil { return path } - // if args[0] was a path to nanobox already + // if args[0] was a path to microbox already if fileutil.Exists(programName) { return programName } @@ -61,9 +61,9 @@ func NanoboxPath() string { // the path where the vpn is located func VpnPath() string { - bridgeClient := "nanobox-vpn" + bridgeClient := "microbox-vpn" - // lookup the full path to nanobox + // lookup the full path to microbox path, err := exec.LookPath(bridgeClient) if err == nil { return path diff --git a/util/console/console.go b/util/console/console.go index b92139e6..9095a88b 100644 --- a/util/console/console.go +++ b/util/console/console.go @@ -10,11 +10,11 @@ import ( syscall "github.com/docker/docker/pkg/signal" "github.com/docker/docker/pkg/term" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" ) type ConsoleConfig struct { @@ -50,7 +50,7 @@ func Run(id string, consoleConfig ConsoleConfig) error { stdInFD, isTerminal := term.GetFdInfo(stdin) stdOutFD, _ := term.GetFdInfo(stdout) - user := "gonano" + user := "gomicro" if registry.GetString("console_user") != "" { user = registry.GetString("console_user") } @@ -82,7 +82,7 @@ func Run(id string, consoleConfig ConsoleConfig) error { } defer resp.Conn.Close() - console := models.Console{exec.ID, id} + console := models.Console{ID: exec.ID, ContainerID: id} console.Save() defer console.Delete() diff --git a/util/dhcp/dhcp.go b/util/dhcp/dhcp.go index c4afd772..018f5158 100644 --- a/util/dhcp/dhcp.go +++ b/util/dhcp/dhcp.go @@ -6,9 +6,9 @@ import ( "net" "sync" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/locker" - "github.com/nanobox-io/nanobox/util/provider" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/locker" + "github.com/mu-box/microbox/util/provider" ) var ( @@ -46,7 +46,7 @@ func ReserveGlobal() (net.IP, error) { return nil, err } - // dump the first ip becuase it is the gateway + // dump the first ip because it is the gateway ip := ipSpace.GlobalIP inc(ip) @@ -119,7 +119,7 @@ func ReserveLocal() (net.IP, error) { switch config.Provider { case "docker-machine": - // dump the first ip becuase it is the gateway + // dump the first ip because it is the gateway ip := ipSpace.LocalIP inc(ip) @@ -136,7 +136,7 @@ func ReserveLocal() (net.IP, error) { case "native": - // dump the first ip becuase it is the gateway + // dump the first ip because it is the gateway ip := ipSpace.NativeIP inc(ip) diff --git a/util/dhcp/dhcp_test.go b/util/dhcp/dhcp_test.go index 1ea6b93c..c0c82a83 100644 --- a/util/dhcp/dhcp_test.go +++ b/util/dhcp/dhcp_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/nanobox-io/nanobox/util/dhcp" + "github.com/mu-box/microbox/util/dhcp" ) // TestMain ... @@ -18,18 +18,18 @@ func TestMain(m *testing.M) { func TestReservingIps(t *testing.T) { ipOne, err := dhcp.ReserveGlobal() if err != nil { - t.Errorf("unable to reserve ip", err) + t.Errorf("unable to reserve ip %s", err) } ipTwo, err := dhcp.ReserveGlobal() if err != nil { - t.Errorf("unable to reserve ip", err) + t.Errorf("unable to reserve ip %s", err) } ipThree, err := dhcp.ReserveLocal() if err != nil { - t.Errorf("unable to reserve ip", err) + t.Errorf("unable to reserve ip %s", err) } - if ipOne.String() != "192.168.99.51" || ipTwo.String() != "192.168.99.52" || ipThree.String() != "172.21.0.2" { - t.Errorf("incorrect ip addresses", ipOne, ipTwo, ipThree) + if ipOne.String() != "192.168.99.51" || ipTwo.String() != "192.168.99.52" || (ipThree.String() != "172.20.0.2" && ipThree.String() != "172.21.0.2") { + t.Errorf("incorrect ip addresses %s / %s / %s", ipOne, ipTwo, ipThree) } } @@ -37,15 +37,15 @@ func TestReservingIps(t *testing.T) { func TestReturnIP(t *testing.T) { err := dhcp.ReturnIP(net.ParseIP("192.168.99.50")) if err != nil { - t.Errorf("unable to return ip", err) + t.Errorf("unable to return ip %s", err) } err = dhcp.ReturnIP(net.ParseIP("192.168.99.51")) if err != nil { - t.Errorf("unable to return ip", err) + t.Errorf("unable to return ip %s", err) } err = dhcp.ReturnIP(net.ParseIP("192.168.0.50")) if err != nil { - t.Errorf("unable to return ip", err) + t.Errorf("unable to return ip %s", err) } } @@ -53,26 +53,26 @@ func TestReturnIP(t *testing.T) { func TestReuseIP(t *testing.T) { one, err := dhcp.ReserveGlobal() if err != nil { - t.Errorf("unable to reserve ip", err) + t.Errorf("unable to reserve ip %s", err) } ipTwo, err := dhcp.ReserveGlobal() if err != nil { - t.Errorf("unable to reserve ip", err) + t.Errorf("unable to reserve ip %s", err) } three, err := dhcp.ReserveLocal() if err != nil { - t.Errorf("unable to reserve ip", err) + t.Errorf("unable to reserve ip %s", err) } err = dhcp.ReturnIP(ipTwo) if err != nil { - t.Errorf("unable to return ip", err) + t.Errorf("unable to return ip %s", err) } ipTwoAgain, err := dhcp.ReserveGlobal() if err != nil { - t.Errorf("unable to reserve ip", err) + t.Errorf("unable to reserve ip %s", err) } if !ipTwo.Equal(ipTwoAgain) { - t.Errorf("i should ahve recieved a repeat of %s but i got %s", ipTwo.String(), ipTwoAgain.String()) + t.Errorf("should have received a repeat of %s but got %s", ipTwo.String(), ipTwoAgain.String()) } dhcp.ReturnIP(one) dhcp.ReturnIP(three) diff --git a/util/display/characters.go b/util/display/characters.go index dc02c24c..b8b8b8ed 100644 --- a/util/display/characters.go +++ b/util/display/characters.go @@ -1,10 +1,11 @@ +//go:build !windows // +build !windows package display // ... var ( - TaskSpinner = []string{"⣷", "⣯", "⣟", "⡿", "⢿", "⣻", "⣽", "⣾"} - TaskComplete = "✓" - TaskPause = "*" + TaskSpinner = []string{`⣷`, `⣯`, `⣟`, `⡿`, `⢿`, `⣻`, `⣽`, `⣾`} + TaskComplete = `✓` + TaskPause = `*` ) diff --git a/util/display/characters_windows.go b/util/display/characters_windows.go index 64c1e563..a317bf9e 100644 --- a/util/display/characters_windows.go +++ b/util/display/characters_windows.go @@ -1,9 +1,10 @@ +//go:build windows // +build windows package display var ( - TaskSpinner = []string{"\\", "|", "/", "-"} - TaskComplete = "√" - TaskPause = "*" + TaskSpinner = []string{`\`, `|`, `/`, `-`} + TaskComplete = `√` + TaskPause = `*` ) diff --git a/util/display/command_error.go b/util/display/command_error.go index b4acb41c..51357239 100644 --- a/util/display/command_error.go +++ b/util/display/command_error.go @@ -7,17 +7,17 @@ import ( "runtime" "strings" - "github.com/nanobox-io/nanobox-boxfile" + boxfile "github.com/mu-box/microbox-boxfile" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/odin" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/odin" ) var ( - CmdErrRegex = regexp.MustCompile(":\\s?$") + CmdErrRegex = regexp.MustCompile(`:\s?$`) ) // CommandErr ... @@ -77,24 +77,24 @@ Suggest : %s`, output, parsedErr.suggest) conf, _ := models.LoadConfig() - // submit error to nanobox + // submit error to microbox odin.SubmitEvent( "desktop#error", - "an error occurred running nanobox desktop", + "an error occurred running microbox desktop", appID, map[string]interface{}{ - "app-id": appID, - "app-name": appName, - "boxfile": boxfileString, - "context": parsedErr.context, - "error": parsedErr.cause, - "mount-type": conf.MountType, - "nanobox-version": models.VersionString(), - "output": parsedErr.output, - "os": runtime.GOOS, - "provider": conf.Provider, - "suggest": parsedErr.suggest, - "team": parsedErr.team, + "app-id": appID, + "app-name": appName, + "boxfile": boxfileString, + "context": parsedErr.context, + "error": parsedErr.cause, + "mount-type": conf.MountType, + "microbox-version": models.VersionString(), + "output": parsedErr.output, + "os": runtime.GOOS, + "provider": conf.Provider, + "suggest": parsedErr.suggest, + "team": parsedErr.team, }, ) @@ -142,7 +142,7 @@ func parseCommandErr(err error) errBits { var team, cause, context string // if it is one of our utility errors we can - // extract the cause and the stack seperately + // extract the cause and the stack separately if er, ok := err.(util.Err); ok { bits := errBits{} bits.team, bits.cause = parseTeam(er.Message) diff --git a/util/display/display.go b/util/display/display.go index 0d9243a1..ccd6f2f8 100644 --- a/util/display/display.go +++ b/util/display/display.go @@ -12,7 +12,7 @@ import ( "golang.org/x/crypto/ssh/terminal" - "github.com/nanobox-io/nanobox/util/config" + "github.com/mu-box/microbox/util/config" ) var ( diff --git a/util/display/docker_percent.go b/util/display/docker_percent.go index a53400e4..1a69b873 100644 --- a/util/display/docker_percent.go +++ b/util/display/docker_percent.go @@ -72,7 +72,7 @@ func (part *DockerPercentPart) update(status Status) { // default: - // there is a chance if given a tag (nanobox/build:v1) + // there is a chance if given a tag (microbox/build:v1) // it will be able to pull a part from the non labeled parts if strings.HasPrefix(status.Status, "Pulling from") { part.downloaded = 100 diff --git a/util/display/logs.go b/util/display/logs.go index ad801aed..de485446 100644 --- a/util/display/logs.go +++ b/util/display/logs.go @@ -7,11 +7,11 @@ import ( "time" "github.com/mitchellh/colorstring" - "github.com/nanopack/logvac/core" - "github.com/nanopack/mist/core" + logvac "github.com/mu-box/logvac/core" + mist "github.com/mu-box/mist/core" ) -// Entry represents the data comming back from a mist message (mist.Message.Data) +// Entry represents the data coming back from a mist message (mist.Message.Data) type Entry struct { Time time.Time `json:"time"` // "2016-09-07T20:33:34.446275741Z" UTime int `json:"utime"` // 1473280414446275741 diff --git a/util/display/messages.go b/util/display/messages.go index 7d14d434..a5363889 100644 --- a/util/display/messages.go +++ b/util/display/messages.go @@ -121,7 +121,7 @@ func DevRunEmpty() { ! You don't have any web or worker start commands specified in your boxfile.yml. More information about start commands is available here: - https://docs.nanobox.io/boxfile/web/#start-command + https://docs.microbox.cloud/boxfile/web/#start-command `)) } @@ -152,7 +152,7 @@ func ProviderSetup() { os.Stderr.WriteString(fmt.Sprintf(` -------------------------------------------------------------------------------- + HEADS UP: -+ Nanobox will run a single VM transparently within VirtualBox. ++ Microbox will run a single VM transparently within VirtualBox. + All apps and containers will be launched within the same VM. -------------------------------------------------------------------------------- @@ -163,10 +163,10 @@ func MigrateOldRequired() { os.Stderr.WriteString(fmt.Sprintf(` -------------------------------------------------------------------------------- + WARNING: -+ Nanobox has been successfully upgraded! This change constitutes a major ++ Microbox has been successfully upgraded! This change constitutes a major + architectural refactor as well as data re-structure. To use this version we -+ need to purge your current apps. No worries, nanobox will re-build them for -+ you the next time you use "nanobox run". ++ need to purge your current apps. No worries, microbox will re-build them for ++ you the next time you use "microbox run". -------------------------------------------------------------------------------- `)) @@ -178,7 +178,7 @@ func MigrateProviderRequired() { + WARNING: + It looks like you want to use a different provider, cool! Just FYI, we have + to bring down your existing apps as providers are not compatible. No worries, -+ nanobox will re-build them for you the next time you use "nanobox run". ++ microbox will re-build them for you the next time you use "microbox run". -------------------------------------------------------------------------------- `)) } @@ -186,16 +186,16 @@ func MigrateProviderRequired() { func BadTerminal() { os.Stderr.WriteString(fmt.Sprintf(` -------------------------------------------------------------------------------- -This console is currently not supported by nanobox +This console is currently not supported by microbox Please refer to the docs for more information -------------------------------------------------------------------------------- `)) } func MissingDependencies(provider string, missingParts []string) { - fmt.Printf("Using nanobox with %s requires tools that appear to not be available on your system.\n", provider) + fmt.Printf("Using microbox with %s requires tools that appear to not be available on your system.\n", provider) fmt.Println(strings.Join(missingParts, "\n")) - fmt.Println("View these requirements at docs.nanobox.io/install") + fmt.Println("View these requirements at docs.microbox.cloud/install") } func DeployComplete() { @@ -214,30 +214,30 @@ func LoginComplete() { func NetworkCreateError(name, network string) { os.Stderr.WriteString(fmt.Sprintf(` -Nanobox is trying to create a native docker network, and it +Microbox is trying to create a native docker network, and it looks like we have a conflict. An existing docker network is already using the %s address space. You will need to either remove the conflicting network, or set an alternative address space with the following: -nanobox config set %s +microbox config set %s `, network, name)) } func VMCommunicationError() { os.Stderr.WriteString(fmt.Sprintf(` -------------------------------------------------------------------------------- -Nanobox has started a VM that needs access to your machine for mounting. +Microbox has started a VM that needs access to your machine for mounting. This VM is unable to communicate with the host machine currently. Please verify that you don't have a firewall blocking this connection, and try again! -------------------------------------------------------------------------------- `)) } -func NoGonanaUser() { +func NoGomicroUser() { os.Stderr.WriteString(fmt.Sprintf(` -We could not connect as the gonano user but we were able to +%s We could not connect as the gomicro user but we were able to fall back to the default user `, TaskComplete)) } @@ -246,10 +246,10 @@ func MissingBoxfile() { os.Stderr.WriteString(fmt.Sprintf(` -------------------------------------------------------------------------------- MISSING BOXFILE.YML -Nanobox is looking for a boxfile.yml config file. You might want to +Microbox is looking for a boxfile.yml config file. You might want to check out our getting-started guide on configuring your app: -https://guides.nanobox.io/ +https://guides.microbox.cloud/ -------------------------------------------------------------------------------- `)) } @@ -258,7 +258,7 @@ func InvalidBoxfile() { os.Stderr.WriteString(fmt.Sprintf(` -------------------------------------------------------------------------------- INVALID BOXFILE.YML -Nanobox requires valid yaml in your boxfile.yml config file. Please paste the +Microbox requires valid yaml in your boxfile.yml config file. Please paste the contents of your boxfile into www.yamllint.com to validate. -------------------------------------------------------------------------------- `)) @@ -268,11 +268,11 @@ func TooManyKeys() { os.Stderr.WriteString(fmt.Sprintf(` -------------------------------------------------------------------------------- POSSIBLY TOO MANY KEYS -Nanobox imports your ssh key directory for fetching dependencies but it appears +Microbox imports your ssh key directory for fetching dependencies but it appears you may have more than we can handle. You might want to check out our docs on specifying a key to use: -https://docs.nanobox.io/local-config/configure-nanobox/ +https://docs.microbox.cloud/local-config/configure-microbox/ -------------------------------------------------------------------------------- `)) } @@ -281,7 +281,7 @@ func WorldWritable() { os.Stderr.WriteString(fmt.Sprintf(` -------------------------------------------------------------------------------- Virtualbox was unable to create the virtual machine because a folder in the path -is globaly accessable and it should be private. +is globally accessible and it should be private. -------------------------------------------------------------------------------- `)) @@ -289,17 +289,17 @@ is globaly accessable and it should be private. func LoginRequired() { os.Stderr.WriteString(fmt.Sprintf(` -It appears you are running Nanobox for the first time. -Login to your Nanobox account: +It appears you are running Microbox for the first time. +Login to your Microbox account: `)) } -func UnexpectedPrivilage() { +func UnexpectedPrivilege() { os.Stderr.WriteString(fmt.Sprintf(` -------------------------------------------------------------------------------- + ERROR: -+ Nanobox is designed to run as a standard user (non root) -+ Please run all nanobox commands as a non privileged user ++ Microbox is designed to run as a standard user (non root) ++ Please run all microbox commands as a non privileged user -------------------------------------------------------------------------------- `)) @@ -319,7 +319,7 @@ func PortInUse(port string) { -------------------------------------------------------------------------------- ADDRESS IN USE It appears your local port (%s) is in use. Please specify a different port with -the '-p' flag. (eg. 'nanobox tunnel data.db -p 5444') +the '-p' flag. (eg. 'microbox tunnel data.db -p 5444') -------------------------------------------------------------------------------- `, port)) } @@ -329,7 +329,7 @@ func PortPrivileged(port string) { -------------------------------------------------------------------------------- PRIVILEGED PORT Port '%s' is a privileged port. Please specify a port greater than 1023 with -the '-p' flag. (eg. 'nanobox tunnel data.db -p 5444') +the '-p' flag. (eg. 'microbox tunnel data.db -p 5444') -------------------------------------------------------------------------------- `, port)) } @@ -350,7 +350,7 @@ func ConsoleLocalCode() { -------------------------------------------------------------------------------- CANNOT CONSOLE TO LOCAL CODE NODE It appears you are trying to console to a local code node. When consoling to a -local web/worker, please use 'nanobox run'. +local web/worker, please use 'microbox run'. -------------------------------------------------------------------------------- `)) } diff --git a/util/display/privilege_unix.go b/util/display/privilege_unix.go index c7af4a0f..19a5170a 100644 --- a/util/display/privilege_unix.go +++ b/util/display/privilege_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package display diff --git a/util/display/privilege_windows.go b/util/display/privilege_windows.go index 8cbc94fa..96e3a55c 100644 --- a/util/display/privilege_windows.go +++ b/util/display/privilege_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package display diff --git a/util/display/prompt.go b/util/display/prompt.go index 7387e3cc..53bb70c5 100644 --- a/util/display/prompt.go +++ b/util/display/prompt.go @@ -9,7 +9,7 @@ import ( // get the username func ReadUsername() (string, error) { - return Ask("Nanobox Username") + return Ask("Microbox Username") } func Ask(question string) (string, error) { diff --git a/util/display/prompt_unix.go b/util/display/prompt_unix.go index d8cff283..80b0eefd 100644 --- a/util/display/prompt_unix.go +++ b/util/display/prompt_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package display diff --git a/util/display/prompt_windows.go b/util/display/prompt_windows.go index 7cdbcf29..c56d50e8 100644 --- a/util/display/prompt_windows.go +++ b/util/display/prompt_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package display diff --git a/util/display/summary.go b/util/display/summary.go index d1eb5a76..fd05c53d 100644 --- a/util/display/summary.go +++ b/util/display/summary.go @@ -11,7 +11,7 @@ import ( // "github.com/jcelliott/lumber" "github.com/lyondhill/vtclean" - "github.com/nanobox-io/nanobox/util" + "github.com/mu-box/microbox/util" ) // ... @@ -89,7 +89,7 @@ func (s *Summarizer) Pause() { // Resume prints the "complete" label and toggles shutdown func (s *Summarizer) Resume() { // generate and print the complete header - s.Label = s.Label + // s.Label = s.Label // turn the ticker back on s.shutdown = false diff --git a/util/dns/dns.go b/util/dns/dns.go index 744bf0e7..e8d9a5ec 100644 --- a/util/dns/dns.go +++ b/util/dns/dns.go @@ -8,7 +8,7 @@ import ( "os" "strings" - "github.com/nanobox-io/nanobox/commands/server" + "github.com/mu-box/microbox/commands/server" ) type DomainName struct { @@ -38,7 +38,7 @@ func init() { // Entry generate the DNS entry to be added func Entry(ip, name, env string) string { - return fmt.Sprintf("%s %s # dns added for '%s' by nanobox", ip, name, env) + return fmt.Sprintf("%s %s # dns added for '%s' by microbox", ip, name, env) } // Exists ... @@ -139,7 +139,7 @@ func Remove(entry string) error { err := server.ClientRun("DomainRPC.Remove", req, resp) if !resp.Success { - err = fmt.Errorf("failed to remove domain: %v %v", err, resp.Message) + return fmt.Errorf("failed to remove domain: %v %v", err, resp.Message) } return nil } @@ -191,13 +191,13 @@ func (drpc *DomainRPC) Remove(req Request, resp *Response) error { } -// RemoveAll removes all dns entries added by nanobox +// RemoveAll removes all dns entries added by microbox func RemoveAll() error { - // short-circuit if no entries were added by nanobox - if len(List("by nanobox")) == 0 { + // short-circuit if no entries were added by microbox + if len(List("by microbox")) == 0 { return nil } - return Remove("by nanobox") + return Remove("by microbox") } diff --git a/util/dns/dns_unix.go b/util/dns/dns_unix.go index 6878ec08..cf40914c 100644 --- a/util/dns/dns_unix.go +++ b/util/dns/dns_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package dns diff --git a/util/dns/dns_windows.go b/util/dns/dns_windows.go index 644e0cbe..3cfe15d6 100644 --- a/util/dns/dns_windows.go +++ b/util/dns/dns_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package dns diff --git a/util/error.go b/util/error.go index 4ff6f3d3..2fb5fd1e 100644 --- a/util/error.go +++ b/util/error.go @@ -107,7 +107,7 @@ func Error(err error) error { } // prepend the new message to the stack on our error messages -// this is usefull because delimiting stack elements by : +// this is useful because delimiting stack elements by : // is not sufficient func ErrorAppend(err error, fmtStr string, args ...interface{}) error { if err == nil { diff --git a/util/exec.go b/util/exec.go index 15fd234b..a867b98a 100644 --- a/util/exec.go +++ b/util/exec.go @@ -6,7 +6,7 @@ import ( "io" "github.com/jcelliott/lumber" - "github.com/nanobox-io/golang-docker-client" + docker "github.com/mu-box/golang-docker-client" ) // Cmd ... @@ -105,7 +105,7 @@ func DockerCommand(id, user, path string, args []string) *Cmd { } // Exec is a shortcut for the process that turns the interface into a one liner -// the recieved stream is used for display or error handling as the Stderr portion +// the received stream is used for display or error handling as the Stderr portion // while the Stdout is left blank to allow the run command to set a bytes buffer // which is then returned from the Output() function func DockerExec(id, user, name string, args []string, stream io.Writer) (string, error) { diff --git a/util/hookit/hookit.go b/util/hookit/hookit.go index d6930ba3..f727d601 100644 --- a/util/hookit/hookit.go +++ b/util/hookit/hookit.go @@ -4,10 +4,10 @@ import ( "fmt" "strings" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/console" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/console" + "github.com/mu-box/microbox/util/display" ) // since `--debug` runs the command twice, combined prevents duplication of the error output. @@ -25,7 +25,7 @@ func Exec(container, hook, payload, displayLevel string) (string, error) { stream.CaptureOutput(true) - out, err := util.DockerExec(container, "root", "/opt/nanobox/hooks/"+hook, []string{payload}, stream) + out, err := util.DockerExec(container, "root", "/opt/microbox/hooks/"+hook, []string{payload}, stream) if err != nil && (strings.Contains(string(out), "such file or directory") && strings.Contains(err.Error(), "bad exit code(126)")) { // if its a 126 the hook didnt exist return "", nil diff --git a/util/locker/global.go b/util/locker/global.go index a135612f..16fb1489 100644 --- a/util/locker/global.go +++ b/util/locker/global.go @@ -8,7 +8,7 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) var ( diff --git a/util/locker/local.go b/util/locker/local.go index 4882d442..f84b41b9 100644 --- a/util/locker/local.go +++ b/util/locker/local.go @@ -6,8 +6,8 @@ import ( "time" "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/config" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/config" ) var ( @@ -29,7 +29,7 @@ func LocalLock() error { mutex.Lock() lCount++ - lumber.Trace("local lock aquired (%d)", lCount) + lumber.Trace("local lock acquired (%d)", lCount) mutex.Unlock() return nil @@ -69,7 +69,7 @@ func LocalUnlock() (err error) { lumber.Trace("local lock released (%d)", lCount) mutex.Unlock() - // if im not the last guy to release my lock quit immidiately instead of closing + // if im not the last guy to release my lock quit immediately instead of closing // the connection if lCount > 0 || lln == nil { return nil diff --git a/util/locker/locker_internal_test.go b/util/locker/locker_internal_test.go index e1e06b83..44120498 100644 --- a/util/locker/locker_internal_test.go +++ b/util/locker/locker_internal_test.go @@ -6,7 +6,7 @@ import "testing" func TestLocalLock(t *testing.T) { err := LocalLock() if err != nil { - t.Errorf("unable to aquire lock %+v", err) + t.Errorf("unable to acquire lock %+v", err) } if lln == nil { t.Errorf("lock was aqquired but the listener is not populated") @@ -64,7 +64,7 @@ func TestLocalStackLocking(t *testing.T) { func TestGlobalLock(t *testing.T) { err := GlobalLock() if err != nil { - t.Errorf("unable to aquire lock %+v", err) + t.Errorf("unable to acquire lock %+v", err) } if gln == nil { t.Errorf("lock was aqquired but the listener is not populated") diff --git a/util/nanoagent/connect.go b/util/microagent/connect.go similarity index 78% rename from util/nanoagent/connect.go rename to util/microagent/connect.go index 90477a12..a028c401 100644 --- a/util/nanoagent/connect.go +++ b/util/microagent/connect.go @@ -1,4 +1,4 @@ -package nanoagent +package microagent import ( "crypto/tls" @@ -12,7 +12,7 @@ func connect(req *http.Request, location string) (net.Conn, error) { // if we can't connect to the server, lets bail out early conn, err := tls.Dial("tcp4", location, &tls.Config{InsecureSkipVerify: true}) if err != nil { - return conn, fmt.Errorf("failed to establish connection to nanoagent: %s", err.Error()) + return conn, fmt.Errorf("failed to establish connection to microagent: %s", err.Error()) } // we dont defer a conn.Close() here because we're returning the conn and @@ -20,7 +20,7 @@ func connect(req *http.Request, location string) (net.Conn, error) { // make an http request if err := req.Write(conn); err != nil { - return conn, fmt.Errorf("failed to establish console session with nanoagent: %s", err.Error()) + return conn, fmt.Errorf("failed to establish console session with microagent: %s", err.Error()) } return conn, nil diff --git a/util/nanoagent/console.go b/util/microagent/console.go similarity index 88% rename from util/nanoagent/console.go rename to util/microagent/console.go index 511fcd4f..99ff3574 100644 --- a/util/nanoagent/console.go +++ b/util/microagent/console.go @@ -1,4 +1,4 @@ -package nanoagent +package microagent import ( "fmt" @@ -10,16 +10,16 @@ import ( syscall "github.com/docker/docker/pkg/signal" "github.com/docker/docker/pkg/term" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/util/display" ) // establishes a remote docker client on a production app func Console(key, location string) error { - // establish connection to nanoagent + // establish connection to microagent path := fmt.Sprintf("/exec?key=%s", key) req, err := http.NewRequest("POST", path, nil) if err != nil { - return fmt.Errorf("failed to generate a request for nanoagent: %s", err.Error()) + return fmt.Errorf("failed to generate a request for microagent: %s", err.Error()) } // printMOTD and warning @@ -42,7 +42,7 @@ func Console(key, location string) error { // if we are using a term, lets upgrade it to RawMode if isTerminal { // handle all incoming os signals and act accordingly; default behavior is to - // forward all signals to nanobox server + // forward all signals to microbox server go monitor(stdOutFD, location, key) oldInState, err := term.SetRawTerminal(stdInFD) @@ -89,7 +89,7 @@ func resizeTTY(fd uintptr, location, key string) error { w := int(ws.Width) h := int(ws.Height) - // resize by posting to a path on nanoagent + // resize by posting to a path on microagent url := fmt.Sprintf("https://%s/resizeexec?key=%s&w=%d&h=%d", location, key, w, h) // POST diff --git a/util/nanoagent/ssh.go b/util/microagent/ssh.go similarity index 87% rename from util/nanoagent/ssh.go rename to util/microagent/ssh.go index 8c89d091..95f0294f 100644 --- a/util/nanoagent/ssh.go +++ b/util/microagent/ssh.go @@ -1,12 +1,13 @@ -package nanoagent +package microagent import ( "fmt" - "github.com/nanobox-io/golang-ssh" "strconv" "strings" - "github.com/nanobox-io/nanobox/util/display" + ssh "github.com/mu-box/golang-ssh" + + "github.com/mu-box/microbox/util/display" ) func SSH(key, location string) error { @@ -25,7 +26,7 @@ func SSH(key, location string) error { } // establish connection - client, err := ssh.NewNativeClient(key, locationParts[0], "SSH-2.0-nanobox", port, &nanPass) + client, err := ssh.NewNativeClient(key, locationParts[0], "SSH-2.0-microbox", port, &nanPass) if err != nil { return fmt.Errorf("Failed to create new client - %s", err) } diff --git a/util/nanoagent/tunnel.go b/util/microagent/tunnel.go similarity index 91% rename from util/nanoagent/tunnel.go rename to util/microagent/tunnel.go index ea90a834..77d716fe 100644 --- a/util/nanoagent/tunnel.go +++ b/util/microagent/tunnel.go @@ -1,4 +1,4 @@ -package nanoagent +package microagent import ( "fmt" @@ -8,8 +8,8 @@ import ( "strings" "syscall" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" ) func Tunnel(key, location, port, name string) error { @@ -20,7 +20,7 @@ func Tunnel(key, location, port, name string) error { // establish a connection and just leave it open. req, err := http.NewRequest("POST", fmt.Sprintf("/tunnel?key=%s", key), nil) if err != nil { - return fmt.Errorf("failed to generate a request for nanoagent: %s", err.Error()) + return fmt.Errorf("failed to generate a request for microagent: %s", err.Error()) } // set noproxy because this connection allows more multiple connections @@ -69,7 +69,7 @@ func Tunnel(key, location, port, name string) error { go handleConnection(conn, key, location) } - return nil + // return nil } func handleConnection(conn net.Conn, key, location string) { diff --git a/util/mixpanel/mixpanel.go b/util/mixpanel/mixpanel.go index bb9248dc..e4f4b522 100644 --- a/util/mixpanel/mixpanel.go +++ b/util/mixpanel/mixpanel.go @@ -6,8 +6,8 @@ import ( "github.com/jcelliott/lumber" mp "github.com/timehop/go-mixpanel" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" ) var token string diff --git a/util/odin/odin.go b/util/odin/odin.go index a9688c61..c297984d 100644 --- a/util/odin/odin.go +++ b/util/odin/odin.go @@ -14,21 +14,21 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" ) const ( - NANOBOX = "https://api.nanobox.io/v1/" - BONESALT = "https://api.bonesalt.com/v1/" - DEV = "http://api.nanobox.local:8080/v1/" - SIM = "http://api.nanobox.test/v1/" + 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/" ) var ( - // set the default endpoint to nanobox - endpoint = "nanobox" + // set the default endpoint to microbox + endpoint = "microbox" apiKey string ) @@ -211,7 +211,7 @@ func EstablishTunnel(tunCfg models.TunnelConfig) (models.TunnelInfo, error) { func EstablishConsole(appID, id string) (string, string, string, error) { // use a default user params := url.Values{} - params.Set("user", "gonano") + params.Set("user", "gomicro") if registry.GetString("console_user") != "" { params.Set("user", registry.GetString("console_user")) } @@ -341,11 +341,11 @@ func doRequest(method, path string, params url.Values, requestBody, responseBody // if they have not logged in but the user name and password are both set // use attempt to authenticate if auth.Key == "" && - os.Getenv("NANOBOX_PASSWORD") != "" && - os.Getenv("NANOBOX_USERNAME") != "" && + os.Getenv("MICROBOX_PASSWORD") != "" && + os.Getenv("MICROBOX_USERNAME") != "" && path != "user_auth_token" { - auth.Key, _ = Auth(os.Getenv("NANOBOX_USERNAME"), os.Getenv("NANOBOX_PASSWORD")) + auth.Key, _ = Auth(os.Getenv("MICROBOX_USERNAME"), os.Getenv("MICROBOX_PASSWORD")) } if params == nil { @@ -385,7 +385,7 @@ func doRequest(method, path string, params url.Values, requestBody, responseBody err = util.ErrorfQuiet("[USER] Unauthorized (%s)", b) if err != nil { if err2, ok := err.(util.Err); ok { - err2.Suggest = "It appears you are not logged in, run `nanobox login` and try again" + err2.Suggest = "It appears you are not logged in, run `microbox login` and try again" return err2 } } @@ -408,7 +408,7 @@ func doRequest(method, path string, params url.Values, requestBody, responseBody rb := map[string]string{} err = json.Unmarshal(b, &rb) if err != nil { - return util.ErrorfQuiet("[NANOBOX] %s", b) + return util.ErrorfQuiet("[MICROBOX] %s", b) } errorMessage, ok := rb["error"] @@ -442,13 +442,13 @@ func odinURL() string { return o } switch endpoint { - case "bonesalt": - return BONESALT + case "wycrobox": + return WYCROBOX case "dev": return DEV case "sim": return SIM default: - return NANOBOX + return MICROBOX } } diff --git a/util/os.go b/util/os.go index ba15100a..fa8a36cf 100644 --- a/util/os.go +++ b/util/os.go @@ -17,7 +17,7 @@ func OsDetect() (string, error) { return "linux", nil } - return "", fmt.Errorf("Unsupported operating system. Please contact support.") + return "", fmt.Errorf("Unsupported operating system (%s). Please contact support.", runtime.GOOS) } func getDarwin() (string, error) { @@ -25,22 +25,106 @@ func getDarwin() (string, error) { if err != nil { return "", fmt.Errorf("Failed to retrieve version - %s", err.Error()) } - r, _ := regexp.Compile("10\\.([0-9]+).*") + + r, _ := regexp.Compile(`10\.([0-9]+).*`) match := r.FindStringSubmatch(string(out)) - if len(match) != 2 { - return "", fmt.Errorf("Failed to parse version") + if len(match) == 2 { + return tenToDarwin(match[1]) + } + + r, _ = regexp.Compile(`([0-9]+)\..*`) + match = r.FindStringSubmatch(string(out)) + if len(match) == 2 { + return laterToDarwin(match[1]) } - return toDarwin(match[1]) + return "", fmt.Errorf("Failed to parse version from %s. Please contact support.", out) } -func toDarwin(v string) (string, error) { +func tenToDarwin(v string) (string, error) { switch v { case "12": return "sierra", nil case "13": return "high sierra", nil - default: - return "incompatible", fmt.Errorf("Incompatible OSX version. Please contact support.") + case "14": + return "mojave", nil + case "15": + return "catalina", nil + } + + return "", fmt.Errorf("Unsupported macOS version 10.%s. Please contact support.", v) +} + +func laterToDarwin(v string) (string, error) { + switch v { + case "11": + return "big sur", nil + case "12": + return "monterey", nil + } + + return "", fmt.Errorf("Unsupported macOS version %s.x. Please contact support.", v) +} + +func ArchDetect() (string, error) { + switch runtime.GOARCH { + case "amd64": + return "amd64", nil + case "arm64": + return "arm64", nil + case "arm": + return "arm32", nil + case "s390x": + return "s390x", nil } + + return "", fmt.Errorf("Unsupported processor type %s. Please contact support.", runtime.GOARCH) +} + +func OsArchDetect() (string, error) { + var os, arch string + + if v, err := OsDetect(); err != nil { + return "", err + } else { + os = v + } + if v, err := ArchDetect(); err != nil { + return "", err + } else { + arch = v + } + + osArch := fmt.Sprintf("%s/%s", os, arch) + switch osArch { + case "sierra/amd64": + return "sierra/amd64", nil + case "high sierra/amd64": + return "high sierra/amd64", nil + case "mojave/amd64": + return "mojave/amd64", nil + case "catalina/amd64": + return "catalina/amd64", nil + case "big sur/amd64": + return "big sur/amd64", nil + case "big sur/arm64": + return "big sur/arm64", nil + case "monterey/amd64": + return "monterey/amd64", nil + case "monterey/arm64": + return "monterey/arm64", nil + case "windows/amd64": + return "windows/amd64", nil + case "linux/amd64": + return "linux/amd64", nil + case "linux/arm64": + return "linux/arm64", nil + case "linux/arm32": + return "linux/arm32", nil + case "linux/s390x": + return "linux/s390x", nil + } + + return "", fmt.Errorf("Unsupported os/arch combo %s. Please contact support.", osArch) } diff --git a/util/provider/bridge/bridge.go b/util/provider/bridge/bridge.go index 8177eeae..3cdd4ef8 100644 --- a/util/provider/bridge/bridge.go +++ b/util/provider/bridge/bridge.go @@ -1,8 +1,9 @@ package bridge import ( - "github.com/nanobox-io/nanobox/commands/server" "os/exec" + + "github.com/mu-box/microbox/commands/server" ) type Bridge struct{} diff --git a/util/provider/bridge/start.go b/util/provider/bridge/start.go index 318399e5..e7dfd748 100644 --- a/util/provider/bridge/start.go +++ b/util/provider/bridge/start.go @@ -6,8 +6,8 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/commands/server" - "github.com/nanobox-io/nanobox/util/config" + "github.com/mu-box/microbox/commands/server" + "github.com/mu-box/microbox/util/config" ) type stream struct { diff --git a/util/provider/bridge/stop.go b/util/provider/bridge/stop.go index 7de3a4bd..52ecedac 100644 --- a/util/provider/bridge/stop.go +++ b/util/provider/bridge/stop.go @@ -1,7 +1,7 @@ package bridge import ( - "github.com/nanobox-io/nanobox/commands/server" + "github.com/mu-box/microbox/commands/server" ) func Stop() error { diff --git a/util/provider/dockermachine.go b/util/provider/dockermachine.go index 4206f7d1..c41635d9 100644 --- a/util/provider/dockermachine.go +++ b/util/provider/dockermachine.go @@ -7,22 +7,24 @@ import ( "net" "os" "os/exec" + // "path/filepath" "io" "regexp" "runtime" "strings" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/display" - // "github.com/nanobox-io/nanobox/util/fileutil" - "github.com/nanobox-io/nanobox/util/vbox" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/display" + + // "github.com/mu-box/microbox/util/fileutil" + "github.com/mu-box/microbox/util/vbox" ) var ( vboxManageCmd = vbox.DetectVBoxManageCmd() - dockerMachineCmd = "nanobox-machine" + dockerMachineCmd = "microbox-machine" ) // DockerMachine ... @@ -107,7 +109,7 @@ func (machine DockerMachine) Valid() (error, []string) { } func (machine DockerMachine) Status() string { - cmd := exec.Command(dockerMachineCmd, "status", "nanobox") + cmd := exec.Command(dockerMachineCmd, "status", "microbox") output, _ := cmd.CombinedOutput() return strings.TrimSpace(string(output)) } @@ -125,7 +127,7 @@ func (machine DockerMachine) Create() error { } // make sure dockermachine is clean - exec.Command(dockerMachineCmd, "rm", "-f", "nanobox").Run() + exec.Command(dockerMachineCmd, "rm", "-f", "microbox").Run() display.ProviderSetup() @@ -177,7 +179,7 @@ func (machine DockerMachine) Create() error { cmd = append(cmd, "--virtualbox-disk-size", fmt.Sprintf("%d", disk)) } - cmd = append(cmd, "nanobox") + cmd = append(cmd, "microbox") process := exec.Command(cmd[0], cmd[1:]...) @@ -191,7 +193,7 @@ func (machine DockerMachine) Create() error { display.StartTask("Launching VM") if err := process.Run(); err != nil { - // if its complainging about the world writable error issue + // if its complaining about the world writable error issue if strings.Contains(fullBuffer.String(), "VERR_SUPLIB_WORLD_WRITABLE") { display.WorldWritable() return util.ErrorfQuiet("[USER] %s: %s", fullBuffer.String(), err) @@ -226,7 +228,7 @@ func (machine DockerMachine) Stop() error { cmd := []string{ dockerMachineCmd, "stop", - "nanobox", + "microbox", } process := exec.Command(cmd[0], cmd[1:]...) @@ -263,7 +265,7 @@ func (machine DockerMachine) Destroy() error { dockerMachineCmd, "rm", "-f", - "nanobox", + "microbox", } process := exec.Command(cmd[0], cmd[1:]...) @@ -292,7 +294,7 @@ func (machine DockerMachine) Start() error { cmd := []string{ dockerMachineCmd, "start", - "nanobox", + "microbox", } process := exec.Command(cmd[0], cmd[1:]...) @@ -314,7 +316,7 @@ func (machine DockerMachine) Start() error { display.StopTask() } - // create custom nanobox docker network + // create custom microbox docker network if !machine.hasNetwork() { config, _ := models.LoadConfig() ip, ipNet, err := net.ParseCIDR(config.DockerMachineNetworkSpace) @@ -325,7 +327,7 @@ func (machine DockerMachine) Start() error { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "docker", "network", "create", @@ -334,7 +336,7 @@ func (machine DockerMachine) Start() error { "--opt='com.docker.network.driver.mtu=1450'", "--opt='com.docker.network.bridge.name=redd0'", fmt.Sprintf("--gateway=%s", ip.String()), - "nanobox", + "microbox", } process := exec.Command(cmd[0], cmd[1:]...) @@ -359,7 +361,7 @@ func (machine DockerMachine) Start() error { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "modprobe", "ip_vs", @@ -389,7 +391,7 @@ func (machine DockerMachine) Start() error { cmd = []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "pkill", "udhcpc", @@ -407,7 +409,7 @@ func (machine DockerMachine) Start() error { cmd = []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "curl", "--connect-timeout", "5", @@ -418,7 +420,7 @@ func (machine DockerMachine) Start() error { if err := process.Run(); err != nil { display.ErrorTask() display.VMCommunicationError() - return util.ErrorfQuiet("[NANOBOX] VM cannot communicate with host") + return util.ErrorfQuiet("[MICROBOX] VM cannot communicate with host") } if machine.changedIP() { @@ -440,11 +442,11 @@ func (machine DockerMachine) HostMntDir() string { // DockerEnv exports the docker connection information to the running process func (machine DockerMachine) DockerEnv() error { - // docker-machine env nanobox + // docker-machine env microbox // export DOCKER_TLS_VERIFY="1" // export DOCKER_HOST="tcp://192.168.99.102:2376" - // export DOCKER_CERT_PATH="/Users/lyon/.docker/machine/machines/nanobox" - // export DOCKER_MACHINE_NAME="nanobox" + // export DOCKER_CERT_PATH="/Users/lyon/.docker/machine/machines/microbox" + // export DOCKER_MACHINE_NAME="microbox" // create an anonymous struct that we will populate after running inspect inspect := struct { @@ -462,7 +464,7 @@ func (machine DockerMachine) DockerEnv() error { }{} // fetch the docker-machine endpoint information - cmd := exec.Command(dockerMachineCmd, "inspect", "nanobox") + cmd := exec.Command(dockerMachineCmd, "inspect", "microbox") b, err := cmd.CombinedOutput() if err != nil { return fmt.Errorf("%s: %s", b, err) @@ -480,10 +482,10 @@ func (machine DockerMachine) DockerEnv() error { } if inspect.Driver.IPAddress == "" { - return util.Err{Message: "docker-machine didnt start docker properly", Suggest: "run `nanobox-machine stop nanobox` and try again"} + return util.Err{Message: "docker-machine didnt start docker properly", Suggest: "run `microbox-machine stop microbox` and try again"} } // set docker environment variables for client connections - os.Setenv("DOCKER_MACHINE_NAME", "nanobox") + os.Setenv("DOCKER_MACHINE_NAME", "microbox") os.Setenv("DOCKER_HOST", fmt.Sprintf("tcp://%s:2376", inspect.Driver.IPAddress)) os.Setenv("DOCKER_CERT_PATH", inspect.HostOptions.AuthOptions.StorePath) @@ -499,7 +501,7 @@ func (machine DockerMachine) AddIP(ip string) error { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "ip", "addr", @@ -531,7 +533,7 @@ func (machine DockerMachine) RemoveIP(ip string) error { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "ip", "addr", @@ -554,7 +556,7 @@ func (machine DockerMachine) RemoveIP(ip string) error { func (dockermachine DockerMachine) SetDefaultIP(ip string) error { // check to see if the route is already set as the default - checkOut, _ := exec.Command(dockerMachineCmd, "ssh", "nanobox", "ip", "route").CombinedOutput() + checkOut, _ := exec.Command(dockerMachineCmd, "ssh", "microbox", "ip", "route").CombinedOutput() if strings.Contains(string(checkOut), ip) { // if the output has this ip already we can return without changing anything return nil @@ -563,7 +565,7 @@ func (dockermachine DockerMachine) SetDefaultIP(ip string) error { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "ip", "route", @@ -595,7 +597,7 @@ func (machine DockerMachine) AddNat(ip, containerIP string) error { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "/usr/local/sbin/iptables", "-t", @@ -626,7 +628,7 @@ func (machine DockerMachine) AddNat(ip, containerIP string) error { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "/usr/local/sbin/iptables", "-t", @@ -663,7 +665,7 @@ func (machine DockerMachine) RemoveNat(ip, containerIP string) error { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "/usr/local/sbin/iptables", "-t", @@ -694,7 +696,7 @@ func (machine DockerMachine) RemoveNat(ip, containerIP string) error { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "/usr/local/sbin/iptables", "-t", @@ -731,7 +733,7 @@ func (machine DockerMachine) RemoveEnvDir(id string) error { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "rm", "-rf", @@ -757,7 +759,7 @@ func (machine DockerMachine) HostIP() (string, error) { }{} // fetch the docker-machine endpoint information - cmd := exec.Command(dockerMachineCmd, "inspect", "nanobox") + cmd := exec.Command(dockerMachineCmd, "inspect", "microbox") b, err := cmd.CombinedOutput() if err != nil { return "", fmt.Errorf("%s: %s", b, err) @@ -783,7 +785,7 @@ func (machine DockerMachine) ReservedIPs() (rtn []string) { func (machine DockerMachine) Run(command []string) ([]byte, error) { // All commands need to be run in the docker machine, so we create a prefix - context := []string{dockerMachineCmd, "ssh", "nanobox"} + context := []string{dockerMachineCmd, "ssh", "microbox"} // now we can generate a run command combining the context with the command run := append(context, command...) @@ -803,7 +805,7 @@ func (machine DockerMachine) regenerateCert() error { display.StartTask("Regenerating Docker certs") - cmd := exec.Command(dockerMachineCmd, "regenerate-certs", "-f", "nanobox") + cmd := exec.Command(dockerMachineCmd, "regenerate-certs", "-f", "microbox") b, err := cmd.CombinedOutput() if err != nil { display.ErrorTask() @@ -816,15 +818,15 @@ func (machine DockerMachine) regenerateCert() error { // isCreated ... func (machine DockerMachine) isCreated() bool { - // docker-machine status nanobox - cmd := exec.Command(dockerMachineCmd, "status", "nanobox") + // docker-machine status microbox + cmd := exec.Command(dockerMachineCmd, "status", "microbox") output, err := cmd.CombinedOutput() if err != nil { return false } - if bytes.Contains(output, []byte("Host does not exist: \"nanobox\"")) || + if bytes.Contains(output, []byte("Host does not exist: \"microbox\"")) || bytes.Contains(output, []byte("error")) { return false } @@ -838,11 +840,11 @@ func (machine DockerMachine) hasNetwork() bool { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "docker", "network", "inspect", - "nanobox", + "microbox", } process := exec.Command(cmd[0], cmd[1:]...) @@ -852,7 +854,7 @@ func (machine DockerMachine) hasNetwork() bool { return false } - if bytes.Contains(output, []byte("Error: No such network: nanobox")) { + if bytes.Contains(output, []byte("Error: No such network: microbox")) { return false } @@ -862,8 +864,8 @@ func (machine DockerMachine) hasNetwork() bool { // IsReady ... func (machine DockerMachine) IsReady() bool { - // docker-machine status nanobox - cmd := exec.Command(dockerMachineCmd, "status", "nanobox") + // docker-machine status microbox + cmd := exec.Command(dockerMachineCmd, "status", "microbox") output, err := cmd.CombinedOutput() if err != nil { return false @@ -883,7 +885,7 @@ func (machine DockerMachine) hasIP(ip string) bool { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "ip", "addr", "show", @@ -911,7 +913,7 @@ func (machine DockerMachine) hasNatPreroute(hostIP, containerIP string) bool { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "/usr/local/sbin/iptables", "-t", @@ -946,7 +948,7 @@ func (machine DockerMachine) hasNatPostroute(hostIP, containerIP string) bool { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "/usr/local/sbin/iptables", "-t", @@ -1013,7 +1015,7 @@ func dockerMachineURL() string { // temporarily replace the docker-machine version with a custom one until // docker fixes the issues created by Sierra // download = fmt.Sprintf("%s/docker-machine-Darwin-x86_64", download) - download = "https://s3.amazonaws.com/tools.nanobox.io/docker-machine/darwin/docker-machine" + download = "https://s3.amazonaws.com/tools.microbox.cloud/docker-machine/darwin/docker-machine" case "linux": download = fmt.Sprintf("%s/docker-machine-Linux-x86_64", download) case "windows": diff --git a/util/provider/dockermachine_mount.go b/util/provider/dockermachine_mount.go index 980beca7..81ff9920 100644 --- a/util/provider/dockermachine_mount.go +++ b/util/provider/dockermachine_mount.go @@ -9,9 +9,9 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/commands/registry" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/processors/env/share" + "github.com/mu-box/microbox/commands/registry" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/processors/env/share" ) func (machine DockerMachine) RequiresMount() bool { @@ -24,7 +24,7 @@ func (machine DockerMachine) HasMount(mount string) bool { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "cat", "/proc/mounts", @@ -41,7 +41,7 @@ func (machine DockerMachine) HasMount(mount string) bool { func (machine DockerMachine) staleMount(mount string) bool { - // removed the ensure statment because its slow and already installed + // removed the ensure statement because its slow and already installed // // ensure stat is installed // cmd := []string{"sh", "-c", setupCoreUtilsScript()} // if b, err := Run(cmd); err != nil { @@ -82,7 +82,7 @@ func (machine DockerMachine) AddMount(local, host string) error { case "netfs": // add netfs share - // here we use the processor so we can do privilage exec + // here we use the processor so we can do privilege exec lumber.Info("adding share in netfs for %s", local) if err := share.Add(local); err != nil { return err @@ -148,7 +148,7 @@ func (machine DockerMachine) hasShare(local, host string) bool { cmd := []string{ vboxManageCmd, "showvminfo", - "nanobox", + "microbox", "--machinereadable", } @@ -177,7 +177,7 @@ func (machine DockerMachine) addShare(local, host string) error { vboxManageCmd, "sharedfolder", "add", - "nanobox", + "microbox", "--name", name, "--hostpath", @@ -214,7 +214,7 @@ func (machine DockerMachine) removeShare(local, host string) error { vboxManageCmd, "sharedfolder", "remove", - "nanobox", + "microbox", "--name", name, "--transient", @@ -242,7 +242,7 @@ func (machine DockerMachine) addNativeMount(local, host string) error { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "mkdir", "-p", @@ -261,7 +261,7 @@ func (machine DockerMachine) addNativeMount(local, host string) error { cmd = []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "mount", "-t", @@ -289,7 +289,7 @@ func (machine DockerMachine) removeNativeMount(local, host string) error { cmd := []string{ dockerMachineCmd, "ssh", - "nanobox", + "microbox", "sudo", "umount", "-f", diff --git a/util/provider/dockermachine_mount_unix.go b/util/provider/dockermachine_mount_unix.go index c303db83..ba3be510 100644 --- a/util/provider/dockermachine_mount_unix.go +++ b/util/provider/dockermachine_mount_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package provider @@ -8,7 +9,7 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) // Mount mounts a share on a guest machine diff --git a/util/provider/dockermachine_mount_windows.go b/util/provider/dockermachine_mount_windows.go index 055c5ced..0356fcb9 100644 --- a/util/provider/dockermachine_mount_windows.go +++ b/util/provider/dockermachine_mount_windows.go @@ -8,9 +8,9 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) // add mounts using cifs for windows development @@ -53,7 +53,7 @@ func (machine DockerMachine) addNetfsMount(local, host string) error { // mount! // mount -t cifs -o sec=ntlmssp,username=USER,password=PASSWORD,uid=1000,gid=1000 //192.168.99.1/ / - source := fmt.Sprintf("//192.168.99.1/nanobox-%s", appID) + source := fmt.Sprintf("//192.168.99.1/microbox-%s", appID) // mfsymlinks, config, _ := models.LoadConfig() additionalOptions := config.NetfsMountOpts diff --git a/util/provider/native.go b/util/provider/native.go index 003af44e..263c45e3 100644 --- a/util/provider/native.go +++ b/util/provider/native.go @@ -11,9 +11,9 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/config" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/config" + "github.com/mu-box/microbox/util/display" ) // Native ... @@ -74,7 +74,7 @@ func (native Native) Implode() error { containers := []string{} for _, part := range parts { - if strings.Contains(part, "nanobox_") { + if strings.Contains(part, "microbox_") { containers = append(containers, strings.Fields(part)[0]) } } @@ -92,12 +92,12 @@ func (native Native) Implode() error { // Destroy does nothing on native func (native Native) Destroy() error { - // TODO: remove nanobox images + // TODO: remove microbox images if native.hasNetwork() { display.StartTask("Removing custom docker network...") - cmd := exec.Command("docker", "network", "rm", "nanobox") + cmd := exec.Command("docker", "network", "rm", "microbox") cmd.Stdout = display.NewStreamer(" ") cmd.Stderr = display.NewStreamer(" ") @@ -142,7 +142,7 @@ func (native Native) Start() error { return err } - cmd := exec.Command("docker", "network", "create", "--driver=bridge", fmt.Sprintf("--subnet=%s", ipNet.String()), "--opt=\"com.docker.network.driver.mtu=1450\"", "--opt=\"com.docker.network.bridge.name=redd0\"", fmt.Sprintf("--gateway=%s", ip.String()), "nanobox") + cmd := exec.Command("docker", "network", "create", "--driver=bridge", fmt.Sprintf("--subnet=%s", ipNet.String()), "--opt=\"com.docker.network.driver.mtu=1450\"", "--opt=\"com.docker.network.bridge.name=redd0\"", fmt.Sprintf("--gateway=%s", ip.String()), "microbox") cmd.Stdout = display.NewStreamer(" ") cmd.Stderr = display.NewStreamer(" ") @@ -177,7 +177,7 @@ func (native Native) Start() error { return err } - cmd := exec.Command("docker", "network", "create", "--driver=bridge", fmt.Sprintf("--subnet=%s", ipNet.String()), "--opt=\"com.docker.network.driver.mtu=1450\"", "--opt=\"com.docker.network.bridge.name=redd0\"", fmt.Sprintf("--gateway=%s", ip.String()), "nanobox") + cmd := exec.Command("docker", "network", "create", "--driver=bridge", fmt.Sprintf("--subnet=%s", ipNet.String()), "--opt=\"com.docker.network.driver.mtu=1450\"", "--opt=\"com.docker.network.bridge.name=redd0\"", fmt.Sprintf("--gateway=%s", ip.String()), "microbox") cmd.Stdout = display.NewStreamer(" ") cmd.Stderr = display.NewStreamer(" ") @@ -327,8 +327,8 @@ func (native Native) RemoveEnvDir(id string) error { // hasNetwork ... func (native Native) hasNetwork() bool { - // docker-machine ssh nanobox docker network inspect nanobox - cmd := exec.Command("docker", "network", "inspect", "nanobox") + // docker-machine ssh microbox docker network inspect microbox + cmd := exec.Command("docker", "network", "inspect", "microbox") b, err := cmd.CombinedOutput() // diff --git a/util/provider/provider.go b/util/provider/provider.go index e077053e..4d2eca39 100644 --- a/util/provider/provider.go +++ b/util/provider/provider.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) // Provider ... @@ -66,7 +66,7 @@ func Valid() (error, []string) { func ValidReady() error { if !IsReady() { - return errors.New("the provider is not ready try running 'nanobox start' first") + return errors.New("the provider is not ready try running 'microbox start' first") } return nil } diff --git a/util/provider/share/rpc.go b/util/provider/share/rpc.go index fe161977..4d1732be 100644 --- a/util/provider/share/rpc.go +++ b/util/provider/share/rpc.go @@ -1,7 +1,7 @@ package share import ( - "github.com/nanobox-io/nanobox/commands/server" + "github.com/mu-box/microbox/commands/server" ) type ShareRPC struct{} diff --git a/util/provider/share/share_darwin.go b/util/provider/share/share_darwin.go index 0741d326..7fdb75f7 100644 --- a/util/provider/share/share_darwin.go +++ b/util/provider/share/share_darwin.go @@ -11,9 +11,9 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/commands/server" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" + "github.com/mu-box/microbox/commands/server" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" ) type Request struct { @@ -120,7 +120,7 @@ func (sh *ShareRPC) Add(req Request, resp *Response) error { } } - // if this is the first time nanobox adds to the exports (single line) + // if this is the first time microbox adds to the exports (single line) if !found { lines = append(lines, fmt.Sprintf("\"%s\" %s", req.Path, lineCheck)) } diff --git a/util/provider/share/share_linux.go b/util/provider/share/share_linux.go index 8f712ff3..1874412d 100644 --- a/util/provider/share/share_linux.go +++ b/util/provider/share/share_linux.go @@ -11,8 +11,8 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/commands/server" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/commands/server" + "github.com/mu-box/microbox/models" ) // EXPORTSFILE ... diff --git a/util/provider/share/share_test.go b/util/provider/share/share_test.go index 89a0f714..1c800933 100644 --- a/util/provider/share/share_test.go +++ b/util/provider/share/share_test.go @@ -5,10 +5,10 @@ import ( "path/filepath" "testing" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util/config" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util/config" - "github.com/nanobox-io/nanobox/util/provider/share" + "github.com/mu-box/microbox/util/provider/share" ) func TestMain(m *testing.M) { @@ -88,9 +88,9 @@ func TestShare(t *testing.T) { // this commented version is if we pull out the recursive boxfile search from localDir() // // TestShare tests adding parent first, so we can test if removal of parent removes child/sub path // func TestShare(t *testing.T) { -// // path = /go/src/github.com/nanobox-io/nanobox/util/provider/share +// // path = /go/src/github.com/mu-box/microbox/util/provider/share // path := config.LocalDir() -// // parentPath = /go/src/github.com/nanobox-io/nanobox/util/provider +// // parentPath = /go/src/github.com/mu-box/microbox/util/provider // parentPath := filepath.Dir(path) // if share.Exists(parentPath) { // t.Fatal("parent appears to exist when it shouldnt") diff --git a/util/provider/share/share_windows.go b/util/provider/share/share_windows.go index b93a7d9e..3343bcc0 100644 --- a/util/provider/share/share_windows.go +++ b/util/provider/share/share_windows.go @@ -9,8 +9,8 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/commands/server" - "github.com/nanobox-io/nanobox/util/config" + "github.com/mu-box/microbox/commands/server" + "github.com/mu-box/microbox/util/config" ) type Request struct { @@ -83,7 +83,7 @@ func (sh *ShareRPC) Add(req Request, resp *Response) error { cmd := []string{ "net", "share", - fmt.Sprintf("nanobox-%s=%s", req.AppID, req.Path), + fmt.Sprintf("microbox-%s=%s", req.AppID, req.Path), "/unlimited", fmt.Sprintf("/GRANT:%s,FULL", req.User), } @@ -147,7 +147,7 @@ func (sh *ShareRPC) Remove(req Request, resp *Response) error { cmd := []string{ "net", "share", - fmt.Sprintf("nanobox-%s", req.AppID), + fmt.Sprintf("microbox-%s", req.AppID), "/delete", "/y", } diff --git a/util/service/remove_unix.go b/util/service/remove_unix.go index 31e25a91..8e1fc427 100644 --- a/util/service/remove_unix.go +++ b/util/service/remove_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package service @@ -13,7 +14,7 @@ func Remove(name string) error { cmd := removeCmd(name) out, err := exec.Command(cmd[0], cmd[1:]...).CombinedOutput() if err != nil { - fmt.Errorf("out: %s, err: %s", out, err) + return fmt.Errorf("out: %s, err: %s", out, err) } } diff --git a/util/service/service_linux.go b/util/service/service_linux.go index e0834c7f..91270c70 100644 --- a/util/service/service_linux.go +++ b/util/service/service_linux.go @@ -34,10 +34,10 @@ func launchSystem() string { func startCmd(name string) []string { switch launchSystem() { case "systemd": - // systemctl start nanobox-openvpn.service + // systemctl start microbox-openvpn.service return []string{"systemctl", "start", fmt.Sprintf("%s.service", name)} case "upstart": - // initctl start nanobox-openvpn + // initctl start microbox-openvpn return []string{"initctl", "start", name} } @@ -74,10 +74,10 @@ func Running(name string) bool { func stopCmd(name string) []string { switch launchSystem() { case "systemd": - // systemctl start nanobox-openvpn.service + // systemctl start microbox-openvpn.service return []string{"systemctl", "stop", fmt.Sprintf("%s.service", name)} case "upstart": - // initctl start nanobox-openvpn + // initctl start microbox-openvpn return []string{"initctl", "stop", name} } diff --git a/util/service/start_unix.go b/util/service/start_unix.go index 30393385..4eb569f4 100644 --- a/util/service/start_unix.go +++ b/util/service/start_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package service @@ -11,7 +12,7 @@ func Start(name string) error { cmd := startCmd(name) out, err := exec.Command(cmd[0], cmd[1:]...).CombinedOutput() if err != nil { - fmt.Errorf("out: %s, err: %s", out, err) + return fmt.Errorf("out: %s, err: %s", out, err) } if !Running(name) { diff --git a/util/service/stop_unix.go b/util/service/stop_unix.go index f90e523a..f0bfe347 100644 --- a/util/service/stop_unix.go +++ b/util/service/stop_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package service @@ -11,7 +12,7 @@ func Stop(name string) error { cmd := stopCmd(name) out, err := exec.Command(cmd[0], cmd[1:]...).CombinedOutput() if err != nil { - fmt.Errorf("out: %s, err: %s", out, err) + return fmt.Errorf("out: %s, err: %s", out, err) } return nil } diff --git a/util/terminal_size.go b/util/terminal_size.go index 8703dc85..d90d1966 100644 --- a/util/terminal_size.go +++ b/util/terminal_size.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package util diff --git a/util/update/check.go b/util/update/check.go index a907cd5f..6f02eb53 100644 --- a/util/update/check.go +++ b/util/update/check.go @@ -7,13 +7,13 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) -// Check for updates to nanobox every other day +// Check for updates to microbox every other day const checkFrequency = (48 * time.Hour) -// Check checks to see if there is an update available for the nanobox CLI +// Check checks to see if there is an update available for the microbox CLI func Check() { // load the update model updateInfo, err := models.LoadUpdate() @@ -44,13 +44,13 @@ func Check() { // fmt.Printf(` ------------------------------------------------ -Hey! A newer version of nanobox is available. +Hey! A newer version of microbox is available. %s Run the following command to update: -$ nanobox-update +$ microbox-update ------------------------------------------------ `, latest) @@ -68,8 +68,8 @@ func checkable(updateInfo *models.Update) bool { return time.Since(updateInfo.LastCheckAt) >= checkFrequency } -// CheckTomorrow updates the last checked at time to a day later so nanobox will -// check for updates tommorrow. This is only called if the check failed, likely +// CheckTomorrow updates the last checked at time to a day later so microbox will +// check for updates tomorrow. This is only called if the check failed, likely // due to a network error. func checkTomorrow(updateInfo *models.Update) error { updateInfo.LastCheckAt = updateInfo.LastCheckAt.Add(24 * time.Hour) diff --git a/util/update/name.go b/util/update/name.go index e134ec82..e55772e8 100644 --- a/util/update/name.go +++ b/util/update/name.go @@ -1,6 +1,7 @@ +//go:build !windows // +build !windows package update -var Name = "nanobox" -var TmpName = "nanobox.tmp" +var Name = "microbox" +var TmpName = "microbox.tmp" diff --git a/util/update/name_windows.go b/util/update/name_windows.go index c13c4ab7..f8dccba9 100644 --- a/util/update/name_windows.go +++ b/util/update/name_windows.go @@ -1,4 +1,4 @@ package update -var Name = "nanobox.exe" -var TmpName = "nanobox-tmp.exe" +var Name = "microbox.exe" +var TmpName = "microbox-tmp.exe" diff --git a/util/update/run.go b/util/update/run.go index 9ed76aaf..47ff6de4 100644 --- a/util/update/run.go +++ b/util/update/run.go @@ -9,7 +9,7 @@ import ( "path/filepath" "strings" - "github.com/nanobox-io/nanobox/util/display" + "github.com/mu-box/microbox/util/display" ) var Server bool @@ -26,7 +26,7 @@ func Run(path string) error { return err } - if !strings.Contains(path, "nanobox-update") { + if !strings.Contains(path, "microbox-update") { fmt.Printf("Current version: %s", getCurrentVersion(path)) } @@ -55,10 +55,10 @@ func Run(path string) error { // update the model update := newUpdate() - if !strings.Contains(path, "nanobox-update") { + 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/nanobox-io/nanobox/blob/master/CHANGELOG.md") + fmt.Println("https://github.com/mu-box/microbox/blob/master/CHANGELOG.md") } return update.Save() @@ -71,7 +71,7 @@ func getCurrentVersion(path string) string { } version, err := exec.Command(path, "version").Output() if err != nil { - fmt.Println("Error while trying to get the nanobox version") + fmt.Println("Error while trying to get the microbox version") return "" } return string(version) diff --git a/util/update/update.go b/util/update/update.go index 6680ec32..5280f064 100644 --- a/util/update/update.go +++ b/util/update/update.go @@ -1,4 +1,4 @@ -// Package update handles the updating of nanobox cli +// Package update handles the updating of microbox cli package update import ( @@ -10,15 +10,15 @@ import ( "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox/models" + "github.com/mu-box/microbox/models" ) func remotePath() string { - return fmt.Sprintf("https://s3.amazonaws.com/tools.nanobox.io/nanobox/v2/%s/%s/%s", runtime.GOOS, runtime.GOARCH, Name) + return fmt.Sprintf("https://s3.amazonaws.com/tools.microbox.cloud/microbox/v2/%s/%s/%s", runtime.GOOS, runtime.GOARCH, Name) } func latestVersion() string { - remotePath := "https://s3.amazonaws.com/tools.nanobox.io/nanobox/v2/version" + remotePath := "https://s3.amazonaws.com/tools.microbox.cloud/microbox/v2/version" res, err := http.Get(remotePath) if err != nil { lumber.Error("update:http.Get(%s): %s", remotePath, err) diff --git a/util/util.go b/util/util.go index f8acd492..2d8c2d45 100644 --- a/util/util.go +++ b/util/util.go @@ -10,12 +10,12 @@ import ( "path/filepath" "time" - "github.com/nanobox-io/nanobox/util/config" + "github.com/mu-box/microbox/util/config" ) const ( - // VERSION is the global version for nanobox; mainly used in the update process + // VERSION is the global version for microbox; mainly used in the update process // but placed here to allow access when needed (commands, processor, etc.) letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ) diff --git a/util/util_test.go b/util/util_test.go index 6912975d..bfd2cbba 100644 --- a/util/util_test.go +++ b/util/util_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/nanobox-io/nanobox/util" + "github.com/mu-box/microbox/util" ) func TestRetry(t *testing.T) { @@ -25,7 +25,7 @@ func TestRetry(t *testing.T) { err = util.Retry(failingFunc, 3, time.Nanosecond) if err != nil { - t.Errorf("func succeeded but i recieved an error") + t.Errorf("func succeeded but i received an error") } } diff --git a/util/util_unix.go b/util/util_unix.go index 4d1a81fa..3aea6322 100644 --- a/util/util_unix.go +++ b/util/util_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package util @@ -15,11 +16,7 @@ func IsPrivileged() bool { // Execute a syscall to return the user id. If the user id is 0 then we're // running with root escalation. - if os.Geteuid() == 0 { - return true - } - - return false + return os.Geteuid() == 0 } // PrivilegeExec runs a command as sudo diff --git a/util/util_windows.go b/util/util_windows.go index c177860e..d0c15625 100644 --- a/util/util_windows.go +++ b/util/util_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package util @@ -53,8 +54,8 @@ func PrivilegeExec(command string) error { // ensure the command is prepared to be used in powershell escalation // command = preparePrivilegeCmd(command) - // add the --internal flag if the command is nanobox - if strings.HasPrefix(command, "nanobox ") { + // add the --internal flag if the command is microbox + if strings.HasPrefix(command, "microbox ") { command = fmt.Sprintf("%s --internal", command) } diff --git a/util/vbox/vbox_unix.go b/util/vbox/vbox_unix.go index c1550f61..2c8ba748 100644 --- a/util/vbox/vbox_unix.go +++ b/util/vbox/vbox_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package vbox diff --git a/util/vbox/vbox_windows.go b/util/vbox/vbox_windows.go index f90f3240..74b2d621 100644 --- a/util/vbox/vbox_windows.go +++ b/util/vbox/vbox_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package vbox diff --git a/util/watch/crawl_internal_test.go b/util/watch/crawl_internal_test.go index 3f870e9b..ebf6a147 100644 --- a/util/watch/crawl_internal_test.go +++ b/util/watch/crawl_internal_test.go @@ -7,20 +7,20 @@ import ( ) func TestCrawlFiles(t *testing.T) { - os.MkdirAll("/tmp/nanobox/", 0777) - crawlWatcher := newCrawlWatcher("/tmp/nanobox/") + os.MkdirAll("/tmp/microbox/", 0777) + crawlWatcher := newCrawlWatcher("/tmp/microbox/") err := crawlWatcher.watch() if err != nil { t.Fatalf("failed to watch: %s", err) } defer crawlWatcher.close() - exec.Command("touch", "/tmp/nanobox/crawl.tmp").Run() + exec.Command("touch", "/tmp/microbox/crawl.tmp").Run() // pull the first event off the channel ev := <-crawlWatcher.eventChan() - if ev.file != "/tmp/nanobox/crawl.tmp" { + if ev.file != "/tmp/microbox/crawl.tmp" { t.Errorf("the wrong file path came out %s", ev.file) } if ev.error != nil { diff --git a/util/watch/notify_internal_test.go b/util/watch/notify_internal_test.go index 54276ce1..80d48171 100644 --- a/util/watch/notify_internal_test.go +++ b/util/watch/notify_internal_test.go @@ -8,8 +8,8 @@ import ( ) func TestNotifyFiles(t *testing.T) { - os.MkdirAll("/tmp/nanobox/", 0777) - notifyWatcher, err := newRecursiveWatcher("/tmp/nanobox/") + os.MkdirAll("/tmp/microbox/", 0777) + notifyWatcher, err := newRecursiveWatcher("/tmp/microbox/") defer notifyWatcher.close() if err != nil { t.Fatalf("failed to watch: %s", err) @@ -17,12 +17,12 @@ func TestNotifyFiles(t *testing.T) { notifyWatcher.watch() <-time.After(time.Second) - ioutil.WriteFile("/tmp/nanobox/notify.tmp", []byte("hi"), 0777) + ioutil.WriteFile("/tmp/microbox/notify.tmp", []byte("hi"), 0777) // pull the first event off the channel ev := <-notifyWatcher.eventChan() - if ev.file != "/tmp/nanobox/notify.tmp" { + if ev.file != "/tmp/microbox/notify.tmp" { t.Errorf("the wrong file path came out %s", ev.file) } if ev.error != nil { diff --git a/util/watch/watch.go b/util/watch/watch.go index 0bffcfff..5dbbf132 100644 --- a/util/watch/watch.go +++ b/util/watch/watch.go @@ -9,11 +9,11 @@ import ( "time" "github.com/jcelliott/lumber" - "github.com/nanobox-io/nanobox-boxfile" + boxfile "github.com/mu-box/microbox-boxfile" - "github.com/nanobox-io/nanobox/models" - "github.com/nanobox-io/nanobox/util" - "github.com/nanobox-io/nanobox/util/config" + "github.com/mu-box/microbox/models" + "github.com/mu-box/microbox/util" + "github.com/mu-box/microbox/util/config" ) var ignoreFile = []string{".git", ".hg", ".svn", ".bzr"} @@ -27,7 +27,7 @@ var ctimeAvailable bool // useful watching mechanism that looks at files and gets a hash of the content // then when -// watch a directory and report changes to nanobox +// watch a directory and report changes to microbox func Watch(container, path string) error { populateIgnore(path) // ctimeCheck(container) // see comment in batchPublish() @@ -38,13 +38,13 @@ func Watch(container, path string) error { watcher, err := newRecursiveWatcher("./") if err != nil { // if it fails display a message and try the slow one - lumber.Info("Error occured in fast notify watcher: %s", err.Error()) + lumber.Info("Error occurred in fast notify watcher: %s", err.Error()) // print the warning // we added /r because this message often appears in a raw terminal which requires // carriage returns fmt.Printf("\n\r---------------------------------------------------------------------\n\r\n\r") - fmt.Printf("An error occured in the fast notify watcher: '%s'\n\r\n\r", err.Error()) + fmt.Printf("An error occurred in the fast notify watcher: '%s'\n\r\n\r", err.Error()) fmt.Printf("Generally, having too low of a ulimit causes these issues.\n\r") fmt.Printf("Consider upping your ulimit to resolve (`ulimit -n 2048`).\n\r") fmt.Printf("Until then, we'll go ahead and rollover to a slower polling solution.\n\r") @@ -86,7 +86,7 @@ func uniq(list []string) []string { for i := range list { tmp[list[i]] = struct{}{} } - for k, _ := range tmp { + for k := range tmp { newlist = append(newlist, k) } return newlist @@ -145,17 +145,15 @@ func ctime(container string, changeList []string) { util.DockerExec(container, "root", "ctime", changeList, nil) } -// populate the ignore file from the nanoignore +// populate the ignore file from the microignore func populateIgnore(path string) { // add pieces from the env - env, err := models.FindEnvByID(config.EnvID()) + env, _ := models.FindEnvByID(config.EnvID()) box := boxfile.New([]byte(env.BuiltBoxfile)) - for _, libDir := range box.Node("run.config").StringSliceValue("cache_dirs") { - ignoreFile = append(ignoreFile, libDir) - } + ignoreFile = append(ignoreFile, box.Node("run.config").StringSliceValue("cache_dirs")...) - // add parts from the nanoignore - b, err := ioutil.ReadFile(filepath.ToSlash(filepath.Join(path, ".nanoignore"))) + // add parts from the microignore + b, err := ioutil.ReadFile(filepath.ToSlash(filepath.Join(path, ".microignore"))) if err != nil { return } diff --git a/vendor/vendor.json b/vendor/vendor.json deleted file mode 100644 index d3ab8f8a..00000000 --- a/vendor/vendor.json +++ /dev/null @@ -1,535 +0,0 @@ -{ - "comment": "", - "ignore": "test", - "package": [ - { - "checksumSHA1": "nqy1YQXwXd8J3cg2o0dkvXcoyJI=", - "path": "github.com/Azure/go-ansiterm", - "revision": "388960b655244e76e24c75f48631564eaefade62", - "revisionTime": "2016-04-25T22:46:13Z" - }, - { - "checksumSHA1": "jBimnggjIiFUjaImNoJhSVLtdzw=", - "path": "github.com/Azure/go-ansiterm/winterm", - "revision": "388960b655244e76e24c75f48631564eaefade62", - "revisionTime": "2016-04-25T22:46:13Z" - }, - { - "checksumSHA1": "3xEzE5vH/UVyyB3YSzEcr2MAZqw=", - "path": "github.com/BurntSushi/toml", - "revision": "5c4df71dfe9ac89ef6287afc05e4c1b16ae65a1e", - "revisionTime": "2016-01-02T14:47:48Z" - }, - { - "checksumSHA1": "L9njXCkN30+qHaLayiiA2Q9jDlY=", - "path": "github.com/Microsoft/go-winio", - "revision": "fff283ad5116362ca252298cfc9b95828956d85d", - "revisionTime": "2017-02-01T00:43:30Z" - }, - { - "checksumSHA1": "okEyrP/wQJTUiNl3in0GqJdc9jI=", - "path": "github.com/Sirupsen/logrus", - "revision": "11538ee6888f72d4ab44a1aeba06b9bc4cb134a1", - "revisionTime": "2015-07-24T01:49:03Z" - }, - { - "checksumSHA1": "Zo/5JpHnY58PeuY/UaX0n9MuClk=", - "path": "github.com/boltdb/bolt", - "revision": "0b00effdd7a8270ebd91c24297e51643e370dd52", - "revisionTime": "2015-11-12T15:10:49Z" - }, - { - "checksumSHA1": "f1wARLDzsF/JoyN01yoxXEwFIp8=", - "path": "github.com/docker/distribution/digest", - "revision": "b7088d29c6ee508881153aed3bb46290f521e15d", - "revisionTime": "2016-05-03T00:48:11Z" - }, - { - "checksumSHA1": "PzXRTLmmqWXxmDqdIXLcRYBma18=", - "path": "github.com/docker/distribution/reference", - "revision": "b7088d29c6ee508881153aed3bb46290f521e15d", - "revisionTime": "2016-05-03T00:48:11Z" - }, - { - "checksumSHA1": "cwBya/PBzAcK06fsBww4AeVC9Go=", - "path": "github.com/docker/docker/pkg/signal", - "revision": "09b929083d34836a78ce8ee79b22aea082712072", - "revisionTime": "2016-08-19T20:09:57Z" - }, - { - "checksumSHA1": "YDYbS5U2mDwfcOUJ6M09cP6Bubg=", - "path": "github.com/docker/docker/pkg/stdcopy", - "revision": "09b929083d34836a78ce8ee79b22aea082712072", - "revisionTime": "2016-08-19T20:09:57Z" - }, - { - "checksumSHA1": "E+nAUmxUmGVf9py6HDVjs3LOBUU=", - "path": "github.com/docker/docker/pkg/term", - "revision": "09b929083d34836a78ce8ee79b22aea082712072", - "revisionTime": "2016-08-19T20:09:57Z" - }, - { - "checksumSHA1": "k1RJrQuAMExp5VUDOXlnLBN47vE=", - "path": "github.com/docker/docker/pkg/term/windows", - "revision": "09b929083d34836a78ce8ee79b22aea082712072", - "revisionTime": "2016-08-19T20:09:57Z" - }, - { - "checksumSHA1": "PDXSPZlb43hdy26n6hZi2UJxi5I=", - "path": "github.com/docker/engine-api/client", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "hy25CjwQPy8lt2FH0hg4rPNyD+g=", - "path": "github.com/docker/engine-api/client/transport", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "wks7rWVqxJxaTNduI08okVCOMCg=", - "path": "github.com/docker/engine-api/client/transport/cancellable", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "GlyAlAfGRjTBbuqHgRNaRG2fAaw=", - "path": "github.com/docker/engine-api/types", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "ry5lgawDzJEEFNOgiLkAj7yJH6E=", - "path": "github.com/docker/engine-api/types/blkiodev", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "N2c370aeony2XlMnVsq8qyZCb8U=", - "path": "github.com/docker/engine-api/types/container", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "hZV62Xzt/i0e/WBKWww3rpkRAR4=", - "path": "github.com/docker/engine-api/types/filters", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "d5BuQrBPAQwmU/WjUSfYBZTKnFA=", - "path": "github.com/docker/engine-api/types/mount", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "Khzf7tXOZxxJy/5BCHD3aINtyU8=", - "path": "github.com/docker/engine-api/types/network", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "DrGaE4uA19LswH15o/LVYxs7TgE=", - "path": "github.com/docker/engine-api/types/reference", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "Ps1btJzYmpXCDE+0f3AX54XTObM=", - "path": "github.com/docker/engine-api/types/registry", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "Mgvb6aJiQKpzcOQy5LpfpWrM5L0=", - "path": "github.com/docker/engine-api/types/strslice", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "jIl991if+0Vwc4jGEpoAWnHi4FQ=", - "path": "github.com/docker/engine-api/types/swarm", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "NXxuzwsg/CA+CM56b+ViwOdO9T0=", - "path": "github.com/docker/engine-api/types/time", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "AE3TTpPWvv9ic71FiF0HnRr46mE=", - "path": "github.com/docker/engine-api/types/versions", - "revision": "4290f40c056686fcaa5c9caf02eac1dde9315adf", - "revisionTime": "2016-09-08T23:21:04Z" - }, - { - "checksumSHA1": "kktbWelM0xVH61fOWltCEOR/87E=", - "path": "github.com/docker/go-connections/nat", - "revision": "34b5052da6b11e27f5f2e357b38b571ddddd3928", - "revisionTime": "2016-02-12T23:19:11Z" - }, - { - "checksumSHA1": "qduzCUW9qrkJVh/5ec54Rzrq26g=", - "path": "github.com/docker/go-connections/sockets", - "revision": "34b5052da6b11e27f5f2e357b38b571ddddd3928", - "revisionTime": "2016-02-12T23:19:11Z" - }, - { - "checksumSHA1": "NNF1CFse3IHgzxyCDnKgTxrbZP0=", - "path": "github.com/docker/go-connections/tlsconfig", - "revision": "34b5052da6b11e27f5f2e357b38b571ddddd3928", - "revisionTime": "2016-02-12T23:19:11Z" - }, - { - "checksumSHA1": "18hmvak2Dc9x5cgKeZ2iApviT7w=", - "path": "github.com/docker/go-units", - "revision": "5d2041e26a699eaca682e2ea41c8f891e1060444", - "revisionTime": "2016-01-25T17:48:45Z" - }, - { - "checksumSHA1": "pfZB2heUOImpxC+LS/xFSFDd2J8=", - "path": "github.com/docker/machine/libmachine/log", - "revision": "937160559e02cc430fe176991beb9a6ffbfe3de0", - "revisionTime": "2017-07-12T23:53:51Z", - "version": "v0.12.2", - "versionExact": "v0.12.2" - }, - { - "checksumSHA1": "WZq3NS1/0CN7IyeZqH+AugPzm7k=", - "path": "github.com/docker/machine/libmachine/mcnutils", - "revision": "937160559e02cc430fe176991beb9a6ffbfe3de0", - "revisionTime": "2017-07-12T23:53:51Z", - "version": "v0.12.2", - "versionExact": "v0.12.2" - }, - { - "checksumSHA1": "Fn8hXKmkAUxnXi5RrIexvW9BnI8=", - "path": "github.com/docker/machine/version", - "revision": "937160559e02cc430fe176991beb9a6ffbfe3de0", - "revisionTime": "2017-07-12T23:53:51Z", - "version": "v0.12.2", - "versionExact": "v0.12.2" - }, - { - "checksumSHA1": "xgjI2W3RGiQwNlxsOW2V9fJ9kaM=", - "path": "github.com/fsnotify/fsnotify", - "revision": "f12c6236fe7b5cf6bcf30e5935d08cb079d78334", - "revisionTime": "2016-08-16T05:15:41Z" - }, - { - "checksumSHA1": "RqlXnqTJnV68iQmiDMaOMhtj7VY=", - "path": "github.com/hashicorp/hcl", - "revision": "578dd9746824a54637686b51a41bad457a56bcef", - "revisionTime": "2016-01-19T20:27:37Z" - }, - { - "checksumSHA1": "WP5ODRo9+USuAsKYPu5RW3q8Epg=", - "path": "github.com/hashicorp/hcl/hcl/ast", - "revision": "578dd9746824a54637686b51a41bad457a56bcef", - "revisionTime": "2016-01-19T20:27:37Z" - }, - { - "checksumSHA1": "Bp6ftbfyrMdHvLlzcNsLQH+Xqw4=", - "path": "github.com/hashicorp/hcl/hcl/parser", - "revision": "578dd9746824a54637686b51a41bad457a56bcef", - "revisionTime": "2016-01-19T20:27:37Z" - }, - { - "checksumSHA1": "AwXW3BDC53INB5cY2CLmtIFfOPw=", - "path": "github.com/hashicorp/hcl/hcl/scanner", - "revision": "578dd9746824a54637686b51a41bad457a56bcef", - "revisionTime": "2016-01-19T20:27:37Z" - }, - { - "checksumSHA1": "wh2mSXMC88JiAy8FIrTtL7OmY7Q=", - "path": "github.com/hashicorp/hcl/hcl/strconv", - "revision": "578dd9746824a54637686b51a41bad457a56bcef", - "revisionTime": "2016-01-19T20:27:37Z" - }, - { - "checksumSHA1": "mCxZsnCaqyKhAC5iulJQpt8LIqA=", - "path": "github.com/hashicorp/hcl/hcl/token", - "revision": "578dd9746824a54637686b51a41bad457a56bcef", - "revisionTime": "2016-01-19T20:27:37Z" - }, - { - "checksumSHA1": "uEaK2zagnGctsUmjWt8ZYmK1Yvs=", - "path": "github.com/hashicorp/hcl/json/parser", - "revision": "578dd9746824a54637686b51a41bad457a56bcef", - "revisionTime": "2016-01-19T20:27:37Z" - }, - { - "checksumSHA1": "S1e0F9ZKSnqgOLfjDTYazRL28tA=", - "path": "github.com/hashicorp/hcl/json/scanner", - "revision": "578dd9746824a54637686b51a41bad457a56bcef", - "revisionTime": "2016-01-19T20:27:37Z" - }, - { - "checksumSHA1": "fNlXQCQEnb+B3k5UDL/r15xtSJY=", - "path": "github.com/hashicorp/hcl/json/token", - "revision": "578dd9746824a54637686b51a41bad457a56bcef", - "revisionTime": "2016-01-19T20:27:37Z" - }, - { - "checksumSHA1": "40vJyUB4ezQSn/NSadsKEOrudMc=", - "path": "github.com/inconshreveable/mousetrap", - "revision": "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75", - "revisionTime": "2014-10-17T20:07:13Z" - }, - { - "checksumSHA1": "TW1TbIL4RRT4fpdvwVxph25vdKw=", - "path": "github.com/jcelliott/lumber", - "revision": "dd349441af25132d146d7095c6693a15431fc9b1", - "revisionTime": "2016-03-24T20:37:08Z" - }, - { - "checksumSHA1": "1YeGotQXMZMqk+mmm8sbBVJywpw=", - "path": "github.com/kr/pretty", - "revision": "e6ac2fc51e89a3249e82157fa0bb7a18ef9dd5bb", - "revisionTime": "2015-05-20T16:35:14Z" - }, - { - "checksumSHA1": "uulQHQ7IsRKqDudBC8Go9J0gtAc=", - "path": "github.com/kr/text", - "revision": "bb797dc4fb8320488f47bf11de07a733d7233e1f", - "revisionTime": "2015-09-05T22:45:08Z" - }, - { - "checksumSHA1": "YFg6EOS/oNzEPAc5wXjbWmgr2tQ=", - "path": "github.com/lyondhill/vtclean", - "revision": "ea70112eba8c76618853d04b02eaf84da56067b4", - "revisionTime": "2017-02-14T19:52:31Z" - }, - { - "checksumSHA1": "KCgFx/QQG9vUtshnL9aUxeWGFyY=", - "path": "github.com/magiconair/properties", - "revision": "c81f9d71af8f8cba1466501d30326b99a4e56c19", - "revisionTime": "2015-12-21T21:31:49Z" - }, - { - "checksumSHA1": "4gQDMNWk+eTJ4lSwVDW+MnwaB0U=", - "path": "github.com/mitchellh/colorstring", - "revision": "61164e49940b423ba1f12ddbdf01632ac793e5e9", - "revisionTime": "2015-02-28T18:11:56Z" - }, - { - "checksumSHA1": "6MlTkhpXf7Wt2R2cSY9Vnetxw1Q=", - "path": "github.com/mitchellh/go-homedir", - "revision": "56f508a88415ab57e596a176f0789ede8f790903", - "revisionTime": "2015-08-22T23:45:38Z" - }, - { - "checksumSHA1": "L3leymg2RT8hFl5uL+5KP/LpBkg=", - "path": "github.com/mitchellh/go-wordwrap", - "revision": "ad45545899c7b13c020ea92b2072220eefad42b8", - "revisionTime": "2015-03-14T17:03:34Z" - }, - { - "checksumSHA1": "4Js6Jlu93Wa0o6Kjt393L9Z7diE=", - "path": "github.com/mitchellh/mapstructure", - "revision": "281073eb9eb092240d33ef253c404f1cca550309", - "revisionTime": "2015-07-17T05:11:58Z" - }, - { - "checksumSHA1": "mvyZI+F9HYUSJ3qI2mb1dRNedcc=", - "path": "github.com/nanobox-io/golang-docker-client", - "revision": "d1683dd8c7dd48bdd358d2583c26295919f7c2ca", - "revisionTime": "2017-09-01T18:42:07Z" - }, - { - "checksumSHA1": "qlhiU9lPzLZrgRbmoTMjh2AYfLY=", - "path": "github.com/nanobox-io/golang-portal-client", - "revision": "350613abb8743e43ff433b1ad9a327b171db35ec", - "revisionTime": "2017-09-01T18:44:16Z" - }, - { - "checksumSHA1": "UwQRRri8/y+7BExMLpmDfvwmRmo=", - "path": "github.com/nanobox-io/golang-ssh", - "revision": "b42e3bb3b407c94193734f85d2f2f37067651d78", - "revisionTime": "2016-09-12T15:03:35Z" - }, - { - "checksumSHA1": "wTAYmbl1nt5HdkjblpnInPKhwp0=", - "path": "github.com/nanobox-io/nanobox-boxfile", - "revision": "213ff24b93f4b7de0a8067841612278c1995d393", - "revisionTime": "2017-08-03T21:20:06Z" - }, - { - "checksumSHA1": "sW6kgyu+s0Vg9q9u0BpPH3DlkC8=", - "path": "github.com/nanobox-io/nanobox-golang-stylish", - "revision": "030019c3e9a974f3142a674bc189dff000ca59b3", - "revisionTime": "2016-06-17T20:12:42Z" - }, - { - "checksumSHA1": "5rOBGrnVJoymxI+FQn5tyHgbgcA=", - "path": "github.com/nanopack/logvac/config", - "revision": "655f2ff0ed087cf7103f2bfdde0324019fabaf4c", - "revisionTime": "2017-09-07T18:11:09Z" - }, - { - "checksumSHA1": "RI5cATdVXt1L8NoI0+8op9butCg=", - "path": "github.com/nanopack/logvac/core", - "revision": "655f2ff0ed087cf7103f2bfdde0324019fabaf4c", - "revisionTime": "2017-09-07T18:11:09Z" - }, - { - "checksumSHA1": "TTEICNRFfe8Q66Z1WqZt+J9X49g=", - "path": "github.com/nanopack/mist/clients", - "revision": "5d5621c29dfb71d4b9a7807017fa2b0888b3bf2b", - "revisionTime": "2016-06-03T20:53:41Z" - }, - { - "checksumSHA1": "skE8e+6AYM88cOoRKFJZOv6lyiA=", - "path": "github.com/nanopack/mist/core", - "revision": "5d5621c29dfb71d4b9a7807017fa2b0888b3bf2b", - "revisionTime": "2016-06-03T20:53:41Z" - }, - { - "checksumSHA1": "PjL2cp7Ch/YS025P8ZVsIggW4lc=", - "path": "github.com/opencontainers/runc/libcontainer/user", - "revision": "0107c7fb6cef8d2f302f299039cc2f9a903880ac", - "revisionTime": "2016-02-19T03:27:39Z" - }, - { - "checksumSHA1": "65+hx0QlLzpWe5pnjAzteKBnC10=", - "path": "github.com/spf13/cast", - "revision": "ee7b3e0353166ab1f3a605294ac8cd2b77953778", - "revisionTime": "2015-11-26T06:42:19Z" - }, - { - "checksumSHA1": "S6eaGT0CxheIdcQs9MR8sTbZqkQ=", - "path": "github.com/spf13/cobra", - "revision": "8e91712f174ced10270cf66615e0a9127e7c4de5", - "revisionTime": "2016-01-17T03:09:38Z" - }, - { - "checksumSHA1": "88nY1XQWDuufclM+CiLeSxtVtaQ=", - "path": "github.com/spf13/jwalterweatherman", - "revision": "d00654080cddbd2b082acaa74007cb94a2b40866", - "revisionTime": "2015-10-14T07:12:31Z" - }, - { - "checksumSHA1": "MrBzoMkuXdrGKo09/ka+JCC2Mlk=", - "path": "github.com/spf13/pflag", - "revision": "7f60f83a2c81bc3c3c0d5297f61ddfa68da9d3b7", - "revisionTime": "2015-10-24T10:54:09Z" - }, - { - "checksumSHA1": "v/deLzEkJhEOd1R8q/q8od/RaII=", - "path": "github.com/spf13/viper", - "revision": "a212099cbe6fbe8d07476bfda8d2d39b6ff8f325", - "revisionTime": "2016-01-11T15:07:23Z" - }, - { - "checksumSHA1": "JudmDUXw4yXgKTvHmeMadarw4KA=", - "path": "github.com/timehop/go-mixpanel", - "revision": "9b81eaf1f33eda1d280d59adbd1fe9d3ad3da08f", - "revisionTime": "2015-06-30T22:09:33Z" - }, - { - "checksumSHA1": "h+pFYiRHBogczS8/F1NoN3Ata44=", - "path": "golang.org/x/crypto/curve25519", - "revision": "e311231e83195f401421a286060d65643f9c9d40", - "revisionTime": "2016-09-12T10:18:32Z" - }, - { - "checksumSHA1": "wGb//LjBPNxYHqk+dcLo7BjPXK8=", - "path": "golang.org/x/crypto/ed25519", - "revision": "e311231e83195f401421a286060d65643f9c9d40", - "revisionTime": "2016-09-12T10:18:32Z" - }, - { - "checksumSHA1": "LXFcVx8I587SnWmKycSDEq9yvK8=", - "path": "golang.org/x/crypto/ed25519/internal/edwards25519", - "revision": "e311231e83195f401421a286060d65643f9c9d40", - "revisionTime": "2016-09-12T10:18:32Z" - }, - { - "checksumSHA1": "pXOcpeiBjX3zbVKeg0pvYnEmtqU=", - "path": "golang.org/x/crypto/ssh", - "revision": "e311231e83195f401421a286060d65643f9c9d40", - "revisionTime": "2016-09-12T10:18:32Z" - }, - { - "checksumSHA1": "y3a1tOZVwKCqG2yJZvAYycnelyM=", - "path": "golang.org/x/crypto/ssh/terminal", - "revision": "e311231e83195f401421a286060d65643f9c9d40", - "revisionTime": "2016-09-12T10:18:32Z" - }, - { - "checksumSHA1": "5ARrN3Zq+E9zazFb/N+b08Serys=", - "path": "golang.org/x/net/context", - "revision": "b6d7b1396ec874c3b00f6c84cd4301a17c56c8ed", - "revisionTime": "2016-02-16T13:16:06Z" - }, - { - "checksumSHA1": "LvdVRE0FqdR68SvVpRkHs1rxhcA=", - "path": "golang.org/x/net/proxy", - "revision": "b6d7b1396ec874c3b00f6c84cd4301a17c56c8ed", - "revisionTime": "2016-02-16T13:16:06Z" - }, - { - "checksumSHA1": "7EZyXN0EmZLgGxZxK01IJua4c8o=", - "path": "golang.org/x/net/websocket", - "revision": "57efc9c3d9f91fb3277f8da1cff370539c4d3dc5", - "revisionTime": "2017-08-18T05:32:00Z" - }, - { - "checksumSHA1": "CoRxz7vk573Zu/UcMS4PzpAsv3w=", - "path": "golang.org/x/sys/unix", - "revision": "b776ec39b3e54652e09028aaaaac9757f4f8211a", - "revisionTime": "2016-04-21T02:29:30Z" - }, - { - "checksumSHA1": "6aa7Y4gpUDxYNt48cOT95zMjp9E=", - "path": "golang.org/x/sys/windows", - "revision": "b776ec39b3e54652e09028aaaaac9757f4f8211a", - "revisionTime": "2016-04-21T02:29:30Z" - }, - { - "checksumSHA1": "ZcvekRXq6FjnGCznsRqfVTjA+pc=", - "path": "golang.org/x/sys/windows/registry", - "revision": "b776ec39b3e54652e09028aaaaac9757f4f8211a", - "revisionTime": "2016-04-21T02:29:30Z" - }, - { - "checksumSHA1": "IRqLaXM/VQRzkbXPuiqOxTb2W0Y=", - "path": "golang.org/x/sys/windows/svc", - "revision": "99f16d856c9836c42d24e7ab64ea72916925fa97", - "revisionTime": "2017-03-08T15:04:45Z" - }, - { - "checksumSHA1": "1ouiyoHRaaMDNeq/nap9B0UuQw4=", - "path": "golang.org/x/sys/windows/svc/debug", - "revision": "99f16d856c9836c42d24e7ab64ea72916925fa97", - "revisionTime": "2017-03-08T15:04:45Z" - }, - { - "checksumSHA1": "uVlUSSKplihZG7N+QJ6fzDZ4Kh8=", - "path": "golang.org/x/sys/windows/svc/eventlog", - "revision": "99f16d856c9836c42d24e7ab64ea72916925fa97", - "revisionTime": "2017-03-08T15:04:45Z" - }, - { - "checksumSHA1": "6dvXhF7BOHN87mMJ8SaAuFxai0Q=", - "path": "golang.org/x/sys/windows/svc/mgr", - "revision": "8fd966b47dbdd4faa03de0d06e3d733baeb9a1a9", - "revisionTime": "2016-04-10T19:02:41Z" - }, - { - "checksumSHA1": "WCpgePNKiUKt0S0VE/e5kF5OnzU=", - "path": "gopkg.in/fsnotify.v1", - "revision": "8611c35ab31c1c28aa903d33cf8b6e44a399b09e", - "revisionTime": "2016-01-10T15:04:37Z" - }, - { - "checksumSHA1": "Ww6wiSKdA8LwxoJz4DNUF+crH4g=", - "path": "gopkg.in/yaml.v2", - "revision": "f7716cbe52baa25d2e9b0d0da546fcf909fc16b4", - "revisionTime": "2015-12-01T16:27:45Z" - } - ], - "rootPath": "github.com/nanobox-io/nanobox" -}