You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -275,7 +275,9 @@ The db used will depend on which env vars are set.
275
275
276
276
-**Supabase**: Follow the Supabase [self-hosting docs](https://supabase.com/docs/guides/self-hosting), then use [dl-sb-iac](https://github.com/lissy93/dl-sb-iac) to import the schema and configure auth, edge functions, emails, etc.
277
277
- Then set: `SUPABASE_URL` and `SUPABASE_ANON_KEY` environmental variables
278
-
-**Postgres**: Deploy a Postgres instance, then use our [`setup-postgres.sh`](https://github.com/Lissy93/domain-locker/blob/main/db/setup-postgres.sh) script to init your DB with our[`schema.sql`](https://github.com/Lissy93/domain-locker/blob/main/db/schema.sql)
278
+
-**Postgres**: Deploy a Postgres instance, then apply the [`schema.sql`](https://github.com/Lissy93/domain-locker/blob/main/db/schema.sql)
279
+
- If DB already exists: `psql -h $DL_PG_HOST -U $DL_PG_USER -d $DL_PG_NAME -f ./db/schema.sql`
280
+
- If creating from scratch: Use [`setup-postgres.sh`](https://github.com/Lissy93/domain-locker/blob/main/db/setup-postgres.sh) (requires superuser access)
279
281
- Then set: `DL_PG_HOST`, `DL_PG_PORT`, `DL_PG_USER`, `DL_PG_PASSWORD`, `DL_PG_NAME`
Or if creating from scratch, use `./db/setup-postgres.sh` (requires superuser access) to import the [`schema.sql`](https://github.com/Lissy93/domain-locker/blob/main/db/schema.sql).
44
+
39
45
You'll then just need to pass the following env vars to the app, so it can connect to your Postgres instance.
Copy file name to clipboardExpand all lines: src/content/docs/developing/postgres-setup.md
+40-1Lines changed: 40 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,46 @@ In each case, you’d retrieve the connection details (hostname, port, credentia
57
57
58
58
## Configuring the Schema
59
59
60
-
We've got a Bash script in [`./db/setup-postgres.sh`](https://github.com/Lissy93/domain-locker/blob/main/db/setup-postgres.sh) which will take care of creating your database and applying the Domain Locker schema.
60
+
### Quick Setup (Database Already Created)
61
+
62
+
If your database and user are already created (e.g., using Docker, Proxmox, or managed hosting), simply apply the schema:
63
+
64
+
```bash
65
+
# Set your connection details
66
+
export DL_PG_HOST=localhost
67
+
export DL_PG_PORT=5432
68
+
export DL_PG_USER=domainlocker
69
+
export DL_PG_PASSWORD=your_password
70
+
export DL_PG_NAME=domainlocker
71
+
72
+
# Apply schema directly
73
+
PGPASSWORD="$DL_PG_PASSWORD" psql \
74
+
-h "$DL_PG_HOST" \
75
+
-p "$DL_PG_PORT" \
76
+
-U "$DL_PG_USER" \
77
+
-d "$DL_PG_NAME" \
78
+
-f ./db/schema.sql
79
+
```
80
+
81
+
### Full Setup (Create Database + Apply Schema)
82
+
83
+
If you need to create the database and user from scratch, use our setup script:
84
+
85
+
```bash
86
+
# Set your connection details
87
+
export DL_PG_HOST=localhost
88
+
export DL_PG_PORT=5432
89
+
export DL_PG_USER=domainlocker
90
+
export DL_PG_PASSWORD=your_password
91
+
export DL_PG_NAME=domainlocker
92
+
93
+
# Run the setup script (requires postgres superuser access)
94
+
./db/setup-postgres.sh
95
+
```
96
+
97
+
The [`setup-postgres.sh`](https://github.com/Lissy93/domain-locker/blob/main/db/setup-postgres.sh) script will create the database, user, grant privileges, and apply the schema.
98
+
99
+
**Note**: The setup script connects as the `postgres` superuser to create resources. If you don't have superuser access or the database is already created, use the Quick Setup method above.
0 commit comments