full-install: add letsencrypt cert gen script

This commit is contained in:
starbirdtech383
2024-01-26 15:26:51 +05:30
parent 818f8082be
commit ea8662a4e1
12 changed files with 134 additions and 13 deletions

View File

@@ -0,0 +1,32 @@
#!/bin/bash
# expects nginx to be up and running with conf.d/certbot.conf
# dns to be mapped to the machine where cert is generated
#
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
SERVER_NAME=${1}
if [[ -z "$SERVER_NAME" ]]
then
echo "required argument servername"
echo "usage ex: ./gen_certs my.nocodb.com"
exit 1
fi
echo "Creating configs for SERVER_NAME: ${SERVER_NAME}"
cd ${SCRIPT_DIR}/../conf/nginx/conf.d
sed "s,<SERVER_NAME>,${SERVER_NAME},g" ${SCRIPT_DIR}/../nginx/conf-templates/certbot_conf.template > certbot.conf
cd ${SCRIPT_DIR}/../bin
./nginx_start.sh
./nginx_reload.sh
echo "Triggering certbot to create ssl configs: ${SERVER_NAME}"
cd ${SCRIPT_DIR}/..
docker-compose run --rm certbot certonly --webroot --webroot-path /var/www/certbot/ -d ${SERVER_NAME}
echo "Now reload nginx with new ssl configs for your site : ${SERVER_NAME}"
cd ${SCRIPT_DIR}/../conf/nginx/conf.d
sed "s,<SERVER_NAME>,${SERVER_NAME},g" ${SCRIPT_DIR}/../nginx/conf-templates/ssl_server_name_conf.template > ${SERVER_NAME}.conf
${SCRIPT_DIR}/../bin/nginx_reload.sh

View File

@@ -1,3 +1,7 @@
nocodb_install_version="1.0.0" # Replace with actual version
REQUIRED_PORTS=(80 443)
DOCKER_IMAGES=("redis:latest" "postgres:14.7" "nocodb/nocodb:latest" "nginx")
DOCKER_IMAGES=("redis:latest" "postgres:14.7" "nocodb/nocodb:latest" "nginx" "certbot/certbot:latest" )
# Array of properties with default values
properties=( "POSTGRES_USER=postgres" "POSTGRES_PASSWORD=test123" "POSTGRES_DB=nocodb" "NC_REDIS_URL=redis://redis:6379/4" 'NC_DB=pg://postgres:5432?u=postgres&password=${POSTGRES_PASSWORD:-nocodb}&d=postgres' )
# "NC_INSTALL_ROOT=${SCRIPT_DIR}" "MINIO_ROOT_USER=minioadmin" "MINIO_ROOT_PASSWORD=minioadmin"