From eb70f6a066cbcc8604ab5a7e2f1e64a72af95480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kate=C5=99ina=20Churanov=C3=A1?= Date: Sat, 11 Dec 2021 15:49:05 +0100 Subject: [PATCH 001/475] fix: making the key name in the config database unique --- ...add_unique_index_to_settings_table_keys.py | 24 +++++++++++++++++++ powerdnsadmin/models/setting.py | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 migrations/versions/b24bf17725d2_add_unique_index_to_settings_table_keys.py diff --git a/migrations/versions/b24bf17725d2_add_unique_index_to_settings_table_keys.py b/migrations/versions/b24bf17725d2_add_unique_index_to_settings_table_keys.py new file mode 100644 index 000000000..48cfbe956 --- /dev/null +++ b/migrations/versions/b24bf17725d2_add_unique_index_to_settings_table_keys.py @@ -0,0 +1,24 @@ +"""Add unique index to settings table keys + +Revision ID: b24bf17725d2 +Revises: 0967658d9c0d +Create Date: 2021-12-12 20:29:17.103441 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'b24bf17725d2' +down_revision = '0967658d9c0d' +branch_labels = None +depends_on = None + + +def upgrade(): + op.create_index(op.f('ix_setting_name'), 'setting', ['name'], unique=True) + + +def downgrade(): + op.drop_index(op.f('ix_setting_name'), table_name='setting') diff --git a/powerdnsadmin/models/setting.py b/powerdnsadmin/models/setting.py index a46cfb6bb..4b9bcc5e3 100644 --- a/powerdnsadmin/models/setting.py +++ b/powerdnsadmin/models/setting.py @@ -11,7 +11,7 @@ class Setting(db.Model): id = db.Column(db.Integer, primary_key=True) - name = db.Column(db.String(64)) + name = db.Column(db.String(64), unique=True, index=True) value = db.Column(db.Text()) defaults = { From f41696c31084f363a4c1c42c7b078e6a3fe8b3cd Mon Sep 17 00:00:00 2001 From: root Date: Mon, 18 Apr 2022 09:01:22 +0000 Subject: [PATCH 002/475] WIP - Added health check --- powerdnsadmin/lib/errors.py | 8 ++++++++ powerdnsadmin/routes/api.py | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/powerdnsadmin/lib/errors.py b/powerdnsadmin/lib/errors.py index 687f5543e..b82001755 100644 --- a/powerdnsadmin/lib/errors.py +++ b/powerdnsadmin/lib/errors.py @@ -171,3 +171,11 @@ def __init__(self, name=None, message="Delete of user failed"): StructuredException.__init__(self) self.message = message self.name = name + +class HealthCheckFail(StructuredException): + status_code = 500 + + def __init__(self,name=None, message="Health check failed"): + StructuredException.__init__(self) + self.message = message + self.name = name \ No newline at end of file diff --git a/powerdnsadmin/routes/api.py b/powerdnsadmin/routes/api.py index 4fce368ba..580e1a1c4 100644 --- a/powerdnsadmin/routes/api.py +++ b/powerdnsadmin/routes/api.py @@ -23,7 +23,7 @@ AccountCreateFail, AccountUpdateFail, AccountDeleteFail, AccountCreateDuplicate, AccountNotExists, UserCreateFail, UserCreateDuplicate, UserUpdateFail, UserDeleteFail, - UserUpdateFailEmail, + UserUpdateFailEmail, HealthCheckFail ) from ..decorators import ( api_basic_auth, api_can_create_domain, is_json, apikey_auth, @@ -1182,3 +1182,36 @@ def sync_domains(): domain = Domain() domain.update() return 'Finished synchronization in background', 200 + +@api_bp.route('/health', methods=['GET']) +def health(): + domain = Domain() + domain_to_query = domain.query.first() + + if not domain_to_query: + current_app.logger.error("No domain found to query a health check") + raise (HealthCheckFail) + + pdns_api_url = Setting().get('pdns_api_url') + pdns_api_key = Setting().get('pdns_api_key') + pdns_version = Setting().get('pdns_version') + api_uri_with_prefix = utils.pdns_api_extended_uri(pdns_version) + api_uri = '/servers/localhost/zones/{}'.format(domain_to_query.name) + headers = {} + headers['X-API-Key'] = pdns_api_key + + try: + resp = utils.fetch_remote(urljoin(pdns_api_url, api_uri_with_prefix + api_uri), + method='GET', + headers=headers, + accept='application/json; q=1', + verify=Setting().get('verify_ssl_connections')) + + except Exception as e: + current_app.logger.error("Health Check - Failed to query authoritative server for domain {}".format(domain_to_query.name)) + return make_response("bad", 503) + + if resp.status_code == 200: + return make_response("good", 200) + else: + return make_response("bad", 503) \ No newline at end of file From 4958423cc74a929f052f4da6dea9f684f33b5850 Mon Sep 17 00:00:00 2001 From: RGanor <44501230+RGanor@users.noreply.github.com> Date: Mon, 18 Apr 2022 22:11:31 +0300 Subject: [PATCH 003/475] Update api.py --- powerdnsadmin/routes/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/powerdnsadmin/routes/api.py b/powerdnsadmin/routes/api.py index 580e1a1c4..7ce363d0b 100644 --- a/powerdnsadmin/routes/api.py +++ b/powerdnsadmin/routes/api.py @@ -1214,4 +1214,5 @@ def health(): if resp.status_code == 200: return make_response("good", 200) else: - return make_response("bad", 503) \ No newline at end of file + return make_response("bad", 503) + From 40deb3c145619067ff20af15b4a0d0c589d33322 Mon Sep 17 00:00:00 2001 From: AdvanticGmbH Date: Wed, 6 Apr 2022 14:59:59 +0200 Subject: [PATCH 004/475] Create method to encode and decode idna MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously strings with characters like "ß" would throw and exception This seems to happen because the lib behind encode().decode('idna') cant handle characters like this --- powerdnsadmin/lib/utils.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/powerdnsadmin/lib/utils.py b/powerdnsadmin/lib/utils.py index 951f75009..9e7cf20cd 100644 --- a/powerdnsadmin/lib/utils.py +++ b/powerdnsadmin/lib/utils.py @@ -4,6 +4,7 @@ import requests import hashlib import ipaddress +import idna from collections.abc import Iterable from distutils.version import StrictVersion @@ -248,10 +249,27 @@ def pretty_domain_name(value): if value.startswith('xn--') \ or value.find('.xn--') != -1: try: - return value.encode().decode('idna') + return to_idna(value, 'decode') except: - raise Exception("Cannot decode IDN domain") + raise Exception('Cannot decode IDN domain') else: return value else: - raise Exception("Require the Punycode in string format") + raise Exception('Require the Punycode in string format') + +def to_idna(value, action): + splits = value.split() + result = [] + if action == 'encode': + for split in splits: + try: + # Try encoding to idna + result.append(idna.encode(split).decode()) + except idna.IDNAError: + result.append(split) + elif action == 'decode': + for split in splits: + result.append(idna.decode(split)) + else: + raise Exception('No valid action received') + return ' '.join(result) From 191e919626d396494c1197fa4405e158a6fc1251 Mon Sep 17 00:00:00 2001 From: AdvanticGmbH Date: Wed, 6 Apr 2022 17:01:28 +0200 Subject: [PATCH 005/475] Allow IDNA in SOA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Previously having characters like "ü" in the SOA wouldnt allow to push updates to the domain * Also use the new method to_idna to support characters like "ß" --- powerdnsadmin/models/record.py | 6 +++--- powerdnsadmin/routes/domain.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/powerdnsadmin/models/record.py b/powerdnsadmin/models/record.py index 9929b67b4..c19576aba 100644 --- a/powerdnsadmin/models/record.py +++ b/powerdnsadmin/models/record.py @@ -169,12 +169,12 @@ def build_rrsets(self, domain_name, submitted_records): record['record_data'] = record['record_data'].replace('[ZONE]', domain_name) # Translate record name into punycode (IDN) as that's the only way # to convey non-ascii records to the dns server - record['record_name'] = record['record_name'].encode('idna').decode() + record['record_name'] = utils.to_idna(record["record_name"], "encode") #TODO: error handling # If the record is an alias (CNAME), we will also make sure that # the target domain is properly converted to punycode (IDN) - if record["record_type"] == 'CNAME': - record['record_data'] = record['record_data'].encode('idna').decode() + if record['record_type'] == 'CNAME' or record['record_type'] == 'SOA': + record['record_data'] = utils.to_idna(record['record_data'], 'encode') #TODO: error handling # If it is ipv6 reverse zone and PRETTY_IPV6_PTR is enabled, # We convert ipv6 address back to reverse record format diff --git a/powerdnsadmin/routes/domain.py b/powerdnsadmin/routes/domain.py index e3b61cc7d..603a2a300 100644 --- a/powerdnsadmin/routes/domain.py +++ b/powerdnsadmin/routes/domain.py @@ -10,6 +10,7 @@ from ..lib.utils import pretty_domain_name from ..lib.utils import pretty_json +from ..lib.utils import to_idna from ..decorators import can_create_domain, operator_role_required, can_access_domain, can_configure_dnssec, can_remove_domain from ..models.user import User, Anonymous from ..models.account import Account @@ -379,7 +380,7 @@ def add(): # Encode domain name into punycode (IDN) try: - domain_name = domain_name.encode('idna').decode() + domain_name = to_idna(domain_name, 'encode') except: current_app.logger.error("Cannot encode the domain name {}".format(domain_name)) current_app.logger.debug(traceback.format_exc()) From 68045cc60c7160b11cb4fbbe655be750de4d0851 Mon Sep 17 00:00:00 2001 From: corubba Date: Sat, 7 May 2022 21:14:29 +0200 Subject: [PATCH 006/475] Fix revision in migration filename This has no functional impact, flask-migrate aka alembic was and will continue to work as expected. It is just a cosmetic change for consistency. --- ...in_the_db.py => 31a4ed468b18_remove_all_settings_in_the_db.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename migrations/versions/{1274ed462010_remove_all_settings_in_the_db.py => 31a4ed468b18_remove_all_settings_in_the_db.py} (100%) diff --git a/migrations/versions/1274ed462010_remove_all_settings_in_the_db.py b/migrations/versions/31a4ed468b18_remove_all_settings_in_the_db.py similarity index 100% rename from migrations/versions/1274ed462010_remove_all_settings_in_the_db.py rename to migrations/versions/31a4ed468b18_remove_all_settings_in_the_db.py From 0e2cd063c5a522c103df1aa401f077ea4523faba Mon Sep 17 00:00:00 2001 From: corubba Date: Sat, 7 May 2022 21:14:48 +0200 Subject: [PATCH 007/475] Remove python v2 remnant As vermin [0] confirms, the codebase has long moved beyond supporting python v2 (which is not a bad thing). This removes the last explicit py2 piece of code. And in case anyone wonders, vermin currently reports the minium version to be v3.6. [0] https://pypi.org/project/vermin/ --- powerdnsadmin/models/user.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/powerdnsadmin/models/user.py b/powerdnsadmin/models/user.py index 1802492a6..1b34d629d 100644 --- a/powerdnsadmin/models/user.py +++ b/powerdnsadmin/models/user.py @@ -83,10 +83,7 @@ def is_anonymous(self): return False def get_id(self): - try: - return unicode(self.id) # python 2 - except NameError: - return str(self.id) # python 3 + return str(self.id) def __repr__(self): return ''.format(self.username) From fec649b7476d0a7cdeb3a011620003acef1d250a Mon Sep 17 00:00:00 2001 From: corubba Date: Sat, 7 May 2022 21:14:57 +0200 Subject: [PATCH 008/475] Header for fixed order column Semantically and syntactically it is better to have the same number of `` as ``. Not that anyone will ever see that new header, since that column is always invisible (except if the user disables javascript). Plus remove a unmatched closing html element. --- powerdnsadmin/templates/domain.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerdnsadmin/templates/domain.html b/powerdnsadmin/templates/domain.html index e5863cdf9..d5e85fc05 100755 --- a/powerdnsadmin/templates/domain.html +++ b/powerdnsadmin/templates/domain.html @@ -60,6 +60,7 @@

{% if current_user.role.name in ['Administrator', 'Operator'] or SETTING.get('allow_user_view_history') %} Changelog {% endif %} + Invisible Sorting Column @@ -104,7 +105,6 @@

{% endif %} - {% if current_user.role.name in ['Administrator', 'Operator'] or SETTING.get('allow_user_view_history') %} diff --git a/requirements.txt b/requirements.txt index 1fc2864b5..051d56096 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,3 +31,4 @@ Jinja2==3.0.3 itsdangerous==2.0.1 werkzeug==2.0.3 cryptography==36.0.2 +flask_session_captcha==1.3.0 \ No newline at end of file From 7f25e3b555064087a91ac0e7625993c54150669d Mon Sep 17 00:00:00 2001 From: Tyler Todd Date: Thu, 2 Feb 2023 21:19:15 +0000 Subject: [PATCH 181/475] Initial go at upgrading from Bootstap v3 to v4 and to AdminLTE v3.2.0 --- package.json | 12 +- powerdnsadmin/static/custom/js/custom.js | 16 +- .../templates/admin_edit_account.html | 56 ++-- powerdnsadmin/templates/admin_edit_key.html | 67 ++-- powerdnsadmin/templates/admin_edit_user.html | 19 ++ .../templates/admin_global_search.html | 20 ++ powerdnsadmin/templates/admin_history.html | 141 ++++---- .../templates/admin_manage_account.html | 132 ++++---- .../templates/admin_manage_keys.html | 129 +++---- .../templates/admin_manage_user.html | 37 +- powerdnsadmin/templates/admin_pdns_stats.html | 20 ++ .../admin_setting_authentication.html | 60 ++-- .../templates/admin_setting_basic.html | 121 +++---- .../templates/admin_setting_pdns.html | 4 +- powerdnsadmin/templates/base.html | 309 ++++++++++------- powerdnsadmin/templates/errors/400.html | 77 +++-- powerdnsadmin/templates/errors/403.html | 69 ++-- powerdnsadmin/templates/errors/404.html | 69 ++-- powerdnsadmin/templates/errors/500.html | 69 ++-- powerdnsadmin/templates/errors/SAML.html | 89 +++-- powerdnsadmin/templates/login.html | 315 +++++++++--------- powerdnsadmin/templates/register.html | 251 ++++++++------ powerdnsadmin/templates/template_add.html | 29 +- requirements.txt | 42 +-- 24 files changed, 1234 insertions(+), 919 deletions(-) diff --git a/package.json b/package.json index 76982c81c..a375986b5 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "dependencies": { - "admin-lte": "2.4.9", - "bootstrap": "^3.4.1", - "bootstrap-datepicker": "^1.8.0", + "admin-lte": "3.2.0", + "bootstrap": "4.6.2", + "bootstrap-datepicker": "^1.9.0", "bootstrap-validator": "^0.11.9", - "datatables.net-plugins": "^1.10.19", + "datatables.net-plugins": "^1.13.1", "icheck": "^1.0.2", "jquery-slimscroll": "^1.3.8", - "jquery-ui-dist": "^1.12.1", + "jquery-ui-dist": "^1.13.2", "jquery.quicksearch": "^2.4.0", - "jtimeout": "^3.1.0", + "jtimeout": "^3.2.0", "multiselect": "^0.9.12" } } diff --git a/powerdnsadmin/static/custom/js/custom.js b/powerdnsadmin/static/custom/js/custom.js index e4b72b16e..0f096bf05 100644 --- a/powerdnsadmin/static/custom/js/custom.js +++ b/powerdnsadmin/static/custom/js/custom.js @@ -287,4 +287,18 @@ function copy_otp_secret_to_clipboard() { navigator.clipboard.writeText(copyBox.value); $("#copy_tooltip").css("visibility", "visible"); setTimeout(function(){ $("#copy_tooltip").css("visibility", "collapse"); }, 2000); - } \ No newline at end of file + } + +// Side menu nav bar active selection +/** add active class and stay opened when selected */ +var url = window.location; + +// for sidebar menu entirely but not cover treeview +$('ul.nav-sidebar a').filter(function() { + return this.href == url; +}).addClass('active'); + +// for treeview +$('ul.nav-treeview a').filter(function() { + return this.href == url; +}).parentsUntil(".nav-sidebar > .nav-treeview").addClass('menu-open').prev('a').addClass('active'); diff --git a/powerdnsadmin/templates/admin_edit_account.html b/powerdnsadmin/templates/admin_edit_account.html index 1946bc926..08403b920 100644 --- a/powerdnsadmin/templates/admin_edit_account.html +++ b/powerdnsadmin/templates/admin_edit_account.html @@ -4,26 +4,34 @@ {% block dashboard_stat %} -
-

- Account - {% if create %}New account{% else %}{{ account.name }}{% endif %} -

- -
+
+
+
+
+

+ Account + {% if create %}New account{% else %}{{ account.name }}{% endif %} +

+
+
+ +
+
+
+
{% endblock %} {% block content %}
-
-
-

{% if create %}Add{% else %}Edit{% endif %} account

+
+
+

{% if create %}Add{% else %}Edit{% endif %} account

@@ -31,7 +39,7 @@

{% if create %}Add{% else %}Edit{% endif %} account

action="{% if create %}{{ url_for('admin.edit_account') }}{% else %}{{ url_for('admin.edit_account', account_name=account.name) }}{% endif %}"> -
+
{% if error %}
@@ -73,10 +81,10 @@

Error!

-
-

Access Control

+
+

Access Control

-
+

Users on the right have access to manage records in all domains associated with the account.

Click on users to move between columns.

@@ -90,7 +98,7 @@

Access Control

- -
-
-
-

Help with creating a new account

+
+
+
+

Help with creating a new account

-
+

An account allows grouping of domains belonging to a particular entity, such as a customer or department.
diff --git a/powerdnsadmin/templates/admin_edit_key.html b/powerdnsadmin/templates/admin_edit_key.html index 6a9434025..a97afcba2 100644 --- a/powerdnsadmin/templates/admin_edit_key.html +++ b/powerdnsadmin/templates/admin_edit_key.html @@ -6,26 +6,35 @@ {% endblock %} {% block dashboard_stat %} -

-

- Key - {% if create %}New key{% else %}{{ key.id }}{% endif %} -

- -
+
+
+
+
+

+ API Keys + {% if create %}Add API Key{% else %}Edit API Key - {{ key.id }}{% endif %} +

+
+
+ +
+
+
+
+ {% endblock %} {% block content %}
-
-
-
-
-

{% if create %}Add{% else %}Edit{% endif %} key

+
+
+
+
+

{% if create %}Add{% else %}Edit{% endif %} Key

@@ -33,7 +42,7 @@

{% if create %}Add{% else %}Edit{% endif %} key

action="{% if create %}{{ url_for('admin.edit_key') }}{% else %}{{ url_for('admin.edit_key', key_id=key.id) }}{% endif %}"> -
+
-
+ +
+
+
+
+

+ Dashboard + Control panel +

+
+
+ +
+
+
+
{% endblock %} {% block content %} diff --git a/powerdnsadmin/templates/admin_global_search.html b/powerdnsadmin/templates/admin_global_search.html index 2e38bf191..815230cc1 100644 --- a/powerdnsadmin/templates/admin_global_search.html +++ b/powerdnsadmin/templates/admin_global_search.html @@ -13,6 +13,26 @@

  • Global Search
  • + +
    +
    +
    +
    +

    + Dashboard + Control panel +

    +
    +
    + +
    +
    +
    +
    + {% endblock %} {% block content %}
    diff --git a/powerdnsadmin/templates/admin_history.html b/powerdnsadmin/templates/admin_history.html index aa16c4a72..23b45b963 100644 --- a/powerdnsadmin/templates/admin_history.html +++ b/powerdnsadmin/templates/admin_history.html @@ -4,15 +4,26 @@ History - {{ SITE_NAME }} {% endblock %} {% block dashboard_stat %} -
    -

    - History Recent events -

    - -
    + +
    +
    +
    +
    +

    + History + Recent Events +

    +
    +
    + +
    +
    +
    +
    + {% endblock %} {% block content %} {% import 'applied_change_macro.html' as applied_change_macro %} @@ -20,57 +31,57 @@

    +
    -
    -
    -
    -

    History Management

    -
    -
    - +
    +
    +
    +

    History Management

    +
    +
    + +
    +
    +
    +
    {% endblock %} {% block extrascripts %} diff --git a/powerdnsadmin/templates/admin_manage_keys.html b/powerdnsadmin/templates/admin_manage_keys.html index dadc2a0f0..9f2c6825e 100644 --- a/powerdnsadmin/templates/admin_manage_keys.html +++ b/powerdnsadmin/templates/admin_manage_keys.html @@ -3,72 +3,75 @@ {% block title %} Key Management - {{ SITE_NAME }} {% endblock %} {% block dashboard_stat %} -
    -

    - Key Manage API keys -

    - -
    +
    +
    +
    +
    +

    + API Keys + Management +

    +
    +
    + +
    +
    +
    +
    {% endblock %} {% block content %}
    -
    -
    -
    -
    -

    Key Management

    -
    - -
    - - - - - - - - - - - - - {% for key in keys %} - - - - - - - - - {% endfor %} - -
    IdRoleDescriptionDomainsAccountsAction
    {{ key.id }}{{ key.role.name }}{{ key.description }}{% for domain in key.domains %}{{ domain.name }}{% if not loop.last %}, {% endif %}{% endfor %}{% for account in key.accounts %}{{ account.name }}{% if not loop.last %}, {% endif %}{% endfor %} - - -
    -
    - -
    - -
    - +
    +
    +
    +

    Key Management

    +
    + +
    + + + + + + + + + + + + + {% for key in keys %} + + + + + + + + + {% endfor %} + +
    IdRoleDescriptionDomainsAccountsAction
    {{ key.id }}{{ key.role.name }}{{ key.description }}{% for domain in key.domains %}{{ domain.name }}{% if not loop.last %}, {% endif %}{% endfor %}{% for account in key.accounts %}{{ account.name }}{% if not loop.last %}, {% endif %}{% endfor %} + + +
    +
    - +
    {% endblock %} {% block extrascripts %} diff --git a/powerdnsadmin/templates/admin_manage_user.html b/powerdnsadmin/templates/admin_manage_user.html index d6a720421..f1b6022f7 100644 --- a/powerdnsadmin/templates/admin_manage_user.html +++ b/powerdnsadmin/templates/admin_manage_user.html @@ -3,31 +3,40 @@ {% block title %} User Management - {{ SITE_NAME }} {% endblock %} {% block dashboard_stat %} -
    -

    - User Manage user privileges -

    - -
    +
    +
    +
    +
    +

    + User + Manage user privileges +

    +
    +
    + +
    +
    +
    +
    {% endblock %} {% block content %}
    -
    -
    -

    User Management

    +
    +
    +

    User Management

    -
    + -
    +
    diff --git a/powerdnsadmin/templates/admin_pdns_stats.html b/powerdnsadmin/templates/admin_pdns_stats.html index cd5a00003..84a1ec6c3 100644 --- a/powerdnsadmin/templates/admin_pdns_stats.html +++ b/powerdnsadmin/templates/admin_pdns_stats.html @@ -13,6 +13,26 @@

  • Admin Console
  • + +
    +
    +
    +
    +

    + Dashboard + Control panel +

    +
    +
    + +
    +
    +
    +
    + {% endblock %} {% block content %} diff --git a/powerdnsadmin/templates/admin_setting_authentication.html b/powerdnsadmin/templates/admin_setting_authentication.html index 5d0fd1020..0509cbb5b 100644 --- a/powerdnsadmin/templates/admin_setting_authentication.html +++ b/powerdnsadmin/templates/admin_setting_authentication.html @@ -4,33 +4,43 @@ Authentication Settings - {{ SITE_NAME }} {% endblock %} {% block dashboard_stat %} -
    -

    - Settings PowerDNS-Admin settings -

    - - + + + + - window.onload = function() { - ldapSelection(); - } - -
    {% endblock %} {% block content %}
    diff --git a/powerdnsadmin/templates/admin_setting_basic.html b/powerdnsadmin/templates/admin_setting_basic.html index d3d0905ea..3df8fc060 100644 --- a/powerdnsadmin/templates/admin_setting_basic.html +++ b/powerdnsadmin/templates/admin_setting_basic.html @@ -4,66 +4,73 @@ Basic Settings - {{ SITE_NAME }} {% endblock %} {% block dashboard_stat %} -
    -

    - Settings PowerDNS-Admin settings -

    - -
    +
    +
    +
    +
    +

    + Settings + Basic +

    +
    +
    + +
    +
    +
    +
    + {% endblock %} {% block content %}
    -
    -
    -
    -
    -

    Basic Settings

    -
    -
    -

    - - - - - - - - - {% for setting in settings %} - - - {% if SETTING.get(setting) in [True, False] %} - - - {% else %} - - - {% endif %} - - {% endfor %} - -
    NameValueChange
    {{ setting }}{{ SETTING.get(setting)|display_setting_state }} - - - -
    -
    - -
    - -
    - +
    +
    +
    +

    Basic Settings

    +
    +
    + + + + + + + + + + {% for setting in settings %} + + + {% if SETTING.get(setting) in [True, False] %} + + + {% else %} + + + {% endif %} + + {% endfor %} + +
    NameValueChange
    + {{ setting }} + {{ SETTING.get(setting)|display_setting_state }} + + + + + +
    +
    - +
    {% endblock %} {% block extrascripts %} diff --git a/powerdnsadmin/templates/admin_setting_pdns.html b/powerdnsadmin/templates/admin_setting_pdns.html index 84f86a9c7..08b42f12c 100644 --- a/powerdnsadmin/templates/admin_setting_pdns.html +++ b/powerdnsadmin/templates/admin_setting_pdns.html @@ -4,7 +4,7 @@ PDNS Settings - {{ SITE_NAME }} {% endblock %} {% block dashboard_stat %} -
    +

    Settings PowerDNS-Admin settings

    @@ -13,7 +13,7 @@

  • Setting
  • PDNS
  • -

    +

    {% endblock %} {% block content %}
    diff --git a/powerdnsadmin/templates/base.html b/powerdnsadmin/templates/base.html index 35bfc51b3..f3261dda6 100644 --- a/powerdnsadmin/templates/base.html +++ b/powerdnsadmin/templates/base.html @@ -2,166 +2,221 @@ {% block head %} - - - - {% block title %}{{ SITE_NAME }}{% endblock %} - - - - - - - - - {% assets "css_main" -%} + + + + {% block title %} + + {{ SITE_NAME }} + + {% endblock %} + + + + + + + + + + {% assets "css_main" -%} - {%- endassets %} -{% if SETTING.get('custom_css') %} - -{% endif %} + {%- endassets %} + {% if SETTING.get('custom_css') %} + + {% endif %} {% endblock %} + -{% set user_image_url = url_for('user.image', username=current_user.username) %} -
    + {% set user_image_url = url_for('user.image', username=current_user.username) %} +
    {% block pageheader %} -
    - - - -
    + {% endblock %} -
    @@ -169,16 +224,24 @@
    {% block dashboard_stat %} -
    -

    - Dashboard - Control panel -

    - -
    +
    +
    +
    +
    +

    + Dashboard + Control panel +

    +
    +
    + +
    +
    +
    +
    {% endblock %} {% block content %} {% endblock %} @@ -382,4 +445,4 @@

    {% block modals %} {% endblock %} - + \ No newline at end of file diff --git a/powerdnsadmin/templates/errors/400.html b/powerdnsadmin/templates/errors/400.html index ec53684de..b2ca8648a 100644 --- a/powerdnsadmin/templates/errors/400.html +++ b/powerdnsadmin/templates/errors/400.html @@ -1,41 +1,52 @@ {% extends "base.html" %} -{% block title %}PowerDNS-Admin - 400 Error{% endblock %} + +{% block title %} + + {{ SITE_NAME }} - 400 Error + +{% endblock %} {% block dashboard_stat %} - -
    -

    - 400 - Error -

    - -
    +
    +
    +
    +
    +

    + 400 + Error +

    +
    +
    + +
    +
    +
    +
    {% endblock %} {% block content %} - -
    +
    -

    400

    -
    -

    - Oops! Bad request -

    -

    - {% if msg %} - {{ msg }} - {% else %} - The server refused to process your request and return a 400 error. - {% endif %} -
    You may return to the dashboard. -

    -
    - +

    + 400 +

    +
    +

    + + Oops! Bad request +

    +

    + {% if msg %} + {{ msg }} + {% else %} + The server refused to process your request and return a 400 error. + {% endif %} +
    You may return to the dashboard. +

    +
    - -
    - -{% endblock %} +
    +{% endblock %} \ No newline at end of file diff --git a/powerdnsadmin/templates/errors/403.html b/powerdnsadmin/templates/errors/403.html index ffe96bf53..f629eb8b2 100644 --- a/powerdnsadmin/templates/errors/403.html +++ b/powerdnsadmin/templates/errors/403.html @@ -1,37 +1,48 @@ {% extends "base.html" %} -{% block title %}PowerDNS-Admin - 403 Error{% endblock %} + +{% block title %} + + {{ SITE_NAME }} - 403 Error + +{% endblock %} {% block dashboard_stat %} - -
    -

    - 403 - Error -

    - -
    +
    +
    +
    +
    +

    + 403 + Error +

    +
    +
    + +
    +
    +
    +
    {% endblock %} {% block content %} - -
    +
    -

    403

    -
    -

    - Oops! Access denied -

    -

    - You don't have permission to access this page - You may return to the dashboard. -

    -
    - +

    + 403 +

    +
    +

    + + Oops! Access denied +

    +

    + You don't have permission to access this page + You may return to the dashboard. +

    +
    - -
    - -{% endblock %} +
    +{% endblock %} \ No newline at end of file diff --git a/powerdnsadmin/templates/errors/404.html b/powerdnsadmin/templates/errors/404.html index a93c73133..858731f4b 100644 --- a/powerdnsadmin/templates/errors/404.html +++ b/powerdnsadmin/templates/errors/404.html @@ -1,37 +1,48 @@ {% extends "base.html" %} -{% block title %}PowerDNS-Admin - 404 Error{% endblock %} + +{% block title %} + + {{ SITE_NAME }} - 404 Error + +{% endblock %} {% block dashboard_stat %} - -
    -

    - 404 - Error -

    - -
    +
    +
    +
    +
    +

    + 404 + Error +

    +
    +
    + +
    +
    +
    +
    {% endblock %} {% block content %} - -
    +
    -

    404

    -
    -

    - Oops! You're lost -

    -

    - The page you requested could not be found. - You may return to the dashboard. -

    -
    - +

    + 404 +

    +
    +

    + + Oops! You're lost +

    +

    + The page you requested could not be found. + You may return to the dashboard. +

    +
    - -
    - -{% endblock %} +
    +{% endblock %} \ No newline at end of file diff --git a/powerdnsadmin/templates/errors/500.html b/powerdnsadmin/templates/errors/500.html index d223b0b48..51142f0fe 100644 --- a/powerdnsadmin/templates/errors/500.html +++ b/powerdnsadmin/templates/errors/500.html @@ -1,37 +1,48 @@ {% extends "base.html" %} -{% block title %}PowerDNS-Admin - 500 Error{% endblock %} + +{% block title %} + + {{ SITE_NAME }} - 500 Error + +{% endblock %} {% block dashboard_stat %} - -
    -

    - 500 - Error -

    - -
    +
    +
    +
    +
    +

    + 500 + Error +

    +
    +
    + +
    +
    +
    +
    {% endblock %} {% block content %} - -
    +
    -

    500

    -
    -

    - Oops! Something went wrong -

    -

    - Try again later. - You may return to the dashboard. -

    -
    - +

    + 500 +

    +
    +

    + + Oops! Something went wrong +

    +

    + Try again later. + You may return to the dashboard. +

    +
    - -
    - -{% endblock %} +
    +{% endblock %} \ No newline at end of file diff --git a/powerdnsadmin/templates/errors/SAML.html b/powerdnsadmin/templates/errors/SAML.html index 2cfacbd82..c77902257 100644 --- a/powerdnsadmin/templates/errors/SAML.html +++ b/powerdnsadmin/templates/errors/SAML.html @@ -1,45 +1,60 @@ {% extends "base.html" %} -{% block title %}PowerDNS-Admin - SAML Authentication Error{% endblock %} + +{% block title %} + + {{ SITE_NAME }} - SAML Authentication Error + +{% endblock %} {% block dashboard_stat %} - -
    -

    - SAML - Error -

    - -
    +
    +
    +
    +
    +

    + SAML + Error +

    +
    +
    + +
    +
    +
    +
    {% endblock %} {% block content %} - -
    +
    -
    -

    SAML Authentication Error



    -
    -

    - Oops! Something went wrong -


    -

    - Login failed.
    - Error(s) when processing SAML Response:
    -

      - {% for error in errors %} -
    • {{ error }}
    • - {% endfor %} -
    - - You may return to the dashboard. -

    -
    - +
    +

    + SAML Authentication Error +

    +
    +
    +
    +
    +

    + Oops! Something went wrong +

    +
    +

    + Login failed. +
    + Error(s) when processing SAML Response: +
    +

      + {% for error in errors %} +
    • {{ error }}
    • + {% endfor %} +
    + You may return to the dashboard. +

    +
    - -
    - -{% endblock %} +
    +{% endblock %} \ No newline at end of file diff --git a/powerdnsadmin/templates/login.html b/powerdnsadmin/templates/login.html index 805422bb8..02f3e41f8 100644 --- a/powerdnsadmin/templates/login.html +++ b/powerdnsadmin/templates/login.html @@ -1,166 +1,171 @@ - - - - - Log In - {{ SITE_NAME }} - - - - - {% assets "css_login" -%} - - {%- endassets %} -{% if SETTING.get('custom_css') %} - -{% endif %} - - - -
    +
    {% endblock %} + {% block extrascripts %} - + {% endblock %} + {% block modals %} -

    - + Microsoft OAuth Settings
    - GROUP SECURITY + Group Security
    @@ -1129,7 +1160,7 @@

    Microsoft OAuth Settings

    - AZURE GROUP ACCOUNT SYNC/CREATION + Azure Group Account Sync / Creation
    From 5c6cf77996266987480ac7b7331f8a6b28b21cce Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 16:42:05 -0400 Subject: [PATCH 343/475] Updated project README to include references to the new security policy. Moved the project's code of conduct out of the contributions guide and into the appropriate policy file. Updated the contribution guide to follow the NetBox project format. Added various issue templates based on the NetBox project formats but updated for PDA. Added additional GitHub workflows to handle stale and closed issue and PR management. Removed legacy stale issue workflow that was not in use. --- .github/ISSUE_TEMPLATE/bug_report.yaml | 78 ++++++++++ .github/ISSUE_TEMPLATE/config.yml | 12 ++ .../ISSUE_TEMPLATE/documentation_change.yaml | 40 +++++ .github/ISSUE_TEMPLATE/feature_request.yaml | 71 +++++++++ .github/ISSUE_TEMPLATE/housekeeping.yaml | 24 +++ .github/PULL_REQUEST_TEMPLATE.md | 14 ++ .github/stale.yml | 20 --- .github/workflows/lock.yml | 21 +++ .github/workflows/stale.yml | 45 ++++++ README.md | 8 +- docs/CODE_OF_CONDUCT.md | 74 +++++++++ docs/CONTRIBUTING.md | 145 ++++++++++-------- docs/SECURITY.md | 31 ++++ 13 files changed, 496 insertions(+), 87 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yaml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/documentation_change.yaml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yaml create mode 100644 .github/ISSUE_TEMPLATE/housekeeping.yaml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/stale.yml create mode 100644 .github/workflows/lock.yml create mode 100644 .github/workflows/stale.yml create mode 100644 docs/CODE_OF_CONDUCT.md create mode 100644 docs/SECURITY.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 000000000..5bacd4e6e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,78 @@ +--- +name: 🐛 Bug Report +description: Report a reproducible bug in the current release of PDA +labels: ["type: bug"] +body: + - type: markdown + attributes: + value: > + **NOTE:** This form is only for reporting _reproducible bugs_ in a current PDA + installation. If you're having trouble with installation or just looking for + assistance with using PDA, please visit our + [discussion forum](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions) instead. + - type: input + attributes: + label: PDA version + description: What version of PDA are you currently running? + options: + - "0.4.0" + - "0.3.0" + - "0.2.5" + - "0.2.4" + - "0.2.3" + - "0.2.2" + - "0.2.1" + - "0.2" + - "0.1" + - "I'm Not Sure" + validations: + required: true + - type: dropdown + attributes: + label: Python version + description: What version of Python are you currently running? + options: + - "3.0" + - "3.1" + - "3.2" + - "3.3" + - "3.4" + - "3.5" + - "3.6" + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + validations: + required: true + - type: textarea + attributes: + label: Steps to Reproduce + description: > + Describe in detail the exact steps that someone else can take to + reproduce this bug using the current stable release of PDA. Begin with the + creation of any necessary database objects and call out every operation being + performed explicitly. If reporting a bug in the REST API, be sure to reconstruct + the raw HTTP request(s) being made. Additionally, **do not rely on the demo instance** for reproducing + suspected bugs, as its data is prone to modification or deletion at any time. + placeholder: | + 1. Click on "create widget" + 2. Set foo to 12 and bar to G + 3. Click the "create" button + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: What did you expect to happen? + placeholder: A new zone record should have been created with the specified values + validations: + required: true + - type: textarea + attributes: + label: Observed Behavior + description: What happened instead? + placeholder: A TypeError exception was raised + validations: + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..98109af7c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,12 @@ +# Reference: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser +blank_issues_enabled: false +contact_links: + - name: 📖 Contributing Policy + url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/docs/CONTRIBUTING.md + about: "Please read through our contributing policy before opening an issue or pull request" + - name: ❓ Discussion + url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions + about: "If you're just looking for help, try starting a discussion instead" + - name: 💬 Project Chat + url: https://mattermost.powerdnsadmin.org/ + about: "Join our Mattermost chat to discuss the project with other users and developers" \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/documentation_change.yaml b/.github/ISSUE_TEMPLATE/documentation_change.yaml new file mode 100644 index 000000000..584d4b488 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation_change.yaml @@ -0,0 +1,40 @@ +--- +name: 📖 Documentation Change +description: Suggest an addition or modification to the PDA documentation +labels: ["type: documentation"] +body: + - type: dropdown + attributes: + label: Change Type + description: What type of change are you proposing? + options: + - Addition + - Correction + - Removal + - Cleanup (formatting, typos, etc.) + validations: + required: true + - type: dropdown + attributes: + label: Area + description: To what section of the documentation does this change primarily pertain? + options: + - Features + - Installation/upgrade + - Getting started + - Configuration + - Customization + - Database Setup + - Debug + - Integrations/API + - Administration + - Development + - Other + validations: + required: true + - type: textarea + attributes: + label: Proposed Changes + description: Describe the proposed changes and why they are necessary. + validations: + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 000000000..b2e193428 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -0,0 +1,71 @@ +--- +name: ✨ Feature Request +description: Propose a new PDA feature or enhancement +labels: ["type: feature"] +body: + - type: markdown + attributes: + value: > + **NOTE:** This form is only for submitting well-formed proposals to extend or modify + PDA in some way. If you're trying to solve a problem but can't figure out how, or if + you still need time to work on the details of a proposed new feature, please start a + [discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions) instead. + - type: input + attributes: + label: PDA version + description: What version of PDA are you currently running? + options: + - "0.4.0" + - "0.3.0" + - "0.2.5" + - "0.2.4" + - "0.2.3" + - "0.2.2" + - "0.2.1" + - "0.2" + - "0.1" + - "I'm Not Sure" + validations: + required: true + - type: dropdown + attributes: + label: Feature type + options: + - Data model modification + - App Setting Addition + - Default App Setting Change + - New functionality + - Change to existing functionality + validations: + required: true + - type: textarea + attributes: + label: Proposed functionality + description: > + Describe in detail the new feature or behavior you are proposing. Include any specific changes + to work flows, data models, and/or the user interface. The more detail you provide here, the + greater chance your proposal has of being discussed. Feature requests which don't include an + actionable implementation plan will be rejected. + validations: + required: true + - type: textarea + attributes: + label: Use case + description: > + Explain how adding this functionality would benefit PDA users. What need does it address? + validations: + required: true + - type: textarea + attributes: + label: Database changes + description: > + Note any changes to the database schema necessary to support the new feature. For example, + does the proposal require adding a new model or field? (Not all new features require database + changes.) + - type: textarea + attributes: + label: External dependencies + description: > + List any new dependencies on external libraries or services that this new feature would + introduce. For example, does the proposal require the installation of a new Python package? + (Not all new features introduce new dependencies.) \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/housekeeping.yaml b/.github/ISSUE_TEMPLATE/housekeeping.yaml new file mode 100644 index 000000000..dba7e3c55 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/housekeeping.yaml @@ -0,0 +1,24 @@ +--- +name: 🏡 Housekeeping +description: A change pertaining to the codebase itself (developers only) +labels: ["type: housekeeping"] +body: + - type: markdown + attributes: + value: > + **NOTE:** This template is for use by maintainers only. Please do not submit + an issue using this template unless you have been specifically asked to do so. + - type: textarea + attributes: + label: Proposed Changes + description: > + Describe in detail the new feature or behavior you'd like to propose. + Include any specific changes to work flows, data models, or the user interface. + validations: + required: true + - type: textarea + attributes: + label: Justification + description: Please provide justification for the proposed change(s). + validations: + required: true \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..05a661177 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,14 @@ + +### Fixes: #1234 + + \ No newline at end of file diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 0c0b1c399..000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,20 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 60 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - bug / broken-feature - - bug / security-vulnerability - - feature / request - - mod / help-wanted -# Label to use when marking an issue as stale -staleLabel: mod / stale -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: true diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml new file mode 100644 index 000000000..938502495 --- /dev/null +++ b/.github/workflows/lock.yml @@ -0,0 +1,21 @@ +# lock-threads (https://github.com/marketplace/actions/lock-threads) +name: 'Lock threads' + +on: + schedule: + - cron: '0 3 * * *' + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +jobs: + lock: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v3 + with: + issue-inactive-days: 90 + pr-inactive-days: 30 + issue-lock-reason: 'resolved' \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..66fd367f6 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,45 @@ +# close-stale-issues (https://github.com/marketplace/actions/close-stale-issues) +name: 'Close stale issues/PRs' + +on: + schedule: + - cron: '0 4 * * *' + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v6 + with: + close-issue-message: > + This issue has been automatically closed due to lack of activity. In an + effort to reduce noise, please do not comment any further. Note that the + core maintainers may elect to reopen this issue at a later date if deemed + necessary. + close-pr-message: > + This PR has been automatically closed due to lack of activity. + days-before-stale: 90 + days-before-close: 30 + exempt-issue-labels: 'status: accepted,status: blocked,status: needs milestone' + operations-per-run: 100 + remove-stale-when-updated: false + stale-issue-label: 'mod / stale' + stale-issue-message: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. PDA + is governed by a small group of core maintainers which means not all opened + issues may receive direct feedback. **Do not** attempt to circumvent this + process by "bumping" the issue; doing so will result in its immediate closure + and you may be barred from participating in any future discussions. Please see + our [contributing guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/docs/CONTRIBUTING.md). + stale-pr-label: 'mod / stale' + stale-pr-message: > + This PR has been automatically marked as stale because it has not had + recent activity. It will be closed automatically if no further action is + taken. \ No newline at end of file diff --git a/README.md b/README.md index 5d07f932c..1cc644c2c 100644 --- a/README.md +++ b/README.md @@ -74,9 +74,13 @@ You can then access PowerDNS-Admin by pointing your browser to http://localhost: ## Contributing -Please see our [contributing guidelines](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/docs/CONTRIBUTING.md). +Please see our [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/docs/CONTRIBUTING.md). + +## Code of Conduct + +Please see our [Code of Conduct Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/docs/CODE_OF_CONDUCT.md). ## License This project is released under the MIT license. For additional -information, [see here](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/LICENSE) +information, [see the full license](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/LICENSE). diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..54b10d73a --- /dev/null +++ b/docs/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Code of Conduct + +# Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [admin@powerdnsadmin.org](mailto:admin@powerdnsadmin.org). All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index df50ba2b0..8c82a802f 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,88 +1,103 @@ -# Contributing +# Contribution Guide -Before submitting new contributions to this repository, it is a good idea to start a discussion with the repository -maintainers on GitHub through the use of issues or discussions. This will help to ensure that your efforts don't get -wasted if the submission is not desirable for the project. +**Looking for help?** PDA has a somewhat active community of fellow users that may be able to provide assistance. Just [start a discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions/new) right here on GitHub! -This is not to say that all contributions that have been discussed will be accepted either. As part of an ongoing -effort to clean up the codebase, some contributions may be rejected if they do not meet the standards of the project -which have not been fully defined yet. This is a work in progress. +
    +

    + :bug: Report a bug · + :bulb: Suggest a feature · + :arrow_heading_up: Submit a pull request +

    +

    + :rescue_worker_helmet: Become a maintainer · + :heart: Other ideas +

    +
    +

    -Please note we have a code of conduct, please follow it in all your interactions with the project. +Some general tips for engaging here on GitHub: -All pull requests should be based on the `dev` branch of this repository and not the `master` branch! +* Register for a free [GitHub account](https://github.com/signup) if you haven't already. +* You can use [GitHub Markdown](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) for formatting text and adding images. +* To help mitigate notification spam, please avoid "bumping" issues with no activity. (To vote an issue up or down, use a :thumbsup: or :thumbsdown: reaction.) +* Please avoid pinging members with `@` unless they've previously expressed interest or involvement with that particular issue. -## Code of Conduct +## :bug: Reporting Bugs -### Our Pledge +* First, ensure that you're running the [latest stable version](https://github.com/PowerDNS-Admin/PowerDNS-Admin/releases) of PDA. If you're running an older version, there's a chance that the bug has already been fixed. -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. +* Next, search our [issues list](https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues?q=is%3Aissue) to see if the bug you've found has already been reported. If you come across a bug report that seems to match, please click "add a reaction" in the top right corner of the issue and add a thumbs up (:thumbsup:). This will help draw more attention to it. Any comments you can add to provide additional information or context would also be much appreciated. -### Our Standards +* If you can't find any existing issues (open or closed) that seem to match yours, you're welcome to [submit a new bug report](https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues/new?label=type%3A+bug&template=bug_report.yaml). Be sure to complete the entire report template, including detailed steps that someone triaging your issue can follow to confirm the reported behavior. (If we're not able to replicate the bug based on the information provided, we'll ask for additional detail.) -Examples of behavior that contributes to creating a positive environment -include: +* Some other tips to keep in mind: + * Error messages and screenshots are especially helpful. + * Don't prepend your issue title with a label like `[Bug]`; the proper label will be assigned automatically. + * Verify that you have GitHub notifications enabled and are subscribed to your issue after submitting. + * We appreciate your patience as bugs are prioritized by their severity, impact, and difficulty to resolve. -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +## :bulb: Feature Requests -Examples of unacceptable behavior by participants include: +* First, check the GitHub [issues list](https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues?q=is%3Aissue) to see if the feature you have in mind has already been proposed. If you happen to find an open feature request that matches your idea, click "add a reaction" in the top right corner of the issue and add a thumbs up (:thumbsup:). This ensures that the issue has a better chance of receiving attention. Also feel free to add a comment with any additional justification for the feature. -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting +* If you have a rough idea that's not quite ready for formal submission yet, start a [GitHub discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions) instead. This is a great way to test the viability and narrow down the scope of a new feature prior to submitting a formal proposal, and can serve to generate interest in your idea from other community members. -### Our Responsibilities +* Once you're ready, submit a feature request [using this template](https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues/new?label=type%3A+feature&template=feature_request.yaml). Be sure to provide sufficient context and detail to convey exactly what you're proposing and why. The stronger your use case, the better chance your proposal has of being accepted. -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. +* Some other tips to keep in mind: + * Don't prepend your issue title with a label like `[Feature]`; the proper label will be assigned automatically. + * Try to anticipate any likely questions about your proposal and provide that information proactively. + * Verify that you have GitHub notifications enabled and are subscribed to your issue after submitting. + * You're welcome to volunteer to implement your FR, but don't submit a pull request until it has been approved. -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. +## :arrow_heading_up: Submitting Pull Requests -### Scope +* [Pull requests](https://docs.github.com/en/pull-requests) (a feature of GitHub) are used to propose changes to NetBox's code base. Our process generally goes like this: + * A user opens a new issue (bug report or feature request) + * A maintainer triages the issue and may mark it as needing an owner + * The issue's author can volunteer to own it, or someone else can + * A maintainer assigns the issue to whomever volunteers + * The issue owner submits a pull request that will resolve the issue + * A maintainer reviews and merges the pull request, closing the issue -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. +* It's very important that you not submit a pull request until a relevant issue has been opened **and** assigned to you. Otherwise, you risk wasting time on work that may ultimately not be needed. -### Enforcement +* New pull requests should generally be based off of the `dev` branch, rather than `master`. The `dev` branch is used for ongoing development, while `master` is used for tracking stable releases. -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at [admin@powerdnsadmin.org](mailto:admin@powerdnsadmin.org). All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. +* In most cases, it is not necessary to add a changelog entry: A maintainer will take care of this when the PR is merged. (This helps avoid merge conflicts resulting from multiple PRs being submitted simultaneously.) -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. +* All code submissions should meet the following criteria (CI will eventually enforce these checks): + * Python syntax is valid + * PEP 8 compliance is enforced, with the exception that lines may be + greater than 80 characters in length -### Attribution +* Some other tips to keep in mind: + * If you'd like to volunteer for someone else's issue, please post a comment on that issue letting us know. (This will allow the maintainers to assign it to you.) + * All new functionality must include relevant tests where applicable. -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] +## :rescue_worker_helmet: Become a Maintainer -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ +We're always looking for motivated individuals to join the maintainers team and help drive PDA's long-term development. Some of our most sought-after skills include: + +* Python development with a strong focus on the [Flask](https://flask.palletsprojects.com/) and [Django](https://www.djangoproject.com/) frameworks +* Expertise working with SQLite, MySQL, and/or PostgreSQL databases +* Javascript & TypeScript proficiency +* A knack for web application design (HTML & CSS) +* Familiarity with git and software development best practices +* Excellent attention to detail +* Working experience in the field of network operations as it relates to the use of DNS (Domain Name System) servers. + +We generally ask that maintainers dedicate around four hours of work to the project each week on average, which includes both hands-on development and project management tasks such as issue triage. + +We do maintain an active Mattermost instance for internal communication, but we also use GitHub issues for project management. + +Some maintainers petition their employer to grant some of their paid time to work on PDA. + +Interested? You can contact our lead maintainer, Matt Scott, at admin@powerdnsadmin.org. We'd love to have you on the team! + +## :heart: Other Ways to Contribute + +You don't have to be a developer to contribute to PDA: There are plenty of other ways you can add value to the community! Below are just a few examples: + +* Help answer questions and provide feedback in our [GitHub discussions](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions). +* Write a blog article or record a YouTube video demonstrating how PDA is used at your organization. diff --git a/docs/SECURITY.md b/docs/SECURITY.md new file mode 100644 index 000000000..bd91d3626 --- /dev/null +++ b/docs/SECURITY.md @@ -0,0 +1,31 @@ +# Security Policy + +## No Warranty + +Per the terms of the MIT license, PDA is offered "as is" and without any guarantee or warranty pertaining to its operation. While every reasonable effort is made by its maintainers to ensure the product remains free of security vulnerabilities, users are ultimately responsible for conducting their own evaluations of each software release. + +## Recommendations + +Administrators are encouraged to adhere to industry best practices concerning the secure operation of software, such as: + +* Do not expose your PDA installation to the public Internet +* Do not permit multiple users to share an account +* Enforce minimum password complexity requirements for local accounts +* Prohibit access to your database from clients other than the PDA application +* Keep your deployment updated to the most recent stable release + +## Reporting a Suspected Vulnerability + +If you believe you've uncovered a security vulnerability and wish to report it confidentially, you may do so via email. Please note that any reported vulnerabilities **MUST** meet all the following conditions: + +* Affects the most recent stable release of PDA, or a current beta release +* Affects a PDA instance installed and configured per the official documentation +* Is reproducible following a prescribed set of instructions + +Please note that we **DO NOT** accept reports generated by automated tooling which merely suggest that a file or file(s) _may_ be vulnerable under certain conditions, as these are most often innocuous. + +If you believe that you've found a vulnerability which meets all of these conditions, please [submit a draft security advisory](https://github.com/PowerDNS-Admin/PowerDNS-Admin/security/advisories/new) on GitHub, or email a brief description of the suspected bug and instructions for reproduction to **admin@powerdnsadmin.org**. + +### Bug Bounties + +As PDA is provided as free open source software, we do not offer any monetary compensation for vulnerability or bug reports, however your contributions are greatly appreciated. \ No newline at end of file From 4b3759d140a3a16de1ba191658203481676fe64f Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 16:46:34 -0400 Subject: [PATCH 344/475] Relocated new security policy to the project root to meet GitHub feature expectations. --- docs/SECURITY.md => SECURITY.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/SECURITY.md => SECURITY.md (100%) diff --git a/docs/SECURITY.md b/SECURITY.md similarity index 100% rename from docs/SECURITY.md rename to SECURITY.md From 23d6dd1fde02ff6cd117a354bae58a7c43fda271 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 16:48:11 -0400 Subject: [PATCH 345/475] Updated project README to include reference to new security policy. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 1cc644c2c..ea2c1a11c 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,10 @@ You can then access PowerDNS-Admin by pointing your browser to http://localhost: ![dashboard](docs/screenshots/dashboard.png) +## Security Issues / Reports + +Please see our [Security Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/SECURITY.md). + ## Contributing Please see our [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/docs/CONTRIBUTING.md). From 0f7c2da81458bf324286523e161645e171037b10 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 16:42:05 -0400 Subject: [PATCH 346/475] Updated project README to include references to the new security policy. Moved the project's code of conduct out of the contributions guide and into the appropriate policy file. Updated the contribution guide to follow the NetBox project format. Added various issue templates based on the NetBox project formats but updated for PDA. Added additional GitHub workflows to handle stale and closed issue and PR management. Removed legacy stale issue workflow that was not in use. --- .github/ISSUE_TEMPLATE/bug_report.yaml | 78 ++++++++++ .github/ISSUE_TEMPLATE/config.yml | 12 ++ .../ISSUE_TEMPLATE/documentation_change.yaml | 40 +++++ .github/ISSUE_TEMPLATE/feature_request.yaml | 71 +++++++++ .github/ISSUE_TEMPLATE/housekeeping.yaml | 24 +++ .github/PULL_REQUEST_TEMPLATE.md | 14 ++ .github/stale.yml | 20 --- .github/workflows/lock.yml | 21 +++ .github/workflows/stale.yml | 45 ++++++ README.md | 8 +- docs/CODE_OF_CONDUCT.md | 74 +++++++++ docs/CONTRIBUTING.md | 145 ++++++++++-------- docs/SECURITY.md | 31 ++++ 13 files changed, 496 insertions(+), 87 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yaml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/documentation_change.yaml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yaml create mode 100644 .github/ISSUE_TEMPLATE/housekeeping.yaml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/stale.yml create mode 100644 .github/workflows/lock.yml create mode 100644 .github/workflows/stale.yml create mode 100644 docs/CODE_OF_CONDUCT.md create mode 100644 docs/SECURITY.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 000000000..5bacd4e6e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,78 @@ +--- +name: 🐛 Bug Report +description: Report a reproducible bug in the current release of PDA +labels: ["type: bug"] +body: + - type: markdown + attributes: + value: > + **NOTE:** This form is only for reporting _reproducible bugs_ in a current PDA + installation. If you're having trouble with installation or just looking for + assistance with using PDA, please visit our + [discussion forum](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions) instead. + - type: input + attributes: + label: PDA version + description: What version of PDA are you currently running? + options: + - "0.4.0" + - "0.3.0" + - "0.2.5" + - "0.2.4" + - "0.2.3" + - "0.2.2" + - "0.2.1" + - "0.2" + - "0.1" + - "I'm Not Sure" + validations: + required: true + - type: dropdown + attributes: + label: Python version + description: What version of Python are you currently running? + options: + - "3.0" + - "3.1" + - "3.2" + - "3.3" + - "3.4" + - "3.5" + - "3.6" + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + validations: + required: true + - type: textarea + attributes: + label: Steps to Reproduce + description: > + Describe in detail the exact steps that someone else can take to + reproduce this bug using the current stable release of PDA. Begin with the + creation of any necessary database objects and call out every operation being + performed explicitly. If reporting a bug in the REST API, be sure to reconstruct + the raw HTTP request(s) being made. Additionally, **do not rely on the demo instance** for reproducing + suspected bugs, as its data is prone to modification or deletion at any time. + placeholder: | + 1. Click on "create widget" + 2. Set foo to 12 and bar to G + 3. Click the "create" button + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: What did you expect to happen? + placeholder: A new zone record should have been created with the specified values + validations: + required: true + - type: textarea + attributes: + label: Observed Behavior + description: What happened instead? + placeholder: A TypeError exception was raised + validations: + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..98109af7c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,12 @@ +# Reference: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser +blank_issues_enabled: false +contact_links: + - name: 📖 Contributing Policy + url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/docs/CONTRIBUTING.md + about: "Please read through our contributing policy before opening an issue or pull request" + - name: ❓ Discussion + url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions + about: "If you're just looking for help, try starting a discussion instead" + - name: 💬 Project Chat + url: https://mattermost.powerdnsadmin.org/ + about: "Join our Mattermost chat to discuss the project with other users and developers" \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/documentation_change.yaml b/.github/ISSUE_TEMPLATE/documentation_change.yaml new file mode 100644 index 000000000..584d4b488 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation_change.yaml @@ -0,0 +1,40 @@ +--- +name: 📖 Documentation Change +description: Suggest an addition or modification to the PDA documentation +labels: ["type: documentation"] +body: + - type: dropdown + attributes: + label: Change Type + description: What type of change are you proposing? + options: + - Addition + - Correction + - Removal + - Cleanup (formatting, typos, etc.) + validations: + required: true + - type: dropdown + attributes: + label: Area + description: To what section of the documentation does this change primarily pertain? + options: + - Features + - Installation/upgrade + - Getting started + - Configuration + - Customization + - Database Setup + - Debug + - Integrations/API + - Administration + - Development + - Other + validations: + required: true + - type: textarea + attributes: + label: Proposed Changes + description: Describe the proposed changes and why they are necessary. + validations: + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 000000000..b2e193428 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -0,0 +1,71 @@ +--- +name: ✨ Feature Request +description: Propose a new PDA feature or enhancement +labels: ["type: feature"] +body: + - type: markdown + attributes: + value: > + **NOTE:** This form is only for submitting well-formed proposals to extend or modify + PDA in some way. If you're trying to solve a problem but can't figure out how, or if + you still need time to work on the details of a proposed new feature, please start a + [discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions) instead. + - type: input + attributes: + label: PDA version + description: What version of PDA are you currently running? + options: + - "0.4.0" + - "0.3.0" + - "0.2.5" + - "0.2.4" + - "0.2.3" + - "0.2.2" + - "0.2.1" + - "0.2" + - "0.1" + - "I'm Not Sure" + validations: + required: true + - type: dropdown + attributes: + label: Feature type + options: + - Data model modification + - App Setting Addition + - Default App Setting Change + - New functionality + - Change to existing functionality + validations: + required: true + - type: textarea + attributes: + label: Proposed functionality + description: > + Describe in detail the new feature or behavior you are proposing. Include any specific changes + to work flows, data models, and/or the user interface. The more detail you provide here, the + greater chance your proposal has of being discussed. Feature requests which don't include an + actionable implementation plan will be rejected. + validations: + required: true + - type: textarea + attributes: + label: Use case + description: > + Explain how adding this functionality would benefit PDA users. What need does it address? + validations: + required: true + - type: textarea + attributes: + label: Database changes + description: > + Note any changes to the database schema necessary to support the new feature. For example, + does the proposal require adding a new model or field? (Not all new features require database + changes.) + - type: textarea + attributes: + label: External dependencies + description: > + List any new dependencies on external libraries or services that this new feature would + introduce. For example, does the proposal require the installation of a new Python package? + (Not all new features introduce new dependencies.) \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/housekeeping.yaml b/.github/ISSUE_TEMPLATE/housekeeping.yaml new file mode 100644 index 000000000..dba7e3c55 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/housekeeping.yaml @@ -0,0 +1,24 @@ +--- +name: 🏡 Housekeeping +description: A change pertaining to the codebase itself (developers only) +labels: ["type: housekeeping"] +body: + - type: markdown + attributes: + value: > + **NOTE:** This template is for use by maintainers only. Please do not submit + an issue using this template unless you have been specifically asked to do so. + - type: textarea + attributes: + label: Proposed Changes + description: > + Describe in detail the new feature or behavior you'd like to propose. + Include any specific changes to work flows, data models, or the user interface. + validations: + required: true + - type: textarea + attributes: + label: Justification + description: Please provide justification for the proposed change(s). + validations: + required: true \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..05a661177 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,14 @@ + +### Fixes: #1234 + + \ No newline at end of file diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 0c0b1c399..000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,20 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 60 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - bug / broken-feature - - bug / security-vulnerability - - feature / request - - mod / help-wanted -# Label to use when marking an issue as stale -staleLabel: mod / stale -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: true diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml new file mode 100644 index 000000000..938502495 --- /dev/null +++ b/.github/workflows/lock.yml @@ -0,0 +1,21 @@ +# lock-threads (https://github.com/marketplace/actions/lock-threads) +name: 'Lock threads' + +on: + schedule: + - cron: '0 3 * * *' + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +jobs: + lock: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v3 + with: + issue-inactive-days: 90 + pr-inactive-days: 30 + issue-lock-reason: 'resolved' \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..66fd367f6 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,45 @@ +# close-stale-issues (https://github.com/marketplace/actions/close-stale-issues) +name: 'Close stale issues/PRs' + +on: + schedule: + - cron: '0 4 * * *' + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v6 + with: + close-issue-message: > + This issue has been automatically closed due to lack of activity. In an + effort to reduce noise, please do not comment any further. Note that the + core maintainers may elect to reopen this issue at a later date if deemed + necessary. + close-pr-message: > + This PR has been automatically closed due to lack of activity. + days-before-stale: 90 + days-before-close: 30 + exempt-issue-labels: 'status: accepted,status: blocked,status: needs milestone' + operations-per-run: 100 + remove-stale-when-updated: false + stale-issue-label: 'mod / stale' + stale-issue-message: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. PDA + is governed by a small group of core maintainers which means not all opened + issues may receive direct feedback. **Do not** attempt to circumvent this + process by "bumping" the issue; doing so will result in its immediate closure + and you may be barred from participating in any future discussions. Please see + our [contributing guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/docs/CONTRIBUTING.md). + stale-pr-label: 'mod / stale' + stale-pr-message: > + This PR has been automatically marked as stale because it has not had + recent activity. It will be closed automatically if no further action is + taken. \ No newline at end of file diff --git a/README.md b/README.md index 5d07f932c..1cc644c2c 100644 --- a/README.md +++ b/README.md @@ -74,9 +74,13 @@ You can then access PowerDNS-Admin by pointing your browser to http://localhost: ## Contributing -Please see our [contributing guidelines](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/docs/CONTRIBUTING.md). +Please see our [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/docs/CONTRIBUTING.md). + +## Code of Conduct + +Please see our [Code of Conduct Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/docs/CODE_OF_CONDUCT.md). ## License This project is released under the MIT license. For additional -information, [see here](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/LICENSE) +information, [see the full license](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/LICENSE). diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..54b10d73a --- /dev/null +++ b/docs/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Code of Conduct + +# Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [admin@powerdnsadmin.org](mailto:admin@powerdnsadmin.org). All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index df50ba2b0..8c82a802f 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,88 +1,103 @@ -# Contributing +# Contribution Guide -Before submitting new contributions to this repository, it is a good idea to start a discussion with the repository -maintainers on GitHub through the use of issues or discussions. This will help to ensure that your efforts don't get -wasted if the submission is not desirable for the project. +**Looking for help?** PDA has a somewhat active community of fellow users that may be able to provide assistance. Just [start a discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions/new) right here on GitHub! -This is not to say that all contributions that have been discussed will be accepted either. As part of an ongoing -effort to clean up the codebase, some contributions may be rejected if they do not meet the standards of the project -which have not been fully defined yet. This is a work in progress. +
    +

    + :bug: Report a bug · + :bulb: Suggest a feature · + :arrow_heading_up: Submit a pull request +

    +

    + :rescue_worker_helmet: Become a maintainer · + :heart: Other ideas +

    +
    +

    -Please note we have a code of conduct, please follow it in all your interactions with the project. +Some general tips for engaging here on GitHub: -All pull requests should be based on the `dev` branch of this repository and not the `master` branch! +* Register for a free [GitHub account](https://github.com/signup) if you haven't already. +* You can use [GitHub Markdown](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) for formatting text and adding images. +* To help mitigate notification spam, please avoid "bumping" issues with no activity. (To vote an issue up or down, use a :thumbsup: or :thumbsdown: reaction.) +* Please avoid pinging members with `@` unless they've previously expressed interest or involvement with that particular issue. -## Code of Conduct +## :bug: Reporting Bugs -### Our Pledge +* First, ensure that you're running the [latest stable version](https://github.com/PowerDNS-Admin/PowerDNS-Admin/releases) of PDA. If you're running an older version, there's a chance that the bug has already been fixed. -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. +* Next, search our [issues list](https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues?q=is%3Aissue) to see if the bug you've found has already been reported. If you come across a bug report that seems to match, please click "add a reaction" in the top right corner of the issue and add a thumbs up (:thumbsup:). This will help draw more attention to it. Any comments you can add to provide additional information or context would also be much appreciated. -### Our Standards +* If you can't find any existing issues (open or closed) that seem to match yours, you're welcome to [submit a new bug report](https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues/new?label=type%3A+bug&template=bug_report.yaml). Be sure to complete the entire report template, including detailed steps that someone triaging your issue can follow to confirm the reported behavior. (If we're not able to replicate the bug based on the information provided, we'll ask for additional detail.) -Examples of behavior that contributes to creating a positive environment -include: +* Some other tips to keep in mind: + * Error messages and screenshots are especially helpful. + * Don't prepend your issue title with a label like `[Bug]`; the proper label will be assigned automatically. + * Verify that you have GitHub notifications enabled and are subscribed to your issue after submitting. + * We appreciate your patience as bugs are prioritized by their severity, impact, and difficulty to resolve. -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +## :bulb: Feature Requests -Examples of unacceptable behavior by participants include: +* First, check the GitHub [issues list](https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues?q=is%3Aissue) to see if the feature you have in mind has already been proposed. If you happen to find an open feature request that matches your idea, click "add a reaction" in the top right corner of the issue and add a thumbs up (:thumbsup:). This ensures that the issue has a better chance of receiving attention. Also feel free to add a comment with any additional justification for the feature. -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting +* If you have a rough idea that's not quite ready for formal submission yet, start a [GitHub discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions) instead. This is a great way to test the viability and narrow down the scope of a new feature prior to submitting a formal proposal, and can serve to generate interest in your idea from other community members. -### Our Responsibilities +* Once you're ready, submit a feature request [using this template](https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues/new?label=type%3A+feature&template=feature_request.yaml). Be sure to provide sufficient context and detail to convey exactly what you're proposing and why. The stronger your use case, the better chance your proposal has of being accepted. -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. +* Some other tips to keep in mind: + * Don't prepend your issue title with a label like `[Feature]`; the proper label will be assigned automatically. + * Try to anticipate any likely questions about your proposal and provide that information proactively. + * Verify that you have GitHub notifications enabled and are subscribed to your issue after submitting. + * You're welcome to volunteer to implement your FR, but don't submit a pull request until it has been approved. -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. +## :arrow_heading_up: Submitting Pull Requests -### Scope +* [Pull requests](https://docs.github.com/en/pull-requests) (a feature of GitHub) are used to propose changes to NetBox's code base. Our process generally goes like this: + * A user opens a new issue (bug report or feature request) + * A maintainer triages the issue and may mark it as needing an owner + * The issue's author can volunteer to own it, or someone else can + * A maintainer assigns the issue to whomever volunteers + * The issue owner submits a pull request that will resolve the issue + * A maintainer reviews and merges the pull request, closing the issue -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. +* It's very important that you not submit a pull request until a relevant issue has been opened **and** assigned to you. Otherwise, you risk wasting time on work that may ultimately not be needed. -### Enforcement +* New pull requests should generally be based off of the `dev` branch, rather than `master`. The `dev` branch is used for ongoing development, while `master` is used for tracking stable releases. -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at [admin@powerdnsadmin.org](mailto:admin@powerdnsadmin.org). All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. +* In most cases, it is not necessary to add a changelog entry: A maintainer will take care of this when the PR is merged. (This helps avoid merge conflicts resulting from multiple PRs being submitted simultaneously.) -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. +* All code submissions should meet the following criteria (CI will eventually enforce these checks): + * Python syntax is valid + * PEP 8 compliance is enforced, with the exception that lines may be + greater than 80 characters in length -### Attribution +* Some other tips to keep in mind: + * If you'd like to volunteer for someone else's issue, please post a comment on that issue letting us know. (This will allow the maintainers to assign it to you.) + * All new functionality must include relevant tests where applicable. -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] +## :rescue_worker_helmet: Become a Maintainer -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ +We're always looking for motivated individuals to join the maintainers team and help drive PDA's long-term development. Some of our most sought-after skills include: + +* Python development with a strong focus on the [Flask](https://flask.palletsprojects.com/) and [Django](https://www.djangoproject.com/) frameworks +* Expertise working with SQLite, MySQL, and/or PostgreSQL databases +* Javascript & TypeScript proficiency +* A knack for web application design (HTML & CSS) +* Familiarity with git and software development best practices +* Excellent attention to detail +* Working experience in the field of network operations as it relates to the use of DNS (Domain Name System) servers. + +We generally ask that maintainers dedicate around four hours of work to the project each week on average, which includes both hands-on development and project management tasks such as issue triage. + +We do maintain an active Mattermost instance for internal communication, but we also use GitHub issues for project management. + +Some maintainers petition their employer to grant some of their paid time to work on PDA. + +Interested? You can contact our lead maintainer, Matt Scott, at admin@powerdnsadmin.org. We'd love to have you on the team! + +## :heart: Other Ways to Contribute + +You don't have to be a developer to contribute to PDA: There are plenty of other ways you can add value to the community! Below are just a few examples: + +* Help answer questions and provide feedback in our [GitHub discussions](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions). +* Write a blog article or record a YouTube video demonstrating how PDA is used at your organization. diff --git a/docs/SECURITY.md b/docs/SECURITY.md new file mode 100644 index 000000000..bd91d3626 --- /dev/null +++ b/docs/SECURITY.md @@ -0,0 +1,31 @@ +# Security Policy + +## No Warranty + +Per the terms of the MIT license, PDA is offered "as is" and without any guarantee or warranty pertaining to its operation. While every reasonable effort is made by its maintainers to ensure the product remains free of security vulnerabilities, users are ultimately responsible for conducting their own evaluations of each software release. + +## Recommendations + +Administrators are encouraged to adhere to industry best practices concerning the secure operation of software, such as: + +* Do not expose your PDA installation to the public Internet +* Do not permit multiple users to share an account +* Enforce minimum password complexity requirements for local accounts +* Prohibit access to your database from clients other than the PDA application +* Keep your deployment updated to the most recent stable release + +## Reporting a Suspected Vulnerability + +If you believe you've uncovered a security vulnerability and wish to report it confidentially, you may do so via email. Please note that any reported vulnerabilities **MUST** meet all the following conditions: + +* Affects the most recent stable release of PDA, or a current beta release +* Affects a PDA instance installed and configured per the official documentation +* Is reproducible following a prescribed set of instructions + +Please note that we **DO NOT** accept reports generated by automated tooling which merely suggest that a file or file(s) _may_ be vulnerable under certain conditions, as these are most often innocuous. + +If you believe that you've found a vulnerability which meets all of these conditions, please [submit a draft security advisory](https://github.com/PowerDNS-Admin/PowerDNS-Admin/security/advisories/new) on GitHub, or email a brief description of the suspected bug and instructions for reproduction to **admin@powerdnsadmin.org**. + +### Bug Bounties + +As PDA is provided as free open source software, we do not offer any monetary compensation for vulnerability or bug reports, however your contributions are greatly appreciated. \ No newline at end of file From 6681d0f5b034a223bef8408f9b2cec03ccd296d1 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 16:46:34 -0400 Subject: [PATCH 347/475] Relocated new security policy to the project root to meet GitHub feature expectations. --- docs/SECURITY.md => SECURITY.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/SECURITY.md => SECURITY.md (100%) diff --git a/docs/SECURITY.md b/SECURITY.md similarity index 100% rename from docs/SECURITY.md rename to SECURITY.md From 31c8577409f191189e9550a8fc79d3890ee07e70 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 16:48:11 -0400 Subject: [PATCH 348/475] Updated project README to include reference to new security policy. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 1cc644c2c..ea2c1a11c 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,10 @@ You can then access PowerDNS-Admin by pointing your browser to http://localhost: ![dashboard](docs/screenshots/dashboard.png) +## Security Issues / Reports + +Please see our [Security Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/SECURITY.md). + ## Contributing Please see our [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/docs/CONTRIBUTING.md). From fc6d8505b7c7ecc0272d16125e9770f05d85d491 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 17:29:05 -0400 Subject: [PATCH 349/475] Corrected an input type mistake in the bug report and feature request templates. Corrected URL mistake in the issue template config.yml file. Updated project README policy reference URLs to use master branch. --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yaml | 2 +- README.md | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 5bacd4e6e..640cff8f8 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -10,7 +10,7 @@ body: installation. If you're having trouble with installation or just looking for assistance with using PDA, please visit our [discussion forum](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions) instead. - - type: input + - type: dropdown attributes: label: PDA version description: What version of PDA are you currently running? diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 98109af7c..1ecb2e9ae 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,7 +2,7 @@ blank_issues_enabled: false contact_links: - name: 📖 Contributing Policy - url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/docs/CONTRIBUTING.md + url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md about: "Please read through our contributing policy before opening an issue or pull request" - name: ❓ Discussion url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index b2e193428..fa1db00d7 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -10,7 +10,7 @@ body: PDA in some way. If you're trying to solve a problem but can't figure out how, or if you still need time to work on the details of a proposed new feature, please start a [discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions) instead. - - type: input + - type: dropdown attributes: label: PDA version description: What version of PDA are you currently running? diff --git a/README.md b/README.md index ea2c1a11c..c16bbca3a 100644 --- a/README.md +++ b/README.md @@ -74,15 +74,15 @@ You can then access PowerDNS-Admin by pointing your browser to http://localhost: ## Security Issues / Reports -Please see our [Security Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/SECURITY.md). +Please see our [Security Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/SECURITY.md). ## Contributing -Please see our [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/docs/CONTRIBUTING.md). +Please see our [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). ## Code of Conduct -Please see our [Code of Conduct Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/docs/CODE_OF_CONDUCT.md). +Please see our [Code of Conduct Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CODE_OF_CONDUCT.md). ## License From a2e5c7d5bced8f3466a4a1f00a8d538194435b69 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 17:29:05 -0400 Subject: [PATCH 350/475] Corrected an input type mistake in the bug report and feature request templates. Corrected URL mistake in the issue template config.yml file. Updated project README policy reference URLs to use master branch. --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yaml | 2 +- README.md | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 5bacd4e6e..640cff8f8 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -10,7 +10,7 @@ body: installation. If you're having trouble with installation or just looking for assistance with using PDA, please visit our [discussion forum](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions) instead. - - type: input + - type: dropdown attributes: label: PDA version description: What version of PDA are you currently running? diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 98109af7c..1ecb2e9ae 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,7 +2,7 @@ blank_issues_enabled: false contact_links: - name: 📖 Contributing Policy - url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/docs/CONTRIBUTING.md + url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md about: "Please read through our contributing policy before opening an issue or pull request" - name: ❓ Discussion url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index b2e193428..fa1db00d7 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -10,7 +10,7 @@ body: PDA in some way. If you're trying to solve a problem but can't figure out how, or if you still need time to work on the details of a proposed new feature, please start a [discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions) instead. - - type: input + - type: dropdown attributes: label: PDA version description: What version of PDA are you currently running? diff --git a/README.md b/README.md index ea2c1a11c..c16bbca3a 100644 --- a/README.md +++ b/README.md @@ -74,15 +74,15 @@ You can then access PowerDNS-Admin by pointing your browser to http://localhost: ## Security Issues / Reports -Please see our [Security Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/SECURITY.md). +Please see our [Security Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/SECURITY.md). ## Contributing -Please see our [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/docs/CONTRIBUTING.md). +Please see our [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). ## Code of Conduct -Please see our [Code of Conduct Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/dev/docs/CODE_OF_CONDUCT.md). +Please see our [Code of Conduct Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CODE_OF_CONDUCT.md). ## License From ae16e9868ae3555c4a6c2185229a6b42b8b072fc Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 17:48:07 -0400 Subject: [PATCH 351/475] Corrected project name reference mistake in contribution guide. --- docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 8c82a802f..8acf50cda 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -52,7 +52,7 @@ Some general tips for engaging here on GitHub: ## :arrow_heading_up: Submitting Pull Requests -* [Pull requests](https://docs.github.com/en/pull-requests) (a feature of GitHub) are used to propose changes to NetBox's code base. Our process generally goes like this: +* [Pull requests](https://docs.github.com/en/pull-requests) (a feature of GitHub) are used to propose changes to PDA's code base. Our process generally goes like this: * A user opens a new issue (bug report or feature request) * A maintainer triages the issue and may mark it as needing an owner * The issue's author can volunteer to own it, or someone else can From 1358e47b5be6da1380a9dfb8440c0e4f9f31a79a Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 17:48:07 -0400 Subject: [PATCH 352/475] Corrected project name reference mistake in contribution guide. --- docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 8c82a802f..8acf50cda 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -52,7 +52,7 @@ Some general tips for engaging here on GitHub: ## :arrow_heading_up: Submitting Pull Requests -* [Pull requests](https://docs.github.com/en/pull-requests) (a feature of GitHub) are used to propose changes to NetBox's code base. Our process generally goes like this: +* [Pull requests](https://docs.github.com/en/pull-requests) (a feature of GitHub) are used to propose changes to PDA's code base. Our process generally goes like this: * A user opens a new issue (bug report or feature request) * A maintainer triages the issue and may mark it as needing an owner * The issue's author can volunteer to own it, or someone else can From 687571101f52dde9d662c1c34edb2b07f68bc375 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 17:56:59 -0400 Subject: [PATCH 353/475] Updated stale issue / PR workflow to include proper exceptions. --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 66fd367f6..d0a3e0d30 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -26,7 +26,7 @@ jobs: This PR has been automatically closed due to lack of activity. days-before-stale: 90 days-before-close: 30 - exempt-issue-labels: 'status: accepted,status: blocked,status: needs milestone' + exempt-issue-labels: 'mod / announcement, mod / accepted, mod / reviewing, mod / testing' operations-per-run: 100 remove-stale-when-updated: false stale-issue-label: 'mod / stale' From 1bfb5429a1553a8eef45a529fcd4694934ae510e Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 17:56:59 -0400 Subject: [PATCH 354/475] Updated stale issue / PR workflow to include proper exceptions. --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 66fd367f6..d0a3e0d30 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -26,7 +26,7 @@ jobs: This PR has been automatically closed due to lack of activity. days-before-stale: 90 days-before-close: 30 - exempt-issue-labels: 'status: accepted,status: blocked,status: needs milestone' + exempt-issue-labels: 'mod / announcement, mod / accepted, mod / reviewing, mod / testing' operations-per-run: 100 remove-stale-when-updated: false stale-issue-label: 'mod / stale' From 3294ed80f3d16fe62408569064ecbecde91a57d9 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 18:03:18 -0400 Subject: [PATCH 355/475] Updated labels for the issue templates. --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- .github/ISSUE_TEMPLATE/documentation_change.yaml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yaml | 2 +- .github/ISSUE_TEMPLATE/housekeeping.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 640cff8f8..0c5a2d72f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,7 +1,7 @@ --- name: 🐛 Bug Report description: Report a reproducible bug in the current release of PDA -labels: ["type: bug"] +labels: ["bug / broken-feature"] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/documentation_change.yaml b/.github/ISSUE_TEMPLATE/documentation_change.yaml index 584d4b488..0b34991b4 100644 --- a/.github/ISSUE_TEMPLATE/documentation_change.yaml +++ b/.github/ISSUE_TEMPLATE/documentation_change.yaml @@ -1,7 +1,7 @@ --- name: 📖 Documentation Change description: Suggest an addition or modification to the PDA documentation -labels: ["type: documentation"] +labels: ["docs / request"] body: - type: dropdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index fa1db00d7..e649c6195 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -1,7 +1,7 @@ --- name: ✨ Feature Request description: Propose a new PDA feature or enhancement -labels: ["type: feature"] +labels: ["feature / request"] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/housekeeping.yaml b/.github/ISSUE_TEMPLATE/housekeeping.yaml index dba7e3c55..2d8e5dfc5 100644 --- a/.github/ISSUE_TEMPLATE/housekeeping.yaml +++ b/.github/ISSUE_TEMPLATE/housekeeping.yaml @@ -1,7 +1,7 @@ --- name: 🏡 Housekeeping description: A change pertaining to the codebase itself (developers only) -labels: ["type: housekeeping"] +labels: ["mod / change-request"] body: - type: markdown attributes: From 98e6b8946f08a41bd224265fbdee46834ccefafc Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 18:03:18 -0400 Subject: [PATCH 356/475] Updated labels for the issue templates. --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- .github/ISSUE_TEMPLATE/documentation_change.yaml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yaml | 2 +- .github/ISSUE_TEMPLATE/housekeeping.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 640cff8f8..0c5a2d72f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,7 +1,7 @@ --- name: 🐛 Bug Report description: Report a reproducible bug in the current release of PDA -labels: ["type: bug"] +labels: ["bug / broken-feature"] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/documentation_change.yaml b/.github/ISSUE_TEMPLATE/documentation_change.yaml index 584d4b488..0b34991b4 100644 --- a/.github/ISSUE_TEMPLATE/documentation_change.yaml +++ b/.github/ISSUE_TEMPLATE/documentation_change.yaml @@ -1,7 +1,7 @@ --- name: 📖 Documentation Change description: Suggest an addition or modification to the PDA documentation -labels: ["type: documentation"] +labels: ["docs / request"] body: - type: dropdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index fa1db00d7..e649c6195 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -1,7 +1,7 @@ --- name: ✨ Feature Request description: Propose a new PDA feature or enhancement -labels: ["type: feature"] +labels: ["feature / request"] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/housekeeping.yaml b/.github/ISSUE_TEMPLATE/housekeeping.yaml index dba7e3c55..2d8e5dfc5 100644 --- a/.github/ISSUE_TEMPLATE/housekeeping.yaml +++ b/.github/ISSUE_TEMPLATE/housekeeping.yaml @@ -1,7 +1,7 @@ --- name: 🏡 Housekeeping description: A change pertaining to the codebase itself (developers only) -labels: ["type: housekeeping"] +labels: ["mod / change-request"] body: - type: markdown attributes: From 763f06a830bae24ce16b8580a09323bac3c79f80 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 18:16:06 -0400 Subject: [PATCH 357/475] Corrected URL mistake in stale issue / PR workflow. --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d0a3e0d30..2c6284cad 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -37,7 +37,7 @@ jobs: issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see - our [contributing guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/docs/CONTRIBUTING.md). + our [contributing guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). stale-pr-label: 'mod / stale' stale-pr-message: > This PR has been automatically marked as stale because it has not had From 92f5071a84135e2058fc6dfc1cd3401cc66b16c5 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 18:16:06 -0400 Subject: [PATCH 358/475] Corrected URL mistake in stale issue / PR workflow. --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d0a3e0d30..2c6284cad 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -37,7 +37,7 @@ jobs: issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see - our [contributing guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/docs/CONTRIBUTING.md). + our [contributing guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). stale-pr-label: 'mod / stale' stale-pr-message: > This PR has been automatically marked as stale because it has not had From 2ca712af4951b3a5f9729ec424414203c495a6da Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 18:25:05 -0400 Subject: [PATCH 359/475] Updated the stale issue / PR workflow to include better verbiage for the contribution guide. Also updated the stale issue / PR workflow to exclude security vulnerabilities. --- .github/workflows/stale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 2c6284cad..666cab72c 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -26,7 +26,7 @@ jobs: This PR has been automatically closed due to lack of activity. days-before-stale: 90 days-before-close: 30 - exempt-issue-labels: 'mod / announcement, mod / accepted, mod / reviewing, mod / testing' + exempt-issue-labels: 'bug / security-vulnerability, mod / announcement, mod / accepted, mod / reviewing, mod / testing' operations-per-run: 100 remove-stale-when-updated: false stale-issue-label: 'mod / stale' @@ -37,7 +37,7 @@ jobs: issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see - our [contributing guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). + our [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). stale-pr-label: 'mod / stale' stale-pr-message: > This PR has been automatically marked as stale because it has not had From 1aac3c0f0d2fdca15e03fcbe9cd5870c123bd31a Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 17 Mar 2023 18:25:05 -0400 Subject: [PATCH 360/475] Updated the stale issue / PR workflow to include better verbiage for the contribution guide. Also updated the stale issue / PR workflow to exclude security vulnerabilities. --- .github/workflows/stale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 2c6284cad..666cab72c 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -26,7 +26,7 @@ jobs: This PR has been automatically closed due to lack of activity. days-before-stale: 90 days-before-close: 30 - exempt-issue-labels: 'mod / announcement, mod / accepted, mod / reviewing, mod / testing' + exempt-issue-labels: 'bug / security-vulnerability, mod / announcement, mod / accepted, mod / reviewing, mod / testing' operations-per-run: 100 remove-stale-when-updated: false stale-issue-label: 'mod / stale' @@ -37,7 +37,7 @@ jobs: issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see - our [contributing guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). + our [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). stale-pr-label: 'mod / stale' stale-pr-message: > This PR has been automatically marked as stale because it has not had From d716f8cc880e8048d89618509d964cd6dac8b6c3 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 18 Mar 2023 08:48:07 -0400 Subject: [PATCH 361/475] Updated various yaml files to include proper opening lines. Tweaked the name of the stale threads workflow. --- .github/ISSUE_TEMPLATE/config.yml | 1 + .github/dependabot.yml | 1 + .github/labels.yml | 4 ++++ .github/workflows/build-and-publish.yml | 2 +- .github/workflows/codeql-analysis.yml | 1 + .github/workflows/lock.yml | 1 + .github/workflows/stale.yml | 2 +- 7 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 1ecb2e9ae..6aba80c68 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,3 +1,4 @@ +--- # Reference: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser blank_issues_enabled: false contact_links: diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 68dd93227..898c59439 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,4 @@ +--- version: 2 updates: - package-ecosystem: npm diff --git a/.github/labels.yml b/.github/labels.yml index c113abb1e..e17cd97d8 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -1,3 +1,4 @@ +--- labels: - name: bug / broken-feature description: Existing feature malfunctioning or broken @@ -38,6 +39,9 @@ labels: - name: mod / announcement description: This is an admin announcement color: 'e5ef23' + - name: mod / change-request + description: Used by internal developers to indicate a change-request. + color: 'e5ef23' - name: mod / changes-requested description: Changes have been requested before proceeding color: 'e5ef23' diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index f76ed984b..74085f0a8 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -1,3 +1,4 @@ +--- name: 'Docker Image' on: @@ -42,7 +43,6 @@ jobs: - name: Docker Image Build uses: docker/build-push-action@v2 - #if: github.ref == 'refs/heads/master' with: context: ./ file: ./docker/Dockerfile diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7f2f14816..b54abf19d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,3 +1,4 @@ +--- # For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 938502495..2005b4538 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -1,3 +1,4 @@ +--- # lock-threads (https://github.com/marketplace/actions/lock-threads) name: 'Lock threads' diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 666cab72c..b14dc6632 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,5 +1,5 @@ # close-stale-issues (https://github.com/marketplace/actions/close-stale-issues) -name: 'Close stale issues/PRs' +name: 'Close Stale Threads' on: schedule: From 2606ad0395a6c08ce9761c6ca4769bb39a53712b Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 18 Mar 2023 08:48:07 -0400 Subject: [PATCH 362/475] Updated various yaml files to include proper opening lines. Tweaked the name of the stale threads workflow. --- .github/ISSUE_TEMPLATE/config.yml | 1 + .github/dependabot.yml | 1 + .github/labels.yml | 4 ++++ .github/workflows/build-and-publish.yml | 2 +- .github/workflows/codeql-analysis.yml | 1 + .github/workflows/lock.yml | 1 + .github/workflows/stale.yml | 2 +- 7 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 1ecb2e9ae..6aba80c68 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,3 +1,4 @@ +--- # Reference: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser blank_issues_enabled: false contact_links: diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 68dd93227..898c59439 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,4 @@ +--- version: 2 updates: - package-ecosystem: npm diff --git a/.github/labels.yml b/.github/labels.yml index c113abb1e..e17cd97d8 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -1,3 +1,4 @@ +--- labels: - name: bug / broken-feature description: Existing feature malfunctioning or broken @@ -38,6 +39,9 @@ labels: - name: mod / announcement description: This is an admin announcement color: 'e5ef23' + - name: mod / change-request + description: Used by internal developers to indicate a change-request. + color: 'e5ef23' - name: mod / changes-requested description: Changes have been requested before proceeding color: 'e5ef23' diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index f76ed984b..74085f0a8 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -1,3 +1,4 @@ +--- name: 'Docker Image' on: @@ -42,7 +43,6 @@ jobs: - name: Docker Image Build uses: docker/build-push-action@v2 - #if: github.ref == 'refs/heads/master' with: context: ./ file: ./docker/Dockerfile diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7f2f14816..b54abf19d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,3 +1,4 @@ +--- # For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 938502495..2005b4538 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -1,3 +1,4 @@ +--- # lock-threads (https://github.com/marketplace/actions/lock-threads) name: 'Lock threads' diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 666cab72c..b14dc6632 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,5 +1,5 @@ # close-stale-issues (https://github.com/marketplace/actions/close-stale-issues) -name: 'Close stale issues/PRs' +name: 'Close Stale Threads' on: schedule: From 340e84ab893f671ac1b46f18d1b7a7e0351e9f9c Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 18 Mar 2023 08:52:39 -0400 Subject: [PATCH 363/475] Updated MegaLinter workflow to include a manual dispatch option. --- .github/workflows/mega-linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 943d3a30c..fec231edb 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -4,6 +4,7 @@ name: MegaLinter on: + workflow_dispatch: push: branches-ignore: - "*" From f44ff7d26149f14524afebec28aa41e9893c7ced Mon Sep 17 00:00:00 2001 From: Nigel Kukard Date: Sat, 18 Mar 2023 19:14:58 +0000 Subject: [PATCH 364/475] fix: fixed session clearing and let logout_user take care of cleanup It seems when logging in and logging out, then logging back in, setting the session timeout to 5 minutes, then waiting for expiry can cause a situation when using SQLA-based sessions which results in a NULL field in the database and causes a persistent 500 Internal Server Error. As per issue 1439 here is a fix found by @raunz. Resolves #1439. Tested for about 8 hours and tons and tons of expired sessions, could not reproduce with the fix applied. --- powerdnsadmin/routes/index.py | 1 - 1 file changed, 1 deletion(-) diff --git a/powerdnsadmin/routes/index.py b/powerdnsadmin/routes/index.py index a21ad31e5..19fd27735 100644 --- a/powerdnsadmin/routes/index.py +++ b/powerdnsadmin/routes/index.py @@ -528,7 +528,6 @@ def clear_session(): session.pop('google_token', None) session.pop('authentication_type', None) session.pop('remote_user', None) - session.clear() logout_user() From 138532fb95ed803a26299ad4da43be245d05519b Mon Sep 17 00:00:00 2001 From: Nigel Kukard Date: Sat, 18 Mar 2023 20:27:02 +0000 Subject: [PATCH 365/475] fix: allow the specification of any combination of groups in LDAP group security configuration Previous behavior required the specification of all three group security groups before the "Save Settings" button would be enabled. This adds a check into users.py which checks that the group is set before searching and removes the javascript preventing the specification of any combination of groups. Tested: - Tested all combinations on AD after MR 1238 - Tested all combinations on OpenLDAP - Tested enabling the Group Security with no groups set which correctly prevents login Resolves #1462 --- powerdnsadmin/models/user.py | 25 ++++++------------- .../admin_setting_authentication.html | 6 ----- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/powerdnsadmin/models/user.py b/powerdnsadmin/models/user.py index 24b43e9a2..e989aa0cb 100644 --- a/powerdnsadmin/models/user.py +++ b/powerdnsadmin/models/user.py @@ -255,33 +255,24 @@ def is_validate(self, method, src_ip='', trust_user=False): if LDAP_TYPE == 'ldap': groupSearchFilter = "(&({0}={1}){2})".format(LDAP_FILTER_GROUPNAME, ldap_username, LDAP_FILTER_GROUP) current_app.logger.debug('Ldap groupSearchFilter {0}'.format(groupSearchFilter)) - if (self.ldap_search(groupSearchFilter, - LDAP_ADMIN_GROUP)): + if (LDAP_ADMIN_GROUP and self.ldap_search(groupSearchFilter, LDAP_ADMIN_GROUP)): role_name = 'Administrator' current_app.logger.info( 'User {0} is part of the "{1}" group that allows admin access to PowerDNS-Admin' - .format(self.username, - LDAP_ADMIN_GROUP)) - elif (self.ldap_search(groupSearchFilter, - LDAP_OPERATOR_GROUP)): + .format(self.username, LDAP_ADMIN_GROUP)) + elif (LDAP_OPERATOR_GROUP and self.ldap_search(groupSearchFilter, LDAP_OPERATOR_GROUP)): role_name = 'Operator' current_app.logger.info( 'User {0} is part of the "{1}" group that allows operator access to PowerDNS-Admin' - .format(self.username, - LDAP_OPERATOR_GROUP)) - elif (self.ldap_search(groupSearchFilter, - LDAP_USER_GROUP)): + .format(self.username, LDAP_OPERATOR_GROUP)) + elif (LDAP_USER_GROUP and self.ldap_search(groupSearchFilter, LDAP_USER_GROUP)): current_app.logger.info( 'User {0} is part of the "{1}" group that allows user access to PowerDNS-Admin' - .format(self.username, - LDAP_USER_GROUP)) + .format(self.username, LDAP_USER_GROUP)) else: current_app.logger.error( - 'User {0} is not part of the "{1}", "{2}" or "{3}" groups that allow access to PowerDNS-Admin' - .format(self.username, - LDAP_ADMIN_GROUP, - LDAP_OPERATOR_GROUP, - LDAP_USER_GROUP)) + 'User {0} is not part of any security groups that allow access to PowerDNS-Admin' + .format(self.username)) return False elif LDAP_TYPE == 'ad': ldap_group_security_roles = OrderedDict( diff --git a/powerdnsadmin/templates/admin_setting_authentication.html b/powerdnsadmin/templates/admin_setting_authentication.html index a4c028865..c5459588e 100644 --- a/powerdnsadmin/templates/admin_setting_authentication.html +++ b/powerdnsadmin/templates/admin_setting_authentication.html @@ -1772,12 +1772,6 @@

    Settings Help

    $('#ldap_filter_username').prop('required', true); $('#ldap_filter_groupname').prop('required', true); - if ($('#ldap_sg_on').is(":checked")) { - $('#ldap_admin_group').prop('required', true); - $('#ldap_operator_group').prop('required', true); - $('#ldap_user_group').prop('required', true); - } - if ($('#autoprovisioning_on').is(":checked")) { $('#autoprovisioning_attribute').prop('required', true); $('#urn_value').prop('required', true); From 33614ae1028932bdda8913bb8c3b8dd8071e72a0 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 18 Mar 2023 19:20:36 -0400 Subject: [PATCH 366/475] Updated invalid value in dependabot workflow. --- .github/dependabot.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 898c59439..29095aab9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,8 @@ updates: ignore: - dependency-name: "*" update-types: [ "version-update:semver-major" ] - labels: feature / dependency + labels: + - 'feature / dependency' - package-ecosystem: pip directory: / schedule: @@ -16,4 +17,5 @@ updates: ignore: - dependency-name: "*" update-types: [ "version-update:semver-major" ] - labels: feature / dependency + labels: + - 'feature / dependency' From ca4bf18f6734326c5091f145760d4f37245bfcc3 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 18 Mar 2023 19:20:36 -0400 Subject: [PATCH 367/475] Updated invalid value in dependabot workflow. --- .github/dependabot.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 898c59439..29095aab9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,8 @@ updates: ignore: - dependency-name: "*" update-types: [ "version-update:semver-major" ] - labels: feature / dependency + labels: + - 'feature / dependency' - package-ecosystem: pip directory: / schedule: @@ -16,4 +17,5 @@ updates: ignore: - dependency-name: "*" update-types: [ "version-update:semver-major" ] - labels: feature / dependency + labels: + - 'feature / dependency' From 78e8d9950dc7a52d6eb656dba02b7c00e12e0690 Mon Sep 17 00:00:00 2001 From: Nigel Kukard Date: Sat, 18 Mar 2023 23:22:01 +0000 Subject: [PATCH 368/475] fix: upgrade setuptools to fix CVE-2022-40897 --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c6fcaf4e9..a80216347 100644 --- a/requirements.txt +++ b/requirements.txt @@ -44,4 +44,5 @@ werkzeug==2.1.2 zipp==3.11.0 rcssmin==1.1.1 zxcvbn==4.4.28 -psycopg2==2.9.5 \ No newline at end of file +psycopg2==2.9.5 +setuptools==65.5.1 # fixes CVE-2022-40897 \ No newline at end of file From e7547ff8d3c0e4570c6d8b0d43c3c17a0ef10613 Mon Sep 17 00:00:00 2001 From: Nigel Kukard Date: Sat, 18 Mar 2023 23:43:51 +0000 Subject: [PATCH 369/475] fix: fix for CVE-2023-0286 & CVE-2023-23931 - cryptography update to 39.0.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a80216347..0db7b16fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,7 @@ bravado-core==5.17.1 certifi==2022.12.7 cffi==1.15.1 configobj==5.0.8 -cryptography==36.0.2 +cryptography==39.0.2 # fixes CVE-2023-0286, CVE-2023-23931 cssmin==0.2.0 dnspython>=2.3.0 flask_session_captcha==1.3.0 From 522705a52bfe4fb3e2e6cf03223671778da6cf87 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 18 Mar 2023 20:49:01 -0400 Subject: [PATCH 370/475] Updated dependabot configuration to target the dev branch. --- .github/dependabot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 29095aab9..482207e3b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,6 +2,7 @@ version: 2 updates: - package-ecosystem: npm + target-branch: dev directory: / schedule: interval: daily @@ -11,6 +12,7 @@ updates: labels: - 'feature / dependency' - package-ecosystem: pip + target-branch: dev directory: / schedule: interval: daily From 0a66089cad7f54a5bdf650dcef4f82cfa2b36e1e Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 18 Mar 2023 20:49:01 -0400 Subject: [PATCH 371/475] Updated dependabot configuration to target the dev branch. --- .github/dependabot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 29095aab9..482207e3b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,6 +2,7 @@ version: 2 updates: - package-ecosystem: npm + target-branch: dev directory: / schedule: interval: daily @@ -11,6 +12,7 @@ updates: labels: - 'feature / dependency' - package-ecosystem: pip + target-branch: dev directory: / schedule: interval: daily From 5acbabaed5e7ee7d4886eefac87881e08d09ac65 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 18 Mar 2023 20:55:20 -0400 Subject: [PATCH 372/475] Updated project README to include donation section. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index c16bbca3a..94d0133b3 100644 --- a/README.md +++ b/README.md @@ -88,3 +88,9 @@ Please see our [Code of Conduct Policy](https://github.com/PowerDNS-Admin/PowerD This project is released under the MIT license. For additional information, [see the full license](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/LICENSE). + +## Donate + +Like my work? + +Buy Me A Coffee \ No newline at end of file From 80b191bc0d2cfac1dbbfe1a9fd0c31e275569200 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 18 Mar 2023 20:55:20 -0400 Subject: [PATCH 373/475] Updated project README to include donation section. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index c16bbca3a..94d0133b3 100644 --- a/README.md +++ b/README.md @@ -88,3 +88,9 @@ Please see our [Code of Conduct Policy](https://github.com/PowerDNS-Admin/PowerD This project is released under the MIT license. For additional information, [see the full license](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/LICENSE). + +## Donate + +Like my work? + +Buy Me A Coffee \ No newline at end of file From 506a75300abf8f3b30106769b7751e32fc8c01e0 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 18 Mar 2023 21:45:28 -0400 Subject: [PATCH 374/475] Added GitHub sponsors configuration. --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..18e85f09f --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [AzorianSolutions] \ No newline at end of file From e11f55523d7c2d6158f9cca6e0ad3c996e71a7ba Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sun, 19 Mar 2023 12:36:44 -0400 Subject: [PATCH 375/475] Corrected minor formatting issue with project's Code of Conduct policy. --- docs/CODE_OF_CONDUCT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md index 54b10d73a..ed3cb4741 100644 --- a/docs/CODE_OF_CONDUCT.md +++ b/docs/CODE_OF_CONDUCT.md @@ -1,6 +1,6 @@ # Code of Conduct -# Our Pledge +## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and From 6b9638ca19aa984eff861a667368a95903e7b32c Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sun, 19 Mar 2023 12:39:44 -0400 Subject: [PATCH 376/475] Updated Security section header of the project README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 94d0133b3..b9f9da501 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ You can then access PowerDNS-Admin by pointing your browser to http://localhost: ![dashboard](docs/screenshots/dashboard.png) -## Security Issues / Reports +## Security Policy Please see our [Security Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/SECURITY.md). From ba19943c64eccacfbf0a00c72d97a75af783e69d Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sun, 19 Mar 2023 15:09:52 -0400 Subject: [PATCH 377/475] Updated stale thread workflow with updated message verbiage. Updated lock thread workflow to properly exclude threads with specific labels. --- .github/workflows/lock.yml | 4 +++- .github/workflows/stale.yml | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 2005b4538..cf6f0b338 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -19,4 +19,6 @@ jobs: with: issue-inactive-days: 90 pr-inactive-days: 30 - issue-lock-reason: 'resolved' \ No newline at end of file + issue-lock-reason: 'resolved' + exclude-any-issue-labels: 'bug / security-vulnerability, mod / announcement, mod / accepted, mod / reviewing, mod / testing' + exclude-any-pr-labels: 'bug / security-vulnerability, mod / announcement, mod / accepted, mod / reviewing, mod / testing' \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index b14dc6632..9b565ec09 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -36,10 +36,11 @@ jobs: is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure - and you may be barred from participating in any future discussions. Please see - our [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). + and you may be barred from participating in any future discussions. Please see our + [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). stale-pr-label: 'mod / stale' stale-pr-message: > This PR has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further action is - taken. \ No newline at end of file + taken. Please see our + [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). \ No newline at end of file From 4e54b5ae0a0e60470c8ed940d3645767dc6b554c Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 18 Mar 2023 21:45:28 -0400 Subject: [PATCH 378/475] Added GitHub sponsors configuration. --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..18e85f09f --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [AzorianSolutions] \ No newline at end of file From 976f52ce7afacb3de39c440dca44cd5348ea34a7 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sun, 19 Mar 2023 12:36:44 -0400 Subject: [PATCH 379/475] Corrected minor formatting issue with project's Code of Conduct policy. --- docs/CODE_OF_CONDUCT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md index 54b10d73a..ed3cb4741 100644 --- a/docs/CODE_OF_CONDUCT.md +++ b/docs/CODE_OF_CONDUCT.md @@ -1,6 +1,6 @@ # Code of Conduct -# Our Pledge +## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and From 236487eada0122c25929a9dff1e736e863376472 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sun, 19 Mar 2023 12:39:44 -0400 Subject: [PATCH 380/475] Updated Security section header of the project README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 94d0133b3..b9f9da501 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ You can then access PowerDNS-Admin by pointing your browser to http://localhost: ![dashboard](docs/screenshots/dashboard.png) -## Security Issues / Reports +## Security Policy Please see our [Security Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/SECURITY.md). From 55faefeedc3a0fa7818a2ad766f40601a8b92ce4 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sun, 19 Mar 2023 15:09:52 -0400 Subject: [PATCH 381/475] Updated stale thread workflow with updated message verbiage. Updated lock thread workflow to properly exclude threads with specific labels. --- .github/workflows/lock.yml | 4 +++- .github/workflows/stale.yml | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 2005b4538..cf6f0b338 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -19,4 +19,6 @@ jobs: with: issue-inactive-days: 90 pr-inactive-days: 30 - issue-lock-reason: 'resolved' \ No newline at end of file + issue-lock-reason: 'resolved' + exclude-any-issue-labels: 'bug / security-vulnerability, mod / announcement, mod / accepted, mod / reviewing, mod / testing' + exclude-any-pr-labels: 'bug / security-vulnerability, mod / announcement, mod / accepted, mod / reviewing, mod / testing' \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index b14dc6632..9b565ec09 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -36,10 +36,11 @@ jobs: is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure - and you may be barred from participating in any future discussions. Please see - our [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). + and you may be barred from participating in any future discussions. Please see our + [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). stale-pr-label: 'mod / stale' stale-pr-message: > This PR has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further action is - taken. \ No newline at end of file + taken. Please see our + [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md). \ No newline at end of file From f6009ba47b7e26984c4a44b2c0feb7f761d31ded Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sun, 19 Mar 2023 17:02:45 -0400 Subject: [PATCH 382/475] Updated CodeQL workflow to exclude non-relevant project paths. --- .github/workflows/codeql-analysis.yml | 64 ++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b54abf19d..9f4b66fc1 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -15,10 +15,70 @@ name: "CodeQL" on: workflow_dispatch: push: - branches: [ dev, master ] + branches: + - 'dev' + - 'main' + - 'master' + - 'dependabot/**' + - 'feature/**' + - 'issue/**' + paths-ignore: + - .github/** + - deploy/** + - docker/** + - docker-test/** + - docs/** + - powerdnsadmin/static/assets/** + - powerdnsadmin/static/custom/css/** + - powerdnsadmin/static/img/** + - powerdnsadmin/swagger-spec.yaml + - .dockerignore + - .gitattributes + - .gitignore + - .lgtm.yml + - .whitesource + - .yarnrc + - docker-compose.yml + - docker-compose-test.yml + - LICENSE + - package.json + - README.md + - requirements.txt + - SECURITY.md + - yarn.lock pull_request: # The branches below must be a subset of the branches above - branches: [ dev, master ] + branches: + - 'dev' + - 'main' + - 'master' + - 'dependabot/**' + - 'feature/**' + - 'issue/**' + paths-ignore: + - .github/** + - deploy/** + - docker/** + - docker-test/** + - docs/** + - powerdnsadmin/static/assets/** + - powerdnsadmin/static/custom/css/** + - powerdnsadmin/static/img/** + - powerdnsadmin/swagger-spec.yaml + - .dockerignore + - .gitattributes + - .gitignore + - .lgtm.yml + - .whitesource + - .yarnrc + - docker-compose.yml + - docker-compose-test.yml + - LICENSE + - package.json + - README.md + - requirements.txt + - SECURITY.md + - yarn.lock schedule: - cron: '45 2 * * 2' From a187d70470daffda44ff34c0f7534c8e9a92dcab Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sun, 19 Mar 2023 17:02:45 -0400 Subject: [PATCH 383/475] Updated CodeQL workflow to exclude non-relevant project paths. --- .github/workflows/codeql-analysis.yml | 64 ++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b54abf19d..9f4b66fc1 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -15,10 +15,70 @@ name: "CodeQL" on: workflow_dispatch: push: - branches: [ dev, master ] + branches: + - 'dev' + - 'main' + - 'master' + - 'dependabot/**' + - 'feature/**' + - 'issue/**' + paths-ignore: + - .github/** + - deploy/** + - docker/** + - docker-test/** + - docs/** + - powerdnsadmin/static/assets/** + - powerdnsadmin/static/custom/css/** + - powerdnsadmin/static/img/** + - powerdnsadmin/swagger-spec.yaml + - .dockerignore + - .gitattributes + - .gitignore + - .lgtm.yml + - .whitesource + - .yarnrc + - docker-compose.yml + - docker-compose-test.yml + - LICENSE + - package.json + - README.md + - requirements.txt + - SECURITY.md + - yarn.lock pull_request: # The branches below must be a subset of the branches above - branches: [ dev, master ] + branches: + - 'dev' + - 'main' + - 'master' + - 'dependabot/**' + - 'feature/**' + - 'issue/**' + paths-ignore: + - .github/** + - deploy/** + - docker/** + - docker-test/** + - docs/** + - powerdnsadmin/static/assets/** + - powerdnsadmin/static/custom/css/** + - powerdnsadmin/static/img/** + - powerdnsadmin/swagger-spec.yaml + - .dockerignore + - .gitattributes + - .gitignore + - .lgtm.yml + - .whitesource + - .yarnrc + - docker-compose.yml + - docker-compose-test.yml + - LICENSE + - package.json + - README.md + - requirements.txt + - SECURITY.md + - yarn.lock schedule: - cron: '45 2 * * 2' From 419bf358921a0fad157f0f00f107deb8e132ed9f Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sun, 19 Mar 2023 17:05:30 -0400 Subject: [PATCH 384/475] Updated build-and-publish workflow to exclude non-relevant project paths. --- .github/workflows/build-and-publish.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 74085f0a8..9eb0fff83 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -9,6 +9,22 @@ on: - 'master' tags: - 'v*.*.*' + paths-ignore: + - .github/** + - deploy/** + - docker-test/** + - docs/** + - .dockerignore + - .gitattributes + - .gitignore + - .lgtm.yml + - .whitesource + - .yarnrc + - docker-compose.yml + - docker-compose-test.yml + - LICENSE + - README.md + - SECURITY.md jobs: build-and-push-docker-image: From 1762a5481b8ad8ae05a65a9a21608bfebe6e569b Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sun, 19 Mar 2023 17:05:30 -0400 Subject: [PATCH 385/475] Updated build-and-publish workflow to exclude non-relevant project paths. --- .github/workflows/build-and-publish.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 74085f0a8..9eb0fff83 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -9,6 +9,22 @@ on: - 'master' tags: - 'v*.*.*' + paths-ignore: + - .github/** + - deploy/** + - docker-test/** + - docs/** + - .dockerignore + - .gitattributes + - .gitignore + - .lgtm.yml + - .whitesource + - .yarnrc + - docker-compose.yml + - docker-compose-test.yml + - LICENSE + - README.md + - SECURITY.md jobs: build-and-push-docker-image: From 271f48306253401acd786edc95201fbe2284fd2d Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Tue, 21 Mar 2023 19:09:48 -0400 Subject: [PATCH 386/475] Updated project README to include organization sponsorship reference. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b9f9da501..cd0c3ddae 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,10 @@ Please see our [Code of Conduct Policy](https://github.com/PowerDNS-Admin/PowerD This project is released under the MIT license. For additional information, [see the full license](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/LICENSE). -## Donate +## [Donate](https://www.buymeacoffee.com/AzorianMatt) Like my work? -Buy Me A Coffee \ No newline at end of file +Buy Me A Coffee + +**Want to sponsor me?** Please visit my organization's [sponsorship page](https://github.com/sponsors/AzorianSolutions). From 92033aa109afb30e5be00a64805ed29e90a37bfa Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Tue, 21 Mar 2023 19:09:48 -0400 Subject: [PATCH 387/475] Updated project README to include organization sponsorship reference. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b9f9da501..cd0c3ddae 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,10 @@ Please see our [Code of Conduct Policy](https://github.com/PowerDNS-Admin/PowerD This project is released under the MIT license. For additional information, [see the full license](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/LICENSE). -## Donate +## [Donate](https://www.buymeacoffee.com/AzorianMatt) Like my work? -Buy Me A Coffee \ No newline at end of file +Buy Me A Coffee + +**Want to sponsor me?** Please visit my organization's [sponsorship page](https://github.com/sponsors/AzorianSolutions). From a9548008691e033279062489d2e52bbb537ea867 Mon Sep 17 00:00:00 2001 From: Nigel Kukard Date: Wed, 22 Mar 2023 01:27:52 +0000 Subject: [PATCH 388/475] fix(api): fixed internal server error being generated from invalid UTF-8 encoded X-API-KEY --- powerdnsadmin/decorators.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/powerdnsadmin/decorators.py b/powerdnsadmin/decorators.py index c6905ba48..cfa5f9d2f 100644 --- a/powerdnsadmin/decorators.py +++ b/powerdnsadmin/decorators.py @@ -460,10 +460,8 @@ def decorated_function(*args, **kwargs): if auth_header: try: apikey_val = str(base64.b64decode(auth_header), 'utf-8') - except binascii.Error as e: - current_app.logger.error( - 'Invalid base64-encoded of credential. Error {0}'.format( - e)) + except (binascii.Error, UnicodeDecodeError) as e: + current_app.logger.error('Invalid base64-encoded X-API-KEY. Error {0}'.format(e)) abort(401) except TypeError as e: current_app.logger.error('Error: {0}'.format(e)) From 15e29b6771741a2b2b25e76845d99dcb28a817e1 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 24 Mar 2023 19:42:35 -0400 Subject: [PATCH 389/475] Added references to the project's discord server. --- .github/SUPPORT.md | 15 +++++++++++++++ README.md | 6 ++++++ docs/CONTRIBUTING.md | 4 +++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .github/SUPPORT.md diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md new file mode 100644 index 000000000..e0df5a649 --- /dev/null +++ b/.github/SUPPORT.md @@ -0,0 +1,15 @@ +# PowerDNS Admin + +## Project Support + +**Looking for help?** PDA has a somewhat active community of fellow users that may be able to provide assistance. +Just [start a discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions/new) right here on GitHub! + +Looking to chat with someone? Join our [Discord Server](https://discord.powerdnsadmin.org). + +Some general tips for engaging here on GitHub: + +* Register for a free [GitHub account](https://github.com/signup) if you haven't already. +* You can use [GitHub Markdown](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) for formatting text and adding images. +* To help mitigate notification spam, please avoid "bumping" issues with no activity. (To vote an issue up or down, use a :thumbsup: or :thumbsdown: reaction.) +* Please avoid pinging members with `@` unless they've previously expressed interest or involvement with that particular issue. diff --git a/README.md b/README.md index cd0c3ddae..6070d5f17 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,12 @@ You can then access PowerDNS-Admin by pointing your browser to http://localhost: ![dashboard](docs/screenshots/dashboard.png) +## Support + +**Looking for help?** Try taking a look at the project's +[Support Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/.github/SUPPORT.md) or joining +our [Discord Server](https://discord.powerdnsadmin.org). + ## Security Policy Please see our [Security Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/SECURITY.md). diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 8acf50cda..d4fb25fa5 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,6 +1,8 @@ # Contribution Guide -**Looking for help?** PDA has a somewhat active community of fellow users that may be able to provide assistance. Just [start a discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions/new) right here on GitHub! +**Looking for help?** Try taking a look at the project's +[Support Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/.github/SUPPORT.md) or joining +our [Discord Server](https://discord.powerdnsadmin.org).

    From b86282b44271dbacf631df7631e69f09fd0e46c9 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 24 Mar 2023 19:42:35 -0400 Subject: [PATCH 390/475] Added references to the project's discord server. --- .github/SUPPORT.md | 15 +++++++++++++++ README.md | 6 ++++++ docs/CONTRIBUTING.md | 4 +++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .github/SUPPORT.md diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md new file mode 100644 index 000000000..e0df5a649 --- /dev/null +++ b/.github/SUPPORT.md @@ -0,0 +1,15 @@ +# PowerDNS Admin + +## Project Support + +**Looking for help?** PDA has a somewhat active community of fellow users that may be able to provide assistance. +Just [start a discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions/new) right here on GitHub! + +Looking to chat with someone? Join our [Discord Server](https://discord.powerdnsadmin.org). + +Some general tips for engaging here on GitHub: + +* Register for a free [GitHub account](https://github.com/signup) if you haven't already. +* You can use [GitHub Markdown](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) for formatting text and adding images. +* To help mitigate notification spam, please avoid "bumping" issues with no activity. (To vote an issue up or down, use a :thumbsup: or :thumbsdown: reaction.) +* Please avoid pinging members with `@` unless they've previously expressed interest or involvement with that particular issue. diff --git a/README.md b/README.md index cd0c3ddae..6070d5f17 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,12 @@ You can then access PowerDNS-Admin by pointing your browser to http://localhost: ![dashboard](docs/screenshots/dashboard.png) +## Support + +**Looking for help?** Try taking a look at the project's +[Support Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/.github/SUPPORT.md) or joining +our [Discord Server](https://discord.powerdnsadmin.org). + ## Security Policy Please see our [Security Policy](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/SECURITY.md). diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 8acf50cda..d4fb25fa5 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,6 +1,8 @@ # Contribution Guide -**Looking for help?** PDA has a somewhat active community of fellow users that may be able to provide assistance. Just [start a discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions/new) right here on GitHub! +**Looking for help?** Try taking a look at the project's +[Support Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/.github/SUPPORT.md) or joining +our [Discord Server](https://discord.powerdnsadmin.org).

    From e0dffff325d3d887c8c5d283bb7d385061d82981 Mon Sep 17 00:00:00 2001 From: Rauno Tuul Date: Sat, 25 Mar 2023 11:47:58 +0200 Subject: [PATCH 391/475] Fix activity search form structure --- powerdnsadmin/templates/admin_history.html | 119 ++++++++++----------- 1 file changed, 59 insertions(+), 60 deletions(-) diff --git a/powerdnsadmin/templates/admin_history.html b/powerdnsadmin/templates/admin_history.html index 51009a28e..5ce6e4c81 100644 --- a/powerdnsadmin/templates/admin_history.html +++ b/powerdnsadmin/templates/admin_history.html @@ -39,8 +39,8 @@

    Activity Search

    {% endif %}

    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Filters
    -
    - -
    -
    - - - -
    - - - -
     
     
    - - - -
    - -
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Filters
    +
    + +
    +
    + + + +
    + + + +
     
     
    + + + +
    +
    +
    From bb34daa33329b00c4096d99abf536ddb03c80be6 Mon Sep 17 00:00:00 2001 From: Rauno Tuul Date: Tue, 28 Mar 2023 16:41:08 +0300 Subject: [PATCH 392/475] Activity pages history base_query unification and perfomance improvement for standard user --- powerdnsadmin/routes/admin.py | 49 +++++++++++------------------------ 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/powerdnsadmin/routes/admin.py b/powerdnsadmin/routes/admin.py index 3e44fd69c..2ae07b396 100644 --- a/powerdnsadmin/routes/admin.py +++ b/powerdnsadmin/routes/admin.py @@ -1159,22 +1159,22 @@ def history_table(): # ajax call data lim = int(Setting().get('max_history_records')) # max num of records if request.method == 'GET': - if current_user.role.name in ['Administrator', 'Operator']: - base_query = History.query - else: + base_query = History.query \ + .with_hint(History, "FORCE INDEX (ix_history_created_on)", 'mysql') + if current_user.role.name not in ['Administrator', 'Operator']: # if the user isn't an administrator or operator, # allow_user_view_history must be enabled to get here, # so include history for the zones for the user - base_query = db.session.query(History) \ - .join(Domain, History.domain_id == Domain.id) \ + allowed_domain_id_subquery = db.session.query(Domain.id) \ .outerjoin(DomainUser, Domain.id == DomainUser.domain_id) \ .outerjoin(Account, Domain.account_id == Account.id) \ .outerjoin(AccountUser, Account.id == AccountUser.account_id) \ - .filter( - db.or_( + .filter(db.or_( DomainUser.user_id == current_user.id, AccountUser.user_id == current_user.id - )) + )) \ + .subquery() + base_query = base_query.filter(History.domain_id.in_(allowed_domain_id_subquery)) domain_name = request.args.get('domain_name_filter') if request.args.get('domain_name_filter') != None \ and len( @@ -1290,11 +1290,9 @@ def history_table(): # ajax call data ) ).order_by(History.created_on.desc()) \ .limit(lim).all() - elif user_name != None and current_user.role.name in ['Administrator', - 'Operator']: # only admins can see the user login-logouts + elif user_name != None and current_user.role.name in ['Administrator', 'Operator']: # only admins can see the user login-logouts - histories = History.query \ - .filter( + histories = base_query.filter( db.and_( db.or_( History.msg.like( @@ -1317,10 +1315,8 @@ def history_table(): # ajax call data temp.append(h) break histories = temp - elif (changed_by != None or max_date != None) and current_user.role.name in ['Administrator', - 'Operator']: # select changed by and date filters only - histories = History.query \ - .filter( + elif (changed_by != None or max_date != None) and current_user.role.name in ['Administrator', 'Operator']: # select changed by and date filters only + histories = base_query.filter( db.and_( History.created_on <= max_date if max_date != None else True, History.created_on >= min_date if min_date != None else True, @@ -1328,10 +1324,8 @@ def history_table(): # ajax call data ) ) \ .order_by(History.created_on.desc()).limit(lim).all() - elif ( - changed_by != None or max_date != None): # special filtering for user because one user does not have access to log-ins logs - histories = base_query \ - .filter( + elif (changed_by != None or max_date != None): # special filtering for user because one user does not have access to log-ins logs + histories = base_query.filter( db.and_( History.created_on <= max_date if max_date != None else True, History.created_on >= min_date if min_date != None else True, @@ -1347,20 +1341,7 @@ def history_table(): # ajax call data ) ).order_by(History.created_on.desc()).limit(lim).all() else: # default view - if current_user.role.name in ['Administrator', 'Operator']: - histories = History.query.order_by(History.created_on.desc()).limit(lim).all() - else: - histories = db.session.query(History) \ - .join(Domain, History.domain_id == Domain.id) \ - .outerjoin(DomainUser, Domain.id == DomainUser.domain_id) \ - .outerjoin(Account, Domain.account_id == Account.id) \ - .outerjoin(AccountUser, Account.id == AccountUser.account_id) \ - .order_by(History.created_on.desc()) \ - .filter( - db.or_( - DomainUser.user_id == current_user.id, - AccountUser.user_id == current_user.id - )).limit(lim).all() + histories = base_query.order_by(History.created_on.desc()).limit(lim).all() detailedHistories = convert_histories(histories) From 0d0339a3166409d6f84c677e4453f80332a137b2 Mon Sep 17 00:00:00 2001 From: Jan Koppe Date: Wed, 29 Mar 2023 14:52:00 +0200 Subject: [PATCH 393/475] fix #1485: allow more than 100 rows default in dashboard The dashboard.domains_custom route was hardcoded to either return all the domains, or at most 100, regardless of default_domain_table_size setting. Make this limit be dependent on default_domain_table_size instead. The API will now limit to 100 or default_domain_table_size, whichever one is higher. This is done to not break any seconday use-cases that might depend on the hardcoded setting. --- powerdnsadmin/routes/dashboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerdnsadmin/routes/dashboard.py b/powerdnsadmin/routes/dashboard.py index 14a8ae351..e517207d8 100644 --- a/powerdnsadmin/routes/dashboard.py +++ b/powerdnsadmin/routes/dashboard.py @@ -141,7 +141,7 @@ def domains_custom(tab_id): filtered_count = domains.count() start = int(request.args.get("start", 0)) - length = min(int(request.args.get("length", 0)), 100) + length = min(int(request.args.get("length", 0)), max(100, int(Setting().get('default_domain_table_size')))) if length != -1: domains = domains[start:start + length] From e6c0b4c15fe84aef3cd25cbbd81ab03fccfbdc65 Mon Sep 17 00:00:00 2001 From: Rauno Tuul Date: Thu, 30 Mar 2023 16:23:03 +0300 Subject: [PATCH 394/475] Performance gain in activity records list as in #1381 --- powerdnsadmin/routes/domain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powerdnsadmin/routes/domain.py b/powerdnsadmin/routes/domain.py index 593e91de4..546419c01 100644 --- a/powerdnsadmin/routes/domain.py +++ b/powerdnsadmin/routes/domain.py @@ -235,14 +235,14 @@ def changelog(domain_name): ).all() if StrictVersion(Setting().get('pdns_version')) >= StrictVersion('4.0.0'): + pretty_v6 = Setting().get('pretty_ipv6_ptr') for r in rrsets: if r['type'] in records_allow_to_edit: r_name = r['name'].rstrip('.') # If it is reverse zone and pretty_ipv6_ptr setting # is enabled, we reformat the name for ipv6 records. - if Setting().get('pretty_ipv6_ptr') and r[ - 'type'] == 'PTR' and 'ip6.arpa' in r_name and '*' not in r_name: + if pretty_v6 and r['type'] == 'PTR' and 'ip6.arpa' in r_name and '*' not in r_name: r_name = dns.reversename.to_address( dns.name.from_text(r_name)) From 19335439bdee97331f2e8627686c1a927e5abd74 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sun, 2 Apr 2023 09:19:05 -0400 Subject: [PATCH 395/475] Completed the removal of the OAuth JWKS URL setting as well as the update of how the existing metadata URL settings are being used. For additional information, reference GitHub issue #1499. --- powerdnsadmin/models/setting.py | 4 -- powerdnsadmin/routes/admin.py | 8 ---- powerdnsadmin/services/azure.py | 27 +++++++----- powerdnsadmin/services/github.py | 32 +++++++++----- powerdnsadmin/services/google.py | 30 ++++++++----- powerdnsadmin/services/oidc.py | 30 ++++++++----- .../admin_setting_authentication.html | 44 ------------------- 7 files changed, 75 insertions(+), 100 deletions(-) diff --git a/powerdnsadmin/models/setting.py b/powerdnsadmin/models/setting.py index 48f929f1e..dedaaab29 100644 --- a/powerdnsadmin/models/setting.py +++ b/powerdnsadmin/models/setting.py @@ -73,7 +73,6 @@ class Setting(db.Model): 'https://github.com/login/oauth/access_token', 'github_oauth_authorize_url': 'https://github.com/login/oauth/authorize', - 'github_oauth_jwks_url': '', 'github_oauth_metadata_url': '', 'google_oauth_enabled': False, 'google_oauth_client_id': '', @@ -81,7 +80,6 @@ class Setting(db.Model): 'google_token_url': 'https://oauth2.googleapis.com/token', 'google_oauth_scope': 'openid email profile', 'google_authorize_url': 'https://accounts.google.com/o/oauth2/v2/auth', - 'google_oauth_jwks_url': '', 'google_oauth_metadata_url': '', 'google_base_url': 'https://www.googleapis.com/oauth2/v3/', 'azure_oauth_enabled': False, @@ -93,7 +91,6 @@ class Setting(db.Model): 'https://login.microsoftonline.com/[tenancy]/oauth2/v2.0/token', 'azure_oauth_authorize_url': 'https://login.microsoftonline.com/[tenancy]/oauth2/v2.0/authorize', - 'azure_oauth_jwks_url': '', 'azure_oauth_metadata_url': '', 'azure_sg_enabled': False, 'azure_admin_group': '', @@ -111,7 +108,6 @@ class Setting(db.Model): 'oidc_oauth_api_url': '', 'oidc_oauth_token_url': '', 'oidc_oauth_authorize_url': '', - 'oidc_oauth_jwks_url': '', 'oidc_oauth_metadata_url': '', 'oidc_oauth_logout_url': '', 'oidc_oauth_username': 'preferred_username', diff --git a/powerdnsadmin/routes/admin.py b/powerdnsadmin/routes/admin.py index 3e44fd69c..eedabdc50 100644 --- a/powerdnsadmin/routes/admin.py +++ b/powerdnsadmin/routes/admin.py @@ -1680,8 +1680,6 @@ def setting_authentication(): request.form.get('google_oauth_scope')) Setting().set('google_authorize_url', request.form.get('google_authorize_url')) - Setting().set('google_oauth_jwks_url', - request.form.get('google_oauth_jwks_url')) Setting().set('google_base_url', request.form.get('google_base_url')) result = { @@ -1715,8 +1713,6 @@ def setting_authentication(): request.form.get('github_oauth_token_url')) Setting().set('github_oauth_authorize_url', request.form.get('github_oauth_authorize_url')) - Setting().set('github_oauth_jwks_url', - request.form.get('github_oauth_jwks_url')) result = { 'status': True, 'msg': @@ -1748,8 +1744,6 @@ def setting_authentication(): request.form.get('azure_oauth_token_url')) Setting().set('azure_oauth_authorize_url', request.form.get('azure_oauth_authorize_url')) - Setting().set('azure_oauth_jwks_url', - request.form.get('azure_oauth_jwks_url')) Setting().set( 'azure_sg_enabled', True if request.form.get('azure_sg_enabled') == 'ON' else False) @@ -1803,8 +1797,6 @@ def setting_authentication(): request.form.get('oidc_oauth_token_url')) Setting().set('oidc_oauth_authorize_url', request.form.get('oidc_oauth_authorize_url')) - Setting().set('oidc_oauth_jwks_url', - request.form.get('oidc_oauth_jwks_url')) Setting().set('oidc_oauth_logout_url', request.form.get('oidc_oauth_logout_url')) Setting().set('oidc_oauth_username', diff --git a/powerdnsadmin/services/azure.py b/powerdnsadmin/services/azure.py index c1fb626b4..65f3bf325 100644 --- a/powerdnsadmin/services/azure.py +++ b/powerdnsadmin/services/azure.py @@ -15,18 +15,25 @@ def update_token(token): session['azure_token'] = token return token + authlib_params = { + 'client_id': Setting().get('azure_oauth_key'), + 'client_secret': Setting().get('azure_oauth_secret'), + 'api_base_url': Setting().get('azure_oauth_api_url'), + 'request_token_url': None, + 'access_token_url': Setting().get('azure_oauth_token_url'), + 'authorize_url': Setting().get('azure_oauth_authorize_url'), + 'client_kwargs': {'scope': Setting().get('azure_oauth_scope')}, + 'fetch_token': fetch_azure_token, + } + + server_metadata_url = Setting().get('azure_oauth_metadata_url') + + if isinstance(server_metadata_url, str) and len(server_metadata_url.strip()) > 0: + authlib_params['server_metadata_url'] = server_metadata_url + azure = authlib_oauth_client.register( 'azure', - client_id=Setting().get('azure_oauth_key'), - client_secret=Setting().get('azure_oauth_secret'), - api_base_url=Setting().get('azure_oauth_api_url'), - request_token_url=None, - access_token_url=Setting().get('azure_oauth_token_url'), - authorize_url=Setting().get('azure_oauth_authorize_url'), - jwks_url=Setting().get('azure_oauth_jwks_url'), - server_metadata_url=Setting().get('azure_oauth_metadata_url'), - client_kwargs={'scope': Setting().get('azure_oauth_scope')}, - fetch_token=fetch_azure_token, + **authlib_params ) @current_app.route('/azure/authorized') diff --git a/powerdnsadmin/services/github.py b/powerdnsadmin/services/github.py index 13c2f000a..ff4a20f47 100644 --- a/powerdnsadmin/services/github.py +++ b/powerdnsadmin/services/github.py @@ -15,20 +15,28 @@ def update_token(token): session['github_token'] = token return token + authlib_params = { + 'client_id': Setting().get('github_oauth_key'), + 'client_secret': Setting().get('github_oauth_secret'), + 'request_token_params': {'scope': Setting().get('github_oauth_scope')}, + 'api_base_url': Setting().get('github_oauth_api_url'), + 'request_token_url': None, + 'access_token_url': Setting().get('github_oauth_token_url'), + 'authorize_url': Setting().get('github_oauth_authorize_url'), + 'client_kwargs': {'scope': Setting().get('github_oauth_scope')}, + 'fetch_token': fetch_github_token, + 'update_token': update_token + } + + server_metadata_url = Setting().get('github_oauth_metadata_url') + + if isinstance(server_metadata_url, str) and len(server_metadata_url.strip()) > 0: + authlib_params['server_metadata_url'] = server_metadata_url + github = authlib_oauth_client.register( 'github', - client_id=Setting().get('github_oauth_key'), - client_secret=Setting().get('github_oauth_secret'), - request_token_params={'scope': Setting().get('github_oauth_scope')}, - api_base_url=Setting().get('github_oauth_api_url'), - request_token_url=None, - access_token_url=Setting().get('github_oauth_token_url'), - authorize_url=Setting().get('github_oauth_authorize_url'), - jwks_url=Setting().get('github_oauth_jwks_url'), - server_metadata_url=Setting().get('github_oauth_metadata_url'), - client_kwargs={'scope': Setting().get('github_oauth_scope')}, - fetch_token=fetch_github_token, - update_token=update_token) + **authlib_params + ) @current_app.route('/github/authorized') def github_authorized(): diff --git a/powerdnsadmin/services/google.py b/powerdnsadmin/services/google.py index fc9af1261..5604819ed 100644 --- a/powerdnsadmin/services/google.py +++ b/powerdnsadmin/services/google.py @@ -15,19 +15,27 @@ def update_token(token): session['google_token'] = token return token + authlib_params = { + 'client_id': Setting().get('google_oauth_client_id'), + 'client_secret': Setting().get('google_oauth_client_secret'), + 'api_base_url': Setting().get('google_base_url'), + 'request_token_url': None, + 'access_token_url': Setting().get('google_token_url'), + 'authorize_url': Setting().get('google_authorize_url'), + 'client_kwargs': {'scope': Setting().get('google_oauth_scope')}, + 'fetch_token': fetch_google_token, + 'update_token': update_token + } + + server_metadata_url = Setting().get('google_oauth_metadata_url') + + if isinstance(server_metadata_url, str) and len(server_metadata_url.strip()) > 0: + authlib_params['server_metadata_url'] = server_metadata_url + google = authlib_oauth_client.register( 'google', - client_id=Setting().get('google_oauth_client_id'), - client_secret=Setting().get('google_oauth_client_secret'), - api_base_url=Setting().get('google_base_url'), - request_token_url=None, - access_token_url=Setting().get('google_token_url'), - authorize_url=Setting().get('google_authorize_url'), - jwks_url=Setting().get('google_oauth_jwks_url'), - server_metadata_url=Setting().get('google_oauth_metadata_url'), - client_kwargs={'scope': Setting().get('google_oauth_scope')}, - fetch_token=fetch_google_token, - update_token=update_token) + **authlib_params + ) @current_app.route('/google/authorized') def google_authorized(): diff --git a/powerdnsadmin/services/oidc.py b/powerdnsadmin/services/oidc.py index 432457ffe..7b0cd46ae 100644 --- a/powerdnsadmin/services/oidc.py +++ b/powerdnsadmin/services/oidc.py @@ -15,19 +15,27 @@ def update_token(token): session['oidc_token'] = token return token + authlib_params = { + 'client_id': Setting().get('oidc_oauth_key'), + 'client_secret': Setting().get('oidc_oauth_secret'), + 'api_base_url': Setting().get('oidc_oauth_api_url'), + 'request_token_url': None, + 'access_token_url': Setting().get('oidc_oauth_token_url'), + 'authorize_url': Setting().get('oidc_oauth_authorize_url'), + 'client_kwargs': {'scope': Setting().get('oidc_oauth_scope')}, + 'fetch_token': fetch_oidc_token, + 'update_token': update_token + } + + server_metadata_url = Setting().get('oidc_oauth_metadata_url') + + if isinstance(server_metadata_url, str) and len(server_metadata_url.strip()) > 0: + authlib_params['server_metadata_url'] = server_metadata_url + oidc = authlib_oauth_client.register( 'oidc', - client_id=Setting().get('oidc_oauth_key'), - client_secret=Setting().get('oidc_oauth_secret'), - api_base_url=Setting().get('oidc_oauth_api_url'), - request_token_url=None, - access_token_url=Setting().get('oidc_oauth_token_url'), - authorize_url=Setting().get('oidc_oauth_authorize_url'), - jwks_url=Setting().get('oidc_oauth_jwks_url'), - server_metadata_url=Setting().get('oidc_oauth_metadata_url'), - client_kwargs={'scope': Setting().get('oidc_oauth_scope')}, - fetch_token=fetch_oidc_token, - update_token=update_token) + **authlib_params + ) @current_app.route('/oidc/authorized') def oidc_authorized(): diff --git a/powerdnsadmin/templates/admin_setting_authentication.html b/powerdnsadmin/templates/admin_setting_authentication.html index c5459588e..cbe6800d1 100644 --- a/powerdnsadmin/templates/admin_setting_authentication.html +++ b/powerdnsadmin/templates/admin_setting_authentication.html @@ -806,17 +806,6 @@

    Google OAuth Settings

    value="{{ SETTING.get('google_authorize_url') }}"> -
    - - - -
    GitHub OAuth Settings value="{{ SETTING.get('github_oauth_authorize_url') }}">
    -
    - - - -
    @@ -1096,17 +1074,6 @@

    Microsoft OAuth Settings

    value="{{ SETTING.get('azure_oauth_authorize_url') }}"> -
    - - - -
    Group Security @@ -1413,17 +1380,6 @@

    OpenID Connect OAuth Settings

    value="{{ SETTING.get('oidc_oauth_authorize_url') }}"> -
    - - - -
    From a2429ad9d6fe0b7e7c5dce8433b3afe722757806 Mon Sep 17 00:00:00 2001 From: Stefan Ubbink Date: Sun, 2 Apr 2023 20:46:32 +0200 Subject: [PATCH 396/475] Make it possible again to use a different Zone Type than 'native', fixes #1501 --- powerdnsadmin/routes/domain.py | 6 +++--- powerdnsadmin/templates/domain_add.html | 18 +++++++++--------- powerdnsadmin/templates/domain_setting.html | 16 ++++++++-------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/powerdnsadmin/routes/domain.py b/powerdnsadmin/routes/domain.py index 593e91de4..bcf91ccf4 100644 --- a/powerdnsadmin/routes/domain.py +++ b/powerdnsadmin/routes/domain.py @@ -66,7 +66,7 @@ def domain(domain_name): current_app.logger.debug("Fetched rrsets: \n{}".format(pretty_json(rrsets))) # API server might be down, misconfigured - if not rrsets and domain.type != 'Slave': + if not rrsets and domain.type != 'slave': abort(500) quick_edit = Setting().get('record_quick_edit') @@ -206,7 +206,7 @@ def changelog(domain_name): current_app.logger.debug("Fetched rrsets: \n{}".format(pretty_json(rrsets))) # API server might be down, misconfigured - if not rrsets and domain.type != 'Slave': + if not rrsets and domain.type != 'slave': abort(500) records_allow_to_edit = Setting().get_records_allow_to_edit() @@ -294,7 +294,7 @@ def record_changelog(domain_name, record_name, record_type): current_app.logger.debug("Fetched rrsets: \n{}".format(pretty_json(rrsets))) # API server might be down, misconfigured - if not rrsets and domain.type != 'Slave': + if not rrsets and domain.type != 'slave': abort(500) # get all changelogs for this domain, in descening order diff --git a/powerdnsadmin/templates/domain_add.html b/powerdnsadmin/templates/domain_add.html index c56821002..8be5817ee 100644 --- a/powerdnsadmin/templates/domain_add.html +++ b/powerdnsadmin/templates/domain_add.html @@ -76,11 +76,16 @@

    Zone Editor

    +
    -
    @@ -228,10 +228,10 @@

    Zone Editor Help

    diff --git a/powerdnsadmin/templates/domain_setting.html b/powerdnsadmin/templates/domain_setting.html index bc9470e39..f59f4a9c6 100644 --- a/powerdnsadmin/templates/domain_setting.html +++ b/powerdnsadmin/templates/domain_setting.html @@ -220,12 +220,12 @@

    Change Zone Type


    -
    + Secret
    +
    + + + +
    +
    + + + +
    @@ -785,16 +804,6 @@

    Google OAuth Settings

    value="{{ SETTING.get('google_token_url') }}">
    -
    - - - -
    @@ -806,15 +815,6 @@

    Google OAuth Settings

    value="{{ SETTING.get('google_authorize_url') }}">
    -
    - - - -
    @@ -870,26 +870,26 @@

    GitHub OAuth Settings

    -
    - +
    + Secret
    @@ -1311,21 +1311,21 @@

    OpenID Connect OAuth Settings

    OAuth
    - +
    - +
    From 9168dd99e074709e2d1cc7f6dd357f25c4aa9e8b Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 8 Apr 2023 18:11:55 -0400 Subject: [PATCH 403/475] Updated the OAuth login handlers to utilize uniform user naming variables. Updated the GitHub login process to split the user's full name based on spaces so that first and last name are filled in on PDA profile. --- powerdnsadmin/routes/index.py | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/powerdnsadmin/routes/index.py b/powerdnsadmin/routes/index.py index 4351a54f1..706d0b9b9 100644 --- a/powerdnsadmin/routes/index.py +++ b/powerdnsadmin/routes/index.py @@ -189,17 +189,25 @@ def login(): if 'github_token' in session: me = json.loads(github.get('user').text) github_username = me['login'] - github_name = me['name'] + github_first_name = me['name'] + github_last_name = '' github_email = me['email'] + # If the user's full name from GitHub contains at least two words, use the first word as the first name and + # the rest as the last name. + github_name_parts = github_first_name.split(' ') + if len(github_name_parts) > 1: + github_first_name = github_name_parts[0] + github_last_name = ' '.join(github_name_parts[1:]) + user = User.query.filter_by(username=github_username).first() if user is None: user = User.query.filter_by(email=github_email).first() if not user: user = User(username=github_username, plain_text_password=None, - firstname=github_name, - lastname='', + firstname=github_first_name, + lastname=github_last_name, email=github_email) result = user.create_local_user() @@ -227,8 +235,8 @@ def login(): mygroups = [] azure_username = me["userPrincipalName"] - azure_givenname = me["givenName"] - azure_familyname = me["surname"] + azure_first_name = me["givenName"] + azure_last_name = me["surname"] if "mail" in me: azure_email = me["mail"] else: @@ -244,8 +252,8 @@ def login(): if not user: user = User(username=azure_username, plain_text_password=None, - firstname=azure_givenname, - lastname=azure_familyname, + firstname=azure_first_name, + lastname=azure_last_name, email=azure_email) result = user.create_local_user() @@ -386,21 +394,21 @@ def login(): if 'oidc_token' in session: me = json.loads(oidc.get('userinfo').text) oidc_username = me[Setting().get('oidc_oauth_username')] - oidc_givenname = me[Setting().get('oidc_oauth_firstname')] - oidc_familyname = me[Setting().get('oidc_oauth_last_name')] + oidc_first_name = me[Setting().get('oidc_oauth_firstname')] + oidc_last_name = me[Setting().get('oidc_oauth_last_name')] oidc_email = me[Setting().get('oidc_oauth_email')] user = User.query.filter_by(username=oidc_username).first() if not user: user = User(username=oidc_username, plain_text_password=None, - firstname=oidc_givenname, - lastname=oidc_familyname, + firstname=oidc_first_name, + lastname=oidc_last_name, email=oidc_email) result = user.create_local_user() else: - user.firstname = oidc_givenname - user.lastname = oidc_familyname + user.firstname = oidc_first_name + user.lastname = oidc_last_name user.email = oidc_email user.plain_text_password = None result = user.update_local_user() From ece96262124985143467534394c64a35b7b35cda Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 8 Apr 2023 18:14:40 -0400 Subject: [PATCH 404/475] Updated the OAuth login handlers to utilize uniform user naming variables. Updated the GitHub login process to split the user's full name based on spaces so that first and last name are filled in on PDA profile. --- powerdnsadmin/routes/index.py | 59 ++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/powerdnsadmin/routes/index.py b/powerdnsadmin/routes/index.py index 706d0b9b9..2636cf18e 100644 --- a/powerdnsadmin/routes/index.py +++ b/powerdnsadmin/routes/index.py @@ -164,18 +164,18 @@ def login(): if 'google_token' in session: user_data = json.loads(google.get('userinfo').text) - first_name = user_data['given_name'] - surname = user_data['family_name'] - email = user_data['email'] - user = User.query.filter_by(username=email).first() + google_first_name = user_data['given_name'] + google_last_name = user_data['family_name'] + google_email = user_data['email'] + user = User.query.filter_by(username=google_email).first() if user is None: - user = User.query.filter_by(email=email).first() + user = User.query.filter_by(email=google_email).first() if not user: - user = User(username=email, - firstname=first_name, - lastname=surname, + user = User(username=google_email, + firstname=google_first_name, + lastname=google_last_name, plain_text_password=None, - email=email) + email=google_email) result = user.create_local_user() if not result['status']: @@ -187,11 +187,11 @@ def login(): return authenticate_user(user, 'Google OAuth') if 'github_token' in session: - me = json.loads(github.get('user').text) - github_username = me['login'] - github_first_name = me['name'] + user_data = json.loads(github.get('user').text) + github_username = user_data['login'] + github_first_name = user_data['name'] github_last_name = '' - github_email = me['email'] + github_email = user_data['email'] # If the user's full name from GitHub contains at least two words, use the first word as the first name and # the rest as the last name. @@ -222,7 +222,7 @@ def login(): if 'azure_token' in session: azure_info = azure.get('me?$select=displayName,givenName,id,mail,surname,userPrincipalName').text current_app.logger.info('Azure login returned: ' + azure_info) - me = json.loads(azure_info) + user_data = json.loads(azure_info) azure_info = azure.post('me/getMemberGroups', json={'securityEnabledOnly': False}).text @@ -234,15 +234,15 @@ def login(): else: mygroups = [] - azure_username = me["userPrincipalName"] - azure_first_name = me["givenName"] - azure_last_name = me["surname"] - if "mail" in me: - azure_email = me["mail"] + azure_username = user_data["userPrincipalName"] + azure_first_name = user_data["givenName"] + azure_last_name = user_data["surname"] + if "mail" in user_data: + azure_email = user_data["mail"] else: azure_email = "" if not azure_email: - azure_email = me["userPrincipalName"] + azure_email = user_data["userPrincipalName"] # Handle foreign principals such as guest users azure_email = re.sub(r"#.*$", "", azure_email) @@ -392,11 +392,11 @@ def login(): return authenticate_user(user, 'Azure OAuth') if 'oidc_token' in session: - me = json.loads(oidc.get('userinfo').text) - oidc_username = me[Setting().get('oidc_oauth_username')] - oidc_first_name = me[Setting().get('oidc_oauth_firstname')] - oidc_last_name = me[Setting().get('oidc_oauth_last_name')] - oidc_email = me[Setting().get('oidc_oauth_email')] + user_data = json.loads(oidc.get('userinfo').text) + oidc_username = user_data[Setting().get('oidc_oauth_username')] + oidc_first_name = user_data[Setting().get('oidc_oauth_firstname')] + oidc_last_name = user_data[Setting().get('oidc_oauth_last_name')] + oidc_email = user_data[Setting().get('oidc_oauth_email')] user = User.query.filter_by(username=oidc_username).first() if not user: @@ -426,10 +426,11 @@ def login(): desc_prop = Setting().get('oidc_oauth_account_description_property') account_to_add = [] - # If the name_property and desc_property exist in me (A variable that contains all the userinfo from the IdP). - if name_prop in me and desc_prop in me: - accounts_name_prop = [me[name_prop]] if type(me[name_prop]) is not list else me[name_prop] - accounts_desc_prop = [me[desc_prop]] if type(me[desc_prop]) is not list else me[desc_prop] + # If the name_property and desc_property exist in me (A variable that contains all the userinfo from the + # IdP). + if name_prop in user_data and desc_prop in user_data: + accounts_name_prop = [user_data[name_prop]] if type(user_data[name_prop]) is not list else user_data[name_prop] + accounts_desc_prop = [user_data[desc_prop]] if type(user_data[desc_prop]) is not list else user_data[desc_prop] # Run on all groups the user is in by the index num. for i in range(len(accounts_name_prop)): From 737e104912af07d07bdf2daf7242fae94adcba45 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sun, 9 Apr 2023 10:11:00 -0400 Subject: [PATCH 405/475] Added KnockoutJS NPM package. Re-formatted and re-organized settings model. Working on Knockout model integration into existing authentication settings editor view. --- package.json | 1 + powerdnsadmin/assets.py | 2 + powerdnsadmin/models/setting.py | 95 +++-- powerdnsadmin/routes/admin.py | 50 ++- .../js/app-authentication-settings-editor.js | 273 +++++++++++++ .../admin_setting_authentication.html | 381 ++++++++---------- yarn.lock | 7 +- 7 files changed, 541 insertions(+), 268 deletions(-) create mode 100644 powerdnsadmin/static/custom/js/app-authentication-settings-editor.js diff --git a/package.json b/package.json index 42f866db8..3aaac1d63 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "jquery-ui-dist": "^1.13.2", "jquery.quicksearch": "^2.4.0", "jtimeout": "^3.2.0", + "knockout": "^3.5.1", "multiselect": "^0.9.12" }, "resolutions": { diff --git a/powerdnsadmin/assets.py b/powerdnsadmin/assets.py index 5e17d7f64..8f9192f64 100644 --- a/powerdnsadmin/assets.py +++ b/powerdnsadmin/assets.py @@ -20,6 +20,7 @@ def concat(self, out, hunks, **kw): 'node_modules/jquery/dist/jquery.js', 'node_modules/bootstrap/dist/js/bootstrap.js', 'node_modules/icheck/icheck.js', + 'node_modules/knockout/build/output/knockout-latest.js', 'custom/js/custom.js', filters=(ConcatFilter, 'rjsmin'), output='generated/login.js') @@ -55,6 +56,7 @@ def concat(self, out, hunks, **kw): 'node_modules/datatables.net-plugins/sorting/natural.js', 'node_modules/jtimeout/src/jTimeout.js', 'node_modules/jquery.quicksearch/src/jquery.quicksearch.js', + 'node_modules/knockout/build/output/knockout-latest.js', 'custom/js/custom.js', 'node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js', filters=(ConcatFilter, 'rjsmin'), diff --git a/powerdnsadmin/models/setting.py b/powerdnsadmin/models/setting.py index dedaaab29..1ef3166b3 100644 --- a/powerdnsadmin/models/setting.py +++ b/powerdnsadmin/models/setting.py @@ -15,6 +15,7 @@ class Setting(db.Model): value = db.Column(db.Text()) defaults = { + # General Settings 'maintenance': False, 'fullscreen_layout': True, 'record_helper': True, @@ -42,56 +43,79 @@ class Setting(db.Model): 'pdns_api_timeout': 30, 'pdns_version': '4.1.1', 'verify_ssl_connections': True, + 'verify_user_email': False, + 'enforce_api_ttl': False, + 'ttl_options': '1 minute,5 minutes,30 minutes,60 minutes,24 hours', + 'otp_field_enabled': True, + 'custom_css': '', + 'otp_force': False, + 'max_history_records': 1000, + 'deny_domain_override': False, + 'account_name_extra_chars': False, + 'gravatar_enabled': False, + + # Local Authentication Settings 'local_db_enabled': True, 'signup_enabled': True, - 'autoprovisioning': False, - 'urn_value': '', - 'autoprovisioning_attribute': '', - 'purge': False, - 'verify_user_email': False, + 'pwd_enforce_characters': False, + 'pwd_min_len': 10, + 'pwd_min_lowercase': 3, + 'pwd_min_uppercase': 2, + 'pwd_min_digits': 2, + 'pwd_min_special': 1, + 'pwd_enforce_complexity': False, + 'pwd_min_complexity': 11, + + # LDAP Authentication Settings 'ldap_enabled': False, 'ldap_type': 'ldap', 'ldap_uri': '', 'ldap_base_dn': '', 'ldap_admin_username': '', 'ldap_admin_password': '', + 'ldap_domain': '', 'ldap_filter_basic': '', - 'ldap_filter_group': '', 'ldap_filter_username': '', + 'ldap_filter_group': '', 'ldap_filter_groupname': '', 'ldap_sg_enabled': False, 'ldap_admin_group': '', 'ldap_operator_group': '', 'ldap_user_group': '', - 'ldap_domain': '', + 'autoprovisioning': False, + 'autoprovisioning_attribute': '', + 'urn_value': '', + 'purge': False, + + # Google OAuth2 Settings + 'google_oauth_enabled': False, + 'google_oauth_client_id': '', + 'google_oauth_client_secret': '', + 'google_oauth_scope': 'openid email profile', + 'google_base_url': 'https://www.googleapis.com/oauth2/v3/', + 'google_oauth_metadata_url': 'https://accounts.google.com/.well-known/openid-configuration', + 'google_token_url': 'https://oauth2.googleapis.com/token', + 'google_authorize_url': 'https://accounts.google.com/o/oauth2/v2/auth', + + # GitHub OAuth2 Settings 'github_oauth_enabled': False, 'github_oauth_key': '', 'github_oauth_secret': '', 'github_oauth_scope': 'email', 'github_oauth_api_url': 'https://api.github.com/user', - 'github_oauth_token_url': - 'https://github.com/login/oauth/access_token', - 'github_oauth_authorize_url': - 'https://github.com/login/oauth/authorize', 'github_oauth_metadata_url': '', - 'google_oauth_enabled': False, - 'google_oauth_client_id': '', - 'google_oauth_client_secret': '', - 'google_token_url': 'https://oauth2.googleapis.com/token', - 'google_oauth_scope': 'openid email profile', - 'google_authorize_url': 'https://accounts.google.com/o/oauth2/v2/auth', - 'google_oauth_metadata_url': '', - 'google_base_url': 'https://www.googleapis.com/oauth2/v3/', + 'github_oauth_token_url': 'https://github.com/login/oauth/access_token', + 'github_oauth_authorize_url': 'https://github.com/login/oauth/authorize', + + # Azure OAuth2 Settings 'azure_oauth_enabled': False, 'azure_oauth_key': '', 'azure_oauth_secret': '', 'azure_oauth_scope': 'User.Read openid email profile', 'azure_oauth_api_url': 'https://graph.microsoft.com/v1.0/', - 'azure_oauth_token_url': - 'https://login.microsoftonline.com/[tenancy]/oauth2/v2.0/token', - 'azure_oauth_authorize_url': - 'https://login.microsoftonline.com/[tenancy]/oauth2/v2.0/authorize', 'azure_oauth_metadata_url': '', + 'azure_oauth_token_url': '', + 'azure_oauth_authorize_url': '', 'azure_sg_enabled': False, 'azure_admin_group': '', 'azure_operator_group': '', @@ -101,22 +125,25 @@ class Setting(db.Model): 'azure_group_accounts_name_re': '', 'azure_group_accounts_description': 'description', 'azure_group_accounts_description_re': '', + + # OIDC OAuth2 Settings 'oidc_oauth_enabled': False, 'oidc_oauth_key': '', 'oidc_oauth_secret': '', 'oidc_oauth_scope': 'email', 'oidc_oauth_api_url': '', + 'oidc_oauth_metadata_url': '', 'oidc_oauth_token_url': '', 'oidc_oauth_authorize_url': '', - 'oidc_oauth_metadata_url': '', 'oidc_oauth_logout_url': '', 'oidc_oauth_username': 'preferred_username', + 'oidc_oauth_email': 'email', 'oidc_oauth_firstname': 'given_name', 'oidc_oauth_last_name': 'family_name', - 'oidc_oauth_email': 'email', 'oidc_oauth_account_name_property': '', 'oidc_oauth_account_description_property': '', - 'enforce_api_ttl': False, + + # Zone Record Settings 'forward_records_allow_edit': { 'A': True, 'AAAA': True, @@ -193,22 +220,6 @@ class Setting(db.Model): 'TXT': True, 'URI': False }, - 'ttl_options': '1 minute,5 minutes,30 minutes,60 minutes,24 hours', - 'otp_field_enabled': True, - 'custom_css': '', - 'otp_force': False, - 'max_history_records': 1000, - 'deny_domain_override': False, - 'account_name_extra_chars': False, - 'gravatar_enabled': False, - 'pwd_enforce_characters': False, - 'pwd_min_len': 10, - 'pwd_min_lowercase': 3, - 'pwd_min_uppercase': 2, - 'pwd_min_digits': 2, - 'pwd_min_special': 1, - 'pwd_enforce_complexity': False, - 'pwd_min_complexity': 11 } def __init__(self, id=None, name=None, value=None): diff --git a/powerdnsadmin/routes/admin.py b/powerdnsadmin/routes/admin.py index eedabdc50..7ec669d2a 100644 --- a/powerdnsadmin/routes/admin.py +++ b/powerdnsadmin/routes/admin.py @@ -72,8 +72,8 @@ def to_state(record): """For the given record, return the state dict.""" return { "disabled": record['disabled'], - "content": record['content'], - "comment": record.get('comment', ''), + "content": record['content'], + "comment": record.get('comment', ''), } add_records = get_records(add_rrset) @@ -149,8 +149,8 @@ def extract_changelogs_from_a_history_entry(out_changes, history_entry, change_n # Sort them by the record name if change_num in out_changes: out_changes[change_num].sort(key=lambda change: - change.del_rrset['name'] if change.del_rrset else change.add_rrset['name'] - ) + change.del_rrset['name'] if change.del_rrset else change.add_rrset['name'] + ) # only used for changelog per record if record_name != None and record_type != None: # then get only the records with the specific (record_name, record_type) tuple @@ -897,7 +897,8 @@ def __init__(self, history, change_set): description=DetailedHistory.get_key_val(detail_dict, "description")) - elif any(msg in history.msg for msg in ['Change zone','Change domain']) and 'access control' in history.msg: # added or removed a user from a zone + elif any(msg in history.msg for msg in ['Change zone', + 'Change domain']) and 'access control' in history.msg: # added or removed a user from a zone users_with_access = DetailedHistory.get_key_val(detail_dict, "user_has_access") self.detailed_msg = render_template_string(""" @@ -942,7 +943,7 @@ def __init__(self, history, change_set): linked_domains=DetailedHistory.get_key_val(detail_dict, "domains")) - elif any(msg in history.msg for msg in ['Update type for zone','Update type for domain']): + elif any(msg in history.msg for msg in ['Update type for zone', 'Update type for domain']): self.detailed_msg = render_template_string("""
    @@ -977,7 +978,8 @@ def __init__(self, history, change_set): 'status'), history_msg=DetailedHistory.get_key_val(detail_dict, 'msg')) - elif any(msg in history.msg for msg in ['Update zone','Update domain']) and 'associate account' in history.msg: # When an account gets associated or dissociate with zones + elif any(msg in history.msg for msg in ['Update zone', + 'Update domain']) and 'associate account' in history.msg: # When an account gets associated or dissociate with zones self.detailed_msg = render_template_string('''
    Zone: {{ domain }}
    @@ -1231,8 +1233,10 @@ def history_table(): # ajax call data .filter( db.and_( db.or_( - History.msg.like("%domain " + domain_name) if domain_name != "*" else History.msg.like("%domain%"), - History.msg.like("%zone " + domain_name) if domain_name != "*" else History.msg.like("%zone%"), + History.msg.like("%domain " + domain_name) if domain_name != "*" else History.msg.like( + "%domain%"), + History.msg.like("%zone " + domain_name) if domain_name != "*" else History.msg.like( + "%zone%"), History.msg.like( "%domain " + domain_name + " access control") if domain_name != "*" else History.msg.like( "%domain%access control"), @@ -1540,7 +1544,8 @@ def has_an_auth_method(local_db_enabled=None, oidc_oauth_enabled = Setting().get('oidc_oauth_enabled') if azure_oauth_enabled is None: azure_oauth_enabled = Setting().get('azure_oauth_enabled') - return local_db_enabled or ldap_enabled or google_oauth_enabled or github_oauth_enabled or oidc_oauth_enabled or azure_oauth_enabled + return local_db_enabled or ldap_enabled or google_oauth_enabled or github_oauth_enabled or oidc_oauth_enabled \ + or azure_oauth_enabled @admin_bp.route('/setting/authentication', methods=['GET', 'POST']) @@ -1562,17 +1567,20 @@ def setting_authentication(): pwd_enforce_characters = True if request.form.get('pwd_enforce_characters') else False pwd_min_len = safe_cast(request.form.get('pwd_min_len', Setting().defaults["pwd_min_len"]), int, Setting().defaults["pwd_min_len"]) - pwd_min_lowercase = safe_cast(request.form.get('pwd_min_lowercase', Setting().defaults["pwd_min_lowercase"]), int, - Setting().defaults["pwd_min_lowercase"]) - pwd_min_uppercase = safe_cast(request.form.get('pwd_min_uppercase', Setting().defaults["pwd_min_uppercase"]), int, - Setting().defaults["pwd_min_uppercase"]) + pwd_min_lowercase = safe_cast( + request.form.get('pwd_min_lowercase', Setting().defaults["pwd_min_lowercase"]), int, + Setting().defaults["pwd_min_lowercase"]) + pwd_min_uppercase = safe_cast( + request.form.get('pwd_min_uppercase', Setting().defaults["pwd_min_uppercase"]), int, + Setting().defaults["pwd_min_uppercase"]) pwd_min_digits = safe_cast(request.form.get('pwd_min_digits', Setting().defaults["pwd_min_digits"]), int, Setting().defaults["pwd_min_digits"]) pwd_min_special = safe_cast(request.form.get('pwd_min_special', Setting().defaults["pwd_min_special"]), int, Setting().defaults["pwd_min_special"]) pwd_enforce_complexity = True if request.form.get('pwd_enforce_complexity') else False - pwd_min_complexity = safe_cast(request.form.get('pwd_min_complexity', Setting().defaults["pwd_min_complexity"]), int, + pwd_min_complexity = safe_cast(request.form.get('pwd_min_complexity', + Setting().defaults["pwd_min_complexity"]), int, Setting().defaults["pwd_min_complexity"]) if not has_an_auth_method(local_db_enabled=local_db_enabled): @@ -1585,14 +1593,12 @@ def setting_authentication(): else: Setting().set('local_db_enabled', local_db_enabled) Setting().set('signup_enabled', signup_enabled) - Setting().set('pwd_enforce_characters', pwd_enforce_characters) Setting().set('pwd_min_len', pwd_min_len) Setting().set('pwd_min_lowercase', pwd_min_lowercase) Setting().set('pwd_min_uppercase', pwd_min_uppercase) Setting().set('pwd_min_digits', pwd_min_digits) Setting().set('pwd_min_special', pwd_min_special) - Setting().set('pwd_enforce_complexity', pwd_enforce_complexity) Setting().set('pwd_min_complexity', pwd_min_complexity) @@ -2097,16 +2103,16 @@ def global_search(): results = server.global_search(object_type='all', query=query) # Filter results to domains to which the user has access permission - if current_user.role.name not in [ 'Administrator', 'Operator' ]: + if current_user.role.name not in ['Administrator', 'Operator']: allowed_domains = db.session.query(Domain) \ .outerjoin(DomainUser, Domain.id == DomainUser.domain_id) \ .outerjoin(Account, Domain.account_id == Account.id) \ .outerjoin(AccountUser, Account.id == AccountUser.account_id) \ .filter( - db.or_( - DomainUser.user_id == current_user.id, - AccountUser.user_id == current_user.id - )) \ + db.or_( + DomainUser.user_id == current_user.id, + AccountUser.user_id == current_user.id + )) \ .with_entities(Domain.name) \ .all() allowed_domains = [value for value, in allowed_domains] diff --git a/powerdnsadmin/static/custom/js/app-authentication-settings-editor.js b/powerdnsadmin/static/custom/js/app-authentication-settings-editor.js new file mode 100644 index 000000000..104b3e99c --- /dev/null +++ b/powerdnsadmin/static/custom/js/app-authentication-settings-editor.js @@ -0,0 +1,273 @@ +let model; + +let AuthenticationSettingsModel = function (user_data, csrf_token, selector) { + let self = this; + + let defaults = { + tab_active: '', + tab_default: 'local', + + // Local Authentication Settings + local_db_enabled: true, + signup_enabled: true, + pwd_enforce_characters: false, + pwd_min_len: 10, + pwd_min_lowercase: 3, + pwd_min_uppercase: 2, + pwd_min_digits: 2, + pwd_min_special: 1, + pwd_enforce_complexity: false, + pwd_min_complexity: 11, + + // LDAP Authentication Settings + ldap_enabled: false, + ldap_type: 'ldap', + ldap_uri: '', + ldap_base_dn: '', + ldap_admin_username: '', + ldap_admin_password: '', + ldap_domain: '', + ldap_filter_basic: '', + ldap_filter_username: '', + ldap_filter_group: '', + ldap_filter_groupname: '', + ldap_sg_enabled: false, + ldap_admin_group: '', + ldap_operator_group: '', + ldap_user_group: '', + autoprovisioning: false, + autoprovisioning_attribute: '', + urn_value: '', + purge: false, + + // Google OAuth2 Settings + google_oauth_enabled: false, + google_oauth_client_id: '', + google_oauth_client_secret: '', + google_oauth_scope: '', + google_base_url: '', + google_oauth_auto_configure: false, + google_oauth_metadata_url: '', + google_token_url: '', + google_authorize_url: '', + + // GitHub OAuth2 Settings + github_oauth_enabled: false, + github_oauth_key: '', + github_oauth_secret: '', + github_oauth_scope: '', + github_oauth_api_url: '', + github_oauth_auto_configure: false, + github_oauth_metadata_url: '', + github_oauth_token_url: '', + github_oauth_authorize_url: '', + + // Azure AD OAuth2 Settings + azure_oauth_enabled: false, + azure_oauth_key: '', + azure_oauth_secret: '', + azure_oauth_scope: '', + azure_oauth_api_url: '', + azure_oauth_auto_configure: false, + azure_oauth_metadata_url: '', + azure_oauth_token_url: '', + azure_oauth_authorize_url: '', + azure_sg_enabled: false, + azure_admin_group: '', + azure_operator_group: '', + azure_user_group: '', + azure_group_accounts_enabled: false, + azure_group_accounts_name: '', + azure_group_accounts_name_re: '', + azure_group_accounts_description: '', + azure_group_accounts_description_re: '', + + // OIDC OAuth2 Settings + oidc_oauth_enabled: false, + oidc_oauth_key: '', + oidc_oauth_secret: '', + oidc_oauth_scope: '', + oidc_oauth_api_url: '', + oidc_oauth_auto_configure: false, + oidc_oauth_metadata_url: '', + oidc_oauth_token_url: '', + oidc_oauth_authorize_url: '', + oidc_oauth_logout_url: '', + oidc_oauth_username: '', + oidc_oauth_email: '', + oidc_oauth_firstname: '', + oidc_oauth_last_name: '', + oidc_oauth_account_name_property: '', + oidc_oauth_account_description_property: '', + } + + self.data = {}; + + self.setupObservables = function () { + self.tab_active = ko.observable(self.data.tab_active); + self.tab_default = ko.observable(self.data.tab_default); + + // Local Authentication Settings + self.local_db_enabled = ko.observable(self.data.local_db_enabled); + self.signup_enabled = ko.observable(self.data.signup_enabled); + self.pwd_enforce_characters = ko.observable(self.data.pwd_enforce_characters); + self.pwd_min_len = ko.observable(self.data.pwd_min_len); + self.pwd_min_lowercase = ko.observable(self.data.pwd_min_lowercase); + self.pwd_min_uppercase = ko.observable(self.data.pwd_min_uppercase); + self.pwd_min_digits = ko.observable(self.data.pwd_min_digits); + self.pwd_min_special = ko.observable(self.data.pwd_min_special); + self.pwd_enforce_complexity = ko.observable(self.data.pwd_enforce_complexity); + self.pwd_min_complexity = ko.observable(self.data.pwd_min_complexity); + + // LDAP Authentication Settings + self.ldap_enabled = ko.observable(self.data.ldap_enabled); + self.ldap_type = ko.observable(self.data.ldap_type); + self.ldap_uri = ko.observable(self.data.ldap_uri); + self.ldap_base_dn = ko.observable(self.data.ldap_base_dn); + self.ldap_admin_username = ko.observable(self.data.ldap_admin_username); + self.ldap_admin_password = ko.observable(self.data.ldap_admin_password); + self.ldap_domain = ko.observable(self.data.ldap_domain); + self.ldap_filter_basic = ko.observable(self.data.ldap_filter_basic); + self.ldap_filter_username = ko.observable(self.data.ldap_filter_username); + self.ldap_filter_group = ko.observable(self.data.ldap_filter_group); + self.ldap_filter_groupname = ko.observable(self.data.ldap_filter_groupname); + self.ldap_sg_enabled = ko.observable(self.data.ldap_sg_enabled); + self.ldap_admin_group = ko.observable(self.data.ldap_admin_group); + self.ldap_operator_group = ko.observable(self.data.ldap_operator_group); + self.ldap_user_group = ko.observable(self.data.ldap_user_group); + self.autoprovisioning = ko.observable(self.data.autoprovisioning); + self.autoprovisioning_attribute = ko.observable(self.data.autoprovisioning_attribute); + self.urn_value = ko.observable(self.data.urn_value); + self.purge = ko.observable(self.data.purge); + + // Google OAuth2 Settings + self.google_oauth_enabled = ko.observable(self.data.google_oauth_enabled); + self.google_oauth_client_id = ko.observable(self.data.google_oauth_client_id); + self.google_oauth_client_secret = ko.observable(self.data.google_oauth_client_secret); + self.google_oauth_scope = ko.observable(self.data.google_oauth_scope); + self.google_base_url = ko.observable(self.data.google_base_url); + self.google_oauth_auto_configure = ko.observable(self.data.google_oauth_auto_configure); + self.google_oauth_metadata_url = ko.observable(self.data.google_oauth_metadata_url); + self.google_token_url = ko.observable(self.data.google_token_url); + self.google_authorize_url = ko.observable(self.data.google_authorize_url); + + // GitHub OAuth2 Settings + self.github_oauth_enabled = ko.observable(self.data.github_oauth_enabled); + self.github_oauth_key = ko.observable(self.data.github_oauth_key); + self.github_oauth_secret = ko.observable(self.data.github_oauth_secret); + self.github_oauth_scope = ko.observable(self.data.github_oauth_scope); + self.github_oauth_api_url = ko.observable(self.data.github_oauth_api_url); + self.github_oauth_auto_configure = ko.observable(self.data.github_oauth_auto_configure); + self.github_oauth_metadata_url = ko.observable(self.data.github_oauth_metadata_url); + self.github_oauth_token_url = ko.observable(self.data.github_oauth_token_url); + self.github_oauth_authorize_url = ko.observable(self.data.github_oauth_authorize_url); + + // Azure AD OAuth2 Settings + self.azure_oauth_enabled = ko.observable(self.data.azure_oauth_enabled); + self.azure_oauth_key = ko.observable(self.data.azure_oauth_key); + self.azure_oauth_secret = ko.observable(self.data.azure_oauth_secret); + self.azure_oauth_scope = ko.observable(self.data.azure_oauth_scope); + self.azure_oauth_api_url = ko.observable(self.data.azure_oauth_api_url); + self.azure_oauth_auto_configure = ko.observable(self.data.azure_oauth_auto_configure); + self.azure_oauth_metadata_url = ko.observable(self.data.azure_oauth_metadata_url); + self.azure_oauth_token_url = ko.observable(self.data.azure_oauth_token_url); + self.azure_oauth_authorize_url = ko.observable(self.data.azure_oauth_authorize_url); + self.azure_sg_enabled = ko.observable(self.data.azure_sg_enabled); + self.azure_admin_group = ko.observable(self.data.azure_admin_group); + self.azure_operator_group = ko.observable(self.data.azure_operator_group); + self.azure_user_group = ko.observable(self.data.azure_user_group); + self.azure_group_accounts_enabled = ko.observable(self.data.azure_group_accounts_enabled); + self.azure_group_accounts_name = ko.observable(self.data.azure_group_accounts_name); + self.azure_group_accounts_name_re = ko.observable(self.data.azure_group_accounts_name_re); + self.azure_group_accounts_description = ko.observable(self.data.azure_group_accounts_description); + self.azure_group_accounts_description_re = ko.observable(self.data.azure_group_accounts_description_re); + + // OIDC OAuth2 Settings + self.oidc_oauth_enabled = ko.observable(self.data.oidc_oauth_enabled); + self.oidc_oauth_key = ko.observable(self.data.oidc_oauth_key); + self.oidc_oauth_secret = ko.observable(self.data.oidc_oauth_secret); + self.oidc_oauth_scope = ko.observable(self.data.oidc_oauth_scope); + self.oidc_oauth_api_url = ko.observable(self.data.oidc_oauth_api_url); + self.oidc_oauth_auto_configure = ko.observable(self.data.oidc_oauth_auto_configure); + self.oidc_oauth_metadata_url = ko.observable(self.data.oidc_oauth_metadata_url); + self.oidc_oauth_token_url = ko.observable(self.data.oidc_oauth_token_url); + self.oidc_oauth_authorize_url = ko.observable(self.data.oidc_oauth_authorize_url); + self.oidc_oauth_logout_url = ko.observable(self.data.oidc_oauth_logout_url); + self.oidc_oauth_username = ko.observable(self.data.oidc_oauth_username); + self.oidc_oauth_email = ko.observable(self.data.oidc_oauth_email); + self.oidc_oauth_firstname = ko.observable(self.data.oidc_oauth_firstname); + self.oidc_oauth_last_name = ko.observable(self.data.oidc_oauth_last_name); + self.oidc_oauth_account_name_property = ko.observable(self.data.oidc_oauth_account_name_property); + self.oidc_oauth_account_description_property = ko.observable(self.data.oidc_oauth_account_description_property); + } + + self.updateWithDefaults = function (instance) { + self.data = $.extend(defaults, instance) + } + + self.activateTab = function (tab) { + $('[role="tablist"] a.nav-link').blur(); + self.tab_active(tab); + window.location.hash = tab; + } + + self.activateDefaultTab = function () { + self.activateTab(self.tab_default()); + } + + self.initTabs = function() { + if (self.hasHash()) { + self.activateTab(self.getHash()); + } else { + self.activateDefaultTab(); + } + } + + self.getHash = function () { + return window.location.hash.substring(1); + } + + self.hasHash = function () { + return window.location.hash.length > 1; + } + + self.setupListeners = function () { + if ('onhashchange' in window) { + $(window).bind('hashchange', self.onHashChange); + } + } + + self.destroyListeners = function () { + if ('onhashchange' in window) { + $(window).unbind('hashchange', self.onHashChange); + } + } + + self.onTabClick = function (model, event) { + self.activateTab($(event.target).data('tab')); + return false; + } + + self.onHashChange = function (event) { + let hash = window.location.hash.trim(); + if (hash.length > 1) { + self.activateTab(hash.substring(1)); + } else { + self.activateDefaultTab(); + } + } + + self.updateWithDefaults(user_data); + self.setupObservables(); + + ko.applyBindings(self); + + self.initTabs(); + self.setupListeners(); +} + +$(function () { + // TODO: Load the data from the server and pass it to the model instantiation + loaded_data = {}; + model = new AuthenticationSettingsModel(loaded_data, CSRF_TOKEN, '#settings-editor'); +}) \ No newline at end of file diff --git a/powerdnsadmin/templates/admin_setting_authentication.html b/powerdnsadmin/templates/admin_setting_authentication.html index ca8baa5a6..73d305d54 100644 --- a/powerdnsadmin/templates/admin_setting_authentication.html +++ b/powerdnsadmin/templates/admin_setting_authentication.html @@ -25,7 +25,7 @@

    Authentication Settings

    -
    +

    Settings Editor

    @@ -43,31 +43,43 @@

    Settings Editor

    {% if domain.type != 'Slave' %} - - - {% if current_user.role.name in ['Administrator', 'Operator'] or allow_user_view_history %} - - {% endif %} + {% else %} {% endif %} @@ -108,7 +104,7 @@

    Zone Editor

    - - {% if current_user.role.name in ['Administrator', 'Operator'] or allow_user_view_history %} - - {% endif %} + {% endif %} + {% endif %} @@ -155,6 +147,7 @@

    Zone Editor

    table#tbl_records thead th:nth-child(2), table#tbl_records thead th:nth-child(3), table#tbl_records thead th:nth-child(4) { width: 100px; } + table#tbl_records thead th:nth-child(7) { width: 80px; } table#tbl_records tbody td { text-align: center; } table#tbl_records tbody td:nth-child(0n+5), table#tbl_records tbody td:nth-child(0n+6) { text-align: left; word-break: break-all; } @@ -203,11 +196,7 @@

    Zone Editor

    // regardless of whatever sorting is done. See orderFixed visible: false, {% if domain.type != 'Slave' %} - {% if current_user.role.name in ['Administrator', 'Operator'] or allow_user_view_history %} - targets: [9] - {% else %} - targets: [8] - {% endif %} + targets: [7] {% else %} targets: [5] {% endif %} @@ -225,11 +214,7 @@

    Zone Editor

    } ], {% if domain.type != 'Slave' %} - {% if current_user.role.name in ['Administrator', 'Operator'] or allow_user_view_history %} - "orderFixed": [[9, 'asc']] - {% else %} - "orderFixed": [[8, 'asc']] - {% endif %} + "orderFixed": [[7, 'asc']] {% else %} "orderFixed": [[5, 'asc']] {% endif %} From ad9e4938bc2ae92de3983fe958796d23392663bb Mon Sep 17 00:00:00 2001 From: Ronan Date: Thu, 31 Aug 2023 16:25:12 +1000 Subject: [PATCH 444/475] Add additional log information Print out the message returned by create_local_user() when it fails to create a new local user. --- powerdnsadmin/routes/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerdnsadmin/routes/index.py b/powerdnsadmin/routes/index.py index d56ce6129..23d88bbdd 100644 --- a/powerdnsadmin/routes/index.py +++ b/powerdnsadmin/routes/index.py @@ -258,7 +258,7 @@ def login(): result = user.create_local_user() if not result['status']: - current_app.logger.warning('Unable to create ' + azure_username) + current_app.logger.warning('Unable to create ' + azure_username + ' Reasoning: ' + result['msg']) session.pop('azure_token', None) # note: a redirect to login results in an endless loop, so render the login page instead return render_template('login.html', From 7fcd2b8aa6ebcf2074ad4fadc92a33162d704e42 Mon Sep 17 00:00:00 2001 From: Ronan Date: Thu, 31 Aug 2023 16:26:48 +1000 Subject: [PATCH 445/475] Fix case sensitivity for duplicate username creation --- powerdnsadmin/models/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerdnsadmin/models/user.py b/powerdnsadmin/models/user.py index e989aa0cb..f1673a578 100644 --- a/powerdnsadmin/models/user.py +++ b/powerdnsadmin/models/user.py @@ -408,7 +408,7 @@ def create_local_user(self): Create local user witch stores username / password in the DB """ # check if username existed - user = User.query.filter(User.username == self.username).first() + user = User.query.filter(User.username.lower() == self.username.lower()).first() if user: return {'status': False, 'msg': 'Username is already in use'} From c52bdd0daf66047e41f56db4967819162861dd46 Mon Sep 17 00:00:00 2001 From: Ronan Date: Thu, 31 Aug 2023 16:28:06 +1000 Subject: [PATCH 446/475] Fix case sensitivity for duplicate email creation --- powerdnsadmin/models/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerdnsadmin/models/user.py b/powerdnsadmin/models/user.py index f1673a578..5a24c913e 100644 --- a/powerdnsadmin/models/user.py +++ b/powerdnsadmin/models/user.py @@ -413,7 +413,7 @@ def create_local_user(self): return {'status': False, 'msg': 'Username is already in use'} # check if email existed - user = User.query.filter(User.email == self.email).first() + user = User.query.filter(User.email.lower() == self.email.lower()).first() if user: return {'status': False, 'msg': 'Email address is already in use'} From 4442577b0bb4e1e4f03eb9b82e2da4c3d54331c2 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 24 Nov 2023 06:26:38 -0500 Subject: [PATCH 447/475] Created a new model to represent the Flask-Session storage schema `sessions` with a method for removing expired sessions. Added a trigger for the Flask-Session model's session clean-up method to the `before_request` handler of the user router. --- powerdnsadmin/models/sessions.py | 39 ++++++++++++++++++++++++++++++++ powerdnsadmin/routes/user.py | 5 ++++ 2 files changed, 44 insertions(+) create mode 100644 powerdnsadmin/models/sessions.py diff --git a/powerdnsadmin/models/sessions.py b/powerdnsadmin/models/sessions.py new file mode 100644 index 000000000..b699a3dff --- /dev/null +++ b/powerdnsadmin/models/sessions.py @@ -0,0 +1,39 @@ +from flask import current_app, session +from flask_login import current_user +from .base import db + + +class Sessions(db.Model): + id = db.Column(db.Integer, primary_key=True) + session_id = db.Column(db.String(255), index=True, unique=True) + data = db.Column(db.BLOB) + expiry = db.Column(db.DateTime) + + def __init__(self, + id=None, + session_id=None, + data=None, + expiry=None): + self.id = id + self.session_id = session_id + self.data = data + self.expiry = expiry + + def __repr__(self): + return ''.format(self.id) + + @staticmethod + def clean_up_expired_sessions(): + """Clean up expired sessions in the database""" + from datetime import datetime + from sqlalchemy import or_ + from sqlalchemy.exc import SQLAlchemyError + + try: + db.session.query(Sessions).filter(or_(Sessions.expiry < datetime.now(), Sessions.expiry is None)).delete() + db.session.commit() + except SQLAlchemyError as e: + db.session.rollback() + current_app.logger.error(e) + return False + return True diff --git a/powerdnsadmin/routes/user.py b/powerdnsadmin/routes/user.py index adba502be..469b45942 100644 --- a/powerdnsadmin/routes/user.py +++ b/powerdnsadmin/routes/user.py @@ -37,6 +37,11 @@ def before_request(): minutes=int(Setting().get('session_timeout'))) session.modified = True + # Clean up expired sessions in the database + if Setting().get('session_type') == 'sqlalchemy': + from ..models.sessions import Sessions + Sessions().clean_up_expired_sessions() + @user_bp.route('/profile', methods=['GET', 'POST']) @login_required From 0472aba25e6b948349527a2340022f1a01c8de86 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 24 Nov 2023 06:54:55 -0500 Subject: [PATCH 448/475] Updated Python requirements for PyYAML from version 5.4 to 6.0.1 to resolve a conflict with Cython. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 15f6761ff..77d830a79 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ Flask-SeaSurf==1.1.1 Flask-Session==0.4.0 Flask==2.2.5 Jinja2==3.1.2 -PyYAML==5.4 +PyYAML==6.0.1 SQLAlchemy==1.3.24 #alembic==1.9.0 bcrypt==4.0.1 From 67085653aed1e70ea94a11680ff39dc11c93b2f8 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 24 Nov 2023 07:33:58 -0500 Subject: [PATCH 449/475] Tested the proposed modification to the Docker healthcheck command to support subdirectory root paths to no avail. Staging changes until a proper resolution is proposed. --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 55ccdfd66..3226fc846 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -92,6 +92,6 @@ RUN chown ${USER}:${USER} ./configs /app && \ EXPOSE 80/tcp USER ${USER} -HEALTHCHECK CMD ["wget","--output-document=-","--quiet","--tries=1","http://127.0.0.1/"] +HEALTHCHECK --interval=5s --timeout=5s --start-period=20s --retries=5 CMD ["wget","--output-document=-","--quiet","--tries=1","http://127.0.0.1${SCRIPT_NAME:-/}"] ENTRYPOINT ["entrypoint.sh"] CMD ["gunicorn","powerdnsadmin:create_app()"] From 447bb1474299e631e1de3c3306875fba8ea207a5 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 24 Nov 2023 07:40:49 -0500 Subject: [PATCH 450/475] Updated the roboto_mono.css and source_sans_pro.css font-face definition files to utilize relative pathing to resolve issues with installations deployed in subdirectories. --- .../static/assets/css/roboto_mono.css | 12 +-- .../static/assets/css/source_sans_pro.css | 84 +++++++++---------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/powerdnsadmin/static/assets/css/roboto_mono.css b/powerdnsadmin/static/assets/css/roboto_mono.css index dc14ffbe9..ceb7256e9 100644 --- a/powerdnsadmin/static/assets/css/roboto_mono.css +++ b/powerdnsadmin/static/assets/css/roboto_mono.css @@ -4,8 +4,8 @@ font-style: normal; font-weight: 300; src: local('Roboto Mono Light'), local('RobotoMono-Light'), - url('/static/assets/fonts/roboto-mono-v7-latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ - url('/static/assets/fonts/roboto-mono-v7-latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-mono-v7-latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ + url('../fonts/roboto-mono-v7-latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* roboto-mono-regular - latin */ @font-face { @@ -13,8 +13,8 @@ font-style: normal; font-weight: 400; src: local('Roboto Mono'), local('RobotoMono-Regular'), - url('/static/assets/fonts/roboto-mono-v7-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ - url('/static/assets/fonts/roboto-mono-v7-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-mono-v7-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ + url('../fonts/roboto-mono-v7-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* roboto-mono-700 - latin */ @font-face { @@ -22,6 +22,6 @@ font-style: normal; font-weight: 700; src: local('Roboto Mono Bold'), local('RobotoMono-Bold'), - url('/static/assets/fonts/roboto-mono-v7-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ - url('/static/assets/fonts/roboto-mono-v7-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-mono-v7-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ + url('../fonts/roboto-mono-v7-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } \ No newline at end of file diff --git a/powerdnsadmin/static/assets/css/source_sans_pro.css b/powerdnsadmin/static/assets/css/source_sans_pro.css index 06ef9f49b..8cd030a5f 100644 --- a/powerdnsadmin/static/assets/css/source_sans_pro.css +++ b/powerdnsadmin/static/assets/css/source_sans_pro.css @@ -3,89 +3,89 @@ font-family: 'Source Sans Pro'; font-style: normal; font-weight: 300; - src: url('/static/assets/fonts/source-sans-pro-v13-latin-300.eot'); /* IE9 Compat Modes */ + src: url('../fonts/source-sans-pro-v13-latin-300.eot'); /* IE9 Compat Modes */ src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), - url('/static/assets/fonts/source-sans-pro-v13-latin-300.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('/static/assets/fonts/source-sans-pro-v13-latin-300.woff2') format('woff2'), /* Super Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-300.woff') format('woff'), /* Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-300.ttf') format('truetype'), /* Safari, Android, iOS */ - url('/static/assets/fonts/source-sans-pro-v13-latin-300.svg#SourceSansPro') format('svg'); /* Legacy iOS */ + url('../fonts/source-sans-pro-v13-latin-300.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/source-sans-pro-v13-latin-300.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-300.woff') format('woff'), /* Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-300.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/source-sans-pro-v13-latin-300.svg#SourceSansPro') format('svg'); /* Legacy iOS */ } /* source-sans-pro-300italic - latin */ @font-face { font-family: 'Source Sans Pro'; font-style: italic; font-weight: 300; - src: url('/static/assets/fonts/source-sans-pro-v13-latin-300italic.eot'); /* IE9 Compat Modes */ + src: url('../fonts/source-sans-pro-v13-latin-300italic.eot'); /* IE9 Compat Modes */ src: local('Source Sans Pro Light Italic'), local('SourceSansPro-LightItalic'), - url('/static/assets/fonts/source-sans-pro-v13-latin-300italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('/static/assets/fonts/source-sans-pro-v13-latin-300italic.woff2') format('woff2'), /* Super Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-300italic.woff') format('woff'), /* Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-300italic.ttf') format('truetype'), /* Safari, Android, iOS */ - url('/static/assets/fonts/source-sans-pro-v13-latin-300italic.svg#SourceSansPro') format('svg'); /* Legacy iOS */ + url('../fonts/source-sans-pro-v13-latin-300italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/source-sans-pro-v13-latin-300italic.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-300italic.woff') format('woff'), /* Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-300italic.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/source-sans-pro-v13-latin-300italic.svg#SourceSansPro') format('svg'); /* Legacy iOS */ } /* source-sans-pro-regular - latin */ @font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 400; - src: url('/static/assets/fonts/source-sans-pro-v13-latin-regular.eot'); /* IE9 Compat Modes */ + src: url('../fonts/source-sans-pro-v13-latin-regular.eot'); /* IE9 Compat Modes */ src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), - url('/static/assets/fonts/source-sans-pro-v13-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('/static/assets/fonts/source-sans-pro-v13-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-regular.woff') format('woff'), /* Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ - url('/static/assets/fonts/source-sans-pro-v13-latin-regular.svg#SourceSansPro') format('svg'); /* Legacy iOS */ + url('../fonts/source-sans-pro-v13-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/source-sans-pro-v13-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/source-sans-pro-v13-latin-regular.svg#SourceSansPro') format('svg'); /* Legacy iOS */ } /* source-sans-pro-italic - latin */ @font-face { font-family: 'Source Sans Pro'; font-style: italic; font-weight: 400; - src: url('/static/assets/fonts/source-sans-pro-v13-latin-italic.eot'); /* IE9 Compat Modes */ + src: url('../fonts/source-sans-pro-v13-latin-italic.eot'); /* IE9 Compat Modes */ src: local('Source Sans Pro Italic'), local('SourceSansPro-Italic'), - url('/static/assets/fonts/source-sans-pro-v13-latin-italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('/static/assets/fonts/source-sans-pro-v13-latin-italic.woff2') format('woff2'), /* Super Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-italic.woff') format('woff'), /* Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-italic.ttf') format('truetype'), /* Safari, Android, iOS */ - url('/static/assets/fonts/source-sans-pro-v13-latin-italic.svg#SourceSansPro') format('svg'); /* Legacy iOS */ + url('../fonts/source-sans-pro-v13-latin-italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/source-sans-pro-v13-latin-italic.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-italic.woff') format('woff'), /* Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-italic.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/source-sans-pro-v13-latin-italic.svg#SourceSansPro') format('svg'); /* Legacy iOS */ } /* source-sans-pro-600 - latin */ @font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 600; - src: url('/static/assets/fonts/source-sans-pro-v13-latin-600.eot'); /* IE9 Compat Modes */ + src: url('../fonts/source-sans-pro-v13-latin-600.eot'); /* IE9 Compat Modes */ src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'), - url('/static/assets/fonts/source-sans-pro-v13-latin-600.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('/static/assets/fonts/source-sans-pro-v13-latin-600.woff2') format('woff2'), /* Super Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-600.woff') format('woff'), /* Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-600.ttf') format('truetype'), /* Safari, Android, iOS */ - url('/static/assets/fonts/source-sans-pro-v13-latin-600.svg#SourceSansPro') format('svg'); /* Legacy iOS */ + url('../fonts/source-sans-pro-v13-latin-600.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/source-sans-pro-v13-latin-600.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-600.woff') format('woff'), /* Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-600.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/source-sans-pro-v13-latin-600.svg#SourceSansPro') format('svg'); /* Legacy iOS */ } /* source-sans-pro-600italic - latin */ @font-face { font-family: 'Source Sans Pro'; font-style: italic; font-weight: 600; - src: url('/static/assets/fonts/source-sans-pro-v13-latin-600italic.eot'); /* IE9 Compat Modes */ + src: url('../fonts/source-sans-pro-v13-latin-600italic.eot'); /* IE9 Compat Modes */ src: local('Source Sans Pro SemiBold Italic'), local('SourceSansPro-SemiBoldItalic'), - url('/static/assets/fonts/source-sans-pro-v13-latin-600italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('/static/assets/fonts/source-sans-pro-v13-latin-600italic.woff2') format('woff2'), /* Super Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-600italic.woff') format('woff'), /* Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-600italic.ttf') format('truetype'), /* Safari, Android, iOS */ - url('/static/assets/fonts/source-sans-pro-v13-latin-600italic.svg#SourceSansPro') format('svg'); /* Legacy iOS */ + url('../fonts/source-sans-pro-v13-latin-600italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/source-sans-pro-v13-latin-600italic.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-600italic.woff') format('woff'), /* Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-600italic.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/source-sans-pro-v13-latin-600italic.svg#SourceSansPro') format('svg'); /* Legacy iOS */ } /* source-sans-pro-700 - latin */ @font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 700; - src: url('/static/assets/fonts/source-sans-pro-v13-latin-700.eot'); /* IE9 Compat Modes */ + src: url('../fonts/source-sans-pro-v13-latin-700.eot'); /* IE9 Compat Modes */ src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), - url('/static/assets/fonts/source-sans-pro-v13-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('/static/assets/fonts/source-sans-pro-v13-latin-700.woff2') format('woff2'), /* Super Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-700.woff') format('woff'), /* Modern Browsers */ - url('/static/assets/fonts/source-sans-pro-v13-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */ - url('/static/assets/fonts/source-sans-pro-v13-latin-700.svg#SourceSansPro') format('svg'); /* Legacy iOS */ + url('../fonts/source-sans-pro-v13-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/source-sans-pro-v13-latin-700.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-700.woff') format('woff'), /* Modern Browsers */ + url('../fonts/source-sans-pro-v13-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/source-sans-pro-v13-latin-700.svg#SourceSansPro') format('svg'); /* Legacy iOS */ } \ No newline at end of file From 28c63abea438316ca4a3026bc1f9081780f916fe Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 24 Nov 2023 08:18:20 -0500 Subject: [PATCH 451/475] Updated the index router to pivot from the use of the deprecated `before_app_first_request` event to the replacement of `record_once`. --- powerdnsadmin/routes/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerdnsadmin/routes/index.py b/powerdnsadmin/routes/index.py index 23d88bbdd..aaf2ed311 100644 --- a/powerdnsadmin/routes/index.py +++ b/powerdnsadmin/routes/index.py @@ -46,7 +46,7 @@ url_prefix='/') -@index_bp.before_app_first_request +@index_bp.record_once def register_modules(): global google global github From 09014bf4a9931d9de02029aa5494e2de3ca4be73 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 24 Nov 2023 09:03:39 -0500 Subject: [PATCH 452/475] Correcting case-sensitivity issue with zone type comparison. --- powerdnsadmin/routes/domain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerdnsadmin/routes/domain.py b/powerdnsadmin/routes/domain.py index 56ca4059a..6cd9d38b5 100644 --- a/powerdnsadmin/routes/domain.py +++ b/powerdnsadmin/routes/domain.py @@ -66,7 +66,7 @@ def domain(domain_name): current_app.logger.debug("Fetched rrsets: \n{}".format(pretty_json(rrsets))) # API server might be down, misconfigured - if not rrsets and domain.type != 'slave': + if not rrsets and str(domain.type).lower() != 'slave': abort(500) quick_edit = Setting().get('record_quick_edit') From b347e3df5538d89d83d5c18685da23affbe48d78 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 24 Nov 2023 09:19:16 -0500 Subject: [PATCH 453/475] Updated zone list view to properly encode the zone name when using it to build request URIs to the back-end. --- powerdnsadmin/templates/dashboard.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/powerdnsadmin/templates/dashboard.html b/powerdnsadmin/templates/dashboard.html index 83d71d327..8cb039009 100755 --- a/powerdnsadmin/templates/dashboard.html +++ b/powerdnsadmin/templates/dashboard.html @@ -181,17 +181,17 @@

    {% if current_user.role.name in ['Administrator', 'Operator'] or not SETTING.get('dnssec_admins_only') %} $(document.body).on("click", ".button_dnssec", function () { var domain = $(this).prop('id'); - getdnssec($SCRIPT_ROOT + '/domain/' + domain + '/dnssec', domain); + getdnssec($SCRIPT_ROOT + '/domain/' + encodeURIComponent(domain) + '/dnssec', domain); }); $(document.body).on("click", ".button_dnssec_enable", function () { var domain = $(this).prop('id'); - enable_dns_sec($SCRIPT_ROOT + '/domain/' + domain + '/dnssec/enable', '{{ csrf_token() }}'); + enable_dns_sec($SCRIPT_ROOT + '/domain/' + encodeURIComponent(domain) + '/dnssec/enable', '{{ csrf_token() }}'); }); $(document.body).on("click", ".button_dnssec_disable", function () { var domain = $(this).prop('id'); - enable_dns_sec($SCRIPT_ROOT + '/domain/' + domain + '/dnssec/disable', '{{ csrf_token() }}'); + enable_dns_sec($SCRIPT_ROOT + '/domain/' + encodeURIComponent(domain) + '/dnssec/disable', '{{ csrf_token() }}'); }); {% endif %} From 4dab950efce1eaf9df1068d6e335b168d7ca965a Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 24 Nov 2023 09:28:21 -0500 Subject: [PATCH 454/475] Reverting a bad change I made to remove a deprecated feature that is removed in Flask 2.3. --- powerdnsadmin/routes/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerdnsadmin/routes/index.py b/powerdnsadmin/routes/index.py index aaf2ed311..23d88bbdd 100644 --- a/powerdnsadmin/routes/index.py +++ b/powerdnsadmin/routes/index.py @@ -46,7 +46,7 @@ url_prefix='/') -@index_bp.record_once +@index_bp.before_app_first_request def register_modules(): global google global github From 18f38fd1caf417cde96a4c6d786669e39f4964a5 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 24 Nov 2023 09:49:40 -0500 Subject: [PATCH 455/475] Updated backend to properly encode the zone name sent to PDNS API so that zones with URL unsafe characters don't break the request. --- powerdnsadmin/models/domain.py | 21 ++++++++++++++++----- powerdnsadmin/static/custom/js/custom.js | 4 ++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/powerdnsadmin/models/domain.py b/powerdnsadmin/models/domain.py index bfa04451f..f0b9a30bf 100644 --- a/powerdnsadmin/models/domain.py +++ b/powerdnsadmin/models/domain.py @@ -643,6 +643,8 @@ def update_from_master(self, domain_name): """ Update records from Master DNS server """ + import urllib.parse + domain = Domain.query.filter(Domain.name == domain_name).first() if domain: headers = {'X-API-Key': self.PDNS_API_KEY} @@ -650,7 +652,7 @@ def update_from_master(self, domain_name): r = utils.fetch_json(urljoin( self.PDNS_STATS_URL, self.API_EXTENDED_URL + '/servers/localhost/zones/{0}/axfr-retrieve'.format( - domain.name)), + urllib.parse.quote_plus(domain.name))), headers=headers, timeout=int( Setting().get('pdns_api_timeout')), @@ -673,6 +675,8 @@ def get_domain_dnssec(self, domain_name): """ Get zone DNSSEC information """ + import urllib.parse + domain = Domain.query.filter(Domain.name == domain_name).first() if domain: headers = {'X-API-Key': self.PDNS_API_KEY} @@ -681,7 +685,7 @@ def get_domain_dnssec(self, domain_name): urljoin( self.PDNS_STATS_URL, self.API_EXTENDED_URL + '/servers/localhost/zones/{0}/cryptokeys'.format( - domain.name)), + urllib.parse.quote_plus(domain.name))), headers=headers, timeout=int(Setting().get('pdns_api_timeout')), method='GET', @@ -709,6 +713,8 @@ def enable_domain_dnssec(self, domain_name): """ Enable zone DNSSEC """ + import urllib.parse + domain = Domain.query.filter(Domain.name == domain_name).first() if domain: headers = {'X-API-Key': self.PDNS_API_KEY, 'Content-Type': 'application/json'} @@ -718,7 +724,9 @@ def enable_domain_dnssec(self, domain_name): jdata = utils.fetch_json( urljoin( self.PDNS_STATS_URL, self.API_EXTENDED_URL + - '/servers/localhost/zones/{0}'.format(domain.name)), + '/servers/localhost/zones/{0}'.format( + urllib.parse.quote_plus(domain.name) + )), headers=headers, timeout=int(Setting().get('pdns_api_timeout')), method='PUT', @@ -738,7 +746,8 @@ def enable_domain_dnssec(self, domain_name): urljoin( self.PDNS_STATS_URL, self.API_EXTENDED_URL + '/servers/localhost/zones/{0}/cryptokeys'.format( - domain.name)), + urllib.parse.quote_plus(domain.name) + )), headers=headers, timeout=int(Setting().get('pdns_api_timeout')), method='POST', @@ -775,6 +784,8 @@ def delete_dnssec_key(self, domain_name, key_id): """ Remove keys DNSSEC """ + import urllib.parse + domain = Domain.query.filter(Domain.name == domain_name).first() if domain: headers = {'X-API-Key': self.PDNS_API_KEY, 'Content-Type': 'application/json'} @@ -784,7 +795,7 @@ def delete_dnssec_key(self, domain_name, key_id): urljoin( self.PDNS_STATS_URL, self.API_EXTENDED_URL + '/servers/localhost/zones/{0}/cryptokeys/{1}'.format( - domain.name, key_id)), + urllib.parse.quote_plus(domain.name), key_id)), headers=headers, timeout=int(Setting().get('pdns_api_timeout')), method='DELETE', diff --git a/powerdnsadmin/static/custom/js/custom.js b/powerdnsadmin/static/custom/js/custom.js index 1b7a983dd..e4890d94f 100644 --- a/powerdnsadmin/static/custom/js/custom.js +++ b/powerdnsadmin/static/custom/js/custom.js @@ -30,14 +30,14 @@ function applyChanges(data, url, showResult, refreshPage) { function applyRecordChanges(data, domain) { $.ajax({ type : "POST", - url : $SCRIPT_ROOT + '/domain/' + domain + '/apply', + url : $SCRIPT_ROOT + '/domain/' + encodeURIComponent(domain) + '/apply', data : JSON.stringify(data),// now data come in this function contentType : "application/json; charset=utf-8", crossDomain : true, dataType : "json", success : function(data, status, jqXHR) { // update Apply button value - $.getJSON($SCRIPT_ROOT + '/domain/' + domain + '/info', function(data) { + $.getJSON($SCRIPT_ROOT + '/domain/' + encodeURIComponent(domain) + '/info', function(data) { $(".button_apply_changes").val(data['serial']); }); From ddb3151b61d4b5be59b24a9734c5d6d1cbb45e8b Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 24 Nov 2023 11:14:09 -0500 Subject: [PATCH 456/475] Correcting bug introduced by PR 1658. --- powerdnsadmin/models/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powerdnsadmin/models/user.py b/powerdnsadmin/models/user.py index 5a24c913e..0596e3df1 100644 --- a/powerdnsadmin/models/user.py +++ b/powerdnsadmin/models/user.py @@ -408,12 +408,12 @@ def create_local_user(self): Create local user witch stores username / password in the DB """ # check if username existed - user = User.query.filter(User.username.lower() == self.username.lower()).first() + user = User.query.filter(str(User.username).lower() == self.username.lower()).first() if user: return {'status': False, 'msg': 'Username is already in use'} # check if email existed - user = User.query.filter(User.email.lower() == self.email.lower()).first() + user = User.query.filter(str(User.email).lower() == self.email.lower()).first() if user: return {'status': False, 'msg': 'Email address is already in use'} From 66c262c57d07198d7d9549198744f4577d6f5c65 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 25 Nov 2023 08:09:46 -0500 Subject: [PATCH 457/475] Adding latest project announcements to repository. --- .../project-update-2022-12-09.md | 100 ++++++++++++++++ .../project-update-2023-11-25.md | 109 ++++++++++++++++++ 2 files changed, 209 insertions(+) create mode 100644 docs/announcements/project-update-2022-12-09.md create mode 100644 docs/announcements/project-update-2023-11-25.md diff --git a/docs/announcements/project-update-2022-12-09.md b/docs/announcements/project-update-2022-12-09.md new file mode 100644 index 000000000..427751bb0 --- /dev/null +++ b/docs/announcements/project-update-2022-12-09.md @@ -0,0 +1,100 @@ +# PDA Project Update + +## Introduction + +Hello PDA community members, + +My name is Matt Scott, and I am the owner of [Azorian Solutions](https://azorian.solutions), a consultancy for the +Internet Service Provider (ISP) industry. I'm pleased to announce that I have taken ownership of the PDA project and +will be taking over the lead maintainer role, effective immediately. + +Please always remember and thank both [Khanh Ngo](https://github.com/ngoduykhanh) and +[Jérôme Becot](https://github.com/jbe-dw) for their efforts in keeping this project alive thus far. Without the effort +of Khanh creating the PDA project and community, and the efforts of Jérôme for holding up the lead maintainer role after +Khanh had to step down, this project would not still be alive today. + +With that being said, please read through all the following announcements as they are important if you're an active PDA +user or community member. I intend to make many great enhancements to the project, but it could be a bumpy road ahead. + +### Project Maintenance + +As it stands today, contributions to the project are at a low. At this point, there is a rather large backlog of issues +and feature requests in contrast to the current maintenance capacities. This is not to say you should lose hope though! +As part of this project transition, some additional contribution interest has been generated and I expect to attract +more with the changes I'm planning to make. In the near future, I may by-pass some usual maintenance processes in order +to expedite some changes to the project that have been outstanding for some time. + +This is to say however that unless the project attracts a healthy new contribution base, issues may continue to pile up +as maintenance capacity is rather limited. This is further complicated by the fact that the current code base is harder +to follow naturally since it largely lacks uniformity and standards. This lack of uniformity has lead to a difficult +situation that makes implementing certain changes less effective. This status quo is not uncommon with projects born how +PDA was born, so it's unfortunate but not unexpected. + +### Change of Direction + +In order to reorganize the project and get it on a track to a future that allows it to contend with other commercial +quality products, I had to make many considerations to the proficiencies of two unique paths forward to achieve this +goal. One path forward is seemingly obvious, continue maintaining the current code base while overhauling it to shift it +towards the envisioned goal. The other path is a fresh solution design with a complete rebuild. + +The answer to the aforementioned decision might seem obvious to those of you who typically favor the "don't reinvent the +wheel" mentality. I'm unclear of the details surrounding the original use-case that drove the development of this +project, but I don't believe it was on-par with some use-cases we see today which include operators handling many tens +of thousands of zones and/or records. There are many changes that have been (sometimes) haphazardly implemented which +has lead to the previously mentioned lack of uniformity among other issues. To put it simply, I'm not sure if the +project ever had a grand vision per se but instead was mostly reactionary to community requests. + +I believe that the current project has served the community fairly well from what I can tell. I know the product has +certainly helped me in my professional efforts with many environments. I also believe that it's time to pivot so that +the project can realize it's true potential, considering the existing user base. For this reason, I am beginning the +planning phase of a project overhaul. This effort will involve a complete re-engineering of the project's contribution +standards and requirements, technology stack, and project structure. + +This was not an easy decision to come to but one must appreciate that there aren't as many people that can get very +excited about working on the current project code base. The current project has many barriers to entry which I intend to +drastically impact with future changes. The reality is that it's easier to gain contribution participation with a new +build effort as it offers an opportunity to own a part of the project with impactful contributions. + +### Project Enhancements + +Since this is the beginning of a rebirth of the project so to speak, I want to implement a new operational tactic that +will hopefully drive contributions through incentive. Many of us understand that any project, needs a leader to stay on +track and organized. If everything were a democratic process, it would take too long and suffer unnecessary challenges. +With that being said, I do believe that there is plenty of opportunity through-out various development phases of the +project to allow for a democratic process where the community contributors and members can participate in the +decision-making. + +The plan to achieve the aforementioned democratic goal is to centralize communications and define some basic structured +processes. To do this, more effective methods of communication have been implemented to allow those interested in +contributing to easily participate in fluid, open communication. This has already been proving to be quite effective for +exchanging ideas and visions while addressing the issue with contributors living in vastly different time zones. This is +effectively a private chat hosted by the PDA project using Mattermost (a Slack-like alternative). + +Even if you aren't in a position to directly contribute work to the project, you can still contribute by participating +in these very important and early discussions that will impact the solution engineering. If the PDA project is an +important tool in your organization, I encourage you to join the conversation and contribute where applicable your +use-cases. Having more insight on the community use-cases will only benefit the future of this project. + +If you're interested in joining the conversation, please email me at +[admin@powerdnsadmin.org](mailto:admin@powerdnsadmin.org) for an invitation. + +### Re-branding + +As part of this project transition, I will also be changing the naming scheme in order to support the future development +efforts toward a newly engineered solution. The current PDA project will ultimately become known as the "PDA Legacy" +application. This change will help facilitate the long-term solution to take the branding position of the existing +solution. Another effort I will be making is to get an app landing page online at the project's new domain: +[powerdnsadmin.org](https://powerdnsadmin.org). This will act as one more point of online exposure for the project which +will hopefully lend itself well to attracting additional community members. + +### Contribution Requirements + +Another big change that will be made with the new project, will be well-defined contribution requirements. I realize +these requirements can be demotivating for some, but they are a necessary evil to ensure the project actually achieves +its goals effectively. It's important to always remember that strict requirements are to everyone's benefit as they push +for order where chaos is quite destructive. + +### Closing + +I hope these announcements garner more participation in the PDA community. The project definitely needs more help to +achieve any goal at this point, so your participation is valued! diff --git a/docs/announcements/project-update-2023-11-25.md b/docs/announcements/project-update-2023-11-25.md new file mode 100644 index 000000000..5e1719f34 --- /dev/null +++ b/docs/announcements/project-update-2023-11-25.md @@ -0,0 +1,109 @@ +# PDA Project Update + +## Introduction + +Hello PDA community members, + +I know it has been quite awhile since the last formal announcement like this. Things have been quite busy and difficult +for me both professional and personally. While I try hard to never make my problems someone else's problems, I do +believe it's important to be transparent with the community. I'm not going to go into details, but I will say that I +have been dealing with some mental health issues that have been quite challenging. I'm not one to give up though, +so I'm pushing through and trying to get back on track. + +With that being said, let's jump into the announcements. + +### Project Maintenance + +Granted I haven't been nearly as active on the project as I would like to be, I have been keeping an eye on things and +trying to keep up with the maintenance. I know there are a lot of issues and feature requests that have been piling up, +and I'm sorry for that. Even if I had been more active in recent months, it would have not changed the true root cause +of the issue. + +This project was started out of a need for an individual's own use-case. I don't believe it was never intended to be a +commercial quality product nor a community project. It did however gain traction quickly and the community grew. This +is a great thing, but it also comes with some challenges. The biggest challenge is that the project was never designed +to be a community project. This means that the project lacks many of the things that are required to effectively manage +a community project. This is not to say that the project is doomed, but many of the fast-paced changes combined with +the lack of standards has lead to a difficult situation that makes implementing certain changes incredibly unproductive +and quite often, entirely counter-productive. + +After many years of accepting contributions from those who are not professional developers, the project has become quite +difficult to maintain. This is not to say that I don't appreciate the contributions, but it's important to understand +that the state of the code-base for the project is not in a good place. This is not uncommon with projects born how PDA +was born, so it's unfortunate but not unexpected. + +As of today, there are so many dependencies and a large amount of very poorly implemented features that it's difficult +to make any changes without breaking many other pieces. This is further complicated by the fact that the current code +base is harder to follow naturally since it largely lacks uniformity and standards. This lack of uniformity has lead to +a situation where automated regression testing is not possible. This is a very important aspect of any project that +expects to be able to make changes without breaking things. This is also a very important aspect of any project that +expects to be able to accept contributions from the community with minimum management resources. + +The hard reality is that the majority of stakeholders in the project are not professional developers. This naturally +means the amount of people that can offer quality contributions is very limited. This problem is further aggravated by +the poor quality feature implementation which is very hard to follow, even for seasoned developers like myself. So many +seemingly small issues that have been reported, have lead to finding that the resolution is not as simple as it seems. + +### New Direction + +As I previously stated in my last formal announcement, we would be working towards a total replacement of the project. +Unfortunately, this is not a simple task, and it's not something that can be done quickly. Furthermore, with +increasingly limited capacity in our own lives to work on this, we are essentially drowning in a sea of technical debt +created by the past decisions of the project to accept all contributions. We have essentially reached a point where +far too much time and resources are being wasted just to attempt to meet the current demand of requests on the current +edition of PDA. This is a tragedy because the efforts that are invested into the current edition, really aren't +creating true progress for the project, but instead merely delaying the inevitable. + +As I have stated before to many community members, one aspect of taking over management of this project to ultimately +save it and keep it alive, would involve making hard decisions that many will not agree with. It's unfortunate that +many of those who are less than supportive of these decisions, often lack the appropriate experience to understand the +importance of these decisions. I'm not saying that I'm always right, but I am saying that it's not hard to see where +this is headed without some drastic changes. + +With all of that being said, it's time for me to make some hard decisions. I have decided that the best course of +action is to stop accepting contributions to the current edition of PDA. At this point, due to the aforementioned +issues that lead to breaking the application with seemingly simple changes, it's just not worth the effort to try to +keep up with the current edition. This is not to say that I'm giving up on the project, but instead I'm going to +re-focus my efforts on the new edition of PDA. This is the only way to ensure that the project will survive and +hopefully thrive in the future. + +I will not abandon the current set of updates that were planned for the next release of `0.4.2` however. I have +re-scheduled that release to be out by the end of the year. This will be the last release of the current edition of +PDA. The consensus from some users is that the current edition is stable enough to be used in production environments. +I don't necessarily agree with that, but I do believe that it's stable enough to be used in production +environments with the understanding that it's not a commercial quality product. + +### Future Contributions + +For those of you wondering about contributions to the new edition of PDA, the answer for now is simple. I won't be +accepting any contributions to the new edition until I can achieve a stable release that delivers the core features of +the current edition. This is not to say that I won't be accepting any contributions at all, but instead that I will be +very selective about what contributions I accept. I believe this is the only way to ensure that a solid foundation not +only takes shape, but remains solid. + +It is well understood that many developers have their own ways of doing things, but it's important to understand +that this project is not a personal project. This project is a community project and therefore must be treated as such. +This means that the project must be engineered in a way that allows for the community to participate in the development +process. This is not possible if the project is not engineered in a way that is easy to follow and understand. + +### Project Enhancements + +It should be understood that one of the greatest benefits of this pivot is that it will allow for a more structured +development process. As a result of that, the project could potentially see a future where it adopts a whole new set of +features that weren't previously imagined. One prime example of this could be integration with registrar APIs. This +could make easy work of tasks such as DNSSEC key rotation, which is currently a very manual process. + +I am still working on final project requirements for additional phases of the new PDA edition, but these additions +won't receive any attention until the core features are implemented. I will be sure to make announcements as these +requirements are finalized. It is my intention to follow a request for proposal (RFP) process for these additional +features. This will allow the community to participate in the decision-making process for future expansion of the +project. + +### Closing + +I hope that by the time you have reached this point in the announcement, that I have elicited new hope for the +long-term future of the project. I know that many of you have been waiting for a long time for some of the features that have been +requested. I know that many of you have been waiting for a long time for some of the issues to be resolved, for +requested features to be implemented, and for the project to be more stable. It's unfortunate that it has taken this +long to get to this point, but this is the nature of life itself. I hope that you can understand that this is the only +reasonable gamble that the project survives and thrives in the future. From 6f47cbd91b1212960249c506579df78302b65487 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 25 Nov 2023 08:16:26 -0500 Subject: [PATCH 458/475] Updating the issue configuration to disable the submission of new issues of all types. --- .github/ISSUE_TEMPLATE/config.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 6aba80c68..9292a2ea4 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,12 +2,5 @@ # Reference: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser blank_issues_enabled: false contact_links: - - name: 📖 Contributing Policy - url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md - about: "Please read through our contributing policy before opening an issue or pull request" - - name: ❓ Discussion - url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions - about: "If you're just looking for help, try starting a discussion instead" - - name: 💬 Project Chat - url: https://mattermost.powerdnsadmin.org/ - about: "Join our Mattermost chat to discuss the project with other users and developers" \ No newline at end of file + - name: 📖 Project Update - PLEASE READ! + url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions/1708 From 5d4e560836b16f0c0a65f20185ddb587a436b580 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 25 Nov 2023 08:17:37 -0500 Subject: [PATCH 459/475] Updating the issue configuration to disable the submission of new issues of all types. --- .github/ISSUE_TEMPLATE/{bug_report.yaml => _bug_report.yaml} | 0 .../{documentation_change.yaml => _documentation_change.yaml} | 0 .../{feature_request.yaml => _feature_request.yaml} | 0 .github/ISSUE_TEMPLATE/{housekeeping.yaml => _housekeeping.yaml} | 0 .github/ISSUE_TEMPLATE/config.yml | 1 + 5 files changed, 1 insertion(+) rename .github/ISSUE_TEMPLATE/{bug_report.yaml => _bug_report.yaml} (100%) rename .github/ISSUE_TEMPLATE/{documentation_change.yaml => _documentation_change.yaml} (100%) rename .github/ISSUE_TEMPLATE/{feature_request.yaml => _feature_request.yaml} (100%) rename .github/ISSUE_TEMPLATE/{housekeeping.yaml => _housekeeping.yaml} (100%) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/_bug_report.yaml similarity index 100% rename from .github/ISSUE_TEMPLATE/bug_report.yaml rename to .github/ISSUE_TEMPLATE/_bug_report.yaml diff --git a/.github/ISSUE_TEMPLATE/documentation_change.yaml b/.github/ISSUE_TEMPLATE/_documentation_change.yaml similarity index 100% rename from .github/ISSUE_TEMPLATE/documentation_change.yaml rename to .github/ISSUE_TEMPLATE/_documentation_change.yaml diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/_feature_request.yaml similarity index 100% rename from .github/ISSUE_TEMPLATE/feature_request.yaml rename to .github/ISSUE_TEMPLATE/_feature_request.yaml diff --git a/.github/ISSUE_TEMPLATE/housekeeping.yaml b/.github/ISSUE_TEMPLATE/_housekeeping.yaml similarity index 100% rename from .github/ISSUE_TEMPLATE/housekeeping.yaml rename to .github/ISSUE_TEMPLATE/_housekeeping.yaml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 9292a2ea4..550f15e21 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -4,3 +4,4 @@ blank_issues_enabled: false contact_links: - name: 📖 Project Update - PLEASE READ! url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions/1708 + about: "Important information about the future of this project" From 17e6adb8a78f4a4343313ab9b299a4cb25585a60 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sat, 25 Nov 2023 08:17:56 -0500 Subject: [PATCH 460/475] Updating the issue configuration to disable the submission of new issues of all types. --- .github/ISSUE_TEMPLATE/_bug_report.yaml | 79 ------------------- .../ISSUE_TEMPLATE/_documentation_change.yaml | 40 ---------- .github/ISSUE_TEMPLATE/_feature_request.yaml | 72 ----------------- .github/ISSUE_TEMPLATE/_housekeeping.yaml | 24 ------ 4 files changed, 215 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/_bug_report.yaml delete mode 100644 .github/ISSUE_TEMPLATE/_documentation_change.yaml delete mode 100644 .github/ISSUE_TEMPLATE/_feature_request.yaml delete mode 100644 .github/ISSUE_TEMPLATE/_housekeeping.yaml diff --git a/.github/ISSUE_TEMPLATE/_bug_report.yaml b/.github/ISSUE_TEMPLATE/_bug_report.yaml deleted file mode 100644 index ea05799ed..000000000 --- a/.github/ISSUE_TEMPLATE/_bug_report.yaml +++ /dev/null @@ -1,79 +0,0 @@ ---- -name: 🐛 Bug Report -description: Report a reproducible bug in the current release of PDA -labels: ["bug / broken-feature"] -body: - - type: markdown - attributes: - value: > - **NOTE:** This form is only for reporting _reproducible bugs_ in a current PDA - installation. If you're having trouble with installation or just looking for - assistance with using PDA, please visit our - [discussion forum](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions) instead. - - type: dropdown - attributes: - label: PDA version - description: What version of PDA are you currently running? - options: - - "0.4.1" - - "0.4.0" - - "0.3.0" - - "0.2.5" - - "0.2.4" - - "0.2.3" - - "0.2.2" - - "0.2.1" - - "0.2" - - "0.1" - - "I'm Not Sure" - validations: - required: true - - type: dropdown - attributes: - label: Python version - description: What version of Python are you currently running? - options: - - "3.0" - - "3.1" - - "3.2" - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "3.7" - - "3.8" - - "3.9" - - "3.10" - - "3.11" - validations: - required: true - - type: textarea - attributes: - label: Steps to Reproduce - description: > - Describe in detail the exact steps that someone else can take to - reproduce this bug using the current stable release of PDA. Begin with the - creation of any necessary database objects and call out every operation being - performed explicitly. If reporting a bug in the REST API, be sure to reconstruct - the raw HTTP request(s) being made. Additionally, **do not rely on the demo instance** for reproducing - suspected bugs, as its data is prone to modification or deletion at any time. - placeholder: | - 1. Click on "create widget" - 2. Set foo to 12 and bar to G - 3. Click the "create" button - validations: - required: true - - type: textarea - attributes: - label: Expected Behavior - description: What did you expect to happen? - placeholder: A new zone record should have been created with the specified values - validations: - required: true - - type: textarea - attributes: - label: Observed Behavior - description: What happened instead? - placeholder: A TypeError exception was raised - validations: - required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/_documentation_change.yaml b/.github/ISSUE_TEMPLATE/_documentation_change.yaml deleted file mode 100644 index 0b34991b4..000000000 --- a/.github/ISSUE_TEMPLATE/_documentation_change.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: 📖 Documentation Change -description: Suggest an addition or modification to the PDA documentation -labels: ["docs / request"] -body: - - type: dropdown - attributes: - label: Change Type - description: What type of change are you proposing? - options: - - Addition - - Correction - - Removal - - Cleanup (formatting, typos, etc.) - validations: - required: true - - type: dropdown - attributes: - label: Area - description: To what section of the documentation does this change primarily pertain? - options: - - Features - - Installation/upgrade - - Getting started - - Configuration - - Customization - - Database Setup - - Debug - - Integrations/API - - Administration - - Development - - Other - validations: - required: true - - type: textarea - attributes: - label: Proposed Changes - description: Describe the proposed changes and why they are necessary. - validations: - required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/_feature_request.yaml b/.github/ISSUE_TEMPLATE/_feature_request.yaml deleted file mode 100644 index 45950a1a2..000000000 --- a/.github/ISSUE_TEMPLATE/_feature_request.yaml +++ /dev/null @@ -1,72 +0,0 @@ ---- -name: ✨ Feature Request -description: Propose a new PDA feature or enhancement -labels: ["feature / request"] -body: - - type: markdown - attributes: - value: > - **NOTE:** This form is only for submitting well-formed proposals to extend or modify - PDA in some way. If you're trying to solve a problem but can't figure out how, or if - you still need time to work on the details of a proposed new feature, please start a - [discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions) instead. - - type: dropdown - attributes: - label: PDA version - description: What version of PDA are you currently running? - options: - - "0.4.1" - - "0.4.0" - - "0.3.0" - - "0.2.5" - - "0.2.4" - - "0.2.3" - - "0.2.2" - - "0.2.1" - - "0.2" - - "0.1" - - "I'm Not Sure" - validations: - required: true - - type: dropdown - attributes: - label: Feature type - options: - - Data model modification - - App Setting Addition - - Default App Setting Change - - New functionality - - Change to existing functionality - validations: - required: true - - type: textarea - attributes: - label: Proposed functionality - description: > - Describe in detail the new feature or behavior you are proposing. Include any specific changes - to work flows, data models, and/or the user interface. The more detail you provide here, the - greater chance your proposal has of being discussed. Feature requests which don't include an - actionable implementation plan will be rejected. - validations: - required: true - - type: textarea - attributes: - label: Use case - description: > - Explain how adding this functionality would benefit PDA users. What need does it address? - validations: - required: true - - type: textarea - attributes: - label: Database changes - description: > - Note any changes to the database schema necessary to support the new feature. For example, - does the proposal require adding a new model or field? (Not all new features require database - changes.) - - type: textarea - attributes: - label: External dependencies - description: > - List any new dependencies on external libraries or services that this new feature would - introduce. For example, does the proposal require the installation of a new Python package? - (Not all new features introduce new dependencies.) \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/_housekeeping.yaml b/.github/ISSUE_TEMPLATE/_housekeeping.yaml deleted file mode 100644 index 2d8e5dfc5..000000000 --- a/.github/ISSUE_TEMPLATE/_housekeeping.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: 🏡 Housekeeping -description: A change pertaining to the codebase itself (developers only) -labels: ["mod / change-request"] -body: - - type: markdown - attributes: - value: > - **NOTE:** This template is for use by maintainers only. Please do not submit - an issue using this template unless you have been specifically asked to do so. - - type: textarea - attributes: - label: Proposed Changes - description: > - Describe in detail the new feature or behavior you'd like to propose. - Include any specific changes to work flows, data models, or the user interface. - validations: - required: true - - type: textarea - attributes: - label: Justification - description: Please provide justification for the proposed change(s). - validations: - required: true \ No newline at end of file From 06fa9537a87e7e40cf6b992175586dbb11be91b1 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Wed, 29 Nov 2023 15:21:31 -0500 Subject: [PATCH 461/475] Updated project documentation to better control the flow of new issue submission attempts. Updated project README to include clear notice of the latest update for the project freeze. --- README.md | 2 ++ docs/CONTRIBUTING.md | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6070d5f17..055e68d12 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ A PowerDNS web interface with advanced features. - Provides an API for zone and record management among other features - Provides full IDN/Punycode support +## [Project Update - PLEASE READ!!!](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions/1708) + ## Running PowerDNS-Admin There are several ways to run PowerDNS-Admin. The quickest way is to use Docker. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index d4fb25fa5..2a978dc6c 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -24,13 +24,15 @@ Some general tips for engaging here on GitHub: * To help mitigate notification spam, please avoid "bumping" issues with no activity. (To vote an issue up or down, use a :thumbsup: or :thumbsdown: reaction.) * Please avoid pinging members with `@` unless they've previously expressed interest or involvement with that particular issue. +## [Project Update - PLEASE READ!!!](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions/1708) + ## :bug: Reporting Bugs * First, ensure that you're running the [latest stable version](https://github.com/PowerDNS-Admin/PowerDNS-Admin/releases) of PDA. If you're running an older version, there's a chance that the bug has already been fixed. * Next, search our [issues list](https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues?q=is%3Aissue) to see if the bug you've found has already been reported. If you come across a bug report that seems to match, please click "add a reaction" in the top right corner of the issue and add a thumbs up (:thumbsup:). This will help draw more attention to it. Any comments you can add to provide additional information or context would also be much appreciated. -* If you can't find any existing issues (open or closed) that seem to match yours, you're welcome to [submit a new bug report](https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues/new?label=type%3A+bug&template=bug_report.yaml). Be sure to complete the entire report template, including detailed steps that someone triaging your issue can follow to confirm the reported behavior. (If we're not able to replicate the bug based on the information provided, we'll ask for additional detail.) +* If you can't find any existing issues (open or closed) that seem to match yours, you're welcome to [submit a new bug report](https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues/new/choose). Be sure to complete the entire report template, including detailed steps that someone triaging your issue can follow to confirm the reported behavior. (If we're not able to replicate the bug based on the information provided, we'll ask for additional detail.) * Some other tips to keep in mind: * Error messages and screenshots are especially helpful. @@ -44,7 +46,7 @@ Some general tips for engaging here on GitHub: * If you have a rough idea that's not quite ready for formal submission yet, start a [GitHub discussion](https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions) instead. This is a great way to test the viability and narrow down the scope of a new feature prior to submitting a formal proposal, and can serve to generate interest in your idea from other community members. -* Once you're ready, submit a feature request [using this template](https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues/new?label=type%3A+feature&template=feature_request.yaml). Be sure to provide sufficient context and detail to convey exactly what you're proposing and why. The stronger your use case, the better chance your proposal has of being accepted. +* Once you're ready, submit a feature request [using this template](https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues/choose). Be sure to provide sufficient context and detail to convey exactly what you're proposing and why. The stronger your use case, the better chance your proposal has of being accepted. * Some other tips to keep in mind: * Don't prepend your issue title with a label like `[Feature]`; the proper label will be assigned automatically. From 7b6aafbb2c8b3b4c7608dd048e1c9a7ffe59bce1 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 8 Dec 2023 04:53:52 -0500 Subject: [PATCH 462/475] Adding LDAP search filter cleansing mechanism to account for special characters that need replaced in LDAP search queries. --- powerdnsadmin/models/user.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/powerdnsadmin/models/user.py b/powerdnsadmin/models/user.py index 0596e3df1..02e4af0c3 100644 --- a/powerdnsadmin/models/user.py +++ b/powerdnsadmin/models/user.py @@ -133,9 +133,21 @@ def ldap_init_conn(self): conn.protocol_version = ldap.VERSION3 return conn + def escape_filter_chars(self, filter_str): + """ + Escape chars for ldap search + """ + escape_chars = ['\\', '*', '(', ')', '\x00'] + replace_chars = ['\\5c', '\\2a', '\\28', '\\29', '\\00'] + for escape_char in escape_chars: + filter_str = filter_str.replace(escape_char, replace_chars[escape_chars.index(escape_char)]) + return filter_str + def ldap_search(self, searchFilter, baseDN, retrieveAttributes=None): searchScope = ldap.SCOPE_SUBTREE + searchFilter = self.escape_filter_chars(searchFilter) + try: conn = self.ldap_init_conn() if Setting().get('ldap_type') == 'ad': From 59a32a148f51c4768c9068f2f7f11b05804a649b Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Fri, 8 Dec 2023 06:17:34 -0500 Subject: [PATCH 463/475] Corrected a mistake with the new LDAP search filter cleansing that broke LDAP altogether. Moved the filtering to only target the user DN with Active Directory LDAP connections. --- powerdnsadmin/models/user.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/powerdnsadmin/models/user.py b/powerdnsadmin/models/user.py index 02e4af0c3..42f894fe1 100644 --- a/powerdnsadmin/models/user.py +++ b/powerdnsadmin/models/user.py @@ -146,8 +146,6 @@ def escape_filter_chars(self, filter_str): def ldap_search(self, searchFilter, baseDN, retrieveAttributes=None): searchScope = ldap.SCOPE_SUBTREE - searchFilter = self.escape_filter_chars(searchFilter) - try: conn = self.ldap_init_conn() if Setting().get('ldap_type') == 'ad': @@ -292,7 +290,7 @@ def is_validate(self, method, src_ip='', trust_user=False): Operator=LDAP_OPERATOR_GROUP, User=LDAP_USER_GROUP, ) - user_dn = ldap_result[0][0][0] + user_dn = self.escape_filter_chars(ldap_result[0][0][0]) sf_groups = "" for group in ldap_group_security_roles.values(): From 9415b4663f187073372f45201d61c86a0a5d3a34 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Mon, 11 Dec 2023 08:36:37 -0500 Subject: [PATCH 464/475] Applied the latest suggestion from @ashneilson which appears to be a good fix this time. --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 3226fc846..519e0775f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -92,6 +92,6 @@ RUN chown ${USER}:${USER} ./configs /app && \ EXPOSE 80/tcp USER ${USER} -HEALTHCHECK --interval=5s --timeout=5s --start-period=20s --retries=5 CMD ["wget","--output-document=-","--quiet","--tries=1","http://127.0.0.1${SCRIPT_NAME:-/}"] +HEALTHCHECK --interval=5s --timeout=5s --start-period=20s --retries=5 CMD wget --output-document=- --quiet --tries=1 http://127.0.0.1${SCRIPT_NAME:-/} ENTRYPOINT ["entrypoint.sh"] CMD ["gunicorn","powerdnsadmin:create_app()"] From 577b3509163ab8d4c280dda397c40aaea9449215 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 07:12:28 +0000 Subject: [PATCH 465/475] Bump mysqlclient from 2.0.1 to 2.2.1 Bumps [mysqlclient](https://github.com/PyMySQL/mysqlclient) from 2.0.1 to 2.2.1. - [Release notes](https://github.com/PyMySQL/mysqlclient/releases) - [Changelog](https://github.com/PyMySQL/mysqlclient/blob/main/HISTORY.rst) - [Commits](https://github.com/PyMySQL/mysqlclient/compare/v2.0.1...v2.2.1) --- updated-dependencies: - dependency-name: mysqlclient dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 77d830a79..9a0a103e1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,7 +26,7 @@ itsdangerous==2.1.2 jsonschema[format]>=2.5.1,<4.0.0 # until https://github.com/Yelp/bravado-core/pull/385 lima==0.5 --use-feature=no-binary-enable-wheel-cache lxml==4.9.0 -mysqlclient==2.0.1 +mysqlclient==2.2.1 passlib==1.7.4 #pyOpenSSL==22.1.0 pyasn1==0.4.8 From e3e773cc85c45ed20927ac41bc4e0bdd23f242a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 07:08:40 +0000 Subject: [PATCH 466/475] Bump bcrypt from 4.0.1 to 4.1.2 Bumps [bcrypt](https://github.com/pyca/bcrypt) from 4.0.1 to 4.1.2. - [Changelog](https://github.com/pyca/bcrypt/blob/main/release.py) - [Commits](https://github.com/pyca/bcrypt/compare/4.0.1...4.1.2) --- updated-dependencies: - dependency-name: bcrypt dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 77d830a79..2bf0919e2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ Jinja2==3.1.2 PyYAML==6.0.1 SQLAlchemy==1.3.24 #alembic==1.9.0 -bcrypt==4.0.1 +bcrypt==4.1.2 bravado-core==5.17.1 certifi==2022.12.7 cffi==1.15.1 From 69dda3a5deb453a217cb4679ba3ef3204a2dddd7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 07:37:17 +0000 Subject: [PATCH 467/475] Bump pytest from 7.2.1 to 7.4.4 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.2.1 to 7.4.4. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.2.1...7.4.4) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 77d830a79..01de4975a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,7 +31,7 @@ passlib==1.7.4 #pyOpenSSL==22.1.0 pyasn1==0.4.8 pyotp==2.8.0 -pytest==7.2.1 +pytest==7.4.4 python-ldap==3.4.3 python3-saml==1.15.0 pytimeparse==1.1.8 From eb3243a07571259cb47e78f1c7f00b2bc141e948 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jan 2024 20:33:31 +0000 Subject: [PATCH 468/475] Bump jinja2 from 3.1.2 to 3.1.3 Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/pallets/jinja/releases) - [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/jinja/compare/3.1.2...3.1.3) --- updated-dependencies: - dependency-name: jinja2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0db7b16fd..601fe394c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ Flask-SSLify==0.1.5 Flask-SeaSurf==1.1.1 Flask-Session==0.4.0 Flask==2.1.3 -Jinja2==3.1.2 +Jinja2==3.1.3 PyYAML==5.4 SQLAlchemy==1.3.24 #alembic==1.9.0 From fdc1ba59e75381f04b4c43bbdb1ef5b29f2b8d47 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 20:20:34 +0000 Subject: [PATCH 469/475] Bump sqlalchemy from 1.3.24 to 1.4.51 Bumps [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) from 1.3.24 to 1.4.51. - [Release notes](https://github.com/sqlalchemy/sqlalchemy/releases) - [Changelog](https://github.com/sqlalchemy/sqlalchemy/blob/main/CHANGES.rst) - [Commits](https://github.com/sqlalchemy/sqlalchemy/commits) --- updated-dependencies: - dependency-name: sqlalchemy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 945873fd6..28149ea96 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ Flask-Session==0.4.0 Flask==2.2.5 Jinja2==3.1.2 PyYAML==6.0.1 -SQLAlchemy==1.3.24 +SQLAlchemy==1.4.51 #alembic==1.9.0 bcrypt==4.1.2 bravado-core==5.17.1 From 7998dd80c9b1b627d28a4872e3a2fe81228a0013 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Wed, 31 Jan 2024 15:54:58 -0500 Subject: [PATCH 470/475] Managed to complete the following pip dependency changes: - Jinaj2 - `3.1.3` - upgrade from `3.1.2` - certifi - `2023.11.17` - downgrade from `2023.12.17` - cryptography - `42.0.2` - upgrade from `39.0.2` - requests - `2.31.0` - upgrade from `2.28.2` - werkzeug - `2.3.8` - upgrade from `2.2.3` --- requirements.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index e8d61f372..a2665e282 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,16 +8,16 @@ Flask-SSLify==0.1.5 Flask-SeaSurf==1.1.1 Flask-Session==0.4.0 Flask==2.2.5 -Jinja2==3.1.2 +Jinja2==3.1.3 PyYAML==6.0.1 SQLAlchemy==1.4.51 #alembic==1.9.0 bcrypt==4.1.2 bravado-core==5.17.1 -certifi==2022.12.7 +certifi==2023.11.17 cffi==1.15.1 configobj==5.0.8 -cryptography==39.0.2 # fixes CVE-2023-0286, CVE-2023-23931 +cryptography==42.0.2 cssmin==0.2.0 dnspython>=2.3.0 flask_session_captcha==1.3.0 @@ -37,10 +37,10 @@ python3-saml==1.15.0 pytimeparse==1.1.8 pytz==2022.7.1 qrcode==7.3.1 -requests==2.28.2 +requests==2.31.0 rjsmin==1.2.1 webcolors==1.12 -werkzeug==2.2.3 +werkzeug==2.3.8 zipp==3.11.0 rcssmin==1.1.1 zxcvbn==4.4.28 From 51bdeca2188dfc46a5e854503257a3f7df745d69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 20:59:09 +0000 Subject: [PATCH 471/475] Bump crypto-js from 4.1.1 to 4.2.0 Bumps [crypto-js](https://github.com/brix/crypto-js) from 4.1.1 to 4.2.0. - [Commits](https://github.com/brix/crypto-js/compare/4.1.1...4.2.0) --- updated-dependencies: - dependency-name: crypto-js dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6420088f4..4d39ad083 100644 --- a/yarn.lock +++ b/yarn.lock @@ -360,9 +360,9 @@ core-util-is@~1.0.0: integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== crypto-js@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf" - integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw== + version "4.2.0" + resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.2.0.tgz#4d931639ecdfd12ff80e8186dba6af2c2e856631" + integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q== d@1, d@^1.0.1: version "1.0.1" From 9c457f1db0711eafc7554e0b6a40f29eb200c48f Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Wed, 31 Jan 2024 16:08:37 -0500 Subject: [PATCH 472/475] Updated the following NPM dependencies: - crypto-js from `4.1.1` to `4.2.0` --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6420088f4..4d39ad083 100644 --- a/yarn.lock +++ b/yarn.lock @@ -360,9 +360,9 @@ core-util-is@~1.0.0: integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== crypto-js@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf" - integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw== + version "4.2.0" + resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.2.0.tgz#4d931639ecdfd12ff80e8186dba6af2c2e856631" + integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q== d@1, d@^1.0.1: version "1.0.1" From af462a9bae508b5c97a5cd06821db06e36c9b168 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Wed, 31 Jan 2024 16:32:41 -0500 Subject: [PATCH 473/475] Disabling Mega Linter for all recognized branch patterns. --- .github/workflows/mega-linter.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index fec231edb..fa29545f0 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -12,6 +12,9 @@ on: - "main" - "master" - "dependabot/**" + - "feature/**" + - "issues/**" + - "release/**" env: # Comment env block if you do not want to apply fixes # Apply linter fixes configuration From fa4861a6eda7072bac3b23441be12c75e2003eff Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Tue, 4 Jun 2024 13:55:56 -0400 Subject: [PATCH 474/475] Update README.md Removed Azorian Solutions branding from project README. --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index d1615c5a5..4435c7f7e 100644 --- a/README.md +++ b/README.md @@ -96,11 +96,3 @@ Please see our [Code of Conduct Policy](https://github.com/PowerDNS-Admin/PowerD This project is released under the MIT license. For additional information, [see the full license](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/LICENSE). - -## [Donate](https://www.buymeacoffee.com/AzorianMatt) - -Like my work? - -Buy Me A Coffee - -**Want to sponsor me?** Please visit my organization's [sponsorship page](https://github.com/sponsors/AzorianSolutions). From 3a430198709f426f6cd01931c5024d90728594a2 Mon Sep 17 00:00:00 2001 From: Wolf Vogel Date: Thu, 5 Sep 2024 17:13:50 +0200 Subject: [PATCH 475/475] Update login.html Fixed the "Remember Me" functionality that might not be working due to an unnamed input field. --- powerdnsadmin/templates/login.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerdnsadmin/templates/login.html b/powerdnsadmin/templates/login.html index 84e247d47..37f4050e3 100644 --- a/powerdnsadmin/templates/login.html +++ b/powerdnsadmin/templates/login.html @@ -89,7 +89,7 @@
    - +

    Associate: {{ history_assoc_account }}
    DataCommentEditDeleteChangelogActionsInvisible Sorting Column {{ record.comment }} {% if record.is_allowed_edit() %} - {% else %} @@ -116,23 +112,19 @@

    Zone Editor

    {% endif %} -
    {% if record.is_allowed_delete() %} - {% endif %} - - - 1