Compare commits
No commits in common. "0fe30b0479b194dc9a80900a6dfac0613a84ea22" and "3c7273eb62106374585227623b78c8aea0c676ea" have entirely different histories.
0fe30b0479
...
3c7273eb62
50
.github/workflows/test_set_1.yml
vendored
50
.github/workflows/test_set_1.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
|||||||
if: github.repository_owner == 'hwdsl2'
|
if: github.repository_owner == 'hwdsl2'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os_version: ["centos:9s", "centos:8s", "centos:7", "rockylinux:9", "rockylinux:8", "almalinux:9", "almalinux:8", "amazonlinux:2", "oraclelinux:9", "oraclelinux:8", "oraclelinux:7"]
|
os_version: ["centos:8s", "centos:7", "rockylinux:8", "almalinux:8", "amazonlinux:2", "oraclelinux:8", "oraclelinux:7"]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
env:
|
env:
|
||||||
OS_VERSION: ${{ matrix.os_version }}
|
OS_VERSION: ${{ matrix.os_version }}
|
||||||
@ -51,7 +51,7 @@ jobs:
|
|||||||
}
|
}
|
||||||
|
|
||||||
restart_ipsec() {
|
restart_ipsec() {
|
||||||
if grep -qs -E 'release (8|9)' /etc/oracle-release; then
|
if grep -qs 'release 8' /etc/oracle-release; then
|
||||||
sleep 3
|
sleep 3
|
||||||
fi
|
fi
|
||||||
if ! command -v amazon-linux-extras; then
|
if ! command -v amazon-linux-extras; then
|
||||||
@ -85,43 +85,31 @@ jobs:
|
|||||||
cd /opt/src
|
cd /opt/src
|
||||||
yum -y -q update
|
yum -y -q update
|
||||||
yum -y -q install wget rsyslog
|
yum -y -q install wget rsyslog
|
||||||
if grep -qs 'release 9' /etc/redhat-release; then
|
|
||||||
if grep -qi rocky /etc/redhat-release \
|
|
||||||
|| grep -qi alma /etc/redhat-release; then
|
|
||||||
yum -y -q install diffutils
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
systemctl start rsyslog
|
systemctl start rsyslog
|
||||||
|
|
||||||
cp -f /opt/src/scripts/vpnsetup.sh .
|
cp -f /opt/src/scripts/vpnsetup.sh .
|
||||||
|
cp -f /opt/src/scripts/extras/quickstart.sh .
|
||||||
cp -f /opt/src/scripts/extras/vpnuninstall.sh ./vpnunst.sh
|
cp -f /opt/src/scripts/extras/vpnuninstall.sh ./vpnunst.sh
|
||||||
sed -i -e '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpn.sh"' \
|
sed -i -e '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpn.sh"' \
|
||||||
-e '/curl /a sed -i \x27/status=0/a sed -i "/swan_ver_latest=/s/^/#/" /opt/src/ikev2.sh\x27 "$tmpdir/vpn.sh"' \
|
-e '/curl /a sed -i \x27/status=0/a sed -i "/swan_ver_latest=/s/^/#/" /opt/src/ikev2.sh\x27 "$tmpdir/vpn.sh"' \
|
||||||
vpnsetup.sh
|
vpnsetup.sh quickstart.sh
|
||||||
|
|
||||||
sh vpnsetup.sh
|
for vpnsc in vpnsetup.sh quickstart.sh; do
|
||||||
|
sh "$vpnsc"
|
||||||
|
|
||||||
systemctl restart xl2tpd
|
systemctl restart xl2tpd
|
||||||
restart_ipsec
|
restart_ipsec
|
||||||
if ! grep -qs 'release 9' /etc/oracle-release; then
|
|
||||||
restart_fail2ban
|
restart_fail2ban
|
||||||
cat /var/log/fail2ban.log
|
cat /var/log/fail2ban.log
|
||||||
fi
|
|
||||||
|
|
||||||
netstat -anpu | grep pluto
|
netstat -anpu | grep pluto
|
||||||
netstat -anpu | grep xl2tpd
|
netstat -anpu | grep xl2tpd
|
||||||
if grep -qs 'release 9' /etc/redhat-release; then
|
|
||||||
nft list ruleset
|
|
||||||
nft list ruleset | grep -q '192\.168\.42\.0/24'
|
|
||||||
nft list ruleset | grep -q '192\.168\.43\.0/24'
|
|
||||||
else
|
|
||||||
iptables -nvL
|
iptables -nvL
|
||||||
iptables -nvL | grep -q 'ppp+'
|
iptables -nvL | grep -q 'ppp+'
|
||||||
iptables -nvL | grep -q '192\.168\.43\.0/24'
|
iptables -nvL | grep -q '192\.168\.43\.0/24'
|
||||||
iptables -nvL -t nat
|
iptables -nvL -t nat
|
||||||
iptables -nvL -t nat | grep -q '192\.168\.42\.0/24'
|
iptables -nvL -t nat | grep -q '192\.168\.42\.0/24'
|
||||||
iptables -nvL -t nat | grep -q '192\.168\.43\.0/24'
|
iptables -nvL -t nat | grep -q '192\.168\.43\.0/24'
|
||||||
fi
|
|
||||||
grep pluto "$log1"
|
grep pluto "$log1"
|
||||||
grep xl2tpd "$log2"
|
grep xl2tpd "$log2"
|
||||||
ipsec status
|
ipsec status
|
||||||
@ -145,15 +133,10 @@ jobs:
|
|||||||
ANSWERS
|
ANSWERS
|
||||||
rm -f /etc/ipsec.d/vpnclient*
|
rm -f /etc/ipsec.d/vpnclient*
|
||||||
if grep -qi stream /etc/redhat-release \
|
if grep -qi stream /etc/redhat-release \
|
||||||
|| grep -qs -E 'release (8|9)' /etc/oracle-release; then
|
|| grep -qs 'release 8' /etc/oracle-release; then
|
||||||
mkdir /etc/xl2tpd
|
mkdir /etc/xl2tpd
|
||||||
fi
|
fi
|
||||||
if grep -qs 'release 9' /etc/redhat-release; then
|
done
|
||||||
if grep -qi rocky /etc/redhat-release \
|
|
||||||
|| grep -qi alma /etc/redhat-release; then
|
|
||||||
mkdir /etc/xl2tpd
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$1" != "amazon" ]; then
|
if [ "$1" != "amazon" ]; then
|
||||||
cp -f /opt/src/scripts/vpnsetup_centos.sh ./vpnsetup.sh
|
cp -f /opt/src/scripts/vpnsetup_centos.sh ./vpnsetup.sh
|
||||||
@ -178,18 +161,12 @@ jobs:
|
|||||||
|
|
||||||
netstat -anpu | grep pluto
|
netstat -anpu | grep pluto
|
||||||
netstat -anpu | grep xl2tpd
|
netstat -anpu | grep xl2tpd
|
||||||
if grep -qs 'release 9' /etc/redhat-release; then
|
|
||||||
nft list ruleset
|
|
||||||
nft list ruleset | grep -q '192\.168\.42\.0/24'
|
|
||||||
nft list ruleset | grep -q '192\.168\.43\.0/24'
|
|
||||||
else
|
|
||||||
iptables -nvL
|
iptables -nvL
|
||||||
iptables -nvL | grep -q 'ppp+'
|
iptables -nvL | grep -q 'ppp+'
|
||||||
iptables -nvL | grep -q '192\.168\.43\.0/24'
|
iptables -nvL | grep -q '192\.168\.43\.0/24'
|
||||||
iptables -nvL -t nat
|
iptables -nvL -t nat
|
||||||
iptables -nvL -t nat | grep -q '192\.168\.42\.0/24'
|
iptables -nvL -t nat | grep -q '192\.168\.42\.0/24'
|
||||||
iptables -nvL -t nat | grep -q '192\.168\.43\.0/24'
|
iptables -nvL -t nat | grep -q '192\.168\.43\.0/24'
|
||||||
fi
|
|
||||||
ipsec status
|
ipsec status
|
||||||
ipsec status | grep -q l2tp-psk
|
ipsec status | grep -q l2tp-psk
|
||||||
ipsec status | grep -q xauth-psk
|
ipsec status | grep -q xauth-psk
|
||||||
@ -535,9 +512,7 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ "$OS_VERSION" = "centos:9s" ]; then
|
if [ "$OS_VERSION" = "centos:8s" ]; then
|
||||||
echo "FROM quay.io/centos/centos:stream9" > Dockerfile
|
|
||||||
elif [ "$OS_VERSION" = "centos:8s" ]; then
|
|
||||||
echo "FROM quay.io/centos/centos:stream8" > Dockerfile
|
echo "FROM quay.io/centos/centos:stream8" > Dockerfile
|
||||||
else
|
else
|
||||||
echo "FROM $OS_VERSION" > Dockerfile
|
echo "FROM $OS_VERSION" > Dockerfile
|
||||||
@ -549,13 +524,6 @@ jobs:
|
|||||||
WORKDIR /opt/src
|
WORKDIR /opt/src
|
||||||
|
|
||||||
RUN if command -v amazon-linux-extras; then amazon-linux-extras install -y kernel-ng; fi
|
RUN if command -v amazon-linux-extras; then amazon-linux-extras install -y kernel-ng; fi
|
||||||
EOF
|
|
||||||
|
|
||||||
if [ "$OS_VERSION" = "centos:9s" ]; then
|
|
||||||
echo "RUN yum -y -q install systemd" >> Dockerfile
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat >> Dockerfile <<'EOF'
|
|
||||||
|
|
||||||
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ "$i" = \
|
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ "$i" = \
|
||||||
systemd-tmpfiles-setup.service ] || rm -f "$i"; done); \
|
systemd-tmpfiles-setup.service ] || rm -f "$i"; done); \
|
||||||
|
9
.github/workflows/test_set_2.yml
vendored
9
.github/workflows/test_set_2.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
|||||||
if: github.repository_owner == 'hwdsl2'
|
if: github.repository_owner == 'hwdsl2'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os_version: ["ubuntu:22.04", "ubuntu:20.04", "ubuntu:18.04", "debian:11", "debian:10", "alpine:3.15", "alpine:3.16"]
|
os_version: ["ubuntu:22.04", "ubuntu:20.04", "ubuntu:18.04", "debian:11", "debian:10", "debian:9", "alpine:3.15", "alpine:3.16"]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.os_version }}
|
image: ${{ matrix.os_version }}
|
||||||
@ -92,12 +92,14 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cp -f "$GITHUB_WORKSPACE"/vpnsetup.sh .
|
cp -f "$GITHUB_WORKSPACE"/vpnsetup.sh .
|
||||||
|
cp -f "$GITHUB_WORKSPACE"/extras/quickstart.sh .
|
||||||
cp -f "$GITHUB_WORKSPACE"/extras/vpnuninstall.sh ./vpnunst.sh
|
cp -f "$GITHUB_WORKSPACE"/extras/vpnuninstall.sh ./vpnunst.sh
|
||||||
sed -i -e '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpn.sh"' \
|
sed -i -e '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpn.sh"' \
|
||||||
-e '/curl /a sed -i \x27/status=0/a sed -i "/swan_ver_latest=/s/^/#/" /opt/src/ikev2.sh\x27 "$tmpdir/vpn.sh"' \
|
-e '/curl /a sed -i \x27/status=0/a sed -i "/swan_ver_latest=/s/^/#/" /opt/src/ikev2.sh\x27 "$tmpdir/vpn.sh"' \
|
||||||
vpnsetup.sh
|
vpnsetup.sh quickstart.sh
|
||||||
|
|
||||||
sh vpnsetup.sh
|
for vpnsc in vpnsetup.sh quickstart.sh; do
|
||||||
|
sh "$vpnsc"
|
||||||
|
|
||||||
if [ "$os_type" = "alpine" ]; then
|
if [ "$os_type" = "alpine" ]; then
|
||||||
xl2tpd -c /etc/xl2tpd/xl2tpd.conf
|
xl2tpd -c /etc/xl2tpd/xl2tpd.conf
|
||||||
@ -142,6 +144,7 @@ jobs:
|
|||||||
killall pluto || true
|
killall pluto || true
|
||||||
killall xl2tpd || true
|
killall xl2tpd || true
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
if [ "$os_type" = "alpine" ]; then
|
if [ "$os_type" = "alpine" ]; then
|
||||||
cp -f "$GITHUB_WORKSPACE"/vpnsetup_alpine.sh ./vpnsetup.sh
|
cp -f "$GITHUB_WORKSPACE"/vpnsetup_alpine.sh ./vpnsetup.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user