Skip to content

Commit

Permalink
Use dynamically generate password hash
Browse files Browse the repository at this point in the history
  • Loading branch information
ggiguash committed Dec 30, 2024
1 parent fe738af commit cf6ff2a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/devenv-builder/configure-composer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi
git composer-cli ostree rpm-ostree \
cockpit-composer bash-completion podman runc genisoimage \
createrepo yum-utils selinux-policy-devel jq wget lorax rpm-build \
containernetworking-plugins expect"
containernetworking-plugins expect httpd-tools"

if grep -qE "Red Hat Enterprise Linux.*Beta" /etc/redhat-release; then
VID=$(source /etc/os-release && echo "${VERSION_ID}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SET row_security = off;
--

COPY public."user" (id, uuid, username, password_hash, email, verified, stripe_id, organization, robot, invoice_email, invalid_login_attempts, last_invalid_login, removed_tag_expiration_s, enabled, invoice_email_address, company, family_name, given_name, location, maximum_queued_builds_count, creation_date, last_accessed) FROM stdin;
1 781bf4e3-2458-4b6a-9137-e80ea516be1d microshift $2b$12$aBToatOQeemO4IVB5/lhXOUk3J3iRZaLOpTB9RAho.JLOjnPWdquO microshift@redhat.com t \N f f f 0 2024-12-30 11:40:06.096595 1209600 t \N \N \N \N \N \N 2024-12-30 11:40:06.096597 \N
1 781bf4e3-2458-4b6a-9137-e80ea516be1d microshift $MICROSHIFT_PASSWORD_HASH [email protected] t \N f f f 0 2024-12-30 11:40:06.096595 1209600 t \N \N \N \N \N \N 2024-12-30 11:40:06.096597 \N
\.


Expand Down
9 changes: 8 additions & 1 deletion test/bin/mirror_registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,15 @@ setup_registry() {
# Import the database template content with the 'microshift:microshift' user
# definition. The template was exported using the following command:
# sudo podman exec -it microshift-postgres /usr/bin/pg_dump --data-only -d quay -U user -t public.user
#
# Note: Replace the password hash with '$MICROSHIFT_PASSWORD_HASH' string
# before committing the template into the source repository.
if ${new_db} ; then
sudo podman cp "${SCRIPTDIR}/../assets/quay/user_dump.sql" microshift-postgres:/tmp/user_dump.sql
MICROSHIFT_PASSWORD_HASH="$(htpasswd -bnBC 12 "" microshift | tr -d ':\n')" \
envsubst \
< "${SCRIPTDIR}/../assets/quay/user_dump.sql.template" \
> "${QUAY_CONFIG_DIR}/user_dump.sql"
sudo podman cp "${QUAY_CONFIG_DIR}/user_dump.sql" microshift-postgres:/tmp/user_dump.sql
sudo podman exec -it microshift-postgres psql -d quay -U user -f /tmp/user_dump.sql >/dev/null
fi
}
Expand Down

0 comments on commit cf6ff2a

Please sign in to comment.