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

Config not found in /etc #13

Open
timkgh opened this issue Nov 6, 2022 · 2 comments
Open

Config not found in /etc #13

timkgh opened this issue Nov 6, 2022 · 2 comments

Comments

@timkgh
Copy link

timkgh commented Nov 6, 2022

The help says:

--config string Path to config file. If not specified will look for cloudflare-ddns.toml in the program dir (), $HOME/.config, or /etc, in that order

But running it without --config it does not find the file in /etc/cloudflare-ddns.toml even though it exists and it's readable. Invoking with an explicit --config /etc/cloudflare-ddns.toml works.

@timkgh
Copy link
Author

timkgh commented Nov 6, 2022

Running an strace, it seems there's an extra .toml in the extension. Of course, if I name the file /etc/cloudflare-ddns.toml.toml it finds it.

newfstatat(AT_FDCWD, "/usr/local/bin/cloudflare-ddns.toml.json", 0xc000091a38, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/bin/cloudflare-ddns.toml.toml", 0xc000091b08, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/bin/cloudflare-ddns.toml.yaml", 0xc000091bd8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/bin/cloudflare-ddns.toml.yml", 0xc000091ca8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/bin/cloudflare-ddns.toml.properties", 0xc000091d78, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/bin/cloudflare-ddns.toml.props", 0xc000091e48, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/bin/cloudflare-ddns.toml.prop", 0xc000091f18, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/bin/cloudflare-ddns.toml.hcl", 0xc000132038, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/bin/cloudflare-ddns.toml.tfvars", 0xc000132108, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/bin/cloudflare-ddns.toml.dotenv", 0xc0001321d8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/bin/cloudflare-ddns.toml.env", 0xc0001322a8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/bin/cloudflare-ddns.toml.ini", 0xc000132378, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.config/cloudflare-ddns.toml.json", 0xc000132448, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.config/cloudflare-ddns.toml.toml", 0xc000132518, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.config/cloudflare-ddns.toml.yaml", 0xc0001325e8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.config/cloudflare-ddns.toml.yml", 0xc0001326b8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.config/cloudflare-ddns.toml.properties", 0xc000132788, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.config/cloudflare-ddns.toml.props", 0xc000132858, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.config/cloudflare-ddns.toml.prop", 0xc000132928, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.config/cloudflare-ddns.toml.hcl", 0xc0001329f8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.config/cloudflare-ddns.toml.tfvars", 0xc000132ac8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.config/cloudflare-ddns.toml.dotenv", 0xc000132b98, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.config/cloudflare-ddns.toml.env", 0xc000132c68, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.config/cloudflare-ddns.toml.ini", 0xc000132d38, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/etc/cloudflare-ddns.toml.json", 0xc000132e08, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/etc/cloudflare-ddns.toml.toml", 0xc000132ed8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/etc/cloudflare-ddns.toml.yaml", 0xc000132fa8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/etc/cloudflare-ddns.toml.yml", 0xc000133078, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/etc/cloudflare-ddns.toml.properties", 0xc000133148, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/etc/cloudflare-ddns.toml.props", 0xc000133218, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/etc/cloudflare-ddns.toml.prop", 0xc0001332e8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/etc/cloudflare-ddns.toml.hcl", 0xc0001333b8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/etc/cloudflare-ddns.toml.tfvars", 0xc000133488, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/etc/cloudflare-ddns.toml.dotenv", 0xc000133558, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/etc/cloudflare-ddns.toml.env", 0xc000133628, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/etc/cloudflare-ddns.toml.ini", 0xc0001336f8, 0) = -1 ENOENT (No such file or directory)

@d4z3x
Copy link

d4z3x commented Jun 9, 2023

I fixed this in my fork, and sent a PR here. My fork is here: https://github.com/d4z3x/cloudflare-ddns-client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants