Skip to content

Commit

Permalink
Test plenty of weird characters in CI job MySQL password
Browse files Browse the repository at this point in the history
(cherry picked from commit 2fc7c86)
  • Loading branch information
eldering authored and meisterT committed Nov 25, 2024
1 parent ce9eeda commit 82cc7da
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
6 changes: 2 additions & 4 deletions .github/jobs/baseinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ mysql_root "show databases"
mysql_root "SELECT CURRENT_USER();"
mysql_root "SELECT USER();"
mysql_root "SELECT user,host FROM mysql.user"
echo "unused:sqlserver:domjudge:domjudge:domjudge:3306" > /opt/domjudge/domserver/etc/dbpasswords.secret
mysql_user "SELECT CURRENT_USER();"
mysql_user "SELECT USER();"
echo 'unused:sqlserver:domjudge:domjudge:domjudge_db-pw+% #$*)@(!/;,.:3306' > /opt/domjudge/domserver/etc/dbpasswords.secret
section_end

if [ "${db}" = "install" ]; then
Expand All @@ -75,6 +73,7 @@ if [ "${db}" = "install" ]; then
section_end
elif [ "${db}" = "upgrade" ]; then
section_start "Upgrade DOMjudge database"
/opt/domjudge/domserver/bin/dj_setup_database -uroot -proot update-password
/opt/domjudge/domserver/bin/dj_setup_database -uroot -proot upgrade
section_end
fi
Expand Down Expand Up @@ -139,4 +138,3 @@ elif [ "$version" = "all" ]; then
mysql_root "UPDATE user SET teamid = 1 WHERE userid = 1;" domjudge
fi
section_end

5 changes: 0 additions & 5 deletions .github/jobs/ci_settings.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ mysql_root () {
echo "$1" | mysql -uroot -proot ${2:-} | tee -a "$ARTIFACTS"/mysql.txt
}

mysql_user () {
# shellcheck disable=SC2086
echo "$1" | mysql -udomjudge -pdomjudge ${2:-} | tee -a "$ARTIFACTS"/mysql.txt
}

section_start () {
if [ "$#" -ne 1 ]; then
echo "Only 1 argument is needed for GHA, 2 was needed for GitLab."
Expand Down
2 changes: 1 addition & 1 deletion gitlab/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi

# Generate a dbpasswords file
# Note that this does not use ${DATABASE_NAME} since Symfony adds the _test postfix itself
echo "unused:sqlserver:domjudge:domjudge:domjudge:3306" > etc/dbpasswords.secret
echo 'unused:sqlserver:domjudge:domjudge:domjudge_+% #$*)@(!/;,.:3306' > etc/dbpasswords.secret

# Generate APP_SECRET for symfony
# shellcheck disable=SC2164
Expand Down

0 comments on commit 82cc7da

Please sign in to comment.