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

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

Open
iTim314 opened this issue Feb 21, 2024 · 5 comments
Open

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

iTim314 opened this issue Feb 21, 2024 · 5 comments

Comments

@iTim314
Copy link

iTim314 commented Feb 21, 2024

Versions

  • Core: v6, c771739f
  • Web: v6, da7c0ef
  • FTL: v6, bffd2bd4

Platform

  • OS and version: Ubuntu 22 LTS
  • Platform: Docker

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
Copy link
Member

DL6ER commented Feb 21, 2024

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
Copy link
Author

iTim314 commented Feb 21, 2024

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
Copy link
Member

PromoFaux commented Feb 22, 2024

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
Copy link
Author

iTim314 commented Feb 27, 2024

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
Copy link
Member

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

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

No branches or pull requests

3 participants