location of config.json with standalone binary #495

Open
opened 2025-11-20 04:24:33 -05:00 by saavagebueno · 1 comment
Owner

Originally created by @mwshook on GitHub (Feb 9, 2025).

Running the binary creates a config.json file in a location inconsistent with the README instructions

  1. Is this urgent: Yes

  2. DNS provider(s) you use: Porkbun

  3. Program version:

    2.9.0 built on 2024-12-24T10:43:16Z (commit 78f30614b1d085ef6bfbfce92b0e45ca0204f42a)

  4. What are you using to run the container: no container. Standalone binary ddns-updater_2.9.0_linux_amd64

  5. Extra information:
    Desired behavior: I create config.json per the README, put it in the directory data, run ddns-updater, it finds the config and parses it
    Observed behavior: ddns-updater finds data, creates a new data inside of it, creates a blank config.json inside the nested data .

Following the README instructions, I made a data directory in the same directory with the ddns-updater binary. I put a config.json file inside data following the instructions for my provider, Porkbun. I was not able to get the domain to update. I then realized the problem was that the binary created a blank config.json inside of a new data directory inside of the data directory I created. I copied my config in place of the blank one and now everything works correctly.

Tree output showing the files and directories created:

madmin@HeWasTheNAS ~/bin> tree d*
data
├── config.json
└── data
    ├── config.json
    └── updates.json
ddns-updater_2.9.0_linux_amd64  [error opening dir]

2 directories, 4 files

Logs:

madmin@HeWasTheNAS ~/b/data> ddns-updater_2.9.0_linux_amd64
========================================
========================================
============= ddns-updater =============
========================================
=========== Made with ❤️ by ============
======= https://github.com/qdm12 =======
========================================
========================================

Running version 2.9.0 built on 2024-12-24T10:43:16Z (commit 78f30614b1d085ef6bfbfce92b0e45ca0204f42a)

🔧 Need help? ☕ Discussion? https://github.com/qdm12/ddns-updater/discussions/new/choose
🐛 Bug? ✨ New feature? https://github.com/qdm12/ddns-updater/issues/new/choose
💻 Email? quentin.mcgaw@gmail.com
💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
2025-02-08T20:48:27-08:00 INFO Settings summary:
├── HTTP client
|   └── Timeout: 20s
├── Update
|   ├── Period: 10m0s
|   └── Cooldown: 5m0s
├── Public IP fetching
|   ├── HTTP enabled: yes
|   ├── HTTP IP providers
|   |   └── all
|   ├── HTTP IPv4 providers
|   |   └── all
|   ├── HTTP IPv6 providers
|   |   └── all
|   ├── DNS enabled: yes
|   ├── DNS timeout: 3s
|   └── DNS over TLS providers
|       └── all
├── Resolver: use Go default resolver
├── Server
|   ├── Listening address: :8000
|   └── Root URL: /
├── Health
|   └── Server is disabled
├── Paths
|   ├── Data directory: ./data
|   ├── Config file: data/config.json
|   └── Umask: system default
├── Backup: disabled
└── Logger
    ├── Level: INFO
    └── Caller: hidden
2025-02-08T20:48:27-08:00 INFO reading JSON config from file data/config.json
2025-02-08T20:48:27-08:00 INFO Found single setting to update record
2025-02-08T20:48:28-08:00 INFO Reading history from database: domain shook.rocks owner nas ipv4
2025-02-08T20:48:28-08:00 INFO [http server] http server listening on [::]:8000
2025-02-08T20:48:28-08:00 INFO [backup] disabled
2025-02-08T20:48:28-08:00 INFO ipv4 address of nas.shook.rocks is 35.81.246.46, 44.234.3.221 and your ipv4 address is 50.39.235.211
2025-02-08T20:48:28-08:00 INFO Updating record [domain: shook.rocks | owner: nas | provider: porkbun | ip: ipv4] to use 50.39.235.211
^^2025/02/08 21:06:37 "GET http://hewasthenas.local:8000/ HTTP/1.1" from 192.168.68.66:45146 - 200 2481B in 8.523442ms
2025/02/08 21:06:38 "GET http://hewasthenas.local:8000/static/styles.css HTTP/1.1" from 192.168.68.66:45146 - 200 3203B in 19.934002ms
2025/02/08 21:06:38 "GET http://hewasthenas.local:8000/static/favicon.svg HTTP/1.1" from 192.168.68.66:45146 - 200 3192B in 268.545µs

Configuration file (remove your credentials!):

{
  "settings": [
    {
      "provider": "porkbun",
      "domain": "nas.shook.rocks",
      "api_key": "pk1_",
      "secret_api_key": "sk1_",
      "ip_version": "ipv4",
      "ipv6_suffix": ""
    }
  ]
}

Host OS:
Linux 4.4.302+ #72806 SMP Thu Sep 5 13:44:44 CST 2024 x86_64 GNU/Linux synology_geminilake_224+

Originally created by @mwshook on GitHub (Feb 9, 2025). <!-- YOU CAN CHAT THERE EVENTUALLY: https://github.com/qdm12/ddns-updater/discussions --> Running the binary creates a config.json file in a location inconsistent with the README instructions 1. Is this urgent: Yes 2. DNS provider(s) you use: Porkbun 3. Program version: <!-- See the line at the top of your logs --> `2.9.0 built on 2024-12-24T10:43:16Z (commit 78f30614b1d085ef6bfbfce92b0e45ca0204f42a)` 4. What are you using to run the container: no container. Standalone binary ddns-updater_2.9.0_linux_amd64 5. Extra information: Desired behavior: I create `config.json` per the README, put it in the directory `data`, run `ddns-updater`, it finds the config and parses it Observed behavior: ddns-updater finds `data`, creates a new `data` inside of it, creates a blank `config.json` inside the nested `data` . Following the README instructions, I made a `data` directory in the same directory with the ddns-updater binary. I put a `config.json` file inside `data` following the instructions for my provider, Porkbun. I was not able to get the domain to update. I then realized the problem was that the binary created a blank `config.json` inside of a new `data` directory inside of the `data` directory I created. I copied my config in place of the blank one and now everything works correctly. Tree output showing the files and directories created: ``` madmin@HeWasTheNAS ~/bin> tree d* data ├── config.json └── data ├── config.json └── updates.json ddns-updater_2.9.0_linux_amd64 [error opening dir] 2 directories, 4 files ``` Logs: ``` madmin@HeWasTheNAS ~/b/data> ddns-updater_2.9.0_linux_amd64 ======================================== ======================================== ============= ddns-updater ============= ======================================== =========== Made with ❤️ by ============ ======= https://github.com/qdm12 ======= ======================================== ======================================== Running version 2.9.0 built on 2024-12-24T10:43:16Z (commit 78f30614b1d085ef6bfbfce92b0e45ca0204f42a) 🔧 Need help? ☕ Discussion? https://github.com/qdm12/ddns-updater/discussions/new/choose 🐛 Bug? ✨ New feature? https://github.com/qdm12/ddns-updater/issues/new/choose 💻 Email? quentin.mcgaw@gmail.com 💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12 2025-02-08T20:48:27-08:00 INFO Settings summary: ├── HTTP client | └── Timeout: 20s ├── Update | ├── Period: 10m0s | └── Cooldown: 5m0s ├── Public IP fetching | ├── HTTP enabled: yes | ├── HTTP IP providers | | └── all | ├── HTTP IPv4 providers | | └── all | ├── HTTP IPv6 providers | | └── all | ├── DNS enabled: yes | ├── DNS timeout: 3s | └── DNS over TLS providers | └── all ├── Resolver: use Go default resolver ├── Server | ├── Listening address: :8000 | └── Root URL: / ├── Health | └── Server is disabled ├── Paths | ├── Data directory: ./data | ├── Config file: data/config.json | └── Umask: system default ├── Backup: disabled └── Logger ├── Level: INFO └── Caller: hidden 2025-02-08T20:48:27-08:00 INFO reading JSON config from file data/config.json 2025-02-08T20:48:27-08:00 INFO Found single setting to update record 2025-02-08T20:48:28-08:00 INFO Reading history from database: domain shook.rocks owner nas ipv4 2025-02-08T20:48:28-08:00 INFO [http server] http server listening on [::]:8000 2025-02-08T20:48:28-08:00 INFO [backup] disabled 2025-02-08T20:48:28-08:00 INFO ipv4 address of nas.shook.rocks is 35.81.246.46, 44.234.3.221 and your ipv4 address is 50.39.235.211 2025-02-08T20:48:28-08:00 INFO Updating record [domain: shook.rocks | owner: nas | provider: porkbun | ip: ipv4] to use 50.39.235.211 ^^2025/02/08 21:06:37 "GET http://hewasthenas.local:8000/ HTTP/1.1" from 192.168.68.66:45146 - 200 2481B in 8.523442ms 2025/02/08 21:06:38 "GET http://hewasthenas.local:8000/static/styles.css HTTP/1.1" from 192.168.68.66:45146 - 200 3203B in 19.934002ms 2025/02/08 21:06:38 "GET http://hewasthenas.local:8000/static/favicon.svg HTTP/1.1" from 192.168.68.66:45146 - 200 3192B in 268.545µs ``` Configuration file (**remove your credentials!**): ``` { "settings": [ { "provider": "porkbun", "domain": "nas.shook.rocks", "api_key": "pk1_", "secret_api_key": "sk1_", "ip_version": "ipv4", "ipv6_suffix": "" } ] } ``` Host OS: Linux 4.4.302+ #72806 SMP Thu Sep 5 13:44:44 CST 2024 x86_64 GNU/Linux synology_geminilake_224+
Author
Owner

@kankaristo commented on GitHub (Feb 20, 2025):

madmin@HeWasTheNAS ~/b/data> ddns-updater_2.9.0_linux_amd64

Looks like you're running ddns-updater inside of the data directory. It's looking for a data directory inside the current working directory, and when it can't find one, it creates it. The name of the working directory does not matter, it just happens to be called data as well.

So, looks like it's working as intended. You can run it one directory up, and you won't get that nested data/data directory.

@kankaristo commented on GitHub (Feb 20, 2025): > `madmin@HeWasTheNAS ~/b/data> ddns-updater_2.9.0_linux_amd64` Looks like you're running `ddns-updater` inside of the `data` directory. It's looking for a data directory inside the current working directory, and when it can't find one, it creates it. The name of the working directory does not matter, it just happens to be called `data` as well. So, looks like it's working as intended. You can run it one directory up, and you won't get that nested `data/data` directory.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#495