Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .copier/update_dotenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,20 @@
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:
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 0 additions & 20 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
14 changes: 10 additions & 4 deletions deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading