Skip to content
Snippets Groups Projects
Commit ad5fcbc1 authored by Armin Co's avatar Armin Co
Browse files

Refactoring configuration.

parent 08a23715
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# Get the path to all docker-compose files
# with the "-f" flag.
# Comment the services out that you do not want to use.
# Variable that holds all docker-compose files.
# This is the main compose file which includes letsencrypt
# for your auto generated certificates. Don not remove!
docker_compose_files=" -f docker-compose.base.yml "
# noVNC - Screen sharing with VNC
# docker_compose_files+=" -f ./novnc/docker-compose.yml "
# letsencrypt
docker_compose_files+=" -f letsencrypt-webserver/docker-compose.yml "
# jitsi
docker_compose_files+=" -f jitsi/docker-compose.yml "
# mumble
#docker_compose_files+=" -f ./build-mumble-web/docker-compose.production.yml"
# "return" the string
echo "$docker_compose_files"
\ No newline at end of file
#!/bin/bash
# Get the path to all docker-compose files
# with the "-f" flag.
## YOUR SETTINGS
## Configure domains and letsencrypt
#
DOMAIN=armin-co.de
SUB_DOMAINS=""
MAIL=test@armin-co.de
USE_JITSI="true"
USE_NO_VNC="false"
USE_MUMBLE="false"
# Git
GIT_URL="https://gitlab.cvh-server.de/aco/"
# Variable that holds all docker-compose files.
# This is the main compose file. Don not remove!
# Required for unified a unified path layout.
base_compose_file=" -f docker-compose.base.yml "
DOCKER_COMPOSE_FILES=$base_compose_file
# Letsencrypt
letsencrypt_compose_file=" -f letsencrypt-webserver/docker-compose.yml "
DOCKER_COMPOSE_FILES+=$letsencrypt_compose_file
LETSENCRYPT_DIR=letsencrypt-webserver
LETSENCRYPT_URL="$GIT_URL$LETSENCRYPT_DIR".git
# Jitsi
JITSI_DIR=jitsi-auto-config
JITSI_URL="$GIT_URL$JITSI_DIR".git
if [$USE_JITSI = "true"]; then
jitsi_compose_file=" -f jitsi/docker-compose.yml "
DOCKER_COMPOSE_FILES+=$jitsi_compose_file
SUB_DOMAINS+="jitsi,"
fi
# noVNC - Screen sharing with VNC
NOVNC_DIR=novnc
NOVNC_URL="$GIT_URL$NOVNC_DIR".git
if [$USE_NO_VNC = "true"]; then
novnc_compose_file=" -f ./novnc/docker-compose.yml "
DOCKER_COMPOSE_FILES+=$novnc_compose_file
fi
# Mumble
MUMBLE_DIR=build-mumble-web
MUMBLE_URL=https://github.com/Johni0702/mumble-web.git
if [$USE_MUMBLE = "true"]; then
mumble_compose_file=" -f ./build-mumble-web/docker-compose.production.yml"
DOCKER_COMPOSE_FILES+=$mumble_compose_file
SUB_DOMAINS+="mumble-web"
fi
\ No newline at end of file
#!/bin/bash
## YOUR SETTINGS
## Configure domains and letsencrypt
#
domain=armin-co.de
sub_domains=mumble,mumble-web,jitsi
mail=test@armin-co.de
# git
git_url="https://gitlab.cvh-server.de/aco/"
## Mumble
#
mumble_dir=build-mumble-web
mumble_url="$git_url$mumble_dir".git
## Jitsi
#
jitsi_dir=jitsi-auto-config
jitsi_url="$git_url$jitsi_dir".git
## letsencrypt
#
le_dir=letsencrypt-webserver
le_url="$git_url$le_dir".git
## noVNC
#
novnc_dir=novnc
novnc_url="$git_url$novnc_dir".git
# Do not request new certificates while developing
dbg_delete_letsencrypt=false
source config.sh
# Remove all existing repositories
# and configurations.
function remove_all() {
function remove_all_configs() {
echo "Removing all previous configs..."
git clean -fd
git pull
rm -rf $mumble_dir $jitsi_dir $novnc_dir
if [$dbg_delete_letsencrypt = "true"]; then
rm -rf $le_dir
fi
rm -rf $MUMBLE_DIR $JITSI_DIR $NOVNC_DIR
echo "Removed all repositories."
}
# Clone repositories
function clone_repositories() {
git clone $mumble_url
git clone $jitsi_url
git clone $le_url
git clone $novnc_url
git clone $LETSENCRYPT_URL
git clone $JITSI_URL
git clone $NOVNC_URL
git clone $MUMBLE_URL
wait
}
function configure_letsencrypt() {
echo ""
echo "Setting your letsencrypt domain settings."
echo ""
le_compose=$le_dir/docker-compose.yml
le_compose=$LETSENCRYPT_DIR/docker-compose.yml
# Adds your domain to docker-compose
sed -i "s/your-domain.com/$domain/" $le_compose
sed -i "s/your-domain.com/$DOMAIN/" $le_compose
# Adds the list of subdomains to use to docker-compose
sed -i "s/your_subdomains/$sub_domains/" $le_compose
# Add E-Mail address that will be used to notify you
......@@ -79,10 +35,10 @@ function configure_letsencrypt() {
sed -i "s/your_email/$mail/" $le_compose
# For using not only your subdomains uncomment the following line.
# sed -i "s/- ONLY_SUBDOMAINS=true/- ONLY_SUBDOMAINS=false/" $le_dir
# sed -i "s/- ONLY_SUBDOMAINS=true/- ONLY_SUBDOMAINS=false/" $LETSENCRYPT_DIR
# start once to generate directories and certificates
docker-compose -f $le_compose up -d && docker logs reverse-proxy && docker-compose -f $le_compose down
docker-compose $base_compose_file $letsencrypt_compose_file up -d && docker logs reverse_proxy && docker-compose $base_compose_file $letsencrypt_compose_file down
echo ""
echo "Done configuring LetsEncrypt and generating certificates."
}
......@@ -91,11 +47,11 @@ function configure_letsencrypt() {
## Configure Murmur (mumble server) and mumble-web
#
function configure_mumble() {
cd build-mumble-web
cd $MUMBLE_DIR
git clone https://github.com/Johni0702/mumble-web.git
cd ..
mkdir murmur
cp $mumble_dir/murmur/mumble-server.ini murmur/mumble-server.ini
cp $MUMBLE_DIR/murmur/mumble-server.ini murmur/mumble-server.ini
touch murmur/mumble-server.log
}
......@@ -107,18 +63,12 @@ echo "Starting configuration with cleaning up and pulling again."
echo ""
./tools/stop_containers.sh
remove_all
remove_all_configs
clone_repositories
# configure letsencrypt
configure_letsencrypt
# configure mumble
configure_mumble
./tools/stop_containers.sh
## pull and update all images
#
# ./tools/update_containers.sh
\ No newline at end of file
./tools/update_containers.sh
\ No newline at end of file
#!/bin/bash
# start/restart all containers
# compose_files=$(./compose_files_conf.sh)
#
source compose_files_conf.sh
source config.sh
docker-compose $docker_compose_files up -d
\ No newline at end of file
#!/bin/bash
# compose_files=$(./compose_files_conf.sh)
source compose_files_conf.sh
source config.sh
docker-compose $docker_compose_files down
\ No newline at end of file
......@@ -2,17 +2,23 @@
# Update and restart containers
source compose_files_conf.sh
# compose_files=$(./compose_files_conf.sh)
source config.sh
echo "Pulling images"
echo ""
# pull updated images
docker-compose $docker_compose_files pull
echo "Building images"
echo ""
# build new images if neccessary
docker-compose -f build-mumble-web/docker-compose.production.yml build
docker-compose -f novnc/docker-compose.yml build
# Build new images if neccessary
if [$USE_MUMBLE = "true"]; then
docker-compose -f $mumble_compose_file build
fi
if [$USE_NOVNC = "true"]; then
docker-compose -f $novnc_compose_file build
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment