From 2c49b5a0ece6ddac8334ebeb8a6ce6af16d31984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20=22Zerka=22=20H?= Date: Sat, 18 Nov 2023 17:43:14 +0100 Subject: [PATCH] :bug: Fixed a bug when using a specific character in $DB_PASSWORD (#166) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :bug: Fixed a bug when using a specific character in $DB_PASSWORD * use quote filter and add password escpaing test --------- Co-authored-by: Max Hösel --- .../molecule/default/molecule.yml | 10 ++--- roles/pterodactyl_panel/templates/env.j2 | 44 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/roles/pterodactyl_panel/molecule/default/molecule.yml b/roles/pterodactyl_panel/molecule/default/molecule.yml index 2c76a2b..12508da 100644 --- a/roles/pterodactyl_panel/molecule/default/molecule.yml +++ b/roles/pterodactyl_panel/molecule/default/molecule.yml @@ -20,7 +20,7 @@ platforms: MYSQL_ROOT_PASSWORD: panel_molecule MYSQL_DATABASE: panel_molecule MYSQL_USER: panel_molecule - MYSQL_PASSWORD: panel_molecule + MYSQL_PASSWORD: qw#F8CcMFU%m64o networks: - name: molecule-pterodactyl-panel @@ -45,7 +45,7 @@ platforms: MYSQL_ROOT_PASSWORD: panel_molecule MYSQL_DATABASE: panel_molecule MYSQL_USER: panel_molecule - MYSQL_PASSWORD: panel_molecule + MYSQL_PASSWORD: qw#F8CcMFU%m64o networks: - name: molecule-pterodactyl-panel @@ -69,7 +69,7 @@ platforms: MYSQL_ROOT_PASSWORD: panel_molecule MYSQL_DATABASE: panel_molecule MYSQL_USER: panel_molecule - MYSQL_PASSWORD: panel_molecule + MYSQL_PASSWORD: qw#F8CcMFU%m64o networks: - name: molecule-pterodactyl-panel @@ -94,7 +94,7 @@ platforms: MYSQL_ROOT_PASSWORD: panel_molecule MYSQL_DATABASE: panel_molecule MYSQL_USER: panel_molecule - MYSQL_PASSWORD: panel_molecule + MYSQL_PASSWORD: qw#F8CcMFU%m64o networks: - name: molecule-pterodactyl-panel @@ -113,7 +113,7 @@ provisioner: pterodactyl_panel_db_host: "{{ inventory_hostname }}-db" pterodactyl_panel_db_name: panel_molecule pterodactyl_panel_db_user: panel_molecule - pterodactyl_panel_db_password: panel_molecule + pterodactyl_panel_db_password: qw#F8CcMFU%m64o # Test against the latest panel version unless specified pterodactyl_panel_version: "latest" php7: diff --git a/roles/pterodactyl_panel/templates/env.j2 b/roles/pterodactyl_panel/templates/env.j2 index 7cefbff..b5861c0 100644 --- a/roles/pterodactyl_panel/templates/env.j2 +++ b/roles/pterodactyl_panel/templates/env.j2 @@ -1,34 +1,34 @@ APP_ENV=production APP_DEBUG=false -APP_KEY={{ pterodactyl_panel_app_key }} +APP_KEY={{ pterodactyl_panel_app_key | quote }} APP_THEME=pterodactyl -APP_TIMEZONE={{ pterodactyl_panel_timezone }} +APP_TIMEZONE={{ pterodactyl_panel_timezone | quote }} APP_CLEAR_TASKLOG=720 APP_DELETE_MINUTES=10 APP_ENVIRONMENT_ONLY=true LOG_CHANNEL=daily -APP_LOCALE={{ pterodactyl_panel_locale }} +APP_LOCALE={{ pterodactyl_panel_locale | quote }} -DB_HOST={{ pterodactyl_panel_db_host }} +DB_HOST={{ pterodactyl_panel_db_host | quote }} DB_PORT={{ pterodactyl_panel_db_port }} -DB_DATABASE={{ pterodactyl_panel_db_name }} -DB_USERNAME={{ pterodactyl_panel_db_user }} -DB_PASSWORD={{ pterodactyl_panel_db_password }} +DB_DATABASE={{ pterodactyl_panel_db_name | quote }} +DB_USERNAME={{ pterodactyl_panel_db_user| quote }} +DB_PASSWORD={{ pterodactyl_panel_db_password | quote }} -HASHIDS_SALT={{ pterodactyl_panel_hashids_salt }} +HASHIDS_SALT={{ pterodactyl_panel_hashids_salt | quote }} HASHIDS_LENGTH=8 MAIL_DRIVER=smtp -MAIL_HOST={{ pterodactyl_panel_mail_host }} +MAIL_HOST={{ pterodactyl_panel_mail_host | quote }} MAIL_PORT={{ pterodactyl_panel_mail_port }} -MAIL_USERNAME={{ pterodactyl_panel_mail_user }} -MAIL_PASSWORD={{ pterodactyl_panel_mail_password }} -MAIL_ENCRYPTION={{ pterodactyl_panel_mail_encryption }} -MAIL_FROM={{ pterodactyl_panel_mail_from }} -MAIL_FROM_NAME="{{ pterodactyl_panel_mail_from_name }}" +MAIL_USERNAME={{ pterodactyl_panel_mail_user | quote }} +MAIL_PASSWORD={{ pterodactyl_panel_mail_password | quote }} +MAIL_ENCRYPTION={{ pterodactyl_panel_mail_encryption | quote }} +MAIL_FROM={{ pterodactyl_panel_mail_from | quote }} +MAIL_FROM_NAME={{ pterodactyl_panel_mail_from_name | quote }} -APP_SERVICE_AUTHOR="{{ pterodactyl_panel_egg_author }}" -APP_URL="{{ pterodactyl_panel_url }}" +APP_SERVICE_AUTHOR={{ pterodactyl_panel_egg_author | quote }} +APP_URL={{ pterodactyl_panel_url | quote }} CACHE_DRIVER=redis SESSION_DRIVER=redis @@ -45,10 +45,10 @@ QUEUE_LOW=low APP_ENVIRONMENT_ONLY=false {% if pterodactyl_panel_backup_enable %} -APP_BACKUP_DRIVER={{ pterodactyl_panel_backup_driver }} -AWS_DEFAULT_REGION={{ pterodactyl_panel_aws_default_region }} -AWS_ACCESS_KEY_ID={{ pterodactyl_panel_aws_access_key_id }} -AWS_SECRET_ACCESS_KEY={{ pterodactyl_panel_aws_secret_access_key }} -AWS_BACKUPS_BUCKET={{ pterodactyl_panel_aws_backups_bucket }} -AWS_ENDPOINT={{ pterodactyl_panel_aws_endpoint }} +APP_BACKUP_DRIVER={{ pterodactyl_panel_backup_driver | quote }} +AWS_DEFAULT_REGION={{ pterodactyl_panel_aws_default_region | quote }} +AWS_ACCESS_KEY_ID={{ pterodactyl_panel_aws_access_key_id | quote }} +AWS_SECRET_ACCESS_KEY={{ pterodactyl_panel_aws_secret_access_key | quote }} +AWS_BACKUPS_BUCKET={{ pterodactyl_panel_aws_backups_bucket | quote }} +AWS_ENDPOINT={{ pterodactyl_panel_aws_endpoint | quote }} {% endif %}