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

Introduce a function to extract all includes from bind configuration file #81

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

SandakovMM
Copy link
Contributor

No description provided.

@SandakovMM SandakovMM force-pushed the handle-all-included-files branch 2 times, most recently from 2408550 to 60a2846 Compare October 2, 2024 12:51
pleskdistup/common/src/dns.py Outdated Show resolved Hide resolved
pleskdistup/common/src/dns.py Outdated Show resolved Hide resolved
pleskdistup/common/tests/dnstests.py Show resolved Hide resolved
@SandakovMM
Copy link
Contributor Author

We need to support chroot because we store all named configurations in a chroot environment for named (/var/named/chroot/)

pleskdistup/common/src/dns.py Outdated Show resolved Hide resolved
pleskdistup/common/src/dns.py Outdated Show resolved Hide resolved
pleskdistup/common/src/dns.py Outdated Show resolved Hide resolved
pleskdistup/common/tests/dnstests.py Show resolved Hide resolved
pleskdistup/common/tests/dnstests.py Show resolved Hide resolved
pleskdistup/common/tests/dnstests.py Show resolved Hide resolved
vizovitin
vizovitin previously approved these changes Oct 3, 2024
Copy link
Contributor

@vizovitin vizovitin left a comment

Choose a reason for hiding this comment

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

Please rebase before merge.

includes: typing.List[str] = []

def get_all_includes_from_bind_config(config_file: str, chroot_dir: str = "") -> List[str]:
includes: List[str] = []

if config_file.startswith("/"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: there's os.path.isabs() for that.

…file

It should support chroot directories because we
use chroot environment for bind configurations in plesk.

Also we should not encounter relative paths in include directives
because bind handles they in a preatty specific way
(starting from the directory bind was started)
@SandakovMM SandakovMM merged commit 03e451d into main Oct 4, 2024
3 checks passed
@SandakovMM SandakovMM deleted the handle-all-included-files branch October 4, 2024 06:00
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 this pull request may close these issues.

2 participants