The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Updated website docs and /twenty-server/.env (#8801)
Suhotra Dey27eae53d0a9e
diff --git a/.github/workflows/ci-server.yaml b/.github/workflows/ci-server.yamlindex 06b14130358..82540a48a40 100644--- a/.github/workflows/ci-server.yaml+++ b/.github/workflows/ci-server.yaml@@ -21,7 +21,7 @@ jobs:image: twentycrm/twenty-postgres-spiloenv:PGUSER_SUPERUSER: postgres- PGPASSWORD_SUPERUSER: twenty+ PGPASSWORD_SUPERUSER: postgresALLOW_NOSSL: "true"SPILO_PROVIDER: "local"ports:@@ -73,8 +73,8 @@ jobs:- name: Server / Create DBif: steps.changed-files.outputs.any_changed == 'true'run: |- PGPASSWORD=twenty psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "default";'- PGPASSWORD=twenty psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "test";'+ PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "default";'+ PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "test";'- name: Worker / Runif: steps.changed-files.outputs.any_changed == 'true'run: npx nx run twenty-server:worker:ci@@ -124,7 +124,7 @@ jobs:image: twentycrm/twenty-postgres-spiloenv:PGUSER_SUPERUSER: postgres- PGPASSWORD_SUPERUSER: twenty+ PGPASSWORD_SUPERUSER: postgresALLOW_NOSSL: "true"SPILO_PROVIDER: "local"ports:diff --git a/.github/workflows/ci-website.yaml b/.github/workflows/ci-website.yamlindex 0f87078849f..ed5247a487c 100644--- a/.github/workflows/ci-website.yaml+++ b/.github/workflows/ci-website.yaml@@ -20,7 +20,7 @@ jobs:image: twentycrm/twenty-postgres-spiloenv:PGUSER_SUPERUSER: postgres- PGPASSWORD_SUPERUSER: twenty+ PGPASSWORD_SUPERUSER: postgresALLOW_NOSSL: "true"SPILO_PROVIDER: "local"ports:@@ -46,18 +46,18 @@ jobs:- name: Server / Create DBif: steps.changed-files.outputs.any_changed == 'true'- run: PGPASSWORD=twenty psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "default";'+ run: PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "default";'- name: Website / Run migrationsif: steps.changed-files.outputs.changed == 'true'run: npx nx database:migrate twenty-websiteenv:- DATABASE_PG_URL: postgres://postgres:twenty@localhost:5432/default+ DATABASE_PG_URL: postgres://postgres:postgres@localhost:5432/default- name: Website / Build Websiteif: steps.changed-files.outputs.changed == 'true'run: npx nx build twenty-websiteenv:- DATABASE_PG_URL: postgres://postgres:twenty@localhost:5432/default+ DATABASE_PG_URL: postgres://postgres:postgres@localhost:5432/default- name: Mark as VALIDif: steps.changed-files.outputs.changed != 'true' # If no changes, mark as validdiff --git a/Makefile b/Makefileindex 3b115523d1f..ee4fb9ce59f 100644--- a/Makefile+++ b/Makefile@@ -2,17 +2,17 @@ postgres-on-docker:docker run -d \--name twenty_pg \-e PGUSER_SUPERUSER=postgres \- -e PGPASSWORD_SUPERUSER=twenty \+ -e PGPASSWORD_SUPERUSER=postgres \-e ALLOW_NOSSL=true \-v twenty_db_data:/home/postgres/pgdata \-p 5432:5432 \twentycrm/twenty-postgres-spilo:latest@echo "Waiting for PostgreSQL to be ready..."- @until PGPASSWORD=twenty psql -h localhost -p 5432 -U postgres -d postgres \+ @until PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres \-c 'SELECT pg_is_in_recovery();' 2>/dev/null | grep -q 'f'; do \sleep 1; \done- PGPASSWORD=twenty psql -h localhost -p 5432 -U postgres -d postgres \+ PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres \-c "CREATE DATABASE \"default\" WITH OWNER postgres;" \-c "CREATE DATABASE \"test\" WITH OWNER postgres;"diff --git a/packages/twenty-docker/docker-compose.yml b/packages/twenty-docker/docker-compose.ymlindex e44ee876c4c..2dcb01eebb2 100644--- a/packages/twenty-docker/docker-compose.yml+++ b/packages/twenty-docker/docker-compose.yml@@ -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}/defaultSERVER_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}/defaultSERVER_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/pgdataenvironment:PGUSER_SUPERUSER: ${PGUSER_SUPERUSER:-postgres}- PGPASSWORD_SUPERUSER: ${PGPASSWORD_SUPERUSER:-twenty}+ PGPASSWORD_SUPERUSER: ${PGPASSWORD_SUPERUSER:-postgres}ALLOW_NOSSL: "true"SPILO_PROVIDER: "local"healthcheck:diff --git a/packages/twenty-docker/k8s/manifests/deployment-db.yaml b/packages/twenty-docker/k8s/manifests/deployment-db.yamlindex 4cfe13912b5..02a97c31bcf 100644--- a/packages/twenty-docker/k8s/manifests/deployment-db.yaml+++ b/packages/twenty-docker/k8s/manifests/deployment-db.yaml@@ -33,7 +33,7 @@ spec:- name: PGUSER_SUPERUSERvalue: "postgres"- name: PGPASSWORD_SUPERUSER- value: "twenty"+ value: "postgres"ports:- containerPort: 5432name: tcpdiff --git a/packages/twenty-docker/k8s/manifests/deployment-server.yaml b/packages/twenty-docker/k8s/manifests/deployment-server.yamlindex cd3ad4aa7fd..5c79044211e 100644--- a/packages/twenty-docker/k8s/manifests/deployment-server.yaml+++ b/packages/twenty-docker/k8s/manifests/deployment-server.yaml@@ -40,7 +40,7 @@ spec:- name: FRONT_BASE_URLvalue: "https://crm.example.com:443"- name: "PG_DATABASE_URL"- value: "postgres://postgres:[email protected]/default"+ value: "postgres://postgres:[email protected]/default"- name: "REDIS_URL"value: "redis://twentycrm-redis.twentycrm.svc.cluster.local:6379"- name: ENABLE_DB_MIGRATIONSdiff --git a/packages/twenty-docker/k8s/manifests/deployment-worker.yaml b/packages/twenty-docker/k8s/manifests/deployment-worker.yamlindex 281652dbbc3..a92ef25062a 100644--- a/packages/twenty-docker/k8s/manifests/deployment-worker.yaml+++ b/packages/twenty-docker/k8s/manifests/deployment-worker.yaml@@ -31,7 +31,7 @@ spec:- name: FRONT_BASE_URLvalue: "https://crm.example.com:443"- name: PG_DATABASE_URL- value: "postgres://postgres:[email protected]/default"+ value: "postgres://postgres:[email protected]/default"- name: ENABLE_DB_MIGRATIONSvalue: "false" # it already runs on the server- name: STORAGE_TYPEdiff --git a/packages/twenty-e2e-testing/drivers/env_variables.ts b/packages/twenty-e2e-testing/drivers/env_variables.tsindex 07ba4f6334b..7fd2860cb68 100644--- a/packages/twenty-e2e-testing/drivers/env_variables.ts+++ b/packages/twenty-e2e-testing/drivers/env_variables.ts@@ -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/defaultFRONT_BASE_URL=http://localhost:3001ACCESS_TOKEN_SECRET=replace_me_with_a_random_string_accessLOGIN_TOKEN_SECRET=replace_me_with_a_random_string_logindiff --git a/packages/twenty-server/.env.example b/packages/twenty-server/.env.exampleindex 034db517715..5384eb365bf 100644--- a/packages/twenty-server/.env.example+++ b/packages/twenty-server/.env.example@@ -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/defaultREDIS_URL=redis://localhost:6379FRONT_BASE_URL=http://localhost:3001diff --git a/packages/twenty-server/.env.test b/packages/twenty-server/.env.testindex ac0225eacd3..b0ba4b8c3d7 100644--- a/packages/twenty-server/.env.test+++ b/packages/twenty-server/.env.test@@ -1,4 +1,4 @@-PG_DATABASE_URL=postgres://postgres:twenty@localhost:5432/test+PG_DATABASE_URL=postgres://postgres:postgres@localhost:5432/testREDIS_URL=redis://localhost:6379DEBUG_MODE=truediff --git a/packages/twenty-server/scripts/render-run.sh b/packages/twenty-server/scripts/render-run.shindex 813f9e20ff8..e3b12fde915 100755--- a/packages/twenty-server/scripts/render-run.sh+++ b/packages/twenty-server/scripts/render-run.sh@@ -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/defaultyarn database:init:prodnode dist/src/maindiff --git a/packages/twenty-server/scripts/render-worker.sh b/packages/twenty-server/scripts/render-worker.shindex 25f259e4172..55565d7f934 100755--- a/packages/twenty-server/scripts/render-worker.sh+++ b/packages/twenty-server/scripts/render-worker.sh@@ -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/defaultnode dist/src/queue-worker/queue-workerdiff --git a/packages/twenty-website/src/content/developers/local-setup.mdx b/packages/twenty-website/src/content/developers/local-setup.mdxindex ad6c2e8eba6..f31f7edeac8 100644--- a/packages/twenty-website/src/content/developers/local-setup.mdx+++ b/packages/twenty-website/src/content/developers/local-setup.mdx@@ -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.```bashbrew install postgresql@16export 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.