Updated website docs and /twenty-server/.env (#8801)
Fix for the issue Incorrect Database Connection String in .env File #8741 --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@ -22,7 +22,7 @@ services:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
PORT: 3000
|
||||
PG_DATABASE_URL: postgres://${PGUSER_SUPERUSER:-postgres}:${PGPASSWORD_SUPERUSER:-twenty}@${PG_DATABASE_HOST:-db:5432}/default
|
||||
PG_DATABASE_URL: postgres://${PGUSER_SUPERUSER:-postgres}:${PGPASSWORD_SUPERUSER:-postgres}@${PG_DATABASE_HOST:-db:5432}/default
|
||||
SERVER_URL: ${SERVER_URL}
|
||||
FRONT_BASE_URL: ${FRONT_BASE_URL:-$SERVER_URL}
|
||||
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
|
||||
@ -52,7 +52,7 @@ services:
|
||||
image: twentycrm/twenty:${TAG}
|
||||
command: ["yarn", "worker:prod"]
|
||||
environment:
|
||||
PG_DATABASE_URL: postgres://${PGUSER_SUPERUSER:-postgres}:${PGPASSWORD_SUPERUSER:-twenty}@${PG_DATABASE_HOST:-db:5432}/default
|
||||
PG_DATABASE_URL: postgres://${PGUSER_SUPERUSER:-postgres}:${PGPASSWORD_SUPERUSER:-postgres}@${PG_DATABASE_HOST:-db:5432}/default
|
||||
SERVER_URL: ${SERVER_URL}
|
||||
FRONT_BASE_URL: ${FRONT_BASE_URL:-$SERVER_URL}
|
||||
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
|
||||
@ -78,7 +78,7 @@ services:
|
||||
- db-data:/home/postgres/pgdata
|
||||
environment:
|
||||
PGUSER_SUPERUSER: ${PGUSER_SUPERUSER:-postgres}
|
||||
PGPASSWORD_SUPERUSER: ${PGPASSWORD_SUPERUSER:-twenty}
|
||||
PGPASSWORD_SUPERUSER: ${PGPASSWORD_SUPERUSER:-postgres}
|
||||
ALLOW_NOSSL: "true"
|
||||
SPILO_PROVIDER: "local"
|
||||
healthcheck:
|
||||
|
||||
@ -33,7 +33,7 @@ spec:
|
||||
- name: PGUSER_SUPERUSER
|
||||
value: "postgres"
|
||||
- name: PGPASSWORD_SUPERUSER
|
||||
value: "twenty"
|
||||
value: "postgres"
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: tcp
|
||||
|
||||
@ -40,7 +40,7 @@ spec:
|
||||
- name: FRONT_BASE_URL
|
||||
value: "https://crm.example.com:443"
|
||||
- name: "PG_DATABASE_URL"
|
||||
value: "postgres://postgres:twenty@twenty-db.twentycrm.svc.cluster.local/default"
|
||||
value: "postgres://postgres:postgres@twenty-db.twentycrm.svc.cluster.local/default"
|
||||
- name: "REDIS_URL"
|
||||
value: "redis://twentycrm-redis.twentycrm.svc.cluster.local:6379"
|
||||
- name: ENABLE_DB_MIGRATIONS
|
||||
|
||||
@ -31,7 +31,7 @@ spec:
|
||||
- name: FRONT_BASE_URL
|
||||
value: "https://crm.example.com:443"
|
||||
- name: PG_DATABASE_URL
|
||||
value: "postgres://postgres:twenty@twenty-db.twentycrm.svc.cluster.local/default"
|
||||
value: "postgres://postgres:postgres@twenty-db.twentycrm.svc.cluster.local/default"
|
||||
- name: ENABLE_DB_MIGRATIONS
|
||||
value: "false" # it already runs on the server
|
||||
- name: STORAGE_TYPE
|
||||
|
||||
@ -3,7 +3,7 @@ import path from 'path';
|
||||
|
||||
export const envVariables = (variables: string) => {
|
||||
let payload = `
|
||||
PG_DATABASE_URL=postgres://postgres:twenty@localhost:5432/default
|
||||
PG_DATABASE_URL=postgres://postgres:postgres@localhost:5432/default
|
||||
FRONT_BASE_URL=http://localhost:3001
|
||||
ACCESS_TOKEN_SECRET=replace_me_with_a_random_string_access
|
||||
LOGIN_TOKEN_SECRET=replace_me_with_a_random_string_login
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
# Use this for local setup
|
||||
PG_DATABASE_URL=postgres://postgres:twenty@localhost:5432/default
|
||||
PG_DATABASE_URL=postgres://postgres:postgres@localhost:5432/default
|
||||
REDIS_URL=redis://localhost:6379
|
||||
|
||||
FRONT_BASE_URL=http://localhost:3001
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
PG_DATABASE_URL=postgres://postgres:twenty@localhost:5432/test
|
||||
PG_DATABASE_URL=postgres://postgres:postgres@localhost:5432/test
|
||||
REDIS_URL=redis://localhost:6379
|
||||
|
||||
DEBUG_MODE=true
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
export PG_DATABASE_URL=postgres://postgres:twenty@$PG_DATABASE_HOST:$PG_DATABASE_PORT/default
|
||||
export PG_DATABASE_URL=postgres://postgres:postgres@$PG_DATABASE_HOST:$PG_DATABASE_PORT/default
|
||||
yarn database:init:prod
|
||||
node dist/src/main
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
export PG_DATABASE_URL=postgres://postgres:twenty@$PG_DATABASE_HOST:$PG_DATABASE_PORT/default
|
||||
export PG_DATABASE_URL=postgres://postgres:postgres@$PG_DATABASE_HOST:$PG_DATABASE_PORT/default
|
||||
node dist/src/queue-worker/queue-worker
|
||||
|
||||
@ -109,7 +109,7 @@ You should run all commands in the following steps from the root of the project.
|
||||
<b>Option 1 (preferred):</b> To provision your database locally:
|
||||
Use the following link to install Postgresql on your Linux machine: [Postgresql Installation](https://www.postgresql.org/download/linux/)
|
||||
```bash
|
||||
psql postgres -c "CREATE DATABASE \"default\";" -c "CREATE DATABASE test;" -c "CREATE USER twenty PASSWORD 'twenty';" -c "ALTER ROLE twenty superuser;"
|
||||
psql postgres -c "CREATE DATABASE \"default\";" -c "CREATE DATABASE test;"
|
||||
```
|
||||
Note: You might need to add `sudo -u postgres` to the command before `psql` to avoid permission errors.
|
||||
|
||||
@ -124,7 +124,7 @@ You should run all commands in the following steps from the root of the project.
|
||||
```bash
|
||||
brew install postgresql@16
|
||||
export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH"
|
||||
psql postgres -c "CREATE DATABASE \"default\";" -c "CREATE DATABASE test;" -c "CREATE USER twenty PASSWORD 'twenty';" -c "ALTER ROLE twenty superuser;"
|
||||
psql postgres -c "CREATE DATABASE \"default\";" -c "CREATE DATABASE test;"
|
||||
```
|
||||
|
||||
<b>Option 2:</b> If you have docker installed:
|
||||
@ -138,7 +138,7 @@ You should run all commands in the following steps from the root of the project.
|
||||
<b>Option 1:</b> To provision your Postgresql locally:
|
||||
Use the following link to install Postgresql on your Linux virtual machine: [Postgresql Installation](https://www.postgresql.org/download/linux/)
|
||||
```bash
|
||||
psql postgres -c "CREATE DATABASE \"default\";" -c "CREATE DATABASE test;" -c "CREATE USER twenty PASSWORD 'twenty';" -c "ALTER ROLE twenty superuser;"
|
||||
psql postgres -c "CREATE DATABASE \"default\";" -c "CREATE DATABASE test;"
|
||||
```
|
||||
Note: You might need to add `sudo -u postgres` to the command before `psql` to avoid permission errors.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user