Skip to content

Commit

Permalink
🐛 Fixed a bug when using a specific character in $DB_PASSWORD (#166)
Browse files Browse the repository at this point in the history
* 🐛 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 <[email protected]>
  • Loading branch information
Zerka30 and maxhoesel authored Nov 18, 2023
1 parent 18bafcc commit 2c49b5a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
10 changes: 5 additions & 5 deletions roles/pterodactyl_panel/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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:
Expand Down
44 changes: 22 additions & 22 deletions roles/pterodactyl_panel/templates/env.j2
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 %}

0 comments on commit 2c49b5a

Please sign in to comment.