DNS, collabora, ansible, network, nextcloud fixes

This commit is contained in:
root 2022-11-03 12:44:38 +00:00
parent b8a1f472f5
commit 30251d77aa
8 changed files with 20 additions and 39 deletions

View File

@ -59,7 +59,6 @@ check_ports() {
# Check if ss command exists
if command -v ss &> /dev/null; then
# Check every port we need if it's in use
# for i in 8000; do
for i in 25 53 80 143 389 587 993 8000; do
SS=`ss -tulwn | grep LISTEN | awk '{ print $5 }' | awk -F: '{ print $NF }' | grep "^$i$" | head -1`
# If port 53 (dns) in use by system-resolvd (Ubuntu) then auto fix

View File

@ -12,6 +12,7 @@ config_collabora() {
if [ ! -d "fstack/collabora" ]; then
mkdir -p fstack/collabora/data/root/certs &> /dev/null
cp -rf fstack/dns/data/etc/letsencrypt/archive/$DOMAIN/*.pem fstack/collabora/data/root/certs/
chown 104 fstack/collabora/data/root/certs/*
fi
DOMAIN_ARRAY=(${DOMAIN//./ })

View File

@ -97,6 +97,10 @@ if [ ! -e /etc/bind/.firstdone ]; then
touch /etc/bind/.firstdone
wait -n
elif [ -e /etc/bind/.firstdone ] && [ -e /etc/bind/.failedcert ]; then
# Install bind and certbot packages
apk add --no-cache bind
apk add --no-cache certbot
DOMAIN=`ls /etc/bind/zones | head -1`
named -f -g &
crond &

View File

@ -9,7 +9,7 @@ config_network() {
spin &
SPINPID=$!
docker network create --subnet 172.99.0.0/16 fstack &> /dev/null
[ ! `docker network ls -q --filter name=fstack` ] && docker network create --subnet 172.99.0.0/16 fstack &> /dev/null
[ $? -ne 0 ] && fail "Couldn't run docker network create"
echo -ne "done."

View File

@ -197,7 +197,6 @@ chmod +x fstack/nextcloud/data/root/*.sh
cat > fstack/nextcloud/data/etc/apache2/sites-enabled/000-default.conf <<'EOF'
LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
Listen 443
<VirtualHost *:80>
ServerAdmin admin@localhost
@ -260,7 +259,7 @@ start_nextcloud() {
[ $? -ne 0 ] && fail "Couldn't chown nextcloud.sh in fstack/nextcloud container"
# Run nextcloud.sh - Setup LDAP, configuration for nextcloud
docker exec -it -u 33 nextcloud /var/www/html/nextcloud.sh
docker exec -it -u 33 nextcloud /var/www/html/nextcloud.sh &> /dev/null
[ $? -ne 0 ] && fail "Couldn't run nextcloud.sh inside fstack/nextcloud container"
# Enable SSL module in fstack/nextcloud

View File

@ -75,40 +75,18 @@ 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 ont in use
# we have all ports available and not in use
check_docker
check_ports
# Configure docker private network
config_network
# Configure fstack/dns container and start it
config_dns
start_dns
# Configure fstack/ldap container and start it
config_ldap
start_ldap
# Configure fstack/mail container and start it
config_mail
start_mail
# Configure fstack/collabora container and start it
config_collabora
start_collabora
# Configure fstack/nextcloud container and start it
config_nextcloud
start_nextcloud
# Configure fstack/panel container and start it
config_panel
start_panel
# Configure fstack/proxy container and start it
config_proxy
start_proxy
# Configure and start each federated service
for i in dns ldap mail collabora nextcloud panel proxy; do
config_$i
start_$i
done
# Print out fstack environment details
echo -ne "\n\nInstall completed successfully.\n\n"

View File

@ -3,7 +3,7 @@
# Federated Start Script
usage() {
echo "$0: all|dns|ldap|mail|nextcloud|panel|proxy"
echo "$0: all|dns|ldap|mail|collabora|nextcloud|panel|proxy"
exit 2
}
startservice() {
@ -11,7 +11,7 @@ startservice() {
docker-compose -f fstack/$SERVICE/docker-compose.yml -p $SERVICE up -d
}
startservice_all() {
for i in dns ldap mail nextcloud panel proxy; do
for i in dns ldap mail collabora nextcloud panel proxy; do
echo "* Starting $i.."
docker-compose -f fstack/$i/docker-compose.yml -p $i up -d
done
@ -22,6 +22,6 @@ SERVICE=$1
case "$SERVICE" in
all) startservice_all;;
dns|ldap|mail|nextcloud|panel|proxy) startservice;;
dns|ldap|mail|collabora|nextcloud|panel|proxy) startservice;;
*) usage;;
esac

View File

@ -3,7 +3,7 @@
# Federated Stop Script
usage() {
echo "$0: all|dns|ldap|mail|nextcloud|panel|proxy"
echo "$0: all|dns|ldap|mail|collabora|nextcloud|panel|proxy"
exit 2
}
stopservice() {
@ -11,7 +11,7 @@ stopservice() {
docker-compose -f fstack/$SERVICE/docker-compose.yml -p $SERVICE down
}
stopservice_all() {
for i in dns ldap mail nextcloud panel proxy; do
for i in dns ldap mail collabora nextcloud panel proxy; do
echo "* Stopping $i.."
docker-compose -f fstack/$i/docker-compose.yml -p $i down
done
@ -22,6 +22,6 @@ SERVICE=$1
case "$SERVICE" in
all) stopservice_all;;
dns|ldap|mail|nextcloud|panel|proxy) stopservice;;
dns|ldap|mail|collabora|nextcloud|panel|proxy) stopservice;;
*) usage;;
esac