diff --git a/admin/datasource.ts b/admin/datasource.ts index 769f38b3..4fb6f9da 100644 --- a/admin/datasource.ts +++ b/admin/datasource.ts @@ -14,4 +14,8 @@ export const dataSource = new DataSource({ database: process.env.DB_NAME || "blc", entities: [User, Country, CarbonInputEntity, CostInput], synchronize: false, + ssl: + process.env.NODE_ENV === "production" + ? { rejectUnauthorized: false } + : false, }); diff --git a/client/.env.development b/client/.env.development index 9c6a2e7e..ddec322d 100644 --- a/client/.env.development +++ b/client/.env.development @@ -1,4 +1,4 @@ NEXTAUTH_URL=http://localhost:$PORT NEXTAUTH_SECRET=WAzjpS46vFxp17TsRDU3FXo+TF0vrfy6uhCXwGMBUE8= #NEXT_PUBLIC_API_URL=https://dev.blue-carbon-cost-tool.dev-vizzuality.com/api -NEXT_PUBLIC_API_URL=http://localhost:4000 \ No newline at end of file +NEXT_PUBLIC_API_URL=http://localhost:4000 diff --git a/infrastructure/modules/env/client_env_vars.tf b/infrastructure/modules/env/client_env_vars.tf index 2cf49004..493bc305 100644 --- a/infrastructure/modules/env/client_env_vars.tf +++ b/infrastructure/modules/env/client_env_vars.tf @@ -10,5 +10,6 @@ locals { } client_env_vars = { NEXT_PUBLIC_API_URL = "https://${var.environment}.blue-carbon-cost-tool.dev-vizzuality.com/api" + NEXTAUTH_URL = "https://${var.environment}.blue-carbon-cost-tool.dev-vizzuality.com" } } \ No newline at end of file diff --git a/infrastructure/source_bundle/proxy/conf.d/application.conf b/infrastructure/source_bundle/proxy/conf.d/application.conf index 0a548521..a41a5958 100644 --- a/infrastructure/source_bundle/proxy/conf.d/application.conf +++ b/infrastructure/source_bundle/proxy/conf.d/application.conf @@ -7,7 +7,7 @@ upstream client { } upstream admin { - server admin:1000; + server administration:1000; } server { @@ -41,9 +41,9 @@ server { proxy_pass_request_headers on; client_max_body_size 200m; } - location /admin/ { - rewrite ^/admin/?(.*)$ /$1 break; - proxy_pass http://admin; + location /administration/ { + rewrite ^/administration/?(.*)$ /$1 break; + proxy_pass http://administration; proxy_http_version 1.1; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; diff --git a/package.json b/package.json index 06ecda9d..f2edc4a9 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "api:dev": "pnpm --filter api run start:dev", "api:build": "pnpm --filter api run build", "api:prod": "NODE_ENV=production pnpm --filter api run start:prod", - "admin:prod": "pnpm --filter admin run start:prod", + "admin:prod": "NODE_ENV=production pnpm --filter admin run start:prod", "client:deps": "pnpm --filter client install", "client:dev": "pnpm --filter client run dev", "client:build": "pnpm --filter client run build",