kartoza / least-cost-electrification-somalia

Global Electrification Platform for Global
1 stars 0 forks source link

Handle hostname migration in GEP frontend viewer #42

Closed lucernae closed 2 years ago

lucernae commented 2 years ago

There are two migration issues when we change URL from https://somalia.gep.kartoza.com to https://somalielectrification.so

  1. The page that should be shown when we access https://somalielectrification.so is https://somalilectrification.so/gep

@meomancer is there any way to do that? Can you just confirm if the old https://somalia.gep.kartoza.com was intended to do this. If I setup nginx redirect from https://somalielectrification.so to https://somalielectrification.so/gep then how are the user supposed to be accessing the SDI menu (access GeoNode mainpage)?

I don't think this is possible unless SDI index page were served under different suburl? like perhaps https://somalielectrification.so/sdi

  1. If we open map viewer in https://somalielectrification.so/gep/explore/so-1 , the map layers are referring to https://somalia.gep.kartoza.com . This breaks the layer.

I already made sure the GeoNode stack uses the new URL ([dot]so domain). So this probably coming from the GEP frontend. @meomancer can you advise on how we apply the URL changes? Is it coming from a database, application config, or statically compiled in the GEP javascript lib?

meomancer commented 2 years ago

For me: i need to change the url without domain https://github.com/kartoza/global-electrification-platform-explorer/blob/somalia/app/assets/scripts/config/externalLayers.json

For source layer, we need to move it to config https://github.com/kartoza/global-electrification-platform-explorer/blob/somalia/app/assets/scripts/components/explore/Map.js#L170

Create wiki to tell which file need to be updated manually on server

lkwalke4 commented 2 years ago

@meomancer have you had a chance to work on this yet?

meomancer commented 2 years ago

Hi @lucernae

PR for this : https://github.com/kartoza/least-cost-electrification-somalia/pull/45

this PR already fix GEP too (no need to config) but needs to pull the gep frontend to latest somalia branch (on the submodule)

Or can config like https://github.com/kartoza/least-cost-electrification-somalia/tree/update#to-config-gep-frontend

lucernae commented 2 years ago

Done per @meomancer instruction on the server. Deployed and confirmed the fix is working.