79 lines
2.2 KiB
Bash
Executable File
79 lines
2.2 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Federated installation script
|
|
|
|
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
. /federated/lib/functions.sh
|
|
trap cleanup `seq 0 15`
|
|
|
|
get_config() {
|
|
# FSTACKURL="http://137.184.95.3:8000"
|
|
# [ ! -d "/federated/lib" ] && mkdir -p /federated/lib
|
|
|
|
# Download each library file
|
|
# for i in checks network dns ldap mail; do
|
|
# if [ ! -f "/federated/lib/$i.sh" ]; then
|
|
# curl $FSTACKURL/$i.sh -o /federated/lib/$i.sh -s -f &> /dev/null
|
|
# [ $? -ne 0 ] && failcheck "Couldn't download $i.sh"
|
|
# fi
|
|
# done
|
|
|
|
. /federated/lib/checks.sh
|
|
. /federated/lib/network.sh
|
|
. /federated/lib/dns.sh
|
|
. /federated/lib/postgresql.sh
|
|
. /federated/lib/ldap.sh
|
|
. /federated/lib/mail.sh
|
|
. /federated/lib/collabora.sh
|
|
. /federated/lib/nextcloud.sh
|
|
. /federated/lib/matrix.sh
|
|
. /federated/lib/element.sh
|
|
. /federated/lib/jitsi.sh
|
|
. /federated/lib/listmonk.sh
|
|
. /federated/lib/vaultwarden.sh
|
|
. /federated/lib/panel.sh
|
|
. /federated/lib/proxy.sh
|
|
. /federated/lib/wireguard.sh
|
|
. /federated/lib/connector.sh
|
|
. /federated/lib/baserow.sh
|
|
. /federated/lib/calcom.sh
|
|
|
|
echo -ne "\nFederated Stack install script\n\n"
|
|
read -p '* Enter domain name (domain.com): ' DOMAIN
|
|
read -p '* Enter company name (Domain Company): ' COMPANY
|
|
read -sp '* Enter admin password to use for initial login: ' ADMINPASS
|
|
[ -z "$DOMAIN" ] && failcheck "Must enter a domain name"
|
|
[ -z "$COMPANY" ] && failcheck "Must enter a company name"
|
|
[ -z "$ADMINPASS" ] && failcheck "Must enter a admin password"
|
|
}
|
|
|
|
while getopts d OPTION; do
|
|
case "$OPTION" in
|
|
d) DEBUG=ON;;
|
|
esac
|
|
done
|
|
|
|
# Download lib scripts and take in setup variables
|
|
get_config
|
|
|
|
echo -ne "\n\nStarting Federated install for $DOMAIN\n"
|
|
|
|
# Check that we have docker installed. Check that
|
|
# we have all ports available and not in use
|
|
check_docker
|
|
check_os
|
|
check_ports
|
|
|
|
# Configure docker private network
|
|
config_network
|
|
|
|
# Configure and start each federated service
|
|
for i in dns postgresql ldap mail collabora proxy nextcloud matrix element listmonk vaultwarden panel wireguard jitsi connector baserow calcom; do
|
|
config_$i
|
|
start_$i
|
|
done
|
|
|
|
# Print out federated environment details
|
|
print_details
|
|
echo -ne "\n\n"
|