Skip to content

Commit c745166

Browse files
committed
Introduction of PyFunceble v4.1.0 (Blue Duckling: Ixora)!
Fixed: * Fatal error when a DNS Name longer that 255 octets is given. * URL with scheme and port are no longer `INVALID`. * Encoding format of CSV. We now enforce UTF-8. (#291) * Restrict `python-box` version. (#294) New: * The abilitiy to use proxies. (#132) This include the usage of `socks5` for `.onion` test. * The `--max-http-retries` argument and logic. * The `--*-lookup-only` argument and logic. (#276) * The `--chancy-test` mode. It is a mode that break the multiprocessing safety in place to use the full potential of the machine. **WARNING**: This is dangerous. Use at your own risk. * When testing URL we now do a DNS lookup first. * The DNS Lookup Tool has a max depth of 60. This avoid infinite loop. * Domain registrars are now extracted from the WHOIS record and provided as part of the output datasets. (#272) * It is now possible to display the Top N registrar. (#272) * Multiprocessing-Safe HTTP/HTTPS requests. * SPECIAL rules: - *.dr.ag - * Workaround Y2K28 - until database vendors fix it. * A way to automate CLI demos. Improvement: * IPv6 format of DNS server was improved to accept brackets. * Regex of the WHOIS "decoder" are now case insensitive. * The way workers/processes are spawned and started. It is now possible to differ the startup of a process to a time in the future. * We now run against the inactive and autocontinue dataset when it is really necessary. * Our "self-healing" method to avoid false positive is now stronger. (#282) * The syntax checker does not only follow RFCs, it now tries to accept real world practices. (#282) * Documentation (thanks to @spirillen). Maintenance: * Deployment of AUR packages is now safer. * Added missing documentation of SPECIAL rules. * Fix typo. * It's 2022. Contributors: * @avatartw * @cdgriffith * @mitchellkrogza * @ryanbr * @spirillen * @veracioux
1 parent fb7eac3 commit c745166

File tree

338 files changed

+3373
-639
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

338 files changed

+3373
-639
lines changed

.github/workflows/dev.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,8 @@ jobs:
359359

360360
- name: Install dependencies
361361
run: |
362-
curl -LO "https://repo.archlinuxcn.org/x86_64/${patched_glibc}" && \
363-
bsdtar -C / -xvf "$patched_glibc" && \
364-
rm ${patched_glibc} && \
365362
pacman -Syu --needed --noconfirm && \
366-
pacman -S --needed --noconfirm git binutils pacman-contrib openssh rsync python python-setuptools
367-
env:
368-
patched_glibc: glibc-linux4-2.33-4-x86_64.pkg.tar.zst
363+
pacman -S --needed --noconfirm git binutils pacman-contrib openssh rsync python python-setuptools jq
369364
370365
- uses: actions/checkout@v2
371366
name: Clone repository
@@ -380,6 +375,15 @@ jobs:
380375
381376
latest=$(python3 setup.py --version)
382377
378+
if [[ $(python3 setup.py --name) == "PyFunceble-dev" ]]
379+
then
380+
licenseURL="https://raw.githubusercontent.com/funilrys/PyFunceble/dev/LICENSE"
381+
newURL=$(curl -s https://pypi.org/pypi/PyFunceble-dev/json | jq -r ".releases.\"${latest}\"[] | select(.filename | strings | test(\".tar\")).url")
382+
else
383+
licenseURL="https://raw.githubusercontent.com/funilrys/PyFunceble/master/LICENSE"
384+
newURL=$(curl -s https://pypi.org/pypi/PyFunceble/json | jq -r ".releases.\"${latest}\"[] | select(.filename | strings | test(\".tar\")).url")
385+
fi
386+
383387
git config --global user.name ${{ github.actor }}
384388
git config --global user.email ${{ secrets.GIT_EMAIL }}
385389
git clone ssh://[email protected]/pyfunceble-dev.git ${aurRepoDir}
@@ -398,6 +402,7 @@ jobs:
398402
399403
sed "/^pkgver=/s/.*/pkgver=${latest}/" -i PKGBUILD
400404
sed "/^pkgrel=/s/.*/pkgrel=1/" -i PKGBUILD
405+
sed "s,^source=(.*),source=('${newURL}' '${licenseURL}')," -i PKGBUILD
401406
402407
su makepkg -c "updpkgsums"
403408
su makepkg -c "makepkg --printsrcinfo" > .SRCINFO

.github/workflows/stable.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,8 @@ jobs:
269269

270270
- name: Install dependencies
271271
run: |
272-
mkdir -p /var/lib/pacman/
273-
pacman -Syu --noconfirm
274-
pacman -S --needed --noconfirm git binutils pacman-contrib openssh rsync python python-setuptools
272+
pacman -Syu --needed --noconfirm && \
273+
pacman -S --needed --noconfirm git binutils pacman-contrib openssh rsync python python-setuptools jq
275274
276275
- uses: actions/checkout@v2
277276
name: Clone repository
@@ -286,6 +285,15 @@ jobs:
286285
287286
latest=$(python3 setup.py --version)
288287
288+
if [[ $(python3 setup.py --name) == "PyFunceble-dev" ]]
289+
then
290+
licenseURL="https://raw.githubusercontent.com/funilrys/PyFunceble/dev/LICENSE"
291+
newURL=$(curl -s https://pypi.org/pypi/PyFunceble-dev/json | jq -r ".releases.\"${latest}\"[] | select(.filename | strings | test(\".tar\")).url")
292+
else
293+
licenseURL="https://raw.githubusercontent.com/funilrys/PyFunceble/master/LICENSE"
294+
newURL=$(curl -s https://pypi.org/pypi/PyFunceble/json | jq -r ".releases.\"${latest}\"[] | select(.filename | strings | test(\".tar\")).url")
295+
fi
296+
289297
git config --global user.name ${{ github.actor }}
290298
git config --global user.email ${{ secrets.GIT_EMAIL }}
291299
git clone ssh://[email protected]/pyfunceble.git ${aurRepoDir}
@@ -299,13 +307,12 @@ jobs:
299307
echo "Previous version: ${current}"
300308
echo "New version: ${latest}"
301309
302-
[[ "${current}" == "${latest}" ]] && exit 0
303-
304310
useradd makepkg
305311
chown makepkg:root . -R
306312
307313
sed "/^pkgver=/s/.*/pkgver=${latest}/" -i PKGBUILD
308314
sed "/^pkgrel=/s/.*/pkgrel=1/" -i PKGBUILD
315+
sed "s,^source=(.*),source=('${newURL}' '${licenseURL}')," -i PKGBUILD
309316
310317
su makepkg -c "updpkgsums"
311318
su makepkg -c "makepkg --printsrcinfo" > .SRCINFO

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175

176176
END OF TERMS AND CONDITIONS
177177

178-
Copyright 2017, 2018, 2019, 2020, 2021 Nissar Chababy
178+
Copyright 2017, 2018, 2019, 2020, 2022 Nissar Chababy
179179

180180
Licensed under the Apache License, Version 2.0 (the "License");
181181
you may not use this file except in compliance with the License.

PyFunceble/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
::
3535
3636
37-
Copyright 2017, 2018, 2019, 2020, 2021 Nissar Chababy
37+
Copyright 2017, 2018, 2019, 2020, 2022 Nissar Chababy
3838
3939
Licensed under the Apache License, Version 2.0 (the "License");
4040
you may not use this file except in compliance with the License.

PyFunceble/checker/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
::
3636
3737
38-
Copyright 2017, 2018, 2019, 2020, 2021 Nissar Chababy
38+
Copyright 2017, 2018, 2019, 2020, 2022 Nissar Chababy
3939
4040
Licensed under the Apache License, Version 2.0 (the "License");
4141
you may not use this file except in compliance with the License.

PyFunceble/checker/availability/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
::
3636
3737
38-
Copyright 2017, 2018, 2019, 2020, 2021 Nissar Chababy
38+
Copyright 2017, 2018, 2019, 2020, 2022 Nissar Chababy
3939
4040
Licensed under the Apache License, Version 2.0 (the "License");
4141
you may not use this file except in compliance with the License.

PyFunceble/checker/availability/base.py

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
::
3636
3737
38-
Copyright 2017, 2018, 2019, 2020, 2021 Nissar Chababy
38+
Copyright 2017, 2018, 2019, 2020, 2022 Nissar Chababy
3939
4040
Licensed under the Apache License, Version 2.0 (the "License");
4141
you may not use this file except in compliance with the License.
@@ -513,12 +513,23 @@ def subject_propagator(self) -> "CheckerBase":
513513
def should_we_continue_test(self, status_post_syntax_checker: str) -> bool:
514514
"""
515515
Checks if we are allowed to continue a standard testing.
516+
517+
Rules:
518+
1. No status available yet. Continue to next test method.
519+
2. Status is/still INVALID. Continue to next test method.
520+
3. Above are False. Not allowed to continue to next test method.
516521
"""
517522

518-
return bool(
519-
not self.status.status
520-
or status_post_syntax_checker == PyFunceble.storage.STATUS.invalid
521-
)
523+
if not self.status.status:
524+
return True
525+
526+
if (
527+
status_post_syntax_checker == PyFunceble.storage.STATUS.invalid
528+
and self.status.status == PyFunceble.storage.STATUS.invalid
529+
):
530+
return True
531+
532+
return False
522533

523534
def guess_and_set_use_extra_rules(self) -> "AvailabilityCheckerBase":
524535
"""
@@ -663,6 +674,9 @@ def query_syntax_checker(self) -> "AvailabilityCheckerBase":
663674
def query_dns_record(self) -> Optional[Dict[str, Optional[List[str]]]]:
664675
"""
665676
Tries to query the DNS record(s) of the given subject.
677+
678+
.. versionchanged:: 4.1.0b8.dev
679+
Lookup order relative to actual subject.
666680
"""
667681

668682
PyFunceble.facility.Logger.info(
@@ -672,14 +686,16 @@ def query_dns_record(self) -> Optional[Dict[str, Optional[List[str]]]]:
672686

673687
result = {}
674688

675-
if self.status.subdomain_syntax:
689+
if self.status.idna_subject != self.dns_query_tool.subject:
690+
self.domain_syntax_checker.set_subject(self.dns_query_tool.subject)
691+
self.ip_syntax_checker.set_subject(self.dns_query_tool.subject)
692+
693+
if self.domain_syntax_checker.is_valid_subdomain():
676694
lookup_order = ["NS", "A", "AAAA", "CNAME", "DNAME"]
677-
elif self.status.domain_syntax:
678-
lookup_order = ["NS", "CNAME", "A", "AAAA", "DNAME"]
679-
elif self.status.ip_syntax:
695+
elif self.ip_syntax_checker.is_valid():
680696
lookup_order = ["PTR"]
681697
else:
682-
lookup_order = []
698+
lookup_order = ["NS", "CNAME", "A", "AAAA", "DNAME"]
683699

684700
if lookup_order:
685701
for record_type in lookup_order:
@@ -692,6 +708,11 @@ def query_dns_record(self) -> Optional[Dict[str, Optional[List[str]]]]:
692708

693709
break
694710

711+
if self.status.idna_subject != self.dns_query_tool.subject:
712+
# Switch back subject because we don't want to break subsequential calls.
713+
self.domain_syntax_checker.set_subject(self.status.idna_subject)
714+
self.ip_syntax_checker.set_subject(self.status.idna_subject)
715+
695716
PyFunceble.facility.Logger.debug("DNS Record:\n%r", result)
696717

697718
PyFunceble.facility.Logger.info(
@@ -741,9 +762,8 @@ def try_to_query_status_from_whois(
741762
if not known_record:
742763
# We assume that expired dataset are never saved into the
743764
# dataset.
744-
self.status.expiration_date = (
745-
self.whois_query_tool.get_expiration_date()
746-
)
765+
self.status.expiration_date = self.whois_query_tool.expiration_date
766+
self.status.registrar = self.whois_query_tool.lookup_record.registrar
747767
self.status.whois_record = self.whois_query_tool.lookup_record.record
748768

749769
if (
@@ -766,9 +786,11 @@ def try_to_query_status_from_whois(
766786
)
767787
else:
768788
self.status.expiration_date = known_record["expiration_date"]
789+
self.status.registrar = known_record["registrar"]
769790
self.status.whois_record = None
770791
else:
771-
self.status.expiration_date = self.whois_query_tool.get_expiration_date()
792+
self.status.expiration_date = self.whois_query_tool.expiration_date
793+
self.status.registrar = self.whois_query_tool.lookup_record.registrar
772794
self.status.whois_record = self.whois_query_tool.lookup_record.record
773795

774796
if self.status.expiration_date:
@@ -790,11 +812,14 @@ def try_to_query_status_from_whois(
790812
def try_to_query_status_from_dns(self) -> "AvailabilityCheckerBase":
791813
"""
792814
Tries to query the status from the DNS lookup.
815+
816+
.. versionchanged:: 4.1.0b7.dev
817+
Logging return the correct subject.
793818
"""
794819

795820
PyFunceble.facility.Logger.info(
796821
"Started to try to query the status of %r from: DNS Lookup",
797-
self.status.idna_subject,
822+
self.dns_query_tool.subject,
798823
)
799824

800825
lookup_result = self.query_dns_record()
@@ -806,12 +831,12 @@ def try_to_query_status_from_dns(self) -> "AvailabilityCheckerBase":
806831

807832
PyFunceble.facility.Logger.info(
808833
"Could define the status of %r from: DNS Lookup",
809-
self.status.idna_subject,
834+
self.dns_query_tool.subject,
810835
)
811836

812837
PyFunceble.facility.Logger.info(
813838
"Finished to try to query the status of %r from: DNS Lookup",
814-
self.status.idna_subject,
839+
self.dns_query_tool.subject,
815840
)
816841

817842
return self

PyFunceble/checker/availability/domain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
::
3636
3737
38-
Copyright 2017, 2018, 2019, 2020, 2021 Nissar Chababy
38+
Copyright 2017, 2018, 2019, 2020, 2022 Nissar Chababy
3939
4040
Licensed under the Apache License, Version 2.0 (the "License");
4141
you may not use this file except in compliance with the License.

PyFunceble/checker/availability/domain_and_ip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
::
3636
3737
38-
Copyright 2017, 2018, 2019, 2020, 2021 Nissar Chababy
38+
Copyright 2017, 2018, 2019, 2020, 2022 Nissar Chababy
3939
4040
Licensed under the Apache License, Version 2.0 (the "License");
4141
you may not use this file except in compliance with the License.

PyFunceble/checker/availability/extra_rules.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
::
3636
3737
38-
Copyright 2017, 2018, 2019, 2020, 2021 Nissar Chababy
38+
Copyright 2017, 2018, 2019, 2020, 2022 Nissar Chababy
3939
4040
Licensed under the Apache License, Version 2.0 (the "License");
4141
you may not use this file except in compliance with the License.
@@ -85,9 +85,11 @@ def __init__(self, status: Optional[AvailabilityCheckerStatus] = None) -> None:
8585
(self.__switch_to_down_if, 410),
8686
],
8787
r"\.24\.eu$": [(self.__switch_to_down_if, 503)],
88+
r"\.altervista\.org$": [(self.__switch_to_down_if, 403)],
8889
r"\.angelfire\.com$": [(self.__switch_to_down_if, 404)],
8990
r"\.blogspot\.": [self.__handle_blogspot],
9091
r"\.canalblog\.com$": [(self.__switch_to_down_if, 404)],
92+
r"\.dr\.ag$": [(self.__switch_to_down_if, 503)],
9193
r"\.fc2\.com$": [self.__handle_fc2_dot_com],
9294
r"\.github\.io$": [(self.__switch_to_down_if, 404)],
9395
r"\.godaddysites\.com$": [(self.__switch_to_down_if, 404)],

0 commit comments

Comments
 (0)