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

Update teleporter.php to load an archive from the command line #2449

Closed

Conversation

iain-henderson
Copy link

@iain-henderson iain-henderson commented Dec 8, 2022

Thank you for your contribution to the Pi-hole Community!

Please read the comments below to help us consider your Pull Request.

We are all volunteers and completing the process outlined will help us review your commits quicker.

Please make sure you

  1. Base your code and PRs against the repositories developmental branch.
  2. Sign Off all commits as we enforce the DCO for all contributions
  3. Sign all your commits as they must have verified signatures
  4. File a pull request for any change that requires changes to our documentation at our documentation repo

What does this PR aim to accomplish?:

This PR enhances teleporter.php so that it can restore an archive from the command line.

How does this PR accomplish the above?:

Two steps:

  1. Move the logic to load a teleporter archive to it's own method
  2. Add the necessary logic to call that method when an argument is supplied to teleporter.php

Link documentation PRs if any are needed to support this PR:

pi-hole/docs#818


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • [ x] I have read the above and my PR is ready for review. Check this box to confirm

@yubiuser
Copy link
Member

yubiuser commented Dec 8, 2022

There are some errors reported by the php-cs-fixer. Could you address those please.

__

I'll take care of fixing the PHPStan.

@iain-henderson
Copy link
Author

SHould be fixed now, sorry about that.

@yubiuser
Copy link
Member

yubiuser commented Dec 8, 2022

This should fix phpstan: #2450

Once it's merged, please rebase your PR on devel

@yubiuser
Copy link
Member

yubiuser commented Dec 8, 2022

I think it would be nice if you would also make changes to the core repo, as currently pihole -a -t filename will create a backup with [filename].

https://github.com/pi-hole/pi-hole/blob/a4e20f79a34bcc43f3c1063a999a929bfa52a7d4/advanced/Scripts/webpage.sh#L605-L617

We could have a option like pihole -a -t -restore filename

@iain-henderson
Copy link
Author

My plan was to make this change, then the change to pihole, then document the new functionality.

@yubiuser yubiuser requested a review from a team December 9, 2022 20:26
@yubiuser
Copy link
Member

yubiuser commented Dec 9, 2022

Please write the change to pihole and the documentation now. The former will allow for easier testing and the latter will prevent forgetting the documentation at all.

@iain-henderson
Copy link
Author

pihole updates are in pi-hole/pi-hole#5064

scripts/pi-hole/php/teleporter.php Outdated Show resolved Hide resolved
scripts/pi-hole/php/teleporter.php Outdated Show resolved Hide resolved
scripts/pi-hole/php/teleporter.php Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2023

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@yubiuser
Copy link
Member

yubiuser commented Feb 3, 2023

Thanks for your PR and for keeping it up-to-date. However, things are moving fast and the development of Pi-hole v6 is "advanced" already. FTL will include its own webserver and PHP engine and a lot of things will get removed from the web part of Pi-hole and moved into the FTL realm. We picked up your idea and it's already implemented.
pi-hole/FTL@904e1c7

@github-actions
Copy link
Contributor

Conflicts have been resolved.

Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash all your commits down.

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the stale label Apr 17, 2023
@github-actions
Copy link
Contributor

Existing merge conflicts have not been addressed. This PR is considered abandoned.

@github-actions github-actions bot closed this Apr 17, 2023
@iain-henderson
Copy link
Author

Are these changes worth pursuing or is the implementation in v6 sufficient?

@yubiuser
Copy link
Member

Personally, I think the changes in v6 are sufficient. As your code is php is pretty much will be removed with the transition anyway as we want to get rid of php

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

Successfully merging this pull request may close these issues.

None yet

3 participants