Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change perm of pid and logstore #810

Merged
merged 3 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}'
2 changes: 1 addition & 1 deletion pkg/app/appcommon/log_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/launcher/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/pathutil/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const (
tmpSuffix = ".tmp"
ownerRW = 0600
ownerRWOtherRW = 0606
userRWXGroupRX = 0750
)

Expand Down Expand Up @@ -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
}

Expand Down