Skip to content

Commit

Permalink
Merge pull request #5 from botify-labs/compile-server.go
Browse files Browse the repository at this point in the history
Compile server.go
  • Loading branch information
FlavienMontois authored Jun 18, 2024
2 parents ffa0ed6 + cf407ed commit 10a3de8
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto update debian changelog
file_pattern: "debian/changelog"
13 changes: 13 additions & 0 deletions debian/bin/build_go_server.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion debian/manpages/aws-vpn.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions usr/bin/aws-vpn
Original file line number Diff line number Diff line change
Expand Up @@ -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}')

Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.

0 comments on commit 10a3de8

Please sign in to comment.