mirror of
https://github.com/michelleDeko/scalelite-run.git
synced 2026-02-05 15:50:54 +01:00
some fixes and necessary updates for init-letsencrypt.sh
This commit is contained in:
10
README.md
10
README.md
@@ -32,6 +32,11 @@ Create a new .env file based on the dotenv file included.
|
|||||||
|
|
||||||
```
|
```
|
||||||
cp dotenv .env
|
cp dotenv .env
|
||||||
|
|
||||||
|
sed -e '/SECRET_KEY_BASE=/ s/^${openssl rand -hex 64}*/#/' -i .env
|
||||||
|
|
||||||
|
sed -i 's/SECRET_KEY_BASE=.*/SECRET_KEY_BASE=[${openssl rand -hex 64}]/' .env
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Most required variables are pre-set by default, the ones that must be set before starting are:
|
Most required variables are pre-set by default, the ones that must be set before starting are:
|
||||||
@@ -43,3 +48,8 @@ URL_HOST=
|
|||||||
NGINX_SSL=
|
NGINX_SSL=
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Also, when using the `init-letsencrypt.sh` script, you should add the email.
|
||||||
|
|
||||||
|
```
|
||||||
|
LETSENCRYPT_EMAIL=
|
||||||
|
```
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ./log/recordings/:/var/log/nginx
|
- ./log/recordings/:/var/log/nginx
|
||||||
- ${SCALELITE_RECORDING_DIR-/mnt/scalelite-recordings/var/bigbluebutton}/published:/var/bigbluebutton/published
|
- ${SCALELITE_RECORDING_DIR:-/mnt/scalelite-recordings/var/bigbluebutton}/published:/var/bigbluebutton/published
|
||||||
depends_on:
|
depends_on:
|
||||||
- scalelite-api
|
- scalelite-api
|
||||||
|
|
||||||
@@ -74,12 +74,12 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
|
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
|
||||||
- DATABASE_URL=${DATABASE_URL:-postgres://postgres:password@postgres:5432/scalelite?pool=5}
|
- DATABASE_URL=${DATABASE_URL:-postgres://postgres:password@postgres:5432/scalelite?pool=5}
|
||||||
- RECORDING_DISABLED=${RECORDING_DISABLED-false}
|
- RECORDING_DISABLED=${RECORDING_DISABLED:-false}
|
||||||
- SERVER_ID_IS_HOSTNAME=${SERVER_ID_IS_HOSTNAME-false}
|
- SERVER_ID_IS_HOSTNAME=${SERVER_ID_IS_HOSTNAME:-false}
|
||||||
- RAILS_LOG_TO_STDOUT=${RAILS_LOG_TO_STDOUT}
|
- RAILS_LOG_TO_STDOUT=${RAILS_LOG_TO_STDOUT:-false}
|
||||||
volumes:
|
volumes:
|
||||||
- ./log/scalelite-api/:/srv/scalelite/log/
|
- ./log/scalelite-api/:/srv/scalelite/log/
|
||||||
- ${SCALELITE_RECORDING_DIR-/mnt/scalelite-recordings/var/bigbluebutton}:/var/bigbluebutton
|
- ${SCALELITE_RECORDING_DIR:-/mnt/scalelite-recordings/var/bigbluebutton}:/var/bigbluebutton
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
- redis
|
- redis
|
||||||
@@ -94,8 +94,8 @@ services:
|
|||||||
- .env
|
- .env
|
||||||
environment:
|
environment:
|
||||||
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
|
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
|
||||||
- SERVER_ID_IS_HOSTNAME=${SERVER_ID_IS_HOSTNAME-false}
|
- SERVER_ID_IS_HOSTNAME=${SERVER_ID_IS_HOSTNAME:-false}
|
||||||
- RAILS_LOG_TO_STDOUT=${RAILS_LOG_TO_STDOUT}
|
- RAILS_LOG_TO_STDOUT=${RAILS_LOG_TO_STDOUT:-false}
|
||||||
volumes:
|
volumes:
|
||||||
- ./log/scalelite-poller/:/app/log
|
- ./log/scalelite-poller/:/app/log
|
||||||
command: /bin/sh -c "bin/start-poller"
|
command: /bin/sh -c "bin/start-poller"
|
||||||
@@ -113,11 +113,11 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=${DATABASE_URL:-postgres://postgres:password@postgres:5432/scalelite?pool=5}
|
- DATABASE_URL=${DATABASE_URL:-postgres://postgres:password@postgres:5432/scalelite?pool=5}
|
||||||
- RECORDING_DISABLED=false
|
- RECORDING_DISABLED=false
|
||||||
- RAILS_LOG_TO_STDOUT=${RAILS_LOG_TO_STDOUT}
|
- RAILS_LOG_TO_STDOUT=${RAILS_LOG_TO_STDOUT:-false}
|
||||||
volumes:
|
volumes:
|
||||||
- ./log/scalelite-recording-importer/:/app/log
|
- ./log/scalelite-recording-importer/:/app/log
|
||||||
- ${SCALELITE_RECORDING_DIR-/mnt/scalelite-recordings/var/bigbluebutton}:/var/bigbluebutton
|
- ${SCALELITE_RECORDING_DIR:-/mnt/scalelite-recordings/var/bigbluebutton}:/var/bigbluebutton
|
||||||
- ${SCALELITE_RECORDING_DIR-/mnt/scalelite-recordings/var/bigbluebutton}/spool:/var/bigbluebutton/spool
|
- ${SCALELITE_RECORDING_DIR:-/mnt/scalelite-recordings/var/bigbluebutton}/spool:/var/bigbluebutton/spool
|
||||||
command: /bin/sh -c "bin/start-recording-importer"
|
command: /bin/sh -c "bin/start-recording-importer"
|
||||||
depends_on:
|
depends_on:
|
||||||
- scalelite-api
|
- scalelite-api
|
||||||
|
|||||||
15
dotenv
15
dotenv
@@ -46,7 +46,14 @@ SCALELITE_RECORDINGS_DOCKER_IMAGE=bigbluebutton/bbb-playback-proxy:bionic-230-am
|
|||||||
#
|
#
|
||||||
### Optional for development when using different profiles
|
### Optional for development when using different profiles
|
||||||
# DOCKER_PROXY_NGINX_TEMPLATE=scalelite-proxy
|
# DOCKER_PROXY_NGINX_TEMPLATE=scalelite-proxy
|
||||||
DOCKER_PROXY_NGINX_TEMPLATE=scalelite-proxy-protected
|
# Examples:
|
||||||
#DOCKER_PROXY_NGINX_TEMPLATE=scalelite-local
|
# scalelite-proxy <default>
|
||||||
#DOCKER_PROXY_NGINX_TEMPLATE=scalelite-local-protected
|
# scalelite-proxy-protected
|
||||||
#DOCKER_PROXY_NGINX_TEMPLATE=scalelite-cluster
|
# scalelite-local
|
||||||
|
# scalelite-local-protected
|
||||||
|
# scalelite-cluster
|
||||||
|
|
||||||
|
### Optional for the deployment, but required when using init-letsencrypt.sh script
|
||||||
|
# LETSENCRYPT_EMAIL=
|
||||||
|
# LETSENCRYPT_STAGING=0
|
||||||
|
# Set to 1 if you're testing your setup to avoid hitting request limits
|
||||||
|
|||||||
22
dotenv-dev
22
dotenv-dev
@@ -1,22 +0,0 @@
|
|||||||
SECRET_KEY_BASE=secret
|
|
||||||
LOADBALANCER_SECRET=secret
|
|
||||||
URL_HOST=sl.example.com
|
|
||||||
|
|
||||||
SCALELITE_DOCKER_IMAGE=blindsidenetwks/master:v1.0
|
|
||||||
SCALELITE_RECORDINGS_DOCKER_IMAGE=bigbluebutton/bbb-playback-proxy:bionic-230-amazonlinux
|
|
||||||
|
|
||||||
DB_DISABLED: "false"
|
|
||||||
POLL_INTERVAL: "60"
|
|
||||||
RECORDING_DISABLED: "false"
|
|
||||||
RECORDING_IMPORT_POLL: "true"
|
|
||||||
RECORDING_IMPORT_POLL_INTERVAL: "60"
|
|
||||||
|
|
||||||
DOCKER_VOL_SCALELITE_API=/home/ubuntu/scalelite-run/data/scalelite
|
|
||||||
DOCKER_VOL_POSTGRES_DATA=/home/ubuntu/scalelite-run/data/postgres
|
|
||||||
DOCKER_VOL_REDIS_DATA=/home/ubuntu/scalelite-run/data/redis
|
|
||||||
|
|
||||||
DOCKER_PROXY_NGINX_TEMPLATE=scalelite-proxy
|
|
||||||
#DOCKER_PROXY_NGINX_TEMPLATE=scalelite-proxy-protected
|
|
||||||
#DOCKER_PROXY_NGINX_TEMPLATE=scalelite-local
|
|
||||||
#DOCKER_PROXY_NGINX_TEMPLATE=scalelite-local-protected
|
|
||||||
#DOCKER_PROXY_NGINX_TEMPLATE=scalelite-cluster
|
|
||||||
@@ -10,6 +10,17 @@ if [[ ! -f ./.env ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Local .env
|
||||||
|
if [ -f .env ]; then
|
||||||
|
# Load Environment Variables
|
||||||
|
export $(cat .env | grep -v '#' | sed 's/\r$//' | awk '/=/ {print $1}' )
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$LETSENCRYPT_EMAIL" ]]; then
|
||||||
|
echo "Settung up an email for letsencrypt certificates is strongly recommended."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo -e "Initializes letsencrypt certificates for Nginx proxy container\n"
|
echo -e "Initializes letsencrypt certificates for Nginx proxy container\n"
|
||||||
echo -e "Usage: $0 [-z|-r|-h]\n"
|
echo -e "Usage: $0 [-z|-r|-h]\n"
|
||||||
@@ -33,18 +44,13 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
URL_HOST=$(grep URL_HOST .env | cut -d '=' -f2)
|
|
||||||
echo $URL_HOST
|
echo $URL_HOST
|
||||||
NGINX_CONTAINER_NAME=$(grep DOCKER_PROXY_NGINX_TEMPLATE .env | cut -d '=' -f2)
|
|
||||||
if [[ -z "$NGINX_CONTAINER_NAME" ]]; then
|
|
||||||
NGINX_CONTAINER_NAME=scalelite-proxy
|
|
||||||
fi
|
|
||||||
|
|
||||||
domains=($URL_HOST)
|
domains=($URL_HOST)
|
||||||
rsa_key_size=4096
|
rsa_key_size=4096
|
||||||
data_path="./data/certbot"
|
data_path="./data/certbot"
|
||||||
email="$LETSENCRYPT_EMAIL" # Adding a valid address is strongly recommended
|
email="$LETSENCRYPT_EMAIL" # Adding a valid address is strongly recommended.
|
||||||
staging=${LETSENCRYPT_STAGING:-0} # Set to 1 if you're testing your setup to avoid hitting request limits
|
staging=${LETSENCRYPT_STAGING:-0}
|
||||||
|
|
||||||
if [ -d "$data_path" ] && [ "$replaceExisting" -eq 0 ]; then
|
if [ -d "$data_path" ] && [ "$replaceExisting" -eq 0 ]; then
|
||||||
if [ "$interactive" -eq 0 ]; then
|
if [ "$interactive" -eq 0 ]; then
|
||||||
@@ -76,9 +82,8 @@ docker-compose run --rm --entrypoint "\
|
|||||||
-subj '/CN=localhost'" certbot
|
-subj '/CN=localhost'" certbot
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
echo "### Starting scalelite-proxy ..."
|
||||||
echo "### Starting $NGINX_CONTAINER_NAME ..."
|
docker-compose up --force-recreate -d scalelite-proxy
|
||||||
docker-compose up --force-recreate -d $NGINX_CONTAINER_NAME
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo "### Deleting dummy certificate for $domains ..."
|
echo "### Deleting dummy certificate for $domains ..."
|
||||||
|
|||||||
Reference in New Issue
Block a user