From 8470e4817073571f39802967cb2fbfa1c16dc5f6 Mon Sep 17 00:00:00 2001 From: David Inga Date: Tue, 28 Mar 2023 12:57:23 +0200 Subject: [PATCH 1/2] setting up the production server in capistrano --- frontend/config/deploy/production.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/frontend/config/deploy/production.rb b/frontend/config/deploy/production.rb index 3b4ef927a..1a03ee02b 100644 --- a/frontend/config/deploy/production.rb +++ b/frontend/config/deploy/production.rb @@ -1,10 +1,4 @@ -server '52.54.50.38', user: 'ubuntu', roles: %w{web app db}, primary: true +server 'app.resilienceatlas.org', user: 'ubuntu', roles: %w[web app db], primary: true -set :ssh_options, { - forward_agent: true, - auth_methods: %w(publickey) -} - -set :rvm_custom_path, '/home/ubuntu/.rvm' set :node_env, 'production' set :branch, 'master' From 94f3bd912464849a2c08e8361ce75761005deea5 Mon Sep 17 00:00:00 2001 From: David Inga Date: Wed, 29 Mar 2023 11:12:25 +0200 Subject: [PATCH 2/2] fixed subdomain for production env --- frontend/src/state/utils/api.ts | 2 -- frontend/src/utilities/getSubdomain.ts | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/state/utils/api.ts b/frontend/src/state/utils/api.ts index a11b873b8..2233563e3 100644 --- a/frontend/src/state/utils/api.ts +++ b/frontend/src/state/utils/api.ts @@ -8,8 +8,6 @@ import { merge } from 'utilities/helpers'; export const isProd = process.env.NODE_ENV === 'production'; export const PORT = process.env.NEXT_PUBLIC_API_HOST; -// uncomment this line to see map layers quickly for local testing -// export const PORT = 'https://staging.resilienceatlas.org'; const defaultConfig = { baseURL: `${PORT}/api`, diff --git a/frontend/src/utilities/getSubdomain.ts b/frontend/src/utilities/getSubdomain.ts index 9b388cb0a..cd0fac0cf 100644 --- a/frontend/src/utilities/getSubdomain.ts +++ b/frontend/src/utilities/getSubdomain.ts @@ -1,4 +1,4 @@ -import { PORT, isProd } from '../state/utils/api'; +import { isProd } from '../state/utils/api'; import { getRouterParam } from './routeParams'; export const getSubdomainFromURL = (url: string): string => { @@ -19,7 +19,7 @@ export const getSubdomain = (): string => { const siteScope = getRouterParam('site_scope'); if (siteScope && !isProd) return siteScope; // Site scope depends on the domain set in the API - const subdomain = getSubdomainFromURL(PORT); + const subdomain = getSubdomainFromURL(window.location.hostname); return subdomain; };