Fixed gitea and caddy
This commit is contained in:
parent
39ff883347
commit
e782725111
@ -33,7 +33,6 @@ get_config() {
|
|||||||
. /federated/lib/panel.sh
|
. /federated/lib/panel.sh
|
||||||
. /federated/lib/proxy.sh
|
. /federated/lib/proxy.sh
|
||||||
. /federated/lib/wireguard.sh
|
. /federated/lib/wireguard.sh
|
||||||
. /federated/lib/connector.sh
|
|
||||||
. /federated/lib/baserow.sh
|
. /federated/lib/baserow.sh
|
||||||
. /federated/lib/calcom.sh
|
. /federated/lib/calcom.sh
|
||||||
. /federated/lib/gitea.sh
|
. /federated/lib/gitea.sh
|
||||||
@ -80,7 +79,7 @@ check_ports
|
|||||||
config_network
|
config_network
|
||||||
|
|
||||||
# Configure and start each federated service
|
# 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 gitea caddy; do
|
for i in dns postgresql ldap mail collabora proxy nextcloud matrix element listmonk vaultwarden panel wireguard jitsi baserow calcom gitea caddy; do
|
||||||
config_$i
|
config_$i
|
||||||
start_$i
|
start_$i
|
||||||
done
|
done
|
||||||
|
@ -189,6 +189,7 @@ vaultwarden IN A $EXTERNALIP
|
|||||||
vpn IN A $EXTERNALIP
|
vpn IN A $EXTERNALIP
|
||||||
connector IN A $EXTERNALIP
|
connector IN A $EXTERNALIP
|
||||||
baserow IN A $EXTERNALIP
|
baserow IN A $EXTERNALIP
|
||||||
|
gitea IN A $EXTERNALIP
|
||||||
calcom IN A $EXTERNALIP
|
calcom IN A $EXTERNALIP
|
||||||
blog IN A $EXTERNALIP
|
blog IN A $EXTERNALIP
|
||||||
documentation IN A $EXTERNALIP
|
documentation IN A $EXTERNALIP
|
||||||
|
@ -187,41 +187,43 @@ check_ports() {
|
|||||||
|
|
||||||
# Check if ss command exists
|
# Check if ss command exists
|
||||||
if command -v ss &> /dev/null; then
|
if command -v ss &> /dev/null; then
|
||||||
# Check every port we need if it's in use
|
# Check every port we need if it's in use (only if we have never run before)
|
||||||
for i in 25 53 80 143 389 587 993 8000; do
|
if [ $(ls /federated/apps | wc -l) -eq "0" ]; then
|
||||||
SS=`ss -tulwn | grep LISTEN | awk '{ print $5 }' | awk -F: '{ print $NF }' | grep "^$i$" | head -1`
|
for i in 25 53 80 143 389 587 993 8000; do
|
||||||
# If port 53 (dns) in use by system-resolvd (Ubuntu) then auto fix
|
SS=`ss -tulwn | grep LISTEN | awk '{ print $5 }' | awk -F: '{ print $NF }' | grep "^$i$" | head -1`
|
||||||
if [ "$SS" == 53 ]; then
|
# If port 53 (dns) in use by system-resolvd (Ubuntu) then auto fix
|
||||||
if [ $OSRELEASE == "Ubuntu" ]; then
|
if [ "$SS" == 53 ]; then
|
||||||
if [ `pgrep -x systemd-resolve` ]; then
|
if [ $OSRELEASE == "Ubuntu" ]; then
|
||||||
echo -ne "\n* Port 53 in use by systemd-resolved, fixing.."
|
if [ `pgrep -x systemd-resolve` ]; then
|
||||||
spin &
|
echo -ne "\n* Port 53 in use by systemd-resolved, fixing.."
|
||||||
SPINPID=$!
|
spin &
|
||||||
|
SPINPID=$!
|
||||||
|
|
||||||
# Install resolvconf to fix
|
# Install resolvconf to fix
|
||||||
sudo apt install resolvconf -y &> /dev/null
|
sudo apt install resolvconf -y &> /dev/null
|
||||||
[ $? -eq 0 ] && echo -ne "." || failcheck "Failed running sudo apt install resolvconf"
|
[ $? -eq 0 ] && echo -ne "." || failcheck "Failed running sudo apt install resolvconf"
|
||||||
|
|
||||||
# Shut down systemd-resolved
|
# Shut down systemd-resolved
|
||||||
systemctl stop systemd-resolved &> /dev/null
|
systemctl stop systemd-resolved &> /dev/null
|
||||||
[ $? -ne 0 ] && failcheck "Failed running systemctl stop systemd-resolved"
|
[ $? -ne 0 ] && failcheck "Failed running systemctl stop systemd-resolved"
|
||||||
systemctl disable systemd-resolved &> /dev/null
|
systemctl disable systemd-resolved &> /dev/null
|
||||||
[ $? -ne 0 ] && failcheck "Failed running systemctl stop systemd-resolved"
|
[ $? -ne 0 ] && failcheck "Failed running systemctl stop systemd-resolved"
|
||||||
|
|
||||||
# Put nameserver entries so will exist on reboot
|
# Put nameserver entries so will exist on reboot
|
||||||
echo "nameserver 8.8.8.8" > /etc/resolvconf/resolv.conf.d/tail
|
echo "nameserver 8.8.8.8" > /etc/resolvconf/resolv.conf.d/tail
|
||||||
echo "nameserver 8.8.8.8" > /run/resolvconf/resolv.conf
|
echo "nameserver 8.8.8.8" > /run/resolvconf/resolv.conf
|
||||||
|
|
||||||
kill -9 $SPINPID &> /dev/null
|
kill -9 $SPINPID &> /dev/null
|
||||||
echo -ne "done."
|
echo -ne "done."
|
||||||
else
|
else
|
||||||
echo -ne "\nFAILED - Port 53 (dns) is already in use\n\n" && exit 2
|
echo -ne "\nFAILED - Port 53 (dns) is already in use\n\n" && exit 2
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
elif [ "$SS" == "$i" ]; then
|
||||||
|
failcheck "FAILED - Port $i is already in use"
|
||||||
fi
|
fi
|
||||||
elif [ "$SS" == "$i" ]; then
|
done
|
||||||
failcheck "FAILED - Port $i is already in use"
|
fi
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
check_os() {
|
check_os() {
|
||||||
|
@ -83,10 +83,10 @@ GITEA_TOKEN_2=\`curl -H "Content-Type: application/json" -d '{"name":"gitea2","s
|
|||||||
# Create the repository and webhooks
|
# Create the repository and webhooks
|
||||||
for i in www blog documentation; do
|
for i in www blog documentation; do
|
||||||
# Create the repository
|
# Create the repository
|
||||||
curl -k -X POST http://gitea.$DOMAIN:3000/api/v1/user/repos -H "content-type: application/json" -H "Authorization: token \$GITEA_TOKEN_2" --data '{"name":"$i.$DOMAIN","auto_init":true,"default_branch":"master"}'
|
curl -k -X POST http://gitea.$DOMAIN:3000/api/v1/user/repos -H "content-type: application/json" -H "Authorization: token \$GITEA_TOKEN_2" --data "{\"name\":\"\$i.$DOMAIN\",\"auto_init\":true,\"default_branch\":\"master\"}"
|
||||||
# Create the webhook
|
# Create the webhook
|
||||||
curl -X 'POST' \
|
curl -X 'POST' \
|
||||||
'http://gitea.$DOMAIN:3000/api/v1/repos/gitea/$i.$DOMAIN/hooks' \
|
"http://gitea.$DOMAIN:3000/api/v1/repos/gitea/\$i.$DOMAIN/hooks" \
|
||||||
-H 'accept: application/json' \
|
-H 'accept: application/json' \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
-H "Authorization: token \$GITEA_TOKEN_2" \
|
-H "Authorization: token \$GITEA_TOKEN_2" \
|
||||||
|
@ -39,7 +39,7 @@ networks:
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > /federated/apps/panel/.env <<EOF
|
cat > /federated/apps/panel/.env <<EOF
|
||||||
IMAGE_VERSION="1.10"
|
IMAGE_VERSION="v1.10"
|
||||||
VIRTUAL_PROTO=http
|
VIRTUAL_PROTO=http
|
||||||
VIRTUAL_PORT=80
|
VIRTUAL_PORT=80
|
||||||
VIRTUAL_HOST=panel.$DOMAIN
|
VIRTUAL_HOST=panel.$DOMAIN
|
||||||
|
Loading…
x
Reference in New Issue
Block a user