summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoratanarjuat <atanarjuat@example.com>2022-07-31 01:47:34 -0400
committeratanarjuat <atanarjuat@example.com>2022-07-31 02:39:41 -0400
commit8bef66da80dca4ad085122948471b9c1b1be0ac6 (patch)
tree7d4cc6e2f5c16cff193ff550d1a4a8a6aa9d8f6b
parentdaad04f571c8f60500a38a98c87da262baa0361a (diff)
obfs4 ver check
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--Makefile2
-rwxr-xr-xscripts/check-go-modules.sh15
-rwxr-xr-xscripts/check-obfs4-ver.sh14
-rw-r--r--scripts/obfs4-version1
5 files changed, 17 insertions, 17 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e525eb0..9d54c04 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,7 +19,7 @@ validate:
image: golang:alpine
stage: test
script: |
- apk add build-base git
+ apk add build-base git jq curl
go version
go env
diff --git a/Makefile b/Makefile
index 456548c..70320e9 100644
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,7 @@ test:
go test ./...
check-yawning-obfs4:
- ./scripts/check-go-modules.sh
+ ./scripts/check-obfs4-ver.sh
obfsvpn-server-container:
docker build -t ${OBFSVPN_IMAGE_NAME}:${TAG} -f images/obfsvpn/Dockerfile \
diff --git a/scripts/check-go-modules.sh b/scripts/check-go-modules.sh
deleted file mode 100755
index fa4b21c..0000000
--- a/scripts/check-go-modules.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-go get -u gitlab.com/yawning/obfs4.git &> /dev/null
-git --no-pager diff -U0 go.mod | grep -Fq "gitlab.com/yawning/obfs4.git"
-
-case "$?" in
- "0")
- echo "New version of upstream yawning/obfs4 available!!"
- exit 2
- ;;
- *)
- exit 0
- ;;
-esac
-
diff --git a/scripts/check-obfs4-ver.sh b/scripts/check-obfs4-ver.sh
new file mode 100755
index 0000000..cecb7e0
--- /dev/null
+++ b/scripts/check-obfs4-ver.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+# check yawning's HEAD
+available=$(curl -s https://gitlab.com/api/v4/projects/10387781/repository/tags/ | jq ".[0]".name | cut -d "-" -f 2 | cut -d "\"" -f 1)
+current=$(cat scripts/obfs4-version)
+
+echo "current:" $current
+echo "available:" $available
+
+if [ "$available" = "$current" ]; then
+ exit 0
+else
+ echo "New version of upstream yawning/obfs4 available, should update deps."
+ exit 2
+fi;
diff --git a/scripts/obfs4-version b/scripts/obfs4-version
new file mode 100644
index 0000000..43b2961
--- /dev/null
+++ b/scripts/obfs4-version
@@ -0,0 +1 @@
+0.0.13