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

How to update both the domain and subdomain through docker compose? #46

Closed
chlodowich opened this issue Mar 19, 2024 · 8 comments · Fixed by #47
Closed

How to update both the domain and subdomain through docker compose? #46

chlodowich opened this issue Mar 19, 2024 · 8 comments · Fixed by #47

Comments

@chlodowich
Copy link

chlodowich commented Mar 19, 2024

Hello! As mentioned here #19 , multiple concurrent updates seem implemented.

However, after setting up docker compose with the environment variables as so:
"DOMAIN=my.domain",
"SUBDOMAINS=*",

only the A record of *.my.domain is getting updated , while my.domain is not. I am not very tech savvy, so there's probably something I am missing here.

@mietzen
Copy link
Owner

mietzen commented Mar 19, 2024

Try:

SUBDOMAINS: "@,my_other_subdomain,my_subsubdomain.my_subdomain"

For more Infos, see: #7 (comment)

As I am not really an expert on DNS, could you explain what the @ sign means? Indeed, everything seems to work now, when I specify the @ sign for the subdomains environment variable. Before I just left it empty.

The "@" symbol is a placeholder used to represent "the current domain" as in root domain.

@ A free standing @ is used to denote the current origin. [0]

It's handy if you want to set the root domain and subdomains. But I also tested it without subdomain, you should also be able to leave it empty.

[0] RFC1035 - Page 35

@mietzen
Copy link
Owner

mietzen commented Mar 19, 2024

I updated the readme, if you have still have trouble updating the root domain please reopen the issue.

@chlodowich
Copy link
Author

thank you so much! Indeed, this fixed it :)

@kandykarter
Copy link

Is there a way I can use the "@" to configure my root domain, while still using the wildcard? I tried "SUBDOMAINS: "@,*" and it didn't seem to help.

@mietzen
Copy link
Owner

mietzen commented Apr 2, 2024

@kandykarter, This works, just test it:

version: "3"
services:
  porkbun-ddns:
    image: "mietzen/porkbun-ddns:latest"
    container_name: porkbun-ddns
    environment:
      DOMAIN: "my-domain.com" # Your Porkbun domain
      SUBDOMAINS: '@,*' # Subdomains comma spreaded
      SECRETAPIKEY: "xxx" # Your Porkbun Secret-API-Key
      APIKEY: "xxx" # Your Porkbun API-Key
    restart: unless-stopped
porkbun-ddns  | 2024-04-02 17:22:12,094 DEBUG    Create new record, with:
porkbun-ddns  | {"name": "my-domain.com", "type": "A", "content": "1.2.3.4"}
porkbun-ddns  | 2024-04-02 17:22:13,797 INFO     Creating A-Record for my-domain.com with content: 1.2.3.4, Status: SUCCESS
porkbun-ddns  | 2024-04-02 17:22:16,222 DEBUG    Create new record, with:
porkbun-ddns  | {"name": "*.my-domain.com", "type": "A", "content": "1.2.3.4"}
porkbun-ddns  | 2024-04-02 17:22:17,937 INFO     Creating A-Record for *.my-domain.com with content: 1.2.3.4, Status: SUCCESS
porkbun-ddns  | 2024-04-02 17:22:19,338 INFO     Sleeping... 300s

image

Please test it again, if it still fails open a new issue including the content of your docker-compose.yml file and the log output of docker compose up

@kandykarter
Copy link

Oh, weird! Will try it again, maybe I just messed something up somewhere. Thanks for the quick response!

@kandykarter
Copy link

I had it set in reverse before ("*,@"), but setting it like in your example seems to have worked! Weird! Thanks for the help.

@mietzen
Copy link
Owner

mietzen commented Apr 2, 2024

@kandykarter yes that is a bug, I fixed it in #49

Edit: I will release a fixed version after I merged #48

@mietzen mietzen mentioned this issue Apr 2, 2024
mietzen added a commit that referenced this issue Apr 2, 2024
This PR addresses a bug identified by @kandykarter #46 (comment) , where the order of the root domain handle @ determines whether it is set or not.

Additionally, another bug was fixed where all records of a domain were deleted, not just A and AAAA records.
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

Successfully merging a pull request may close this issue.

3 participants