From f1cfbaff6d1f118b4ff2f12399bd00ae3f5cbe34 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Fri, 17 Jul 2026 17:29:33 +0200 Subject: [PATCH] Generate DJANGO_SECRET on the fly --- .ci/run_container.sh | 4 ++++ .../ci/{{ cookiecutter.__project_name }}/.ci/run_container.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.ci/run_container.sh b/.ci/run_container.sh index b3a1c7e9b..ed8deb383 100755 --- a/.ci/run_container.sh +++ b/.ci/run_container.sh @@ -69,6 +69,9 @@ else fi export PULP_CONTENT_ORIGIN +PULP_DJANGO_SECRET="$(python3 -c "import secrets; print(secrets.token_urlsafe(50))")" +export PULP_DJANGO_SECRET + "${CONTAINER_RUNTIME}" \ run ${RM:+--rm} \ --env S6_KEEP_ENV=1 \ @@ -79,6 +82,7 @@ export PULP_CONTENT_ORIGIN ${PULP_DOMAIN_ENABLED:+--env PULP_DOMAIN_ENABLED} \ ${PULP_ENABLED_PLUGINS:+--env PULP_ENABLED_PLUGINS} \ --env PULP_CONTENT_ORIGIN \ + --env PULP_DJANGO_SECRET \ --detach \ --name "pulp-ephemeral" \ --volume "${PULP_CLI_TEST_TMPDIR}/settings:/etc/pulp${SELINUX:+:Z}" \ diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.ci/run_container.sh b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.ci/run_container.sh index b3a1c7e9b..ed8deb383 100755 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.ci/run_container.sh +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.ci/run_container.sh @@ -69,6 +69,9 @@ else fi export PULP_CONTENT_ORIGIN +PULP_DJANGO_SECRET="$(python3 -c "import secrets; print(secrets.token_urlsafe(50))")" +export PULP_DJANGO_SECRET + "${CONTAINER_RUNTIME}" \ run ${RM:+--rm} \ --env S6_KEEP_ENV=1 \ @@ -79,6 +82,7 @@ export PULP_CONTENT_ORIGIN ${PULP_DOMAIN_ENABLED:+--env PULP_DOMAIN_ENABLED} \ ${PULP_ENABLED_PLUGINS:+--env PULP_ENABLED_PLUGINS} \ --env PULP_CONTENT_ORIGIN \ + --env PULP_DJANGO_SECRET \ --detach \ --name "pulp-ephemeral" \ --volume "${PULP_CLI_TEST_TMPDIR}/settings:/etc/pulp${SELINUX:+:Z}" \