diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b243d42..7e9c64e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,3 +69,4 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Auto update debian changelog + file_pattern: "debian/changelog" diff --git a/debian/bin/build_go_server.sh b/debian/bin/build_go_server.sh new file mode 100644 index 0000000..a1e4da0 --- /dev/null +++ b/debian/bin/build_go_server.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +cd usr/share/aws-vpn/ + +echo -e "\n\033[1;34mBuilding go_server\033[m\n" + +go mod init go_server +go build +rm go_server.go + +echo -e "\n\033[1;34mBuilding go_server done\033[m\n" + +exit 0 diff --git a/debian/manpages/aws-vpn.1 b/debian/manpages/aws-vpn.1 index b76e1c6..3f9b705 100644 --- a/debian/manpages/aws-vpn.1 +++ b/debian/manpages/aws-vpn.1 @@ -13,7 +13,7 @@ It starts an http server and open a browser to get the SAML response, then use i \-h, \-\-help Print this help text and exit .TP -\-k, \-\-Kill +\-k, \-\-kill Kill the VPN process .TP \-r, \-\-restart diff --git a/debian/rules b/debian/rules index 02faadf..4ef7e59 100755 --- a/debian/rules +++ b/debian/rules @@ -5,6 +5,7 @@ override_dh_auto_build: bash debian/bin/build_openvpn.sh 2.6.10 + bash debian/bin/build_go_server.sh override_dh_strip: dh_strip --no-automatic-dbgsym diff --git a/usr/bin/aws-vpn b/usr/bin/aws-vpn index 9fe4304..1e829ca 100755 --- a/usr/bin/aws-vpn +++ b/usr/bin/aws-vpn @@ -9,7 +9,7 @@ OVPN_BIN="/usr/share/aws-vpn/openvpn" # Path to the configuration file OVPN_CONF="/etc/aws-vpn.conf" # Path to the http server -SERVER_BIN="/usr/share/aws-vpn/server.go" +SERVER_BIN="/usr/share/aws-vpn/go_server" # Find the PID of the last VPN process if there is any OVPN_PID=$(ps aux | grep $OVPN_BIN | grep -v grep | awk '{print $2}') @@ -123,7 +123,7 @@ OVPN_OUT=$($OVPN_BIN --config "${OVPN_CONF}" --verb 3 \ echo "Opening browser and wait for the response file..." >&3 URL=$(echo "$OVPN_OUT" | grep -Eo 'https://.+') -go run $SERVER_BIN & +$SERVER_BIN & unameOut="$(uname -s)" case "${unameOut}" in diff --git a/usr/share/aws-vpn/server.go b/usr/share/aws-vpn/go_server.go similarity index 100% rename from usr/share/aws-vpn/server.go rename to usr/share/aws-vpn/go_server.go