SP7-Ritmare / starterkit

Geoinformation Enabling Toolkit (GET-IT)
GNU General Public License v3.0
14 stars 11 forks source link

configuration #212

Open ksonda opened 4 years ago

ksonda commented 4 years ago

Hello, I have been attempting to install the starterkit from scratch, but the documentation on the readthedocs website does not seem adequate as to which environment variables need to be changed. The website mentions changing GEONODE_LB_HOST_IP in several .env files. It appears that currently, there is only one .env file and several paths within it where IP addresses or FQDN could be changed (e.g. HTTPS_HOST). My attempts to install end in letsencrypt looping and no certificates being procured. Is there any updated documentation to install from scratch?

oggioniale commented 4 years ago

Dear ksonda, not any other documentation at the moment. We are working for that in these days. Anyhow all the changes at the moment are in the file .env in the root. In the meantime that we finish a proper documentation try these commands.

# For install GET-IT from scratch please start with
git clone https://github.com/SP7-Ritmare/starterkit.git
cd starterkit

# after set the name of the project without space, use only characters like [a-z, A-Z, 0-9]:
# PROJECT_NAME='<set the name of the project here>'
# sed -i "s/COMPOSE_PROJECT_NAME=starterkit/COMPOSE_PROJECT_NAME=$PROJECT_NAME/g" .env

# set your domain name:
FQDN='<set the FQDN of your machine here>'
sed -i "s/demo1.get-it.it/$FQDN/g" .env

# - base layers from google
# case 1) no google api key -> disable GOOGLE MAPS if you have no API key
sed -i "s/GOOGLE_API_KEY=\*/# GOOGLE_API_KEY=\*/g" .env
# case 2) you have an API KEY -> manually edit .env and change the line GOOGLE_API_KEY=************ with your API KEY

# - base layers from bing
# case 1) no BING api key -> disable Bing maps
sed -i "s/BING_API_KEY=\*/# BING_API_KEY=\*/g" .env
# case 2) you have your bing api key -> follow the analogous step of google maps changing the corresponding line

# --------------

# choose GET-IT admin password:
YOURPASSWORD='<set the password for admin on your machine>'

# - Set your admin password. REMARK: even if you change the admin password from the UI of a running container, this password will be reset after reloading the container.
sed -i "s/^ADMIN_PASSWORD=admin/ADMIN_PASSWORD=$YOURPASSWORD/g" .env

# GeoServer admin password could be changed after the installation through the UI.

# SOS admin username and password must be change:
YOUR_SOS_USERNAME='<set the username for server SOS>'
YOUR_SOS_PASSWORD='<set the password for server SOS>'
YOUR_SOS_TRANSACTIONAL_AUTHORIZATION_TOKEN='<set the token for server SOS>'
sed -i "s/SOS_ADMIN_USERNAME=adminsos/SOS_ADMIN_USERNAME=$YOUR_SOS_USERNAME/g" .env
sed -i "s/SOS_ADMIN_PASSWORD=password/SOS_ADMIN_PASSWORD=$YOUR_SOS_PASSWORD/g" .env
sed -i "s/SOS_TRANSACTIONAL_AUTHORIZATION_TOKEN=/SOS_TRANSACTIONAL_AUTHORIZATION_TOKEN=$YOUR_SOS_TRANSACTIONAL_AUTHORIZATION_TOKEN/g" .env

# --------------

# By default the GET-IT is configured for a HTTP installation. 
# If you opt for HTTPS installation you must have a domain name as HTTPS_HOST (doesn't work
# with an ip) and it must be reachable from the outside. 
# If you want to continue the installation with HTTP go directly to the last row of this file, 
# otherwise if you opt for HTTPS you must change the section of HTTPS Settings in .env file follow these lines:
# sed -i "s/SITEURL=http:/SITEURL=https:/g" .env
# sed -i "s/HTTP_HOST=$FQDN/# HTTP_HOST=/g" .env
# sed -i "s/HTTPS_HOST=/HTTPS_HOST=$FQDN/g" .env
# sed -i "s/LETSENCRYPT_MODE=disabled/# LETSENCRYPT_MODE=disabled/g" .env
# sed -i "s/# LETSENCRYPT_MODE=production/LETSENCRYPT_MODE=staging/g" .env
# or if you have a certificate
# sed -i "s/# LETSENCRYPT_MODE=production/LETSENCRYPT_MODE=production/g" .env
# sed -i "s/GEONODE_LB_PORT=80/# GEONODE_LB_PORT=80/g" .env && sed -i "s/# GEONODE_LB_PORT=443/GEONODE_LB_PORT=443/g" .env

# --------------

# Other variables could be change in some files located in scripts/docker/env/production path.
# Within scripts/docker/env/production/sos.env you could change the variables in order to customize the metadata of SOS service.

# --------------
# Final execute 
docker-compose up --build -d
# or 
./docker-startup.sh

Let me know

ksonda commented 4 years ago

Thanks @oggioniale . When I do this, I get these errors:

nginx4starterkit | 2020/03/03 17:02:49 [emerg] 1#1: host not found in "$HTTPS_PORT" of the "listen" directive in /etc/nginx/nginx.https.enabled.conf:10 nginx4starterkit | nginx: [emerg] host not found in "$HTTPS_PORT" of the "listen" directive in /etc/nginx/nginx.https.enabled.conf:10

As well as letsencrypt failing to get certificates.

oggioniale commented 4 years ago

Dear @ksonda Did you have set the HTTPS port in .env file? Witch one? 443 or other? You need to change the hhtps port also in the docker-compose.yml file row 99

geonode:
...
ports:
      - "80:80"
      - "444:443"
...
oggioniale commented 4 years ago

Dear @ksonda Did you have set the HTTPS port in .env file? Witch one? 443 or other? If you set another https port different that 443 you must modify also the docker-compose.yml file at row 99:

geonode:
...
ports:
      - "80:80"
      - "444:443"
...
ksonda commented 4 years ago

Dear @oggioniale

I used the default port numbers throughout

oggioniale commented 4 years ago

Dear @ksonda, do you have already a certificate in the machine where you had installed GET-IT? In .env file how did you set up the variable LETSENCRYPT_MODE?

ksonda commented 4 years ago

I ran the script a few times, purging the docker images after each attempt, so it's possible there is a certificate on the machine. I'll try a fresh machine. I used LETSENCRYPT_MODE=staging