From a0a9496aef2d0ac07184f60137b5486860624c94 Mon Sep 17 00:00:00 2001 From: Sharad Ahlawat Date: Thu, 6 May 2021 15:19:21 -0700 Subject: [PATCH] . --- configs/etc/hosts | 2 +- configs/etc/rc.conf | 2 +- jails/config/git/gitea-restart.sh | 20 ++++++++++++++++++++ jails/config/proxy/haproxy.conf | 3 ++- jails/config/vpngw/ipfw.rules | 2 +- sync-config.sh | 4 ++-- sync-pxe.sh | 4 ++-- 7 files changed, 29 insertions(+), 8 deletions(-) create mode 100755 jails/config/git/gitea-restart.sh diff --git a/configs/etc/hosts b/configs/etc/hosts index 9516bed..6f9b15f 100644 --- a/configs/etc/hosts +++ b/configs/etc/hosts @@ -24,7 +24,7 @@ fd09::10 nas nas.ahlawat.com 192.168.10.10 nas nas.ahlawat.com fd0a::10 nas nas.ahlawat.com 192.168.48.10 nas nas.ahlawat.com -2001:470:f835::10 nas nas.ahlawat.com +2001:470:82a9::10 nas nas.ahlawat.com # # Imaginary network. 10.0.0.2 myname.my.domain myname 10.0.0.3 myfriend.my.domain myfriend diff --git a/configs/etc/rc.conf b/configs/etc/rc.conf index eae48ac..5486ea6 100644 --- a/configs/etc/rc.conf +++ b/configs/etc/rc.conf @@ -54,7 +54,7 @@ ifconfig_lagg0_9_ipv6="inet6 fd09::10/64 auto_linklocal accept_rtadv" ifconfig_lagg0_10="inet 192.168.10.10/24" ifconfig_lagg0_10_ipv6="inet6 fd0a::10/64 auto_linklocal accept_rtadv" ifconfig_lagg0_48="inet 192.168.48.10/24" -ifconfig_lagg0_48_ipv6="inet6 2001:470:f835::10/64 auto_linklocal accept_rtadv" +ifconfig_lagg0_48_ipv6="inet6 2001:470:82a9::10/64 auto_linklocal accept_rtadv" ifconfig_bridge1="addm lagg0.1 up" ifconfig_bridge2="addm lagg0.2 up" diff --git a/jails/config/git/gitea-restart.sh b/jails/config/git/gitea-restart.sh new file mode 100755 index 0000000..d477970 --- /dev/null +++ b/jails/config/git/gitea-restart.sh @@ -0,0 +1,20 @@ +#!/usr/local/bin/bash + +# Copyright (c) 2018-2021, diyIT.org +# All rights reserved. +# +# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License") +# https://diyit.org/license/ +# +# + +Q=`netstat -LAan | grep 3000 | cut -f3 -d" " | cut -f1 -d/` +# Q is null if gitea service is not running + +if [ ! "$Q" ] || [ $Q -ne 0 ]; then + echo "restarting gitea stuck at $Q" + tail /var/log/gitea/gitea.log + kill -9 `pgrep gitea` ; sleep 2 ; service gitea start +fi + +# crontab - 5 * * * * /mnt/config/gitea-restart.sh diff --git a/jails/config/proxy/haproxy.conf b/jails/config/proxy/haproxy.conf index 0f29fea..af0df79 100644 --- a/jails/config/proxy/haproxy.conf +++ b/jails/config/proxy/haproxy.conf @@ -188,7 +188,8 @@ backend bk_ahlawat-cloud http-response add-header X-Frame-Options: SAMEORIGIN backend bk_ahlawat-git - server srv1 gitx.ahlawat.com:3000 check ssl ca-file /mnt/certs/cacert.pem alpn h2 + timeout queue 8s + server srv1 gitx.ahlawat.com:3000 check ssl maxconn 32 ca-file /mnt/certs/cacert.pem alpn h2 server srv2 web.ahlawat.com:443 backup check ssl ca-file /mnt/certs/cacert.pem alpn h2 http-response set-header X-Frame-Options "ALLOW-FROM *.diyit.org" # http-response add-header X-Frame-Options: SAMEORIGIN diff --git a/jails/config/vpngw/ipfw.rules b/jails/config/vpngw/ipfw.rules index 9d1282c..e5b8f6e 100755 --- a/jails/config/vpngw/ipfw.rules +++ b/jails/config/vpngw/ipfw.rules @@ -18,7 +18,7 @@ # Set rules command prefix cmd="ipfw -q add" lif="epair0b" # interface name of VNET attached to Local network -rif="tun1" # interface name of Tunnel attached to Remote network +rif="tun0" # interface name of Tunnel attached to Remote network skip="skipto 12000" # Flush out the list before we begin. diff --git a/sync-config.sh b/sync-config.sh index 8794630..ac5ef4c 100755 --- a/sync-config.sh +++ b/sync-config.sh @@ -9,13 +9,13 @@ # diff -ru / configs | grep -v "Only in /" | grep "Only in" | sed 's/Only in // ; s/: /\//' | xargs -n1 echo WILL DELETE -read -p "(y/N)? " RESP +read -p "Delete (y/N)? " RESP if [ ! -z $RESP ] && [ $RESP == "y" ]; then diff -ru / configs | grep -v "Only in /" | grep "Only in" | sed 's/Only in // ; s/: /\//' | xargs -n1 rm fi diff -ru / configs | grep -v "Only in /" | grep "diff -ru" | sed 's/diff -ru//' | xargs -n2 echo WILL COPY -read -p "(y/N)? " RESP +read -p "Copy (y/N)? " RESP if [ ! -z $RESP ] && [ $RESP == "y" ]; then diff -ru / configs | grep -v "Only in /" | grep "diff -ru" | sed 's/diff -ru//' | xargs -n2 cp fi diff --git a/sync-pxe.sh b/sync-pxe.sh index 9d2a72a..fdb0095 100755 --- a/sync-pxe.sh +++ b/sync-pxe.sh @@ -9,13 +9,13 @@ # diff -ru /mnt/ship/pxe pxe | grep -v "Only in /" | grep "Only in" | sed 's/Only in // ; s/: /\//' | xargs -n1 echo WILL DELETE -read -p "(y/N)? " RESP +read -p "Delete (y/N)? " RESP if [ ! -z $RESP ] && [ $RESP == "y" ]; then diff -ru /mnt/ship/pxe pxe | grep -v "Only in /" | grep "Only in" | sed 's/Only in // ; s/: /\//' | xargs -n1 rm fi diff -ru /mnt/ship/pxe pxe | grep -v "Only in /" | grep "diff -ru" | sed 's/diff -ru//' | xargs -n2 echo WILL COPY -read -p "(y/N)? " RESP +read -p "Copy (y/N)? " RESP if [ ! -z $RESP ] && [ $RESP == "y" ]; then diff -ru /mnt/ship/pxe pxe | grep -v "Only in /" | grep "diff -ru" | sed 's/diff -ru//' | xargs -n2 cp fi