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

conf-path opens a nonexistent file #188

Closed
9yx opened this issue Jan 13, 2020 · 1 comment
Closed

conf-path opens a nonexistent file #188

9yx opened this issue Jan 13, 2020 · 1 comment
Labels
Milestone

Comments

@9yx
Copy link

9yx commented Jan 13, 2020

What is Happening

Start dps with -conf-path=/etc/dns-proxy-server/config.json, (dps location /usr/bin/dns-proxy-server)

when start dps open config /usr/bin/etc/dns-proxy-server/config.json

What is expected

Open config /etc/dns-proxy-server/config.json

Steps to Reproduce

Start:

/usr/bin/dns-proxy-server -conf-path=/etc/dns-proxy-server/config.json

Specs:

  • OS: Archlinux
  • Docker Version: 19.03.5-ce
  • DPS Version: 2.18.7
$ /usr/bin/dns-proxy-server -conf-path=/etc/dns-proxy-server/config.json
2020/01/13 13:02:16.003274 ERROR f=local.go:123 pkg=github.com/mageddo/dns-proxy-server/events/local m=storeDefaultConfig status=error-to-create-conf-path, path=/usr/bin/etc/dns-proxy-server/config.json
2020/01/13 13:02:16.003354 ERROR f=local.go:123 pkg=github.com/mageddo/dns-proxy-server/events/local m=storeDefaultConfig status=error-to-create-conf-path, path=/usr/bin/etc/dns-proxy-server/config.json
@mageddo
Copy link
Owner

mageddo commented Jan 13, 2020

Looks like -conf-path feature wasn't designed to support absolute paths, I think it makes sense to support it.

func GetPath(path string) string {
if !strings.HasPrefix(path, "/") {
path = "/" + path
}
currentPath := GetCurrentPath();
if strings.HasSuffix(currentPath, "/") {
currentPath = currentPath[0:len(currentPath)-1]
}
return currentPath + path
}

@mageddo mageddo added this to the 2.19.x milestone Jan 13, 2020
mageddo added a commit that referenced this issue Jan 15, 2020
* upgrading github-cli to fix master docker release

* make support for absolute paths on config file

* specifying release notes
@mageddo mageddo closed this as completed Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants