Skip to content

Commit

Permalink
Merge pull request #400 from internetstandards/dev
Browse files Browse the repository at this point in the history
fix #396
  • Loading branch information
stitch authored Jan 23, 2023
2 parents 12efe7d + 231d724 commit 54aedbd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def translate_field(field_label, translation_dictionary: Dict[str, str]):
'internet_nl_web_https_tls_keyexchangehash': 'detail_web_tls_kex_hash_func_label',
'internet_nl_web_rpki_exists': 'detail_web_rpki_exists_label',
'internet_nl_web_rpki_valid': 'detail_web_rpki_valid_label',
'internet_nl_web_ns_rpki_exists': 'detail_web_mail_rpki_ns_valid_label',
'internet_nl_web_ns_rpki_exists': 'detail_web_mail_rpki_ns_exists_label',
'internet_nl_web_ns_rpki_valid': 'detail_web_mail_rpki_ns_valid_label',

'internet_nl_web_rpki': 'test_siterpki_label',
Expand Down
16 changes: 8 additions & 8 deletions dashboard/internet_nl_dashboard/logic/report_to_spreadsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@

from dashboard.internet_nl_dashboard.logic import ( # pylint: disable=duplicate-code
MAIL_AUTH_CATEGORY, MAIL_AUTH_FIELDS, MAIL_DNSSEC_CATEGORY, MAIL_DNSSEC_FIELDS,
MAIL_IPV6_CATEGORY, MAIL_IPV6_FIELDS, MAIL_LEGACY_CATEGORY, MAIL_LEGACY_FIELDS,
MAIL_OVERALL_FIELDS, MAIL_RPKI_CATEGORY, MAIL_RPKI_FIELDS, MAIL_TLS_CATEGORY,
MAIL_TLS_CERTIFICATE_FIELDS, MAIL_TLS_DANE_FIELDS, MAIL_TLS_TLS_FIELDS, WEB_APPSECPRIV_CATEGORY,
WEB_APPSECPRIV_FIELDS, WEB_DNSSEC_CATEGORY, WEB_DNSSEC_FIELDS, WEB_IPV6_CATEGORY,
WEB_IPV6_FIELDS, WEB_LEGACY_CATEGORY, WEB_LEGACY_FIELDS, WEB_OVERALL_FIELDS, WEB_RPKI_CATEGORY,
WEB_RPKI_FIELDS, WEB_TLS_CATEGORY, WEB_TLS_CERTIFICATE_FIELDS, WEB_TLS_DANE_FIELDS,
WEB_TLS_HTTP_FIELDS, WEB_TLS_TLS_FIELDS)
MAIL_IPV6_CATEGORY, MAIL_IPV6_FIELDS, MAIL_LEGACY_FIELDS, MAIL_OVERALL_FIELDS,
MAIL_RPKI_CATEGORY, MAIL_RPKI_FIELDS, MAIL_TLS_CATEGORY, MAIL_TLS_CERTIFICATE_FIELDS,
MAIL_TLS_DANE_FIELDS, MAIL_TLS_TLS_FIELDS, WEB_APPSECPRIV_CATEGORY, WEB_APPSECPRIV_FIELDS,
WEB_DNSSEC_CATEGORY, WEB_DNSSEC_FIELDS, WEB_IPV6_CATEGORY, WEB_IPV6_FIELDS, WEB_LEGACY_CATEGORY,
WEB_LEGACY_FIELDS, WEB_OVERALL_FIELDS, WEB_RPKI_CATEGORY, WEB_RPKI_FIELDS, WEB_TLS_CATEGORY,
WEB_TLS_CERTIFICATE_FIELDS, WEB_TLS_DANE_FIELDS, WEB_TLS_HTTP_FIELDS, WEB_TLS_TLS_FIELDS)
from dashboard.internet_nl_dashboard.logic.internet_nl_translations import (get_po_as_dictionary_v2,
translate_field)
from dashboard.internet_nl_dashboard.models import Account, UrlListReport
Expand Down Expand Up @@ -74,7 +73,8 @@

'rpki': MAIL_RPKI_CATEGORY + MAIL_RPKI_FIELDS,

'legacy': MAIL_LEGACY_CATEGORY + MAIL_LEGACY_FIELDS
# #358 MAIL_LEGACY_CATEGORY is useless
'legacy': MAIL_LEGACY_FIELDS
},
}

Expand Down
5 changes: 2 additions & 3 deletions dashboard/internet_nl_dashboard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pytz
import requests
from constance import config
from cryptography.fernet import Fernet
from django.conf import settings
from django.contrib.auth.models import User
Expand All @@ -19,8 +20,6 @@

log = logging.getLogger(__package__)

CREDENTIAL_CHECK_URL = "https://batch.internet.nl/api/"


class Account(models.Model):
"""
Expand Down Expand Up @@ -82,7 +81,7 @@ def connect_to_internet_nl_api(username: str, password: str):
# This makes a connection to the internet.nl dashboard using .htaccess authentication.
try:
response = requests.get(
CREDENTIAL_CHECK_URL,
config.CREDENTIAL_CHECK_URL,
auth=HTTPBasicAuth(username, password),
# a massive timeout for a large file.
timeout=(5, 5)
Expand Down
10 changes: 7 additions & 3 deletions dashboard/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,8 @@
"SECURITY_TXT_IS_REDIRECTED": (False, "When a redirect is used, it will not show the content anymore.", bool),
"SECURITY_TXT_REDIRECT_URL": ("", "The url where security.txt resides", str),
"SECURITY_TXT_CONTENT": ("", "The content of the security.txt file, located at .well-known/security.txt", str),
"CREDENTIAL_CHECK_URL": ("https://batch.internet.nl/api/", "The url where internet.nl api credentials are checked. "
"This is usually the api endpoint.", str)
}

CONSTANCE_CONFIG_FIELDSETS = OrderedDict(
Expand All @@ -540,7 +542,9 @@
'EMAIL_DASHBOARD_ADDRESS')),
('Internet.nl Scans', ('SCAN_AT_ALL', 'INTERNET_NL_API_USERNAME', 'INTERNET_NL_API_PASSWORD',
'INTERNET_NL_API_URL',
'INTERNET_NL_MAXIMUM_URLS', 'SCAN_TIMEOUT_MINUTES_DISCOVERING_ENDPOINTS',
'INTERNET_NL_MAXIMUM_URLS',
"CREDENTIAL_CHECK_URL",
'SCAN_TIMEOUT_MINUTES_DISCOVERING_ENDPOINTS',
'SCAN_TIMEOUT_MINUTES_RETRIEVING_SCANABLE_URLS',
'SCAN_TIMEOUT_MINUTES_REGISTERING_SCAN_AT_INTERNET_NL',
'SCAN_TIMEOUT_MINUTES_IMPORTING_SCAN_RESULTS', 'SCAN_TIMEOUT_MINUTES_CREATING_REPORT',
Expand Down Expand Up @@ -640,8 +644,8 @@
SENTRY_DSN = os.environ.get('SENTRY_DSN')
if SENTRY_DSN:
# new sentry_sdk implementation, with hopes to also get exceptions from workers.
sentry_sdk.init(dsn=SENTRY_DSN, integrations=[CeleryIntegration(), DjangoIntegration(),
RedisIntegration()],
sentry_sdk.init(dsn=SENTRY_DSN, # pylint: disable=abstract-class-instantiated # (following the documentation)
integrations=[CeleryIntegration(), DjangoIntegration(), RedisIntegration()],
release=__version__, send_default_pii=False)

SENTRY_ORGANIZATION = 'internet-cleanup-foundation'
Expand Down

0 comments on commit 54aedbd

Please sign in to comment.