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

Support IPv6 when downloading firmware images #673

Closed
mkrueger92 opened this issue Feb 5, 2025 · 2 comments · Fixed by #681
Closed

Support IPv6 when downloading firmware images #673

mkrueger92 opened this issue Feb 5, 2025 · 2 comments · Fixed by #681

Comments

@mkrueger92
Copy link
Contributor

Hi,

first of all, great project!

When running zigbee2mqtt in a IPv6 environment the firmware update is currently not possible.

The index files can be downloaded because the URL is hardcoded to this:
https://github.com/Koenkk/zigbee-herdsman-converters/blob/b91e0a8e60be1850f9d6bf10cbf47c23f10e0dcc/src/lib/ota.ts#L96
It references "raw.githubusercontent.com" which resolved to

~$ host raw.githubusercontent.com
raw.githubusercontent.com has address 185.199.108.133
raw.githubusercontent.com has address 185.199.111.133
raw.githubusercontent.com has address 185.199.109.133
raw.githubusercontent.com has address 185.199.110.133
raw.githubusercontent.com has IPv6 address 2606:50c0:8000::154
raw.githubusercontent.com has IPv6 address 2606:50c0:8002::154
raw.githubusercontent.com has IPv6 address 2606:50c0:8001::154
raw.githubusercontent.com has IPv6 address 2606:50c0:8003::154

But the URLs in the index files all link to "https://github.com/Koenkk/zigbee-OTA/raw/...".
Unfortunately,

~$ host github.com
github.com has address 140.82.121.4
github.com mail is handled by 10 alt3.aspmx.l.google.com.
github.com mail is handled by 10 alt4.aspmx.l.google.com.
github.com mail is handled by 5 alt1.aspmx.l.google.com.
github.com mail is handled by 5 alt2.aspmx.l.google.com.
github.com mail is handled by 1 aspmx.l.google.com.

github.com resolves to IPv4 only.

Therefore, I propose to change

export const BASE_REPO_URL = `https://github.com/Koenkk/zigbee-OTA/raw/`;
from https://github.com/Koenkk/zigbee-OTA/raw/ to https://raw.githubusercontent.com/Koenkk/zigbee-OTA/.

That would solve some problems in IPv6 only environments.

Thanks for considering this.

@Koenkk
Copy link
Owner

Koenkk commented Feb 5, 2025

No problem, could you make a PR?

mkrueger92 added a commit to mkrueger92/zigbee-OTA that referenced this issue Feb 8, 2025
Fixes Koenkk#673

By using raw.githubusercontent.com over github.com it is possible to access files over IPv6. This helps in environments where IPv4 is not available.
mkrueger92 added a commit to mkrueger92/zigbee-OTA that referenced this issue Feb 8, 2025
@mkrueger92
Copy link
Contributor Author

@Koenkk: I have opened a PR as requested. Please have a look. Thanks for your effort.

mkrueger92 added a commit to mkrueger92/zigbee-OTA that referenced this issue Feb 10, 2025
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.

2 participants