Skip to content

Commit 9508de4

Browse files
committed
Set more greppable admin password
1 parent 678a38c commit 9508de4

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

.github/jobs/baseinstall.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ yarnpkg install
3232
cd ..
3333
section_end
3434

35-
section_start "Set simple admin password"
36-
echo "password" > ./etc/initial_admin_password.secret
37-
echo "default login admin password password" > ~/.netrc
35+
section_start "Set admin password"
36+
echo "${ADMIN_PASSWORD}" > ./etc/initial_admin_password.secret
37+
echo "default login admin password ${ADMIN_PASSWORD}" > ~/.netrc
3838
section_end
3939

4040
section_start "Install domserver"

.github/jobs/webstandard.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,18 @@ section_start "Setup pa11y"
2020
section_end
2121

2222
section_start "Setup the test user"
23-
ADMINPASS=$(cat etc/initial_admin_password.secret)
2423
export COOKIEJAR
2524
COOKIEJAR=$(mktemp --tmpdir)
2625
export CURLOPTS="--fail -sq -m 30 -b $COOKIEJAR"
2726
if [ "$ROLE" = "public" ]; then
28-
ADMINPASS="failedlogin"
27+
ADMIN_PASSWORD="failedlogin"
2928
fi
3029

3130
# Make an initial request which will get us a session id, and grab the csrf token from it
3231
CSRFTOKEN=$(curl $CURLOPTS -c $COOKIEJAR "http://localhost/domjudge/login" 2>/dev/null | sed -n 's/.*_csrf_token.*value="\(.*\)".*/\1/p')
3332
# Make a second request with our session + csrf token to actually log in
3433
# shellcheck disable=SC2086
35-
curl $CURLOPTS -c "$COOKIEJAR" -F "_csrf_token=$CSRFTOKEN" -F "_username=admin" -F "_password=$ADMINPASS" "http://localhost/domjudge/login"
34+
curl $CURLOPTS -c "$COOKIEJAR" -F "_csrf_token=$CSRFTOKEN" -F "_username=admin" -F "_password=$ADMIN_PASSWORD" "http://localhost/domjudge/login"
3635

3736
# Move back to the default directory
3837
cd "$DIR"

.github/workflows/integration.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
integration:
1111
runs-on: ubuntu-24.04
1212
env:
13+
ADMIN_PASSWORD: admin_password
1314
MYSQL_ROOT_PASSWORD: mysql_root_password
1415
timeout-minutes: 30
1516
container:
@@ -57,11 +58,10 @@ jobs:
5758
- name: Check nginx
5859
run: curl -v https://localhost/domjudge/
5960
- name: Configure print command
60-
working-directory: submit
6161
run: |
62-
curl --fail -u 'admin:password' -X 'GET' 'http://localhost/domjudge/api/v4/config?strict=false' \
62+
curl --fail -u "admin:${ADMIN_PASSWORD}" -X 'GET' 'http://localhost/domjudge/api/v4/config?strict=false' \
6363
| jq '.print_command |= "cp [file] /tmp/dj-printfile"' \
64-
| curl --fail -u 'admin:password' -X 'PUT' -T - 'http://localhost/domjudge/api/v4/config?strict=false' \
64+
| curl --fail -u "admin:${ADMIN_PASSWORD}" -X 'PUT' -T - 'http://localhost/domjudge/api/v4/config?strict=false' \
6565
- name: Testing submit client
6666
working-directory: submit
6767
run: make check-full
@@ -127,7 +127,7 @@ jobs:
127127
# Make an initial request which will get us a session id, and grab the csrf token from it
128128
CSRFTOKEN=$(curl $CURLOPTS -c /tmp/cookiejar "http://localhost/domjudge/login" | sed -n 's/.*_csrf_token.*value="\(.*\)".*/\1/p')
129129
# Make a second request with our session + csrf token to actually log in
130-
curl $CURLOPTS -c /tmp/cookiejar -F "_csrf_token=$CSRFTOKEN" -F "_username=admin" -F "_password=password" "http://localhost/domjudge/login"
130+
curl $CURLOPTS -c /tmp/cookiejar -F "_csrf_token=$CSRFTOKEN" -F "_username=admin" -F "_password=${ADMIN_PASSWORD}" "http://localhost/domjudge/login"
131131
# Send a general clarification to later test if we see the event.
132132
curl $CURLOPTS -F "sendto=" -F "problem=1-" -F "bodytext=Testing" -F "submit=Send" \
133133
"http://localhost/domjudge/jury/clarifications/send" -o /dev/null
@@ -172,4 +172,4 @@ jobs:
172172
export CCS_SPECS_PINNED_SHA1='a68aff54c4e60fc2bff2fc5c36c119bffa4d30f1'
173173
( cd ccs-specs && git reset --hard $CCS_SPECS_PINNED_SHA1 )
174174
export CHECK_API="${HOME}/ccs-specs/check-api.sh -j ${HOME}/yajsv"
175-
$CHECK_API -n -C -e -a 'strict=1' http://admin:password@localhost/domjudge/api
175+
$CHECK_API -n -C -e -a 'strict=1' "http://admin:${ADMIN_PASSWORD}@localhost/domjudge/api"

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
checks: write
3131
runs-on: ubuntu-24.04
3232
env:
33+
ADMIN_PASSWORD: admin_password
3334
MYSQL_ROOT_PASSWORD: mysql_root_password
3435
timeout-minutes: 30
3536
container:

.github/workflows/webstandard.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
standards:
1111
runs-on: ubuntu-latest
1212
env:
13+
ADMIN_PASSWORD: admin_password
1314
MYSQL_ROOT_PASSWORD: mysql_root_password
1415
container:
1516
image: domjudge/gitlabci:24.04

0 commit comments

Comments
 (0)