Skip to content

Commit

Permalink
Set a more grep-able admin password
Browse files Browse the repository at this point in the history
Also don't set this explicitly in `workflows/database-upgrade.yml`
as it is already set in `jobs/baseinstall.sh` called before.
Don't pass admin:password to the API check as it already uses
curl with `-n` option to read from `~/.netrc`.
  • Loading branch information
eldering committed Nov 26, 2024
1 parent 77724a4 commit d1a026f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/jobs/baseinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ composer install --no-scripts |tee "$ARTIFACTS"/composer_out.txt
cd ..
section_end

section_start "Set simple admin password"
echo "password" > ./etc/initial_admin_password.secret
echo "default login admin password password" > ~/.netrc
section_start "Set admin password"
echo "admin_password" > ./etc/initial_admin_password.secret
echo "default login admin password admin_password" > ~/.netrc
section_end

section_start "Install domserver"
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/database-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jobs:
run: mysql -hsqlserver -uroot -proot < .github/jobs/data/dj733.sql
- name: Upgrade DOMjudge
run: .github/jobs/baseinstall.sh default upgrade
- name: Setting initial Admin Password
run: echo "pass" > /opt/domjudge/domserver/etc/initial_admin_password.secret
- name: Check for Errors in the Upgrade
run: mysql -hsqlserver -uroot -proot -e "SHOW TABLES FROM domjudge;"
- name: Check for Errors in Domjudge Web
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ jobs:
- name: Configure print command
working-directory: submit
run: |
curl --fail -u 'admin:password' -X 'GET' 'http://localhost/domjudge/api/v4/config?strict=false' \
curl -n --fail -X 'GET' 'http://localhost/domjudge/api/v4/config?strict=false' \
| jq '.print_command |= "cp [file] /tmp/dj-printfile"' \
| curl --fail -u 'admin:password' -X 'PUT' -T - 'http://localhost/domjudge/api/v4/config?strict=false' \
| curl -n --fail -X 'PUT' -T - 'http://localhost/domjudge/api/v4/config?strict=false' \
- name: Testing submit client
working-directory: submit
run: make check-full
Expand Down Expand Up @@ -149,4 +149,4 @@ jobs:
export CCS_SPECS_PINNED_SHA1='a68aff54c4e60fc2bff2fc5c36c119bffa4d30f1'
( cd ccs-specs && git reset --hard $CCS_SPECS_PINNED_SHA1 )
export CHECK_API="${HOME}/ccs-specs/check-api.sh -j ${HOME}/yajsv"
$CHECK_API -n -C -e -a 'strict=1' http://admin:password@localhost/domjudge/api
$CHECK_API -n -C -e -a 'strict=1' http://localhost/domjudge/api

0 comments on commit d1a026f

Please sign in to comment.