Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set ssl for adminjs #37

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions admin/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
2 changes: 1 addition & 1 deletion client/.env.development
Original file line number Diff line number Diff line change
@@ -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
NEXT_PUBLIC_API_URL=http://localhost:4000
1 change: 1 addition & 0 deletions infrastructure/modules/env/client_env_vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
8 changes: 4 additions & 4 deletions infrastructure/source_bundle/proxy/conf.d/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ upstream client {
}

upstream admin {
server admin:1000;
server administration:1000;
}

server {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading