From 2c7e51505ed1622eb1a98b6d4cdd126a4aad6943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 10 Aug 2026 17:56:33 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Simplify=20Copier=20enviro?= =?UTF-8?q?nment=20configuration=20(#2416)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## AI Disclaimer Using Codex with gpt-5.6-sol. Reviewed manually. --- .copier/update_dotenv.py | 11 +++++++++++ README.md | 4 ---- copier.yml | 20 -------------------- deployment.md | 14 ++++++++++---- 4 files changed, 21 insertions(+), 28 deletions(-) diff --git a/.copier/update_dotenv.py b/.copier/update_dotenv.py index 65768856..ceb8eb22 100644 --- a/.copier/update_dotenv.py +++ b/.copier/update_dotenv.py @@ -9,9 +9,20 @@ answers_path = Path(__file__).parent / ".copier-answers.yml" answers = json.loads(answers_path.read_text()) env_path = root_path / ".env" env_content = env_path.read_text() +# Keep deployment provider settings from replacing local development defaults. +env_answer_keys = { + "emails_from_email", + "first_superuser", + "first_superuser_password", + "postgres_password", + "project_name", + "secret_key", +} lines = [] for line in env_content.splitlines(): for key, value in answers.items(): + if key not in env_answer_keys: + continue upper_key = key.upper() if line.startswith(f"{upper_key}="): if " " in value: diff --git a/README.md b/README.md index 9ea0f276..00fd3894 100644 --- a/README.md +++ b/README.md @@ -199,12 +199,8 @@ The input variables, with their default values (some auto generated) are: - `secret_key`: (default: `"changethis"`) The secret key for the project, used for security, stored in .env, you can generate one with the method above. - `first_superuser`: (default: `"admin@example.com"`) The email of the first superuser (in .env). - `first_superuser_password`: (default: `"changethis"`) The password of the first superuser (in .env). -- `smtp_host`: (default: "") The SMTP server host to send emails, you can set it later in .env. -- `smtp_user`: (default: "") The SMTP server user to send emails, you can set it later in .env. -- `smtp_password`: (default: "") The SMTP server password to send emails, you can set it later in .env. - `emails_from_email`: (default: `"info@example.com"`) The email account to send emails from, you can set it later in .env. - `postgres_password`: (default: `"changethis"`) The password for the PostgreSQL database, stored in .env, you can generate one with the method above. -- `sentry_dsn`: (default: "") The DSN for Sentry, if you are using it, you can set it later in .env. ## Backend Development diff --git a/copier.yml b/copier.yml index f28369e8..6d6c99a8 100644 --- a/copier.yml +++ b/copier.yml @@ -21,21 +21,6 @@ first_superuser_password: help: The password of the first superuser (in .env) default: changethis -smtp_host: - type: str - help: The SMTP server host to send emails, you can set it later in .env - default: "" - -smtp_user: - type: str - help: The SMTP server user to send emails, you can set it later in .env - default: "" - -smtp_password: - type: str - help: The SMTP server password to send emails, you can set it later in .env - default: "" - emails_from_email: type: str help: The email account to send emails from, you can set it later in .env @@ -49,11 +34,6 @@ postgres_password: python -c "import secrets; print(secrets.token_urlsafe(32))"' default: changethis -sentry_dsn: - type: str - help: The DSN for Sentry, if you are using it, you can set it later in .env - default: "" - _exclude: # Global - .vscode diff --git a/deployment.md b/deployment.md index 5f3dbb76..8cb4fcb1 100644 --- a/deployment.md +++ b/deployment.md @@ -200,16 +200,22 @@ To configure them, go to your repository's **Settings** > **Environments** and c For each GitHub Environment (`staging` and `production`), configure the required secrets as [environment secrets](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets#creating-secrets-for-an-environment). Environment secrets are preferred over [repository secrets](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets#creating-secrets-for-a-repository) because they are scoped to the specific environment, reducing exposure and aligning with any protection rules you configure. -The current Github Actions workflows expect these secrets: +The deployment workflows require these secrets: * `DOMAIN` -* `EMAILS_FROM_EMAIL` * `FIRST_SUPERUSER` * `FIRST_SUPERUSER_PASSWORD` * `POSTGRES_PASSWORD` * `SECRET_KEY` -* `LATEST_CHANGES` -* `SMOKESHOW_AUTH_KEY` + +To enable emails, configure these additional secrets with the values from your email provider: + +* `SMTP_HOST` +* `SMTP_USER` +* `SMTP_PASSWORD` +* `EMAILS_FROM_EMAIL` + +To enable Sentry, configure the `SENTRY_DSN` secret. ## GitHub Action Deployment Workflows