Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
chore: use Psiphon-Labs/[email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed May 19, 2022
1 parent 7a0d17e commit 9c044eb
Show file tree
Hide file tree
Showing 17 changed files with 103 additions and 158 deletions.
2 changes: 1 addition & 1 deletion tunnel-core/.github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: [ "ubuntu" ]
go: [ "1.17.8" ]
go: [ "1.17.9" ]
test-type: [ "detector", "coverage", "memory" ]

runs-on: ${{ matrix.os }}-latest
Expand Down
2 changes: 1 addition & 1 deletion tunnel-core/ClientLibrary/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \

# Install Go.
# NOTE: Go 1.10+ is required to build c-shared for windows (https://github.com/golang/go/commit/bb0bfd002ada7e3eb9198d4287b32c2fed6e8da6)
ENV GOVERSION=go1.17.8 GOROOT=/usr/local/go GOPATH=/go PATH=$PATH:/usr/local/go/bin:/go/bin CGO_ENABLED=1
ENV GOVERSION=go1.17.9 GOROOT=/usr/local/go GOPATH=/go PATH=$PATH:/usr/local/go/bin:/go/bin CGO_ENABLED=1

RUN curl -L https://storage.googleapis.com/golang/$GOVERSION.linux-amd64.tar.gz -o /tmp/go.tar.gz \
&& tar -C /usr/local -xzf /tmp/go.tar.gz \
Expand Down
4 changes: 2 additions & 2 deletions tunnel-core/ClientLibrary/build-darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ if [ -z ${2+x} ]; then BUILD_TAGS=""; else BUILD_TAGS="$2"; fi
# Note:
# clangwrap.sh needs to be updated when the Go version changes.
# The last version was:
# https://github.com/golang/go/blob/go1.17.8/misc/ios/clangwrap.sh
# https://github.com/golang/go/blob/go1.17.9/misc/ios/clangwrap.sh
# - with a patch to lower -mios-version-min to 7.0
GO_VERSION_REQUIRED="1.17.8"
GO_VERSION_REQUIRED="1.17.9"

# At this time, we don't support modules
export GO111MODULE=off
Expand Down
2 changes: 1 addition & 1 deletion tunnel-core/ConsoleClient/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

# Install Go.
ENV GOVERSION=go1.17.8 GOROOT=/usr/local/go GOPATH=/go PATH=$PATH:/usr/local/go/bin:/go/bin CGO_ENABLED=1
ENV GOVERSION=go1.17.9 GOROOT=/usr/local/go GOPATH=/go PATH=$PATH:/usr/local/go/bin:/go/bin CGO_ENABLED=1

RUN curl -L https://storage.googleapis.com/golang/$GOVERSION.linux-amd64.tar.gz -o /tmp/go.tar.gz \
&& tar -C /usr/local -xzf /tmp/go.tar.gz \
Expand Down
2 changes: 1 addition & 1 deletion tunnel-core/MobileLibrary/Android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

# Install Go.
ENV GOVERSION=go1.17.8 GOROOT=/usr/local/go GOPATH=/go PATH=$PATH:/usr/local/go/bin:/go/bin CGO_ENABLED=1
ENV GOVERSION=go1.17.9 GOROOT=/usr/local/go GOPATH=/go PATH=$PATH:/usr/local/go/bin:/go/bin CGO_ENABLED=1

RUN curl -L https://storage.googleapis.com/golang/$GOVERSION.linux-amd64.tar.gz -o /tmp/go.tar.gz \
&& tar -C /usr/local -xzf /tmp/go.tar.gz \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ public interface HostFeedbackHandler {
default public void sendFeedbackCompleted(java.lang.Exception e) {}
}

public interface HostService extends HostLogger {
public interface HostLibraryLoader {
default public void loadLibrary(String library) {
System.loadLibrary(library);
}
}

public interface HostService extends HostLogger, HostLibraryLoader {

public String getAppName();
public Context getContext();
Expand Down Expand Up @@ -158,7 +164,7 @@ private static PsiphonTunnel newPsiphonTunnelImpl(HostService hostService, boole
mPsiphonTunnel.stop();
}
// Load the native go code embedded in psi.aar
System.loadLibrary("gojni");
hostService.loadLibrary("gojni");
mPsiphonTunnel = new PsiphonTunnel(hostService, shouldRouteThroughTunnelAutomatically);
return mPsiphonTunnel;
}
Expand Down Expand Up @@ -227,7 +233,7 @@ public synchronized boolean startRouting() throws Exception {
// Load tun2socks library embedded in the aar
// If this method is called more than once with the same library name, the second and subsequent calls are ignored.
// http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#loadLibrary%28java.lang.String%29
System.loadLibrary("tun2socks");
mHostService.loadLibrary("tun2socks");
return startVpn();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 29
compileSdkVersion 30
useLibrary 'org.apache.http.legacy'


defaultConfig {
applicationId "ca.psiphon.tunneledwebview"
minSdkVersion 15
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Expand All @@ -25,16 +25,12 @@ android {
}

repositories {
flatDir {
dirs 'libs'
}
maven {
url "https://raw.github.com/Psiphon-Labs/psiphon-tunnel-core-Android-library/master"
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'androidx.appcompat:appcompat:1.0.0'
// always specify exact library version in your real project to avoid non-deterministic builds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private void loadWebView() {
public void run() {
WebViewProxySettings.setLocalProxy(
MainActivity.this, mLocalHttpProxyPort.get());
mWebView.loadUrl("https://freegeoip.app/");
mWebView.loadUrl("https://psip.me/");
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.android.tools.build:gradle:7.1.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
2 changes: 1 addition & 1 deletion tunnel-core/MobileLibrary/Android/make.bash
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fi

cd -
cd build-tmp/psi
echo -e "-keep class psi.** { *; }\n" >> proguard.txt
echo -e "-keep class psi.** { *; }\n-keep class ca.psiphon.** { *; }\n" >> proguard.txt
rm -f ../../ca.psiphon.aar
zip -r ../../ca.psiphon.aar ./
cd -
Expand Down
2 changes: 1 addition & 1 deletion tunnel-core/MobileLibrary/iOS/build-psiphon-framework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e -u -x
if [ -z ${1+x} ]; then BUILD_TAGS=""; else BUILD_TAGS="$1"; fi

# Modify this value as we use newer Go versions.
GO_VERSION_REQUIRED="1.17.8"
GO_VERSION_REQUIRED="1.17.9"

# At this time, gomobile doesn't support modules
export GO111MODULE=off
Expand Down
2 changes: 1 addition & 1 deletion tunnel-core/Server/Dockerfile-binary-builder
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:3.10.2

ENV GOLANG_VERSION 1.17.8
ENV GOLANG_VERSION 1.17.9
ENV GOLANG_SRC_URL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz

RUN set -ex \
Expand Down
2 changes: 1 addition & 1 deletion tunnel-core/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.0.21-24-g09b2c29c
v2.0.23
9 changes: 9 additions & 0 deletions tunnel-core/contributors/pfarcasanu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
2022-04-12

I hereby agree to the terms of the "Psiphon Individual Contributor License Agreement", with MD5 checksum 83d54c85a43e0c0f416758779ea6740a.

I furthermore declare that I am authorized and able to make this agreement and sign this declaration.

Signed,

Paul Farcasanu https://github.com/pfarcasanu
38 changes: 15 additions & 23 deletions tunnel-core/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ require (
github.com/cognusion/go-cache-lru v0.0.0-20170419142635-f73e2280ecea
github.com/deckarep/golang-set v1.8.0
github.com/dgraph-io/badger v1.6.2
github.com/elazarl/goproxy v0.0.0-20220403042543-a53172b9392e
github.com/elazarl/goproxy/ext v0.0.0-20220403042543-a53172b9392e
github.com/florianl/go-nfqueue v1.3.0
github.com/elazarl/goproxy v0.0.0-20220417044921-416226498f94
github.com/elazarl/goproxy/ext v0.0.0-20220417044921-416226498f94
github.com/florianl/go-nfqueue v1.3.1
github.com/gobwas/glob v0.2.4-0.20180402141543-f00a7392b439
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
github.com/google/gopacket v1.1.19
Expand All @@ -21,22 +21,22 @@ require (
github.com/juju/ratelimit v1.0.2-0.20191002062651-f60b32039441
github.com/marten-seemann/qpack v0.2.1
github.com/marusama/semaphore v0.0.0-20190110074507-6952cef993b2
github.com/miekg/dns v1.1.48
github.com/miekg/dns v1.1.49
github.com/mitchellh/panicwrap v1.0.0
github.com/oschwald/maxminddb-golang v1.9.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/refraction-networking/gotapdance v0.0.0-20220119224326-7831ceda04f9
github.com/refraction-networking/utls v1.0.0
github.com/refraction-networking/gotapdance v1.2.0
github.com/refraction-networking/utls v1.1.0
github.com/ryanuber/go-glob v1.0.0
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.1
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635
github.com/wader/filtertransport v0.0.0-20200316221534-bdd9e61eee78
github.com/zach-klippenstein/goregen v0.0.0-20160303162051-795b5e3961ea
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
golang.org/x/net v0.0.0-20220412020605-290c469a71a5
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20220412071739-889880a91fd5
golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898
golang.org/x/net v0.0.0-20220517181318-183a9ca12b87
golang.org/x/sync v0.0.0-20220513210516-0976fa681c29
golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e
golang.org/x/term v0.0.0-20220411215600-e5f449aeb171
)

Expand All @@ -50,32 +50,24 @@ require (
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/protobuf v1.5.3-0.20210916003710-5d5e8c018a13 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/gxui v0.0.0-20151028112939-f85e0a97b3a4 // indirect
github.com/gopherjs/gopherjs v0.0.0-20220410123724-9e86199038b0 // indirect
github.com/josharian/native v1.0.0 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/mdlayher/netlink v1.6.0 // indirect
github.com/mdlayher/socket v0.2.3 // indirect
github.com/mroth/weightedrand v0.4.1 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.19.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/sergeyfrolov/bsbuffer v0.0.0-20180903213811-94e85abb8507 // indirect
github.com/smartystreets/assertions v1.2.1 // indirect
github.com/smartystreets/goconvey v1.7.2 // indirect
gitlab.com/yawning/edwards25519-extra.git v0.0.0-20211229043746-2f91fcc9fbdb // indirect
gitlab.com/yawning/obfs4.git v0.0.0-20220204003609-77af0cba934d // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a // indirect
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f // indirect
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99 // indirect
)
Loading

0 comments on commit 9c044eb

Please sign in to comment.