diff --git a/README-dev.md b/README-dev.md index ddbce38..c567e1d 100644 --- a/README-dev.md +++ b/README-dev.md @@ -31,7 +31,8 @@ Most required variables are preset by default, the ones that must be set before ``` SECRET_KEY_BASE= LOADBALANCER_SECRET= -URL_HOST= +SL_HOST= +DOMAIN_NAME= ``` Obtain the value for SECRET_KEY_BASE and LOADBALANCER_SECRET with: @@ -41,17 +42,23 @@ sed -i "s/SECRET_KEY_BASE=.*/SECRET_KEY_BASE=$(openssl rand -hex 64)/" .env sed -i "s/LOADBALANCER_SECRET=.*/LOADBALANCER_SECRET=$(openssl rand -hex 24)/" .env ``` -Set the hostname on URL_HOST (E.g. sl.example.com) +Set the hostname on SL_HOST (E.g. sl) ``` -sed -i "s/URL_HOST=.*/URL_HOST=sl.example.com" .env +sed -i "s/SL_HOST=.*/SL_HOST=sl" .env +``` + +Set the domain name on DOMAIN_NAME (E.g. example.com) + +``` +sed -i "s/DOMAIN_NAME=.*/DOMAIN_NAME=example.com" .env ``` ## Generate LetsEncrypt SSL certificates manually ``` source ./.env -certbot certonly --manual -d sl.$DOMAIN_NAME --agree-tos --no-bootstrap --manual-public-ip-logging-ok --preferred-challenges=dns --email --server https://acme-v02.api.letsencrypt.org/director +certbot certonly --manual -d $SL_HOST.$DOMAIN_NAME --agree-tos --no-bootstrap --manual-public-ip-logging-ok --preferred-challenges=dns --email --server https://acme-v02.api.letsencrypt.org/director certbot certonly --manual -d redis.$DOMAIN_NAME --agree-tos --no-bootstrap --manual-public-ip-logging-ok --preferred-challenges=dns --email --server https://acme-v02.api.letsencrypt.org/director ``` diff --git a/README.md b/README.md index 8a8256c..b6369f4 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,8 @@ Most required variables are pre-set by default, the ones that must be set before ``` SECRET_KEY_BASE= LOADBALANCER_SECRET= -URL_HOST= +SL_HOST= +DOMAIN_NAME= ``` Obtain the value for SECRET_KEY_BASE and LOADBALANCER_SECRET with: @@ -59,10 +60,16 @@ sed -i "s/SECRET_KEY_BASE=.*/SECRET_KEY_BASE=$(openssl rand -hex 64)/" .env sed -i "s/LOADBALANCER_SECRET=.*/LOADBALANCER_SECRET=$(openssl rand -hex 24)/" .env ``` -Set the hostname on URL_HOST (E.g. sl.example.com) +Set the hostname on SL_HOST (E.g. sl) ``` -sed -i "s/URL_HOST=.*/URL_HOST=sl.example.com" .env +sed -i "s/SL_HOST=.*/SL_HOST=sl" .env +``` + +Set the domain name on DOMAIN_NAME (E.g. example.com) + +``` +sed -i "s/DOMAIN_NAME=.*/DOMAIN_NAME=example.com" .env ``` Start the services. diff --git a/docker-compose.yml b/docker-compose.yml index 2dc2f80..6d4658a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,7 +42,7 @@ services: - "80:80" - "443:443" environment: - - NGINX_HOSTNAME=${SL_HOST:-sl.xlab.blindside-ps.dev} + - NGINX_HOSTNAME=${SL_HOST:-sl}.${DOMAIN_NAME:-user.blindside-ps.dev} volumes: - ./log/proxy-nginx/:/var/log/nginx - ./data/proxy/nginx/sites.template.${DOCKER_PROXY_NGINX_TEMPLATE:-scalelite-proxy}:/etc/nginx/sites.template diff --git a/init-letsencrypt.sh b/init-letsencrypt.sh index bc9107d..e905a59 100755 --- a/init-letsencrypt.sh +++ b/init-letsencrypt.sh @@ -47,9 +47,10 @@ do esac done -echo $URL_HOST +domains="$SL_HOST.$DOMAIN_NAME" + +echo $domains -domains=($URL_HOST) rsa_key_size=4096 data_path="./data/certbot" email="$LETSENCRYPT_EMAIL" # Adding a valid address is strongly recommended.