pi-hole / web

Pi-hole Dashboard for stats and more
https://pi-hole.net
Other
1.97k stars 548 forks source link

CNAME records not imported to v6 from v5 Teleport file #2964

Open iTim314 opened 5 months ago

iTim314 commented 5 months ago

Versions

Platform

Expected behavior

I stood up a fresh instance of Pi-hole v6 Development and imported my v5 Teleport file. I expected all settings to import.

Actual behavior / bug

None of my 22 CNAME records imported. I understand the mechanism that stores CNAMEs is very different now. pihole.toml shows only this:
cnameRecords = []

Steps to reproduce

Steps to reproduce the behavior:

  1. From Pi-hole v5, create a CNAME record.
  2. Export Teleport backup.
  3. Import Teleport backup into a v6 instance.
  4. Observe no CNAMEs imported.

Debug Token

DL6ER commented 5 months ago

Thanks for your report, indeed, handling the legacy CNAME records file was missing in the v5 Teleporter import routines. Unfortunately, I don't have a full archive myself which I could use for testing. But I guess you could give me a hand on this one?

Please run

pihole checkout ftl fix/teleporter_v5_cnames

and test importing your archive again. The CNAME records should now be imported. If not, then something more fundamental is missing and I will need a demo archive to find this out myself.

edit Please note that the binary will only be available in about 20-30 minutes after I post this message. So long, harmless errors are expected when you run the checkout command.

iTim314 commented 5 months ago

It looks like that's not possible since I'm using a Docker image.

dns3:/# pihole checkout ftl fix/teleporter_v5_cnames
Function not supported in Docker images
PromoFaux commented 5 months ago

V6 containers have the checkout command disabled, but if I'm reading the issue correctly you need to run this in a v5 container (in which checkout is enabled) and then export as it is the v5 code that needs fixing to include the records that are missing from your export.

Then you should be able to import that file into the V6 container

Disregard, Speaking to @DL6ER he points out it is meant for a v6 container.

In order to use custom branches in a v6 container, you need to rebuild locally. See this section of the v6 readme:

https://github.com/pi-hole/docker-pi-hole/tree/development-v6?tab=readme-ov-file#building-an-image-with-alternative-component-branches

But in short, clone the repo locally, then issue the following command:

docker buildx build src/. --tag pihole_custom --build-arg FTL_BRANCH=fix/teleporter_v5_cnames --no-cache

then drop pihole_custom into your compose file in place of pihole/pihole:development-v6

iTim314 commented 5 months ago
docker buildx build src/. --tag pihole_custom --build-arg FTL_BRANCH=fix/teleporter_v5_cnames --no-cache

I don't understand why, but this command will not work. Docker is claiming that the --tag (or -t) is invalid. I've run docker build hundreds of times with the --tag flag without issue, and just ran it again for another build.

I cloned the repo using gh repo clone pi-hole/docker-pi-hole into the directory repo. Then ran docker buildx build repo/src/. --tag custom-pihole-v6 --build-arg FTL_BRANCH=fix/teleporter_v5_cnames --no-cache.

Result:

unknown flag: --tag
See 'docker --help'.
PromoFaux commented 2 months ago

Sorry for the VERY delayed response here... life has been quite hectic.

I have since added a simplified build command to the docker repo (documentation here) which should simplify the command to:

./build.sh -t custom-pihole-v6 -f fix/teleporter_v5_cnames