From 32145bf3f58f20a79d9c01c13d30567ede276bce Mon Sep 17 00:00:00 2001 From: ersonp Date: Thu, 10 Jun 2021 16:13:39 +0530 Subject: [PATCH 1/3] Chenge perm of pid and logstore --- pkg/app/appcommon/log_store.go | 2 +- pkg/app/launcher/launcher.go | 2 +- pkg/util/pathutil/util.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/app/appcommon/log_store.go b/pkg/app/appcommon/log_store.go index 4d2e02168d..2bdb2e9efe 100644 --- a/pkg/app/appcommon/log_store.go +++ b/pkg/app/appcommon/log_store.go @@ -65,7 +65,7 @@ type bBoltLogStore struct { // NewBBoltLogStore returns a bbolt implementation of an app log store. func NewBBoltLogStore(path, appName string) (_ LogStore, err error) { - db, err := bbolt.Open(path, 0600, nil) + db, err := bbolt.Open(path, 0606, nil) if err != nil { return nil, err } diff --git a/pkg/app/launcher/launcher.go b/pkg/app/launcher/launcher.go index 0765b06da1..d67f6fee0d 100644 --- a/pkg/app/launcher/launcher.go +++ b/pkg/app/launcher/launcher.go @@ -312,7 +312,7 @@ func ensureDir(path *string) error { */ func (l *Launcher) pidFile() (*os.File, error) { - return os.OpenFile(filepath.Join(l.conf.LocalPath, appsPIDFileName), os.O_RDWR|os.O_CREATE, 0600) + return os.OpenFile(filepath.Join(l.conf.LocalPath, appsPIDFileName), os.O_RDWR|os.O_CREATE, 0606) //nolint:gosec } func (l *Launcher) persistPID(appName string, pid appcommon.ProcID) error { diff --git a/pkg/util/pathutil/util.go b/pkg/util/pathutil/util.go index 5ad34723fd..e0e94a569d 100644 --- a/pkg/util/pathutil/util.go +++ b/pkg/util/pathutil/util.go @@ -11,7 +11,7 @@ import ( const ( tmpSuffix = ".tmp" - ownerRW = 0600 + ownerRW = 0606 userRWXGroupRX = 0750 ) From 59bef1fbfe45a08310dcdd70dea8ba7a8a530111 Mon Sep 17 00:00:00 2001 From: ersonp Date: Thu, 10 Jun 2021 16:34:37 +0530 Subject: [PATCH 2/3] Change ownerRW to ownerRWOtherRW --- pkg/util/pathutil/util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/util/pathutil/util.go b/pkg/util/pathutil/util.go index e0e94a569d..d61a82877f 100644 --- a/pkg/util/pathutil/util.go +++ b/pkg/util/pathutil/util.go @@ -11,7 +11,7 @@ import ( const ( tmpSuffix = ".tmp" - ownerRW = 0606 + ownerRWOtherRW = 0606 userRWXGroupRX = 0750 ) @@ -41,7 +41,7 @@ func AtomicWriteFile(filename string, data []byte) error { } } - if err := ioutil.WriteFile(tempFilePath, data, ownerRW); err != nil { + if err := ioutil.WriteFile(tempFilePath, data, ownerRWOtherRW); err != nil { return err } From 73a4b5eadde6f4b03e6de8ea12e8bf6f3ad0603d Mon Sep 17 00:00:00 2001 From: ersonp Date: Thu, 10 Jun 2021 17:34:08 +0530 Subject: [PATCH 3/3] Make file updates --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 55ff91f357..dc657b5691 100644 --- a/Makefile +++ b/Makefile @@ -42,11 +42,6 @@ BUILD_OPTS_DEPLOY?="-ldflags=$(BUILDINFO) -w -s" check: lint test ## Run linters and tests -move-built-frontend: - rm -rf ${MANAGER_UI_BUILT_DIR} - mkdir ${MANAGER_UI_BUILT_DIR} - cp -r ${MANAGER_UI_DIR}/dist/. ${MANAGER_UI_BUILT_DIR} - build: host-apps bin ## Install dependencies, build apps and binaries. `go build` with ${OPTS} build-static: host-apps-static bin-static ## Build apps and binaries. `go build` with ${OPTS} @@ -145,13 +140,18 @@ github-release: ## Create a GitHub release install-deps-ui: ## Install the UI dependencies cd $(MANAGER_UI_DIR) && npm ci +run: ## Run skywire visor with skywire-config.json, and start a browser if running a hypervisor + ./skywire-visor -c ./skywire-config.json + lint-ui: ## Lint the UI code cd $(MANAGER_UI_DIR) && npm run lint build-ui: install-deps-ui ## Builds the UI cd $(MANAGER_UI_DIR) && npm run build mkdir -p ${PWD}/bin - make move-built-frontend + rm -rf ${MANAGER_UI_BUILT_DIR} + mkdir ${MANAGER_UI_BUILT_DIR} + cp -r ${MANAGER_UI_DIR}/dist/. ${MANAGER_UI_BUILT_DIR} help: @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'