Parcourir la source

feat(cli): set custom postgres port in config.json (#918)

* feat(cli): set custom postgres port in config.json

* fix(cli): small misspelling error.

* fix(cli): misspelling error again

Co-authored-by: Nicolas Meienberger <47644445+meienberger@users.noreply.github.com>

* fix(cli): add required env vard to schemas.

* fix(cli): add default port to schema

* fix(cli): add requested changes

* fix(cli): move posgresPort to pick

---------

Co-authored-by: Nicolas Meienberger <47644445+meienberger@users.noreply.github.com>
Stavros il y a 1 an
Parent
commit
09461527ee

+ 1 - 1
packages/cli/assets/docker-compose.yml

@@ -22,7 +22,7 @@ services:
     restart: on-failure
     stop_grace_period: 1m
     ports:
-      - 5432:5432
+      - ${POSTGRES_PORT-5432}:5432
     volumes:
       - ./data/postgres:/var/lib/postgresql/data
     environment:

+ 1 - 1
packages/cli/src/executors/system/system.helpers.ts

@@ -175,7 +175,7 @@ export const generateSystemEnvFile = async () => {
   envMap.set('POSTGRES_DBNAME', 'tipi');
   envMap.set('POSTGRES_USERNAME', 'tipi');
   envMap.set('POSTGRES_PASSWORD', postgresPassword);
-  envMap.set('POSTGRES_PORT', String(5432));
+  envMap.set('POSTGRES_PORT', String(data.postgresPort || 5432));
   envMap.set('REDIS_HOST', 'tipi-redis');
   envMap.set('REDIS_PASSWORD', redisPassword);
   envMap.set('DEMO_MODE', String(data.demoMode || 'false'));

+ 1 - 1
packages/shared/src/schemas/env-schemas.ts

@@ -63,5 +63,5 @@ export const envSchema = z.object({
 
 export const settingsSchema = envSchema
   .partial()
-  .pick({ dnsIp: true, internalIp: true, appsRepoUrl: true, domain: true, storagePath: true, localDomain: true, demoMode: true, guestDashboard: true })
+  .pick({ dnsIp: true, internalIp: true, postgresPort: true, appsRepoUrl: true, domain: true, storagePath: true, localDomain: true, demoMode: true, guestDashboard: true })
   .and(z.object({ port: z.number(), sslPort: z.number(), listenIp: z.string().ip().trim() }).partial());