Skip to content

Commit

Permalink
Fix db url env vars (#1267)
Browse files Browse the repository at this point in the history
* fix: remove db url log

* docs: db config options

* chore: lint

* chore: lint
  • Loading branch information
grutt authored Feb 13, 2025
1 parent ee623af commit bc1d50b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
23 changes: 12 additions & 11 deletions frontend/docs/pages/self-hosting/configuration-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@ The Hatchet server and engine can be configured via `SERVER` and `DATABASE` envi

## Database Configuration

| Variable | Description | Default Value |
| ---------------------------- | ------------------------ | ------------- |
| `DATABASE_POSTGRES_HOST` | PostgreSQL host | `127.0.0.1` |
| `DATABASE_POSTGRES_PORT` | PostgreSQL port | `5431` |
| `DATABASE_POSTGRES_USERNAME` | PostgreSQL username | `hatchet` |
| `DATABASE_POSTGRES_PASSWORD` | PostgreSQL password | `hatchet` |
| `DATABASE_POSTGRES_DB_NAME` | PostgreSQL database name | `hatchet` |
| `DATABASE_POSTGRES_SSL_MODE` | PostgreSQL SSL mode | `disable` |
| `DATABASE_MAX_CONNS` | Max database connections | `5` |
| `DATABASE_LOG_QUERIES` | Log database queries | `false` |
| `CACHE_DURATION` | Cache duration | `60s` |
| Variable | Description | Default Value |
| ---------------------------- | ---------------------------- | ------------- |
| `DATABASE_URL` | PostgreSQL connection string | `127.0.0.1` |
| `DATABASE_POSTGRES_HOST` | PostgreSQL host | `127.0.0.1` |
| `DATABASE_POSTGRES_PORT` | PostgreSQL port | `5431` |
| `DATABASE_POSTGRES_USERNAME` | PostgreSQL username | `hatchet` |
| `DATABASE_POSTGRES_PASSWORD` | PostgreSQL password | `hatchet` |
| `DATABASE_POSTGRES_DB_NAME` | PostgreSQL database name | `hatchet` |
| `DATABASE_POSTGRES_SSL_MODE` | PostgreSQL SSL mode | `disable` |
| `DATABASE_MAX_CONNS` | Max database connections | `5` |
| `DATABASE_LOG_QUERIES` | Log database queries | `false` |
| `CACHE_DURATION` | Cache duration | `60s` |

## Security Check Configuration

Expand Down
2 changes: 0 additions & 2 deletions frontend/docs/pages/self-hosting/docker-compose.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ services:
command: /hatchet/hatchet-admin quickstart --skip certs --generated-config-dir /hatchet/config --overwrite=false
environment:
DATABASE_URL: "postgres://hatchet:hatchet@postgres:5432/hatchet"
DATABASE_POSTGRES_PORT: "5432"
DATABASE_POSTGRES_HOST: "postgres"
SERVER_TASKQUEUE_RABBITMQ_URL: amqp://user:password@rabbitmq:5672/
SERVER_AUTH_COOKIE_DOMAIN: localhost:8080
SERVER_AUTH_COOKIE_INSECURE: "t"
Expand Down
2 changes: 0 additions & 2 deletions frontend/docs/pages/self-hosting/hatchet-lite.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ services:
RABBITMQ_DEFAULT_USER: "user"
RABBITMQ_DEFAULT_PASS: "password"
DATABASE_URL: "postgresql://hatchet:hatchet@postgres:5432/hatchet?sslmode=disable"
DATABASE_POSTGRES_PORT: "5432"
DATABASE_POSTGRES_HOST: "postgres"
SERVER_TASKQUEUE_RABBITMQ_URL: amqp://user:password@localhost:5672/
SERVER_AUTH_COOKIE_DOMAIN: localhost
SERVER_AUTH_COOKIE_INSECURE: "t"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

To connect to an external Postgres instance, set `postgres.enabled` to `false` in the `values.yaml` file. This will disable the internal Postgres instance and allow you to connect to an external database. You should then add the following configuration for the `hatchet-stack` or `hatchet-ha` charts:

> Note: Either `DATABASE_URL` or `DATABASE_POSTGRES_*` are required
```yaml
sharedConfig:
env:
Expand Down
1 change: 0 additions & 1 deletion hack/db/atlas-apply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ if [[ ! "$DATABASE_URL" =~ sslmode ]]; then
fi
fi

echo "DATABASE_URL: $DATABASE_URL"
# Check for prisma migrations
MIGRATION_NAME=$(psql "$DATABASE_URL" -t -c "SELECT migration_name FROM _prisma_migrations ORDER BY started_at DESC LIMIT 1;" 2>/dev/null | xargs)
MIGRATION_NAME=$(echo $MIGRATION_NAME | cut -d'_' -f1)
Expand Down

0 comments on commit bc1d50b

Please sign in to comment.