Skip to content

remove escape logic for passwords (do not merge until sufficient testing on bookstack PR 140) #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ Container images are configured using parameters passed at runtime (such as thos
| `-p 3306` | Mariadb listens on this port. |
| `-e PUID=1000` | for UserID - see below for explanation |
| `-e PGID=1000` | for GroupID - see below for explanation |
| `-e MYSQL_ROOT_PASSWORD=ROOT_ACCESS_PASSWORD` | Set this to root password for installation (minimum 4 characters). |
| `-e MYSQL_ROOT_PASSWORD=ROOT_ACCESS_PASSWORD` | Set this to root password for installation (minimum 4 characters & non-alphanumeric passwords must be properly escaped). |
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. |
| `-e MYSQL_DATABASE=USER_DB_NAME` | Specify the name of a database to be created on image startup. |
| `-e MYSQL_USER=MYSQL_USER` | This user will have superuser access to the database specified by MYSQL_DATABASE (do not use root here). |
| `-e MYSQL_PASSWORD=DATABASE_PASSWORD` | Set this to the password you want to use for you MYSQL_USER (minimum 4 characters). |
| `-e MYSQL_PASSWORD=DATABASE_PASSWORD` | Set this to the password you want to use for you MYSQL_USER (minimum 4 characters & non-alphanumeric passwords must be properly escaped). |
| `-e REMOTE_SQL=http://URL1/your.sql,https://URL2/your.sql` | Set this to ingest sql files from an http/https endpoint (comma seperated array). |
| `-v /config` | Contains the db itself and all assorted settings. |

Expand Down Expand Up @@ -276,6 +276,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **10.10.22:** - Remove password escape logic which caused problems for a small subset of users.
* **06.07.21:** - Rebase master to alpine.
* **03.07.21:** - Rebase to 3.14.
* **08.02.21:** - Fix new installs.
Expand Down
5 changes: 3 additions & 2 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ param_container_name: "{{ project_name }}"
param_usage_include_net: false
param_usage_include_env: true
param_env_vars:
- { env_var: "MYSQL_ROOT_PASSWORD", env_value: "ROOT_ACCESS_PASSWORD", desc: "Set this to root password for installation (minimum 4 characters)." }
- { env_var: "MYSQL_ROOT_PASSWORD", env_value: "ROOT_ACCESS_PASSWORD", desc: "Set this to root password for installation (minimum 4 characters & non-alphanumeric passwords must be properly escaped)." }
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London." }
param_usage_include_vols: true
param_volumes:
Expand All @@ -41,7 +41,7 @@ opt_param_usage_include_env: true
opt_param_env_vars:
- { env_var: "MYSQL_DATABASE", env_value: "USER_DB_NAME", desc: "Specify the name of a database to be created on image startup." }
- { env_var: "MYSQL_USER", env_value: "MYSQL_USER", desc: "This user will have superuser access to the database specified by MYSQL_DATABASE (do not use root here)." }
- { env_var: "MYSQL_PASSWORD", env_value: "DATABASE_PASSWORD", desc: "Set this to the password you want to use for you MYSQL_USER (minimum 4 characters)." }
- { env_var: "MYSQL_PASSWORD", env_value: "DATABASE_PASSWORD", desc: "Set this to the password you want to use for you MYSQL_USER (minimum 4 characters & non-alphanumeric passwords must be properly escaped)." }
- { env_var: "REMOTE_SQL", env_value: "http://URL1/your.sql,https://URL2/your.sql", desc: "Set this to ingest sql files from an http/https endpoint (comma seperated array)." }
opt_param_usage_include_vols: false
opt_param_usage_include_ports: false
Expand Down Expand Up @@ -96,6 +96,7 @@ app_setup_block: |

# changelog
changelogs:
- { date: "10.10.22:", desc: "Remove password escape logic which caused problems for a small subset of users." }
- { date: "06.07.21:", desc: "Rebase master to alpine." }
- { date: "03.07.21:", desc: "Rebase to 3.14." }
- { date: "08.02.21:", desc: "Fix new installs." }
Expand Down
2 changes: 0 additions & 2 deletions root/etc/cont-init.d/40-initialise-db
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
else
TEST_LEN=${#MYSQL_ROOT_PASSWORD}
fi
MYSQL_ROOT_PASSWORD=$(sed -E 's/('\'')/\\\1/g' <<< "${MYSQL_ROOT_PASSWORD}")
if [ "${TEST_LEN}" -lt "4" ]; then
MYSQL_PASS="CREATE USER 'root'@'%' IDENTIFIED BY '' ;"
else
Expand All @@ -57,7 +56,6 @@ if [ "${MYSQL_USER+x}" ] && \
[ "${MYSQL_DATABASE+x}" ] && \
[ "${MYSQL_PASSWORD+x}" ] && \
[ "${#MYSQL_PASSWORD}" -gt "3" ]; then
MYSQL_PASSWORD=$(sed -E 's/('\'')/\\\1/g' <<< "${MYSQL_PASSWORD}")
read -r -d '' MYSQL_DB_SETUP << EOM
CREATE DATABASE \`${MYSQL_DATABASE}\`;
CREATE USER '${MYSQL_USER}'@'%' IDENTIFIED BY '${MYSQL_PASSWORD}';
Expand Down