First round of new directory structure

This commit is contained in:
Derek Crudgington 2022-12-13 16:56:20 +00:00
parent 2f60d1529e
commit 09f9ee5c62
22 changed files with 274 additions and 626 deletions

0
apps/.gitignore vendored Normal file
View File

0
backups/.gitignore vendored Normal file
View File

View File

@ -24,7 +24,7 @@ spin() {
fail() {
echo -ne "FAILED\n\n$1\n\n"
kill -9 $SPINPID &> /dev/null
# [ -d "fstack/dns" ] && rm -rf fstack/dns
# [ -d "apps/dns" ] && rm -rf apps/dns
# docker network rm fstack &> /dev/null
exit 2;
}
@ -34,30 +34,30 @@ failcheck() {
}
get_config() {
FSTACKURL="http://137.184.95.3:8000"
[ ! -d "fstack/lib" ] && mkdir -p fstack/lib
[ ! -d "/federated/lib" ] && mkdir -p /federated/lib
# Download each library file
for i in checks network dns ldap mail; do
if [ ! -f "fstack/lib/$i.sh" ]; then
curl $FSTACKURL/$i.sh -o fstack/lib/$i.sh -s -f &> /dev/null
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
. fstack/lib/checks.sh
. fstack/lib/network.sh
. fstack/lib/dns.sh
. fstack/lib/postgresql.sh
. fstack/lib/ldap.sh
. fstack/lib/mail.sh
. fstack/lib/collabora.sh
. fstack/lib/nextcloud.sh
. fstack/lib/matrix.sh
. fstack/lib/jitsi.sh
. fstack/lib/listmonk.sh
. fstack/lib/vaultwarden.sh
. fstack/lib/panel.sh
. fstack/lib/proxy.sh
. /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/jitsi.sh
. /federated/lib/listmonk.sh
. /federated/lib/vaultwarden.sh
. /federated/lib/panel.sh
. /federated/lib/proxy.sh
echo -ne "\nFederated Stack install script\n\n"
read -p '* Enter domain name (domain.com): ' DOMAIN
@ -88,13 +88,14 @@ check_ports
config_network
# Configure and start each federated service
for i in dns postgresql ldap mail collabora nextcloud matrix listmonk vaultwarden panel proxy jitsi; do
#for i in dns postgresql ldap mail collabora nextcloud matrix listmonk vaultwarden panel proxy jitsi; do
for i in dns postgresql; do
config_$i
start_$i
done
# Print out fstack environment details
echo -ne "\n\nInstall completed successfully.\n\n"
echo -ne "Certificates at fstack/dns/data/etc/letsencrypt/archive/$DOMAIN\n"
echo -ne "Certificates at apps/dns/data/etc/letsencrypt/archive/$DOMAIN\n"
echo -ne "Webmail is at http://www.$DOMAIN:9002\n"
echo -ne "Login user: admin Password: Provided at start\n"

View File

@ -8,12 +8,12 @@ usage() {
}
startservice() {
echo "* Starting $SERVICE.."
cd fstack/$SERVICE && docker-compose -f docker-compose.yml -p $SERVICE up -d
cd /federated/apps/$SERVICE && docker-compose -f docker-compose.yml -p $SERVICE up -d
}
startservice_all() {
for i in dns postgresql ldap mail collabora nextcloud matrix jitsi listmonk vaultwarden panel proxy; do
echo "* Starting $i.."
cd fstack/$i && docker-compose -f docker-compose.yml -p $i up -d
cd /federated/apps/$i && docker-compose -f docker-compose.yml -p $i up -d
done
}

View File

@ -8,12 +8,12 @@ usage() {
}
stopservice() {
echo "* Stopping $SERVICE.."
docker-compose -f fstack/$SERVICE/docker-compose.yml -p $SERVICE down
docker-compose -f /federated/apps/$SERVICE/docker-compose.yml -p $SERVICE down
}
stopservice_all() {
for i in dns postgresql ldap mail collabora nextcloud matrix jitsi listmonk vaultwarden panel proxy; do
echo "* Stopping $i.."
docker-compose -f fstack/$i/docker-compose.yml -p $i down
docker-compose -f /federated/apps/$i/docker-compose.yml -p $i down
done
}

View File

@ -1,353 +0,0 @@
version: '3.5'
services:
# Frontend
web:
image: jitsi/web:${JITSI_IMAGE_VERSION:-stable-7882}
restart: ${RESTART_POLICY:-unless-stopped}
ports:
- '${HTTP_PORT}:80'
- '${HTTPS_PORT}:443'
volumes:
- ${CONFIG}/web:/config:Z
- ${CONFIG}/web/crontabs:/var/spool/cron/crontabs:Z
- ${CONFIG}/transcripts:/usr/share/jitsi-meet/transcripts:Z
- ./data/config/keys:/config/keys:Z
environment:
- VIRTUAL_PROTO=https
- VIRTUAL_PORT=443
- VIRTUAL_HOST=jitsi.northendnetwork.com
- AMPLITUDE_ID
- ANALYTICS_SCRIPT_URLS
- ANALYTICS_WHITELISTED_EVENTS
- AUDIO_QUALITY_OPUS_BITRATE
- BRANDING_DATA_URL
- CALLSTATS_CUSTOM_SCRIPT_URL
- CALLSTATS_ID
- CALLSTATS_SECRET
- CHROME_EXTENSION_BANNER_JSON
- CONFCODE_URL
- CONFIG_EXTERNAL_CONNECT
- DEFAULT_LANGUAGE
- DEPLOYMENTINFO_ENVIRONMENT
- DEPLOYMENTINFO_ENVIRONMENT_TYPE
- DEPLOYMENTINFO_REGION
- DEPLOYMENTINFO_SHARD
- DEPLOYMENTINFO_USERREGION
- DESKTOP_SHARING_FRAMERATE_MIN
- DESKTOP_SHARING_FRAMERATE_MAX
- DIALIN_NUMBERS_URL
- DIALOUT_AUTH_URL
- DIALOUT_CODES_URL
- DISABLE_AUDIO_LEVELS
- DISABLE_DEEP_LINKING
- DISABLE_GRANT_MODERATOR
- DISABLE_HTTPS
- DISABLE_KICKOUT
- DISABLE_LOCAL_RECORDING
- DISABLE_POLLS
- DISABLE_PRIVATE_CHAT
- DISABLE_PROFILE
- DISABLE_REACTIONS
- DISABLE_REMOTE_VIDEO_MENU
- DROPBOX_APPKEY
- DROPBOX_REDIRECT_URI
- DYNAMIC_BRANDING_URL
- ENABLE_AUDIO_PROCESSING
- ENABLE_AUTH
- ENABLE_BREAKOUT_ROOMS
- ENABLE_CALENDAR
- ENABLE_COLIBRI_WEBSOCKET
- ENABLE_E2EPING
- ENABLE_FILE_RECORDING_SHARING
- ENABLE_GUESTS
- ENABLE_HSTS
- ENABLE_HTTP_REDIRECT
- ENABLE_IPV6
- ENABLE_LETSENCRYPT
- ENABLE_LIPSYNC
- ENABLE_NO_AUDIO_DETECTION
- ENABLE_NOISY_MIC_DETECTION
- ENABLE_OCTO
- ENABLE_OPUS_RED
- ENABLE_PREJOIN_PAGE
- ENABLE_P2P
- ENABLE_WELCOME_PAGE
- ENABLE_CLOSE_PAGE
- ENABLE_LIVESTREAMING
- ENABLE_LOCAL_RECORDING_NOTIFY_ALL_PARTICIPANT
- ENABLE_LOCAL_RECORDING_SELF_START
- ENABLE_RECORDING
- ENABLE_REMB
- ENABLE_REQUIRE_DISPLAY_NAME
- ENABLE_SERVICE_RECORDING
- ENABLE_SIMULCAST
- ENABLE_STATS_ID
- ENABLE_STEREO
- ENABLE_SUBDOMAINS
- ENABLE_TALK_WHILE_MUTED
- ENABLE_TCC
- ENABLE_TRANSCRIPTIONS
- ENABLE_XMPP_WEBSOCKET
- ENABLE_JAAS_COMPONENTS
- ENABLE_MULTI_STREAM
- ETHERPAD_PUBLIC_URL
- ETHERPAD_URL_BASE
- E2EPING_NUM_REQUESTS
- E2EPING_MAX_CONFERENCE_SIZE
- E2EPING_MAX_MESSAGE_PER_SECOND
- GOOGLE_ANALYTICS_ID
- GOOGLE_API_APP_CLIENT_ID
- HIDE_PREMEETING_BUTTONS
- HIDE_PREJOIN_DISPLAY_NAME
- HIDE_PREJOIN_EXTRA_BUTTONS
- INVITE_SERVICE_URL
- JICOFO_AUTH_USER
- LETSENCRYPT_DOMAIN
- LETSENCRYPT_EMAIL
- LETSENCRYPT_USE_STAGING
- MATOMO_ENDPOINT
- MATOMO_SITE_ID
- MICROSOFT_API_APP_CLIENT_ID
- NGINX_RESOLVER
- NGINX_WORKER_PROCESSES
- NGINX_WORKER_CONNECTIONS
- PEOPLE_SEARCH_URL
- PUBLIC_URL
- P2P_PREFERRED_CODEC
- RESOLUTION
- RESOLUTION_MIN
- RESOLUTION_WIDTH
- RESOLUTION_WIDTH_MIN
- START_AUDIO_MUTED
- START_AUDIO_ONLY
- START_BITRATE
- START_SILENT
- START_WITH_AUDIO_MUTED
- START_VIDEO_MUTED
- START_WITH_VIDEO_MUTED
- TESTING_CAP_SCREENSHARE_BITRATE
- TESTING_OCTO_PROBABILITY
- TOKEN_AUTH_URL
- TOOLBAR_BUTTONS
- TZ
- VIDEOQUALITY_BITRATE_H264_LOW
- VIDEOQUALITY_BITRATE_H264_STANDARD
- VIDEOQUALITY_BITRATE_H264_HIGH
- VIDEOQUALITY_BITRATE_VP8_LOW
- VIDEOQUALITY_BITRATE_VP8_STANDARD
- VIDEOQUALITY_BITRATE_VP8_HIGH
- VIDEOQUALITY_BITRATE_VP9_LOW
- VIDEOQUALITY_BITRATE_VP9_STANDARD
- VIDEOQUALITY_BITRATE_VP9_HIGH
- VIDEOQUALITY_ENFORCE_PREFERRED_CODEC
- VIDEOQUALITY_PREFERRED_CODEC
- XMPP_AUTH_DOMAIN
- XMPP_BOSH_URL_BASE
- XMPP_DOMAIN
- XMPP_GUEST_DOMAIN
- XMPP_MUC_DOMAIN
- XMPP_RECORDER_DOMAIN
- XMPP_PORT
networks:
fstack:
ipv4_address: 172.99.0.25
# XMPP server
prosody:
image: jitsi/prosody:${JITSI_IMAGE_VERSION:-stable-7882}
restart: ${RESTART_POLICY:-unless-stopped}
expose:
- '${XMPP_PORT:-5222}'
- '5347'
- '5280'
volumes:
- ${CONFIG}/prosody/config:/config:Z
- ${CONFIG}/prosody/prosody-plugins-custom:/prosody-plugins-custom:Z
environment:
- AUTH_TYPE
- DISABLE_POLLS
- ENABLE_AUTH
- ENABLE_AV_MODERATION
- ENABLE_BREAKOUT_ROOMS
- ENABLE_END_CONFERENCE
- ENABLE_GUESTS
- ENABLE_IPV6
- ENABLE_LOBBY
- ENABLE_RECORDING
- ENABLE_XMPP_WEBSOCKET
- ENABLE_JAAS_COMPONENTS
- GC_TYPE
- GC_INC_TH
- GC_INC_SPEED
- GC_INC_STEP_SIZE
- GC_GEN_MIN_TH
- GC_GEN_MAX_TH
- GLOBAL_CONFIG
- GLOBAL_MODULES
- JIBRI_RECORDER_USER
- JIBRI_RECORDER_PASSWORD
- JIBRI_XMPP_USER
- JIBRI_XMPP_PASSWORD
- JICOFO_AUTH_USER
- JICOFO_AUTH_PASSWORD
- JICOFO_COMPONENT_SECRET
- JIGASI_XMPP_USER
- JIGASI_XMPP_PASSWORD
- JVB_AUTH_USER
- JVB_AUTH_PASSWORD
- JWT_APP_ID
- JWT_APP_SECRET
- JWT_ACCEPTED_ISSUERS
- JWT_ACCEPTED_AUDIENCES
- JWT_ASAP_KEYSERVER
- JWT_ALLOW_EMPTY
- JWT_AUTH_TYPE
- JWT_ENABLE_DOMAIN_VERIFICATION
- JWT_TOKEN_AUTH_MODULE
- MATRIX_UVS_URL
- MATRIX_UVS_ISSUER
- MATRIX_UVS_AUTH_TOKEN
- MATRIX_UVS_SYNC_POWER_LEVELS
- LOG_LEVEL
- LDAP_AUTH_METHOD
- LDAP_BASE
- LDAP_BINDDN
- LDAP_BINDPW
- LDAP_FILTER
- LDAP_VERSION
- LDAP_TLS_CIPHERS
- LDAP_TLS_CHECK_PEER
- LDAP_TLS_CACERT_FILE
- LDAP_TLS_CACERT_DIR
- LDAP_START_TLS
- LDAP_URL
- LDAP_USE_TLS
- MAX_PARTICIPANTS
- PROSODY_RESERVATION_ENABLED
- PROSODY_RESERVATION_REST_BASE_URL
- PUBLIC_URL
- TURN_CREDENTIALS
- TURN_HOST
- TURNS_HOST
- TURN_PORT
- TURNS_PORT
- TZ
- XMPP_DOMAIN
- XMPP_AUTH_DOMAIN
- XMPP_GUEST_DOMAIN
- XMPP_MUC_DOMAIN
- XMPP_INTERNAL_MUC_DOMAIN
- XMPP_MODULES
- XMPP_MUC_MODULES
- XMPP_MUC_CONFIGURATION
- XMPP_INTERNAL_MUC_MODULES
- XMPP_RECORDER_DOMAIN
- XMPP_PORT
networks:
fstack:
ipv4_address: 172.99.0.26
aliases:
- xmpp.meet.jitsi
- xmpp.northendnetwork.com
# Focus component
jicofo:
image: jitsi/jicofo:${JITSI_IMAGE_VERSION:-stable-7882}
restart: ${RESTART_POLICY:-unless-stopped}
volumes:
- ${CONFIG}/jicofo:/config:Z
environment:
- AUTH_TYPE
- BRIDGE_AVG_PARTICIPANT_STRESS
- BRIDGE_STRESS_THRESHOLD
- ENABLE_AUTH
- ENABLE_AUTO_OWNER
- ENABLE_CODEC_VP8
- ENABLE_CODEC_VP9
- ENABLE_CODEC_H264
- ENABLE_OCTO
- ENABLE_RECORDING
- ENABLE_SCTP
- ENABLE_AUTO_LOGIN
- JICOFO_AUTH_USER
- JICOFO_AUTH_PASSWORD
- JICOFO_ENABLE_BRIDGE_HEALTH_CHECKS
- JICOFO_CONF_INITIAL_PARTICIPANT_WAIT_TIMEOUT
- JICOFO_CONF_SINGLE_PARTICIPANT_TIMEOUT
- JICOFO_ENABLE_HEALTH_CHECKS
- JICOFO_SHORT_ID
- JIBRI_BREWERY_MUC
- JIBRI_REQUEST_RETRIES
- JIBRI_PENDING_TIMEOUT
- JIGASI_BREWERY_MUC
- JIGASI_SIP_URI
- JVB_BREWERY_MUC
- MAX_BRIDGE_PARTICIPANTS
- OCTO_BRIDGE_SELECTION_STRATEGY
- SENTRY_DSN="${JICOFO_SENTRY_DSN:-0}"
- SENTRY_ENVIRONMENT
- SENTRY_RELEASE
- TZ
- XMPP_DOMAIN
- XMPP_AUTH_DOMAIN
- XMPP_INTERNAL_MUC_DOMAIN
- XMPP_MUC_DOMAIN
- XMPP_RECORDER_DOMAIN
- XMPP_SERVER
- XMPP_PORT
depends_on:
- prosody
networks:
fstack:
ipv4_address: 172.99.0.27
# Video bridge
jvb:
image: jitsi/jvb:${JITSI_IMAGE_VERSION:-stable-7882}
restart: ${RESTART_POLICY:-unless-stopped}
ports:
- '${JVB_PORT:-10000}:${JVB_PORT:-10000}/udp'
- '127.0.0.1:${JVB_COLIBRI_PORT:-9090}:9090'
volumes:
- ${CONFIG}/jvb:/config:Z
environment:
- DOCKER_HOST_ADDRESS
- ENABLE_COLIBRI_WEBSOCKET
- ENABLE_OCTO
- ENABLE_MULTI_STREAM
- JVB_ADVERTISE_IPS
- JVB_ADVERTISE_PRIVATE_CANDIDATES
- JVB_AUTH_USER
- JVB_AUTH_PASSWORD
- JVB_BREWERY_MUC
- JVB_DISABLE_STUN
- JVB_PORT
- JVB_MUC_NICKNAME
- JVB_STUN_SERVERS
- JVB_OCTO_BIND_ADDRESS
- JVB_OCTO_REGION
- JVB_OCTO_RELAY_ID
- JVB_WS_DOMAIN
- JVB_WS_SERVER_ID
- PUBLIC_URL
- SENTRY_DSN="${JVB_SENTRY_DSN:-0}"
- SENTRY_ENVIRONMENT
- SENTRY_RELEASE
- COLIBRI_REST_ENABLED
- SHUTDOWN_REST_ENABLED
- TZ
- XMPP_AUTH_DOMAIN
- XMPP_INTERNAL_MUC_DOMAIN
- XMPP_SERVER
- XMPP_PORT
depends_on:
- prosody
networks:
fstack:
ipv4_address: 172.99.0.28
# Custom network so all services can communicate using a FQDN
networks:
fstack:
external: true

View File

@ -5,21 +5,21 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_collabora() {
echo -ne "\n* Configuring fstack/collabora container.."
echo -ne "\n* Configuring /federated/apps/collabora container.."
spin &
SPINPID=$!
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/*
if [ ! -d "/federated/apps/collabora" ]; then
mkdir -p /federated/apps/collabora/data/root/certs &> /dev/null
cp -rf /federated/apps/dns/data/etc/letsencrypt/archive/$DOMAIN/*.pem apps/collabora/data/root/certs/
chown 104 /federated/apps/collabora/data/root/certs/*
fi
DOMAIN_ARRAY=(${DOMAIN//./ })
DOMAIN_FIRST=${DOMAIN_ARRAY[0]}
DOMAIN_LAST=${DOMAIN_ARRAY[1]}
cat > fstack/collabora/docker-compose.yml <<EOF
cat > /federated/apps/collabora/docker-compose.yml <<EOF
version: '3.7'
services:
@ -30,7 +30,7 @@ services:
domainname: $DOMAIN
restart: always
networks:
fstack:
federated:
ipv4_address: 172.99.0.20
ports:
- "9980:9980"
@ -49,7 +49,7 @@ services:
- MKNOD
networks:
fstack:
federated:
external: true
EOF
@ -58,17 +58,17 @@ echo -ne "done."
}
start_collabora() {
# Start fstack/collabora with output to /dev/null
echo -ne "\n* Starting fstack/collabora service.."
# Start /federated/apps/collabora with output to /dev/null
echo -ne "\n* Starting /federated/apps/collabora service.."
spin &
SPINPID=$!
if [ $DEBUG ]; then
# Start fstack/collabora with output to console for debug
docker-compose -f fstack/collabora/docker-compose.yml -p collabora up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service fstack/collabora"
# Start /federated/apps/collabora with output to console for debug
docker-compose -f /federated/apps/collabora/docker-compose.yml -p collabora up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service /federated/apps/collabora"
else
docker-compose -f fstack/collabora/docker-compose.yml -p collabora up -d &> /dev/null
docker-compose -f /federated/apps/collabora/docker-compose.yml -p collabora up -d &> /dev/null
# Keep trying collabora port 9980 to make sure it's up
# before we proceed
@ -79,9 +79,9 @@ start_collabora() {
break
else
if [ "$RETRY" == 1 ]; then
docker-compose -f fstack/collabora/docker-compose.yml -p collabora down &> /dev/null
docker-compose -f /federated/apps/collabora/docker-compose.yml -p collabora down &> /dev/null
kill -9 $SPINPID &> /dev/null
fail "There was a problem starting service fstack/collabora\nCheck the output of 'docker logs collabora' or turn on\ndebug with -d"
fail "There was a problem starting service /federated/apps/collabora\nCheck the output of 'docker logs collabora' or turn on\ndebug with -d"
fi
((RETRY--))
sleep 7

View File

@ -5,17 +5,17 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_dns() {
echo -ne "\n* Configuring fstack/dns container.."
echo -ne "\n* Configuring /federated/apps/dns container.."
spin &
SPINPID=$!
EXTERNAL_IP_LASTDIGIT=`echo $EXTERNALIP | awk -F . '{ print $4 }'`
EXTERNALIP_INADDR=`echo $EXTERNALIP | awk -F . '{ print $3"."$2"."$1".in-addr.arpa"}'`
EXTERNALIP_INADDR_CAPS=`echo $EXTERNALIP | awk -F . '{ print $3"."$2"."$1".IN-ADDR.ARPA"}'`
mkdir -p fstack/dns/data/root
mkdir -p fstack/dns/data/etc/bind/zones
mkdir -p fstack/dns/data/var/log/letsencrypt
mkdir -p /federated/apps/dns/data/root
mkdir -p /federated/apps/dns/data/etc/bind/zones
mkdir -p /federated/apps/dns/data/var/log/letsencrypt
cat > fstack/dns/docker-compose.yml <<'EOF'
cat > /federated/apps/dns/docker-compose.yml <<'EOF'
version: '3.7'
services:
@ -26,7 +26,7 @@ services:
restart: always
working_dir: /root
networks:
fstack:
federated:
ipv4_address: 172.99.0.10
volumes:
- ./data/etc/bind:/etc/bind
@ -39,11 +39,11 @@ services:
command: [ "/root/dns-cert.sh" ]
networks:
fstack:
federated:
external: true
EOF
cat > fstack/dns/data/root/dns-cert.sh <<'EOF'
cat > /federated/apps/dns/data/root/dns-cert.sh <<'EOF'
#!/bin/sh -x
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
@ -82,15 +82,15 @@ if [ ! -e /etc/bind/.firstdone ]; then
# Run Certbot again to generate the certificate
certbot certonly --manual --manual-auth-hook /root/acme-dns-auth.py --preferred-challenges dns --debug-challenges -d \*.$DOMAIN -d $DOMAIN --agree-tos --email hostmaster@$DOMAIN -n &> /dev/null
if [ $? -eq 0 ]; then
echo "[fstack]: SUCCESS generating certificates for $DOMAIN!"
echo "[fstack]: Certificates are at /etc/letsencrypt/live/$DOMAIN"
echo "[federated]: SUCCESS generating certificates for $DOMAIN!"
echo "[federated]: Certificates are at /etc/letsencrypt/live/$DOMAIN"
echo -ne "#!/bin/sh\n\n/usr/bin/certbot renew -q" > /etc/periodic/15min/certbot-renew.sh
chmod +x /etc/periodic/15min/certbot-renew.sh
else
touch /etc/bind/.failedcert
touch /etc/bind/.firstdone
echo "[fstack]: FAILED generating certificates for $DOMAIN"
echo "[fstack]: Check that you have DNS setup properly"
echo "[federated]: FAILED generating certificates for $DOMAIN"
echo "[federated]: Check that you have DNS setup properly"
exit 2;
fi
@ -110,12 +110,12 @@ elif [ -e /etc/bind/.firstdone ] && [ -e /etc/bind/.failedcert ]; then
certbot certonly --manual --manual-auth-hook /root/acme-dns-auth.py --preferred-challenges dns --debug-challenges -d \*.$DOMAIN -d $DOMAIN --agree-tos --email hostmaster@$DOMAIN -n &> /dev/null
if [ $? -eq 0 ]; then
rm /etc/bind/.failedcert
echo "[fstack]: SUCCESS generating certificates for $DOMAIN!"
echo "[fstack]: Certificates are at /etc/letsencrypt/live/$DOMAIN"
echo "[federated]: SUCCESS generating certificates for $DOMAIN!"
echo "[federated]: Certificates are at /etc/letsencrypt/live/$DOMAIN"
else
touch /etc/bind/.failedcert
echo "[fstack]: FAILED generating certificates for $DOMAIN"
echo "[fstack]: Check that you have DNS setup properly"
echo "[federated]: FAILED generating certificates for $DOMAIN"
echo "[federated]: Check that you have DNS setup properly"
exit 2;
fi
wait -n
@ -127,9 +127,9 @@ else
fi
EOF
chmod +x fstack/dns/data/root/dns-cert.sh
chmod +x /federated/apps/dns/data/root/dns-cert.sh
cat > fstack/dns/data/etc/bind/named.conf <<EOF
cat > /federated/apps/dns/data/etc/bind/named.conf <<EOF
options {
directory "/var/bind";
@ -154,7 +154,7 @@ controls {
};
EOF
cat > fstack/dns/data/etc/bind/zones/$DOMAIN <<EOF
cat > /federated/apps/dns/data/etc/bind/zones/$DOMAIN <<EOF
\$TTL 2d
\$ORIGIN $DOMAIN.
$DOMAIN. IN SOA ns1.$DOMAIN. hostmaster.$DOMAIN. (
@ -185,7 +185,7 @@ vaultwarden IN A $EXTERNALIP
$DOMAIN. IN A $EXTERNALIP
EOF
cat > fstack/dns/data/etc/bind/zones/$DOMAIN.rev <<EOF
cat > /federated/apps/dns/data/etc/bind/zones/$DOMAIN.rev <<EOF
\$TTL 2d
\$ORIGIN $EXTERNALIP_INADDR_CAPS.
@ IN SOA ns1.$DOMAIN. hostmaster.$DOMAIN. (
@ -205,31 +205,31 @@ kill $SPINPID &> /dev/null
}
start_dns() {
echo -ne "\n* Starting fstack/dns service.."
echo -ne "\n* Starting /federated/apps/dns service.."
spin &
SPINPID=$!
if [ $DEBUG ]; then
# Start fstack/dns with output to console for debug
docker-compose -f fstack/dns/docker-compose.yml -p dns up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service fstack/dns"
# Start /federated/apps/dns with output to console for debug
docker-compose -f /federated/apps/dns/docker-compose.yml -p dns up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service /federated/apps/dns"
else
# Start fstack/dns with output to /dev/null
docker-compose -f fstack/dns/docker-compose.yml -p dns up -d &> /dev/null
# Start /federated/apps/dns with output to /dev/null
docker-compose -f /federated/apps/dns/docker-compose.yml -p dns up -d &> /dev/null
# Keep trying to see that certificates are generated
RETRY="18"
while [ $RETRY -gt 0 ]; do
ls fstack/dns/data/etc/letsencrypt/live/$DOMAIN/*.pem &> /dev/null
ls /federated/apps/dns/data/etc/letsencrypt/live/$DOMAIN/*.pem &> /dev/null
if [ $? -eq 0 ]; then
kill -9 $SPINPID &> /dev/null
echo -ne "done."
# echo -ne "* Certificates at fstack/dns/data/etc/letsencrypt/live/$DOMAIN\n"
# echo -ne "* Certificates at /federated/apps/dns/data/etc/letsencrypt/live/$DOMAIN\n"
break
else
if [ "$RETRY" == 1 ]; then
docker-compose -f fstack/dns/docker-compose.yml -p dns down &> /dev/null
fail "There was a problem starting service fstack/dns\nCheck the output of 'docker logs dns' or turn on\ndebug with -d"
docker-compose -f /federated/apps/dns/docker-compose.yml -p dns down &> /dev/null
fail "There was a problem starting service /federated/apps/dns\nCheck the output of 'docker logs dns' or turn on\ndebug with -d"
fi
((RETRY--))
sleep 9

View File

@ -5,29 +5,29 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_jitsi() {
echo -ne "\n* Configuring fstack/jitsi container.."
echo -ne "\n* Configuring /federated/apps/jitsi container.."
spin &
SPINPID=$!
if [ ! -d "fstack/jitsi" ]; then
mkdir -p fstack/jitsi
# mkdir -p fstack/jitsi/data/config/keys &> /dev/null
# cp -rf fstack/dns/data/etc/letsencrypt/archive/$DOMAIN/*.pem fstack/jitsi/data/config/keys
# mv fstack/jitsi/data/config/keys/fullchain1.pem fstack/jitsi/data/config/keys/cert.crt
# mv fstack/jitsi/data/config/keys/privkey1.pem fstack/jitsi/data/config/keys/cert.key
# chmod 644 fstack/jitsi/data/config/keys/*.pem
if [ ! -d "/federated/apps/jitsi" ]; then
mkdir -p /federated/apps/jitsi
# mkdir -p /federated/apps/jitsi/data/config/keys &> /dev/null
# cp -rf /federated/apps/dns/data/etc/letsencrypt/archive/$DOMAIN/*.pem apps/jitsi/data/config/keys
# mv /federated/apps/jitsi/data/config/keys/fullchain1.pem apps/jitsi/data/config/keys/cert.crt
# mv /federated/apps/jitsi/data/config/keys/privkey1.pem apps/jitsi/data/config/keys/cert.key
# chmod 644 /federated/apps/jitsi/data/config/keys/*.pem
fi
DOMAIN_ARRAY=(${DOMAIN//./ })
DOMAIN_FIRST=${DOMAIN_ARRAY[0]}
DOMAIN_LAST=${DOMAIN_ARRAY[1]}
# Extract Jitsi into fstack/jitsi
tar zxvf fstack/files/jitsi/stable-* --strip-components 1 -C fstack/jitsi &> /dev/null
[ $? -ne 0 ] && fail "Couldn't extract files/jitsi/stable* into fstack/jitsi"
# Extract Jitsi into /federated/apps/jitsi
tar zxvf /federated/apps/files/jitsi/stable-* --strip-components 1 -C apps/jitsi &> /dev/null
[ $? -ne 0 ] && fail "Couldn't extract files/jitsi/stable* into /federated/apps/jitsi"
# Create docker compose file
cat > fstack/jitsi/docker-compose.yml <<EOF
cat > /federated/apps/jitsi/docker-compose.yml <<EOF
version: '3.7'
services:
@ -180,7 +180,7 @@ services:
- XMPP_RECORDER_DOMAIN
- XMPP_PORT
networks:
fstack:
federated:
ipv4_address: 172.99.0.25
# XMPP server
@ -275,7 +275,7 @@ services:
- XMPP_RECORDER_DOMAIN
- XMPP_PORT
networks:
fstack:
federated:
ipv4_address: 172.99.0.26
aliases:
- xmpp.meet.jitsi
@ -329,7 +329,7 @@ services:
depends_on:
- prosody
networks:
fstack:
federated:
ipv4_address: 172.99.0.27
# Video bridge
@ -374,16 +374,16 @@ services:
depends_on:
- prosody
networks:
fstack:
federated:
ipv4_address: 172.99.0.28
networks:
fstack:
federated:
external: true
EOF
# Create Jitsi .env file
cat > fstack/jitsi/.env <<EOF
cat > /federated/apps/jitsi/.env <<EOF
# shellcheck disable=SC2034
################################################################################
################################################################################
@ -606,7 +606,7 @@ EOF
mkdir -p ~/.jitsi-meet-cfg/{web,transcripts,prosody/config,prosody/prosody-plugins-custom,jicofo,jvb,jigasi,jibri}
[ $? -ne 0 ] && fail "Couldn't run mkdir for jitsi configurations"
./fstack/jitsi/gen-passwords.sh
.//federated/apps/jitsi/gen-passwords.sh
[ $? -ne 0 ] && fail "Couldn't run jitsi/gen-passwords.sh"
kill -9 $SPINPID &> /dev/null
@ -614,17 +614,17 @@ echo -ne "done."
}
start_jitsi() {
# Start fstack/jitsi with output to /dev/null
echo -ne "\n* Starting fstack/jitsi service.."
# Start /federated/apps/jitsi with output to /dev/null
echo -ne "\n* Starting /federated/apps/jitsi service.."
spin &
SPINPID=$!
if [ $DEBUG ]; then
# Start fstack/jitsi with output to console for debug
cd fstack/jitsi && docker-compose -f docker-compose.yml -p jitsi up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service fstack/jitsi"
# Start /federated/apps/jitsi with output to console for debug
cd /federated/apps/jitsi && docker-compose -f docker-compose.yml -p jitsi up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service /federated/apps/jitsi"
else
cd fstack/jitsi && docker-compose -f docker-compose.yml -p jitsi up -d &> /dev/null
cd /federated/apps/jitsi && docker-compose -f docker-compose.yml -p jitsi up -d &> /dev/null
# Keep trying jitsi port 443 to make sure it's up
# before we proceed
@ -637,7 +637,7 @@ start_jitsi() {
if [ "$RETRY" == 1 ]; then
docker-compose -f docker-compose.yml -p jitsi down &> /dev/null
kill -9 $SPINPID &> /dev/null
fail "There was a problem starting service fstack/jitsi\nCheck the output of 'docker logs jitsi' or turn on\ndebug with -d"
fail "There was a problem starting service /federated/apps/jitsi\nCheck the output of 'docker logs jitsi' or turn on\ndebug with -d"
fi
((RETRY--))
sleep 7

View File

@ -5,17 +5,17 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_ldap() {
echo -ne "\n* Configuring fstack/ldap container.."
echo -ne "\n* Configuring /federated/apps/ldap container.."
spin &
SPINPID=$!
if [ ! -d "fstack/ldap" ]; then
mkdir -p fstack/ldap/data &> /dev/null
mkdir -p fstack/ldap/data/var/lib/ldap &> /dev/null
mkdir -p fstack/ldap/data/etc/ldap/slap.d &> /dev/null
mkdir -p fstack/ldap/data/certs &> /dev/null
mkdir -p fstack/ldap/data/root &> /dev/null
cp -rf fstack/dns/data/etc/letsencrypt/archive/$DOMAIN/*.pem fstack/ldap/data/certs/
if [ ! -d "/federated/apps/ldap" ]; then
mkdir -p /federated/apps/ldap/data &> /dev/null
mkdir -p /federated/apps/ldap/data/var/lib/ldap &> /dev/null
mkdir -p /federated/apps/ldap/data/etc/ldap/slap.d &> /dev/null
mkdir -p /federated/apps/ldap/data/certs &> /dev/null
mkdir -p /federated/apps/ldap/data/root &> /dev/null
cp -rf /federated/apps/dns/data/etc/letsencrypt/archive/$DOMAIN/*.pem apps/ldap/data/certs/
fi
DOMAIN_ARRAY=(${DOMAIN//./ })
@ -23,7 +23,7 @@ config_ldap() {
DOMAIN_LAST=${DOMAIN_ARRAY[1]}
LDAPADMINPASS=`echo -n $ADMINPASS | openssl dgst -sha1 -binary | openssl enc -base64 | awk '{print "{SHA}"$0}'`
cat > fstack/ldap/docker-compose.yml <<EOF
cat > /federated/apps/ldap/docker-compose.yml <<EOF
version: '3.7'
services:
@ -35,7 +35,7 @@ services:
restart: always
working_dir: /root
networks:
fstack:
federated:
ipv4_address: 172.99.0.11
volumes:
- ./data/var/lib/ldap:/var/lib/ldap
@ -55,11 +55,11 @@ services:
- LDAP_TLS_VERIFY_CLIENT=try
networks:
fstack:
federated:
external: true
EOF
cat > fstack/ldap/data/root/ldap.ldif <<EOF
cat > /federated/apps/ldap/data/root/ldap.ldif <<EOF
dn: ou=people,dc=$DOMAIN_FIRST,dc=$DOMAIN_LAST
ou: people
objectClass: organizationalUnit
@ -126,7 +126,7 @@ memberOf: cn=admins,ou=groups,dc=$DOMAIN_FIRST,dc=$DOMAIN_LAST
memberOf: cn=everybody,ou=groups,dc=$DOMAIN_FIRST,dc=$DOMAIN_LAST
EOF
cat > fstack/ldap/data/root/ldap.sh <<'EOF'
cat > /federated/apps/ldap/data/root/ldap.sh <<'EOF'
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
@ -141,24 +141,24 @@ if [ ! -f .initialized ]; then
fi
EOF
chmod +x fstack/ldap/data/root/ldap.sh
chmod +x /federated/apps/ldap/data/root/ldap.sh
kill -9 $SPINPID &> /dev/null
echo -ne "done."
}
start_ldap() {
# Start fstack/ldap with output to /dev/null
echo -ne "\n* Starting fstack/ldap service.."
# Start /federated/apps/ldap with output to /dev/null
echo -ne "\n* Starting /federated/apps/ldap service.."
spin &
SPINPID=$!
if [ $DEBUG ]; then
# Start fstack/ldap with output to console for debug
docker-compose -f fstack/ldap/docker-compose.yml -p ldap up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service fstack/ldap"
# Start /federated/apps/ldap with output to console for debug
docker-compose -f /federated/apps/ldap/docker-compose.yml -p ldap up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service /federated/apps/ldap"
else
docker-compose -f fstack/ldap/docker-compose.yml -p ldap up -d &> /dev/null
docker-compose -f /federated/apps/ldap/docker-compose.yml -p ldap up -d &> /dev/null
# Keep trying ldap port to make sure it's up
# before we proceed
@ -169,9 +169,9 @@ start_ldap() {
break
else
if [ "$RETRY" == 1 ]; then
docker-compose -f fstack/ldap/docker-compose.yml -p ldap down &> /dev/null
docker-compose -f /federated/apps/ldap/docker-compose.yml -p ldap down &> /dev/null
kill -9 $SPINPID &> /dev/null
fail "There was a problem starting service fstack/ldap\nCheck the output of 'docker logs ldap' or turn on\ndebug with -d"
fail "There was a problem starting service /federated/apps/ldap\nCheck the output of 'docker logs ldap' or turn on\ndebug with -d"
fi
((RETRY--))
sleep 7

View File

@ -5,19 +5,19 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_listmonk() {
echo -ne "\n* Configuring fstack/listmonk container.."
echo -ne "\n* Configuring /federated/apps/listmonk container.."
spin &
SPINPID=$!
if [ ! -d "fstack/listmonk" ]; then
mkdir -p fstack/listmonk/static fstack/listmonk/data/listmonk
if [ ! -d "/federated/apps/listmonk" ]; then
mkdir -p /federated/apps/listmonk/static apps/listmonk/data/listmonk
fi
DOMAIN_ARRAY=(${DOMAIN//./ })
DOMAIN_FIRST=${DOMAIN_ARRAY[0]}
DOMAIN_LAST=${DOMAIN_ARRAY[1]}
cat > fstack/listmonk/docker-compose.yml <<EOF
cat > /federated/apps/listmonk/docker-compose.yml <<EOF
version: "3.7"
services:
@ -29,7 +29,7 @@ services:
restart: always
command: [sh, -c, "yes | ./listmonk --install --config config.toml && ./listmonk --config config.toml"]
networks:
fstack:
federated:
ipv4_address: 172.99.0.39
environment:
- VIRTUAL_PROTO=http
@ -41,11 +41,11 @@ services:
- ./data/listmonk/static:/listmonk/static
networks:
fstack:
federated:
external: true
EOF
cat > fstack/listmonk/data/listmonk/config.toml <<EOF
cat > /federated/apps/listmonk/data/listmonk/config.toml <<EOF
[app]
address = "0.0.0.0:9000"
admin_username = "admin"
@ -69,17 +69,17 @@ echo -ne "done."
}
start_listmonk() {
# Start fstack/listmonk with output to /dev/null
echo -ne "\n* Starting fstack/listmonk service.."
# Start /federated/apps/listmonk with output to /dev/null
echo -ne "\n* Starting /federated/apps/listmonk service.."
spin &
SPINPID=$!
if [ $DEBUG ]; then
# Start fstack/listmonk with output to console for debug
docker-compose -f fstack/listmonk/docker-compose.yml -p listmonk up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service fstack/listmonk"
# Start /federated/apps/listmonk with output to console for debug
docker-compose -f /federated/apps/listmonk/docker-compose.yml -p listmonk up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service /federated/apps/listmonk"
else
docker-compose -f fstack/listmonk/docker-compose.yml -p listmonk up -d &> /dev/null
docker-compose -f /federated/apps/listmonk/docker-compose.yml -p listmonk up -d &> /dev/null
# Keep trying listmonk port 9000 to make sure it's up
# before we proceed
@ -90,9 +90,9 @@ start_listmonk() {
break
else
if [ "$RETRY" == 1 ]; then
docker-compose -f fstack/listmonk/docker-compose.yml -p listmonk down &> /dev/null
docker-compose -f /federated/apps/listmonk/docker-compose.yml -p listmonk down &> /dev/null
kill -9 $SPINPID &> /dev/null
fail "There was a problem starting service fstack/listmonk\nCheck the output of 'docker logs listmonk' or turn on\ndebug with -d"
fail "There was a problem starting service /federated/apps/listmonk\nCheck the output of 'docker logs listmonk' or turn on\ndebug with -d"
fi
((RETRY--))
sleep 7

View File

@ -5,24 +5,24 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_mail() {
echo -ne "\n* Configuring fstack/mail container.."
echo -ne "\n* Configuring /federated/apps/mail container.."
spin &
SPINPID=$!
if [ ! -d "fstack/mail" ]; then
mkdir -p fstack/mail/data/root/certs &> /dev/null
mkdir -p fstack/mail/data/var/mail &> /dev/null
mkdir -p fstack/mail/data/var/mail-state &> /dev/null
mkdir -p fstack/mail/data/var/log/mail &> /dev/null
mkdir -p fstack/mail/data/tmp/docker-mailserver &> /dev/null
cp -rf fstack/dns/data/etc/letsencrypt/archive/$DOMAIN/*.pem fstack/mail/data/root/certs/
if [ ! -d "/federated/apps/mail" ]; then
mkdir -p /federated/apps/mail/data/root/certs &> /dev/null
mkdir -p /federated/apps/mail/data/var/mail &> /dev/null
mkdir -p /federated/apps/mail/data/var/mail-state &> /dev/null
mkdir -p /federated/apps/mail/data/var/log/mail &> /dev/null
mkdir -p /federated/apps/mail/data/tmp/docker-mailserver &> /dev/null
cp -rf /federated/apps/dns/data/etc/letsencrypt/archive/$DOMAIN/*.pem apps/mail/data/root/certs/
fi
DOMAIN_ARRAY=(${DOMAIN//./ })
DOMAIN_FIRST=${DOMAIN_ARRAY[0]}
DOMAIN_LAST=${DOMAIN_ARRAY[1]}
cat > fstack/mail/docker-compose.yml <<EOF
cat > /federated/apps/mail/docker-compose.yml <<EOF
version: '3.7'
services:
@ -33,7 +33,7 @@ services:
domainname: $DOMAIN
restart: always
networks:
fstack:
federated:
ipv4_address: 172.99.0.13
ports:
- "25:25"
@ -92,11 +92,11 @@ services:
- SYS_PTRACE
networks:
fstack:
federated:
external: true
EOF
cat > fstack/mail/data/tmp/docker-mailserver/postfix-main.cf <<'EOF'
cat > /federated/apps/mail/data/tmp/docker-mailserver/postfix-main.cf <<'EOF'
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unknown_sender_domain, reject_sender_login_mismatch
smtpd_sender_login_maps = ldap:/etc/postfix/ldap-aliases.cf
EOF
@ -106,16 +106,16 @@ EOF
}
start_mail() {
echo -ne "\n* Starting fstack/mail service.."
echo -ne "\n* Starting /federated/apps/mail service.."
spin &
SPINPID=$!
if [ $DEBUG ]; then
# Start fstack/mail with output to console for debug
docker-compose -f fstack/mail/docker-compose.yml -p mail up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service fstack/mail"
# Start /federated/apps/mail with output to console for debug
docker-compose -f /federated/apps/mail/docker-compose.yml -p mail up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service /federated/apps/mail"
else
docker-compose -f fstack/mail/docker-compose.yml -p mail up -d &> /dev/null
docker-compose -f /federated/apps/mail/docker-compose.yml -p mail up -d &> /dev/null
# Keep trying mail port 25 to make sure it's up
# before we proceed
@ -126,9 +126,9 @@ start_mail() {
break
else
if [ "$RETRY" == 1 ]; then
docker-compose -f fstack/mail/docker-compose.yml -p mail down &> /dev/null
docker-compose -f /federated/apps/mail/docker-compose.yml -p mail down &> /dev/null
kill -9 $SPINPID &> /dev/null
fail "There was a problem starting service fstack/mail\nCheck the output of 'docker logs mail' or turn on\ndebug with -d"
fail "There was a problem starting service /federated/apps/mail\nCheck the output of 'docker logs mail' or turn on\ndebug with -d"
fi
((RETRY--))
sleep 7
@ -140,20 +140,20 @@ start_mail() {
docker exec -it mail setup config dkim keysize 2048 domain $DOMAIN &> /dev/null
[ $? -ne 0 ] && fail "Couldn't generate DKIM record"
# Insert the DKIM DNS TXT entry into fstack/dns container
cat fstack/mail/data/tmp/docker-mailserver/opendkim/keys/$DOMAIN/mail.txt >> fstack/dns/data/etc/bind/zones/$DOMAIN
[ $? -ne 0 ] && fail "Couldn't insert DKIM record into fstack/dns container"
# Insert the DKIM DNS TXT entry into /federated/apps/dns container
cat /federated/apps/mail/data/tmp/docker-mailserver/opendkim/keys/$DOMAIN/mail.txt >> apps/dns/data/etc/bind/zones/$DOMAIN
[ $? -ne 0 ] && fail "Couldn't insert DKIM record into /federated/apps/dns container"
# Insert the DMARC DNS TXT entry into fstack/dns container
echo "_dmarc.$DOMAIN. IN TXT \"v=DMARC1; p=none; rua=mailto:admin@$DOMAIN; ruf=mailto:admin@$DOMAIN; sp=none; ri=86400\"" >> fstack/dns/data/etc/bind/zones/$DOMAIN
[ $? -ne 0 ] && fail "Couldn't insert DMARC record into fstack/dns container"
# Insert the DMARC DNS TXT entry into /federated/apps/dns container
echo "_dmarc.$DOMAIN. IN TXT \"v=DMARC1; p=none; rua=mailto:admin@$DOMAIN; ruf=mailto:admin@$DOMAIN; sp=none; ri=86400\"" >> /federated/apps/dns/data/etc/bind/zones/$DOMAIN
[ $? -ne 0 ] && fail "Couldn't insert DMARC record into /federated/apps/dns container"
# Reload DNS configuration in fstack/dns container
# Reload DNS configuration in /federated/apps/dns container
docker exec -it dns rndc reload $DOMAIN &> /dev/null
[ $? -ne 0 ] && fail "Couldn't run rndc reload DOMAIN on fstack/dns container"
[ $? -ne 0 ] && fail "Couldn't run rndc reload DOMAIN on /federated/apps/dns container"
docker exec -it dns rndc reload &> /dev/null
[ $? -ne 0 ] && fail "Couldn't run rndc reload on fstack/dns container"
[ $? -ne 0 ] && fail "Couldn't run rndc reload on /federated/apps/dns container"
kill -9 $SPINPID &> /dev/null
echo -ne "done."

View File

@ -5,21 +5,21 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_matrix() {
echo -ne "\n* Configuring fstack/matrix container.."
echo -ne "\n* Configuring /federated/apps/matrix container.."
spin &
SPINPID=$!
if [ ! -d "fstack/matrix" ]; then
mkdir -p fstack/matrix/data/matrix fstack/matrix/data/element &> /dev/null
cp -rf fstack/dns/data/etc/letsencrypt/archive/$DOMAIN/*.pem fstack/matrix/data/matrix
chmod 644 fstack/matrix/data/matrix/*.pem
if [ ! -d "/federated/apps/matrix" ]; then
mkdir -p /federated/apps/matrix/data/matrix apps/matrix/data/element &> /dev/null
cp -rf /federated/apps/dns/data/etc/letsencrypt/archive/$DOMAIN/*.pem apps/matrix/data/matrix
chmod 644 /federated/apps/matrix/data/matrix/*.pem
fi
DOMAIN_ARRAY=(${DOMAIN//./ })
DOMAIN_FIRST=${DOMAIN_ARRAY[0]}
DOMAIN_LAST=${DOMAIN_ARRAY[1]}
cat > fstack/matrix/docker-compose.yml <<EOF
cat > /federated/apps/matrix/docker-compose.yml <<EOF
version: '3.7'
services:
@ -32,7 +32,7 @@ services:
volumes:
- ./data/element/element-config.json:/app/config.json
networks:
fstack:
federated:
ipv4_address: 172.99.0.31
environment:
- VIRTUAL_PROTO=http
@ -46,7 +46,7 @@ services:
domainname: $DOMAIN
restart: always
networks:
fstack:
federated:
ipv4_address: 172.99.0.32
volumes:
- ./data/matrix:/data
@ -56,11 +56,11 @@ services:
- VIRTUAL_HOST=matrix.$DOMAIN
networks:
fstack:
federated:
external: true
EOF
cat > fstack/matrix/data/element/element-config.json <<EOF
cat > /federated/apps/matrix/data/element/element-config.json <<EOF
{
"default_server_config": {
"m.homeserver": {
@ -140,17 +140,17 @@ cat > fstack/matrix/data/element/element-config.json <<EOF
EOF
# Generate the matrix homeserver.yaml file
docker run -it --rm -v "`pwd`/fstack/matrix/data/matrix:/data" -e SYNAPSE_SERVER_NAME=matrix.$DOMAIN -e SYNAPSE_REPORT_STATS=yes matrixdotorg/synapse:latest generate &> /dev/null
docker run -it --rm -v "`pwd`//federated/apps/matrix/data/matrix:/data" -e SYNAPSE_SERVER_NAME=matrix.$DOMAIN -e SYNAPSE_REPORT_STATS=yes matrixdotorg/synapse:latest generate &> /dev/null
[ $? -ne 0 ] && fail "Couldn't run docker matrixdotorg/synapse:latest generate"
# Take out default Sqlite database config
sed -i 's!database: /data/homeserver.db!!g' fstack/matrix/data/matrix/homeserver.yaml
sed -i 's!database:!!g' fstack/matrix/data/matrix/homeserver.yaml
sed -i 's!name: sqlite3!!g' fstack/matrix/data/matrix/homeserver.yaml
sed -i 's!args:!!g' fstack/matrix/data/matrix/homeserver.yaml
sed -i 's!database: /data/homeserver.db!!g' /federated/apps/matrix/data/matrix/homeserver.yaml
sed -i 's!database:!!g' /federated/apps/matrix/data/matrix/homeserver.yaml
sed -i 's!name: sqlite3!!g' /federated/apps/matrix/data/matrix/homeserver.yaml
sed -i 's!args:!!g' /federated/apps/matrix/data/matrix/homeserver.yaml
# Insert our Postgres and LDAP config
cat >> fstack/matrix/data/matrix/homeserver.yaml <<EOF
cat >> /federated/apps/matrix/data/matrix/homeserver.yaml <<EOF
database:
name: psycopg2
@ -185,17 +185,17 @@ echo -ne "done."
}
start_matrix() {
# Start fstack/matrix with output to /dev/null
echo -ne "\n* Starting fstack/matrix service.."
# Start /federated/apps/matrix with output to /dev/null
echo -ne "\n* Starting /federated/apps/matrix service.."
spin &
SPINPID=$!
if [ $DEBUG ]; then
# Start fstack/matrix with output to console for debug
docker-compose -f fstack/matrix/docker-compose.yml -p matrix up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service fstack/matrix"
# Start /federated/apps/matrix with output to console for debug
docker-compose -f /federated/apps/matrix/docker-compose.yml -p matrix up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service /federated/apps/matrix"
else
docker-compose -f fstack/matrix/docker-compose.yml -p matrix up -d &> /dev/null
docker-compose -f /federated/apps/matrix/docker-compose.yml -p matrix up -d &> /dev/null
# Keep trying matrix port 8008 to make sure it's up
# before we proceed
@ -206,9 +206,9 @@ start_matrix() {
break
else
if [ "$RETRY" == 1 ]; then
docker-compose -f fstack/matrix/docker-compose.yml -p matrix down &> /dev/null
docker-compose -f /federated/apps/matrix/docker-compose.yml -p matrix down &> /dev/null
kill -9 $SPINPID &> /dev/null
fail "There was a problem starting service fstack/matrix\nCheck the output of 'docker logs matrix' or turn on\ndebug with -d"
fail "There was a problem starting service /federated/apps/matrix\nCheck the output of 'docker logs matrix' or turn on\ndebug with -d"
fi
((RETRY--))
sleep 7

View File

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

View File

@ -5,19 +5,19 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_nextcloud() {
echo -ne "\n* Configuring fstack/nextcloud container.."
echo -ne "\n* Configuring /federated/apps/nextcloud container.."
spin &
SPINPID=$!
if [ ! -d "fstack/nextcloud" ]; then
mkdir -p fstack/nextcloud/data/var/www/html &> /dev/null
if [ ! -d "/federated/apps/nextcloud" ]; then
mkdir -p /federated/apps/nextcloud/data/var/www/html &> /dev/null
fi
DOMAIN_ARRAY=(${DOMAIN//./ })
DOMAIN_FIRST=${DOMAIN_ARRAY[0]}
DOMAIN_LAST=${DOMAIN_ARRAY[1]}
cat > fstack/nextcloud/docker-compose.yml <<EOF
cat > /federated/apps/nextcloud/docker-compose.yml <<EOF
version: '3.7'
services:
@ -31,7 +31,7 @@ services:
context: .
dockerfile: Dockerfile
networks:
fstack:
federated:
ipv4_address: 172.99.0.15
extra_hosts:
- "collabora.$DOMAIN:$EXTERNALIP"
@ -51,11 +51,11 @@ services:
- POSTGRES_PASSWORD=$ADMINPASS
networks:
fstack:
federated:
external: true
EOF
cat > fstack/nextcloud/supervisord.conf <<EOF
cat > /federated/apps/nextcloud/supervisord.conf <<EOF
[supervisord]
nodaemon=true
logfile=/var/log/supervisord/supervisord.log
@ -80,7 +80,7 @@ stderr_logfile_maxbytes=0
command=service ssh start
EOF
cat > fstack/nextcloud/Dockerfile <<EOF
cat > /federated/apps/nextcloud/Dockerfile <<EOF
FROM nextcloud:latest
RUN apt update -y && apt-get install ssh -y \
@ -101,7 +101,7 @@ ENV NEXTCLOUD_UPDATE=1
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
EOF
cat > fstack/nextcloud/data/nextcloud.sh <<EOF
cat > /federated/apps/nextcloud/data/nextcloud.sh <<EOF
#!/bin/sh
PATH=/var/www/html:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/sbin:/bin
@ -164,23 +164,23 @@ ADMINUUID=\`./occ user:list | grep admin | awk '{ print \$2 }' | awk -F: '{ prin
./occ config:app:set --value "" richdocuments disable_certificate_verification
EOF
chmod +x fstack/nextcloud/data/nextcloud.sh
chmod +x /federated/apps/nextcloud/data/nextcloud.sh
kill -9 $SPINPID &> /dev/null
echo -ne "done."
}
start_nextcloud() {
echo -ne "\n* Starting fstack/nextcloud service.."
echo -ne "\n* Starting /federated/apps/nextcloud service.."
spin &
SPINPID=$!
if [ $DEBUG ]; then
# Start fstack/nextcloud with output to console for debug
docker-compose -f fstack/nextcloud/docker-compose.yml -p nextcloud up --build
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service fstack/nextcloud"
# Start /federated/apps/nextcloud with output to console for debug
docker-compose -f /federated/apps/nextcloud/docker-compose.yml -p nextcloud up --build
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service /federated/apps/nextcloud"
else
docker-compose -f fstack/nextcloud/docker-compose.yml -p nextcloud up --build -d &> /dev/null
docker-compose -f /federated/apps/nextcloud/docker-compose.yml -p nextcloud up --build -d &> /dev/null
# Keep trying nextcloud port 80 to make sure it's up
# before we proceed
@ -191,9 +191,9 @@ start_nextcloud() {
break
else
if [ "$RETRY" == 1 ]; then
docker-compose -f fstack/nextcloud/docker-compose.yml -p nextcloud down &> /dev/null
docker-compose -f /federated/apps/nextcloud/docker-compose.yml -p nextcloud down &> /dev/null
kill -9 $SPINPID &> /dev/null
fail "There was a problem starting service fstack/nextcloud\nCheck the output of 'docker logs nextcloud' or turn on\ndebug with -d"
fail "There was a problem starting service /federated/apps/nextcloud\nCheck the output of 'docker logs nextcloud' or turn on\ndebug with -d"
fi
((RETRY--))
sleep 7
@ -202,14 +202,14 @@ start_nextcloud() {
fi
# Move nextcloud.sh and set nextcloud.sh executable
mv fstack/nextcloud/data/nextcloud.sh fstack/nextcloud/data/var/www/html/
mv /federated/apps/nextcloud/data/nextcloud.sh apps/nextcloud/data/var/www/html/
docker exec -it nextcloud chown www-data:root /var/www/html/nextcloud.sh
docker exec -it nextcloud chmod 755 /var/www/html/nextcloud.sh
[ $? -ne 0 ] && fail "Couldn't chown nextcloud.sh in fstack/nextcloud container"
[ $? -ne 0 ] && fail "Couldn't chown nextcloud.sh in /federated/apps/nextcloud container"
# Run nextcloud.sh - Setup LDAP, configuration for nextcloud
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"
[ $? -ne 0 ] && fail "Couldn't run nextcloud.sh inside /federated/apps/nextcloud container"
kill -9 $SPINPID &> /dev/null
echo -ne "done."

View File

@ -5,19 +5,19 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_panel() {
echo -ne "\n* Configuring fstack/panel container.."
echo -ne "\n* Configuring /federated/apps/panel container.."
spin &
SPINPID=$!
if [ ! -d "fstack/panel" ]; then
mkdir -p fstack/panel
if [ ! -d "/federated/apps/panel" ]; then
mkdir -p /federated/apps/panel
fi
DOMAIN_ARRAY=(${DOMAIN//./ })
DOMAIN_FIRST=${DOMAIN_ARRAY[0]}
DOMAIN_LAST=${DOMAIN_ARRAY[1]}
cat > fstack/panel/ansible_hosts <<EOF
cat > /federated/apps/panel/ansible_hosts <<EOF
[servers]
nextcloud ansible_host=172.99.0.15
@ -26,9 +26,9 @@ ansible_python_interpreter=/usr/bin/python3
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
EOF
cp fstack/files/panel/new_user.php fstack/panel
cp /federated/apps/files/panel/new_user.php apps/panel
cat > fstack/panel/Dockerfile <<EOF
cat > /federated/apps/panel/Dockerfile <<EOF
FROM wheelybird/ldap-user-manager:latest
RUN apt update -y && apt-get install ssh -y \
@ -42,7 +42,7 @@ COPY ansible_hosts /etc/ansible/hosts
COPY new_user.php /opt/ldap_user_manager/account_manager/
EOF
cat > fstack/panel/docker-compose.yml <<EOF
cat > /federated/apps/panel/docker-compose.yml <<EOF
version: '3.7'
services:
@ -56,7 +56,7 @@ services:
context: .
dockerfile: Dockerfile
networks:
fstack:
federated:
ipv4_address: 172.99.0.12
environment:
- VIRTUAL_PROTO=http
@ -82,7 +82,7 @@ services:
- NO_HTTPS=true
networks:
fstack:
federated:
external: true
EOF
@ -91,17 +91,17 @@ echo -ne "done."
}
start_panel() {
# Start fstack/panel with output to /dev/null
echo -ne "\n* Starting fstack/panel service.."
# Start /federated/apps/panel with output to /dev/null
echo -ne "\n* Starting /federated/apps/panel service.."
spin &
SPINPID=$!
if [ $DEBUG ]; then
# Start fstack/panel with output to console for debug
docker-compose -f fstack/panel/docker-compose.yml -p panel up --build
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service fstack/panel"
# Start /federated/apps/panel with output to console for debug
docker-compose -f /federated/apps/panel/docker-compose.yml -p panel up --build
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service /federated/apps/panel"
else
docker-compose -f fstack/panel/docker-compose.yml -p panel up --build -d &> /dev/null
docker-compose -f /federated/apps/panel/docker-compose.yml -p panel up --build -d &> /dev/null
# Keep trying panel port 443 to make sure it's up
# before we proceed
@ -112,9 +112,9 @@ start_panel() {
break
else
if [ "$RETRY" == 1 ]; then
docker-compose -f fstack/panel/docker-compose.yml -p panel down &> /dev/null
docker-compose -f /federated/apps/panel/docker-compose.yml -p panel down &> /dev/null
kill -9 $SPINPID &> /dev/null
fail "There was a problem starting service fstack/panel\nCheck the output of 'docker logs panel' or turn on\ndebug with -d"
fail "There was a problem starting service /federated/apps/panel\nCheck the output of 'docker logs panel' or turn on\ndebug with -d"
fi
((RETRY--))
sleep 7

View File

@ -5,23 +5,23 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_postgresql() {
echo -ne "\n* Configuring fstack/postgresql container.."
echo -ne "\n* Configuring /federated/apps/postgresql container.."
spin &
SPINPID=$!
if [ ! -d "fstack/postgresql" ]; then
mkdir -p fstack/postgresql/data/var/lib/postgresql fstack/postgresql/data/docker-entrypoint-initdb.d
cp fstack/dns/data/etc/letsencrypt/archive/$DOMAIN/fullchain1.pem fstack/postgresql/data/var/lib/postgresql/server.crt
cp fstack/dns/data/etc/letsencrypt/archive/$DOMAIN/privkey1.pem fstack/postgresql/data/var/lib/postgresql/server.key
chown 999 fstack/postgresql/data/var/lib/postgresql/server.*
chmod 600 fstack/postgresql/data/var/lib/postgresql/server.*
if [ ! -d "/federated/apps/postgresql" ]; then
mkdir -p /federated/apps/postgresql/data/var/lib/postgresql apps/postgresql/data/docker-entrypoint-initdb.d
cp /federated/apps/dns/data/etc/letsencrypt/archive/$DOMAIN/fullchain1.pem apps/postgresql/data/var/lib/postgresql/server.crt
cp /federated/apps/dns/data/etc/letsencrypt/archive/$DOMAIN/privkey1.pem apps/postgresql/data/var/lib/postgresql/server.key
chown 999 /federated/apps/postgresql/data/var/lib/postgresql/server.*
chmod 600 /federated/apps/postgresql/data/var/lib/postgresql/server.*
fi
DOMAIN_ARRAY=(${DOMAIN//./ })
DOMAIN_FIRST=${DOMAIN_ARRAY[0]}
DOMAIN_LAST=${DOMAIN_ARRAY[1]}
cat > fstack/postgresql/docker-compose.yml <<EOF
cat > /federated/apps/postgresql/docker-compose.yml <<EOF
version: "3.7"
services:
@ -32,7 +32,7 @@ services:
domainname: $DOMAIN
restart: always
networks:
fstack:
federated:
ipv4_address: 172.99.0.40
volumes:
- ./data/var/lib/postgresql/server.crt:/var/lib/postgresql/server.crt
@ -55,12 +55,12 @@ services:
retries: 5
networks:
fstack:
federated:
external: true
EOF
# cat postgresql/data/docker-entrypoint-initdb.d/init.sql
cat > fstack/postgresql/data/docker-entrypoint-initdb.d/init.sql <<EOF
cat > /federated/apps/postgresql/data/docker-entrypoint-initdb.d/init.sql <<EOF
CREATE USER vaultwarden WITH PASSWORD '$ADMINPASS';
CREATE DATABASE vaultwarden;
GRANT ALL PRIVILEGES ON DATABASE vaultwarden TO vaultwarden;
@ -77,17 +77,17 @@ echo -ne "done."
}
start_postgresql() {
# Start fstack/postgresql with output to /dev/null
echo -ne "\n* Starting fstack/postgresql service.."
# Start /federated/apps/postgresql with output to /dev/null
echo -ne "\n* Starting /federated/apps/postgresql service.."
spin &
SPINPID=$!
if [ $DEBUG ]; then
# Start fstack/postgresql with output to console for debug
docker-compose -f fstack/postgresql/docker-compose.yml -p postgresql up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service fstack/postgresql"
# Start /federated/apps/postgresql with output to console for debug
docker-compose -f /federated/apps/postgresql/docker-compose.yml -p postgresql up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service /federated/apps/postgresql"
else
docker-compose -f fstack/postgresql/docker-compose.yml -p postgresql up -d &> /dev/null
docker-compose -f /federated/apps/postgresql/docker-compose.yml -p postgresql up -d &> /dev/null
# Keep trying postgresql port 5432 to make sure it's up
# before we proceed
@ -98,9 +98,9 @@ start_postgresql() {
break
else
if [ "$RETRY" == 1 ]; then
docker-compose -f fstack/postgresql/docker-compose.yml -p postgresql down &> /dev/null
docker-compose -f /federated/apps/postgresql/docker-compose.yml -p postgresql down &> /dev/null
kill -9 $SPINPID &> /dev/null
fail "There was a problem starting service fstack/postgresql\nCheck the output of 'docker logs postgresql' or turn on\ndebug with -d"
fail "There was a problem starting service /federated/apps/postgresql\nCheck the output of 'docker logs postgresql' or turn on\ndebug with -d"
fi
((RETRY--))
sleep 7

View File

@ -5,21 +5,21 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_proxy() {
echo -ne "\n* Configuring fstack/proxy container.."
echo -ne "\n* Configuring /federated/apps/proxy container.."
spin &
SPINPID=$!
if [ ! -d "fstack/proxy" ]; then
mkdir -p fstack/proxy/data/root/certs &> /dev/null
cp fstack/dns/data/etc/letsencrypt/archive/$DOMAIN/fullchain1.pem fstack/proxy/data/root/certs/$DOMAIN.crt
cp fstack/dns/data/etc/letsencrypt/archive/$DOMAIN/privkey1.pem fstack/proxy/data/root/certs/$DOMAIN.key
if [ ! -d "/federated/apps/proxy" ]; then
mkdir -p /federated/apps/proxy/data/root/certs &> /dev/null
cp /federated/apps/dns/data/etc/letsencrypt/archive/$DOMAIN/fullchain1.pem apps/proxy/data/root/certs/$DOMAIN.crt
cp /federated/apps/dns/data/etc/letsencrypt/archive/$DOMAIN/privkey1.pem apps/proxy/data/root/certs/$DOMAIN.key
fi
DOMAIN_ARRAY=(${DOMAIN//./ })
DOMAIN_FIRST=${DOMAIN_ARRAY[0]}
DOMAIN_LAST=${DOMAIN_ARRAY[1]}
cat > fstack/proxy/docker-compose.yml <<EOF
cat > /federated/apps/proxy/docker-compose.yml <<EOF
version: '3.7'
services:
@ -30,7 +30,7 @@ services:
domainname: $DOMAIN
restart: always
networks:
fstack:
federated:
ipv4_address: 172.99.0.16
ports:
- 80:80
@ -40,7 +40,7 @@ services:
- ./data/root/certs:/etc/nginx/certs
networks:
fstack:
federated:
external: true
EOF
@ -49,17 +49,17 @@ echo -ne "done."
}
start_proxy() {
# Start fstack/proxy with output to /dev/null
echo -ne "\n* Starting fstack/proxy service.."
# Start /federated/apps/proxy with output to /dev/null
echo -ne "\n* Starting /federated/apps/proxy service.."
spin &
SPINPID=$!
if [ $DEBUG ]; then
# Start fstack/proxy with output to console for debug
docker-compose -f fstack/proxy/docker-compose.yml -p proxy up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service fstack/proxy"
# Start /federated/apps/proxy with output to console for debug
docker-compose -f /federated/apps/proxy/docker-compose.yml -p proxy up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service /federated/apps/proxy"
else
docker-compose -f fstack/proxy/docker-compose.yml -p proxy up -d &> /dev/null
docker-compose -f /federated/apps/proxy/docker-compose.yml -p proxy up -d &> /dev/null
# Keep trying proxy port 443 to make sure it's up
# before we proceed
@ -70,9 +70,9 @@ start_proxy() {
break
else
if [ "$RETRY" == 1 ]; then
docker-compose -f fstack/proxy/docker-compose.yml -p proxy down &> /dev/null
docker-compose -f /federated/apps/proxy/docker-compose.yml -p proxy down &> /dev/null
kill -9 $SPINPID &> /dev/null
fail "There was a problem starting service fstack/proxy\nCheck the output of 'docker logs proxy' or turn on\ndebug with -d"
fail "There was a problem starting service /federated/apps/proxy\nCheck the output of 'docker logs proxy' or turn on\ndebug with -d"
fi
((RETRY--))
sleep 7

View File

@ -5,19 +5,19 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_vaultwarden() {
echo -ne "\n* Configuring fstack/vaultwarden container.."
echo -ne "\n* Configuring /federated/apps/vaultwarden container.."
spin &
SPINPID=$!
if [ ! -d "fstack/vaultwarden" ]; then
mkdir -p fstack/vaultwarden/data/data
if [ ! -d "/federated/apps/vaultwarden" ]; then
mkdir -p /federated/apps/vaultwarden/data/data
fi
DOMAIN_ARRAY=(${DOMAIN//./ })
DOMAIN_FIRST=${DOMAIN_ARRAY[0]}
DOMAIN_LAST=${DOMAIN_ARRAY[1]}
cat > fstack/vaultwarden/docker-compose.yml <<EOF
cat > /federated/apps/vaultwarden/docker-compose.yml <<EOF
version: '3.7'
services:
@ -28,7 +28,7 @@ services:
domainname: $DOMAIN
restart: always
networks:
fstack:
federated:
ipv4_address: 172.99.0.33
environment:
- VAULTWARDEN_DATABASE_URL=vaultwarden://vaultwarden:$ADMINPASS@vaultwarden.$DOMAIN/vaultwarden
@ -43,7 +43,7 @@ services:
- ./data/data:/data
networks:
fstack:
federated:
external: true
EOF
@ -52,17 +52,17 @@ echo -ne "done."
}
start_vaultwarden() {
# Start fstack/vaultwarden with output to /dev/null
echo -ne "\n* Starting fstack/vaultwarden service.."
# Start /federated/apps/vaultwarden with output to /dev/null
echo -ne "\n* Starting /federated/apps/vaultwarden service.."
spin &
SPINPID=$!
if [ $DEBUG ]; then
# Start fstack/vaultwarden with output to console for debug
docker-compose -f fstack/vaultwarden/docker-compose.yml -p vaultwarden up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service fstack/vaultwarden"
# Start /federated/apps/vaultwarden with output to console for debug
docker-compose -f /federated/apps/vaultwarden/docker-compose.yml -p vaultwarden up
[ $? -eq 0 ] && echo -ne "done.\n" || fail "There was a problem starting service /federated/apps/vaultwarden"
else
docker-compose -f fstack/vaultwarden/docker-compose.yml -p vaultwarden up -d &> /dev/null
docker-compose -f /federated/apps/vaultwarden/docker-compose.yml -p vaultwarden up -d &> /dev/null
# Keep trying vaultwarden port 80 to make sure it's up
# before we proceed
@ -73,9 +73,9 @@ start_vaultwarden() {
break
else
if [ "$RETRY" == 1 ]; then
docker-compose -f fstack/vaultwarden/docker-compose.yml -p vaultwarden down &> /dev/null
docker-compose -f /federated/apps/vaultwarden/docker-compose.yml -p vaultwarden down &> /dev/null
kill -9 $SPINPID &> /dev/null
fail "There was a problem starting service fstack/vaultwarden\nCheck the output of 'docker logs vaultwarden' or turn on\ndebug with -d"
fail "There was a problem starting service /federated/apps/vaultwarden\nCheck the output of 'docker logs vaultwarden' or turn on\ndebug with -d"
fi
((RETRY--))
sleep 7