Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ go:

os: linux
sudo: required
dist: xenial
dist: bionic

services:
- docker

addons:
artifacts: true

# # Uncomment To override defaults set in travis ci online interface
# # (these will take precedence).
# env:
# - PSIPHON_CORE_VERSION="tags/v2.0.9"
# - PSIPHON_SYSTEM_VERSION="9265a85"

notifications:
slack:
secure: ZzIEqFE4XRdE9U2p3aeE32DMtoC8RgjoEavhEQ1oLrWFgUpLktqmp9UVY/U+W6iElilLpDbFpry51+Sv9MWpxJMxr+Q/JJuq/3Bj5KjF/wEtil7qvBYhQ1sM/qUQFG6wRkrMNjZGMiaTmnkWF0rZB8lf7+nbnGFaPW3AVVbD+8gVDWTHI4Hcvvgs0UbrJzoPfpvH0dprOchswc1BBKTgo5c44rvS2fquEMVcqMMiNJ5JQqphuRWLTfzLgOzImSf0/xJJyVp/YTkSnVSg8BcWmDCJ4iB9fJkVyZM9WxcgY/J4T5VzFxfMah9zv2j8UTfzHSMeCJDRL647hdnkmr/Qum/LN91Ey2DJw5KUH743CsAbyGhQML6wZ3NCeEP06hnMDphalU5+BYhtAPyc5CB84g6eLIUQ2EqptuPZpjFQohFnapCTnfB5XKTcW+PjxJsoJzk8x+85Xid+H1nnNxeyf10tLv6Pwy4ZGmEEbsa4SYWXibpIEu3fPJXEdtrht0vM40pDLeUYL6Axmh7hNjmDQOXJG41saF+Rk4AArRhKhMQTmlYCc0e1H2/hIDXUMPbqjHeCpEkaA5W8BFBKynhlJa0JX+rtHDFaK82Di8rXT0NO2ACyG8ZQqk87qePyBYPyfR8hRwhrkmQHlYYOZzV6LBz+ynJuWl9ktcC2irJlHZs=
Expand Down Expand Up @@ -42,12 +48,19 @@ jobs:
# Substitute build string
- sed -i.bak "s/buildInfo = \"\"/buildInfo = \"$TRAVIS_BRANCH-$TRAVIS_COMMIT\"/" tapdance/logger.go
- mkdir -p $GOPATH/src/github.com/Psiphon-Labs
# Get Specific Psiphon Core Library Release
- git clone https://github.com/Psiphon-Labs/psiphon-tunnel-core.git $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core
- (cd $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core && git checkout $PSIPHON_CORE_VERSION -b build-refraction-networking)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that we previously would clone master branch, but now are cloning build-refraction-networking? Is there a reason for that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pulls a commit based on an environment variable set in the travis ci online environment. I added this so that there is some consistency around what is being built against. It is just checking it out locally to a branch named build-refraction-networking.

This is actually a question that I have for the psiphon folks, if there are stable releases of this repo I would prefer to use those ( as we are for Psiphon-Labs/psiphon-tunnel-core) but these are configurable to specific commits / tags / releases using env vars in travis now.

This is the same for #23

# Remove gotapdance from vendored packages
- go get github.com/kardianos/govendor
- (cd $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core && govendor remove github.com/sergeyfrolov/gotapdance/...)
- (cd $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core && govendor remove github.com/refraction-networking/gotapdance/...)
# replace sergeyfrolov in tapdance wrapper (NOTE: REMOVE AFTER VENDORING IN PSIPHON CHANGES)
- sed -i.bak 's/sergeyfrolov/refraction-networking/g' $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/tapdance/tapdance.go
# Enable TapDance logging
- sed -i.bak 's/refraction_networking_tapdance.Logger().Out = ioutil.Discard//' $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/tapdance/tapdance.go
# Digest this branch's ClientConf into Psiphon's embedded_config
- ./test_scripts/psiphon_digest_cc.sh ./assets/ClientConf $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/tapdance/embedded_config.go
script:
- go build -race -o build/cli-$TRAVIS_OS_NAME ./cli
- go build -race -o build/ConsoleClient-$TRAVIS_OS_NAME -tags 'TAPDANCE' github.com/Psiphon-Labs/psiphon-tunnel-core/ConsoleClient
Expand All @@ -67,8 +80,9 @@ jobs:
- docker pull refraction/psiandroid
- mkdir -p $GOPATH/src/bitbucket.org/psiphon
- hg clone https://bitbucket.org/psiphon/psiphon-circumvention-system $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system
- (cd $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system && hg checkout $PSIPHON_SYSTEM_VERSION)
# Use modified EmbeddedValues.java for TapDance
- openssl aes-256-cbc -d -K $encrypted_8a9748c534c1_key -iv $encrypted_8a9748c534c1_iv -in build/EmbeddedValues.java.enc -out $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/src/main/java/com/psiphon3/psiphonlibrary/EmbeddedValues.java
- openssl enc -nosalt -aes-256-cbc -md sha512 -pbkdf2 -iter 1000 -pass pass:$aes_cbc_passwd -d -in build/EmbeddedValues.java.enc -out $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/src/main/java/com/psiphon3/psiphonlibrary/EmbeddedValues.java
# Patched tunneling protocol for TapDance
- patch $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/src/main/java/com/psiphon3/psiphonlibrary/TunnelManager.java build/TunnelManager.java.patch
script:
Expand Down
Binary file modified build/EmbeddedValues.java.enc
Binary file not shown.
5 changes: 3 additions & 2 deletions tapdance/dialer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"bufio"
"crypto/tls"
"fmt"
pb "github.com/refraction-networking/gotapdance/protobuf"
"io/ioutil"
"net"
"net/http"
"net/url"
"os"
"testing"

pb "github.com/refraction-networking/gotapdance/protobuf"
)

func setupTestAssets() error {
Expand Down Expand Up @@ -59,7 +60,7 @@ func TestMain(m *testing.M) {
os.Exit(retCode)
}

func TestTapDanceDial(t *testing.T) {
func DisabledTestTapDanceDial(t *testing.T) {
urlParse := func(urlStr string) url.URL {
_url, err := url.Parse(urlStr)
if err != nil {
Expand Down
16 changes: 8 additions & 8 deletions tdproxy/tapdance_test.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package tdproxy

import (
pb "github.com/refraction-networking/gotapdance/protobuf"
"github.com/refraction-networking/gotapdance/tapdance"
"crypto/tls"
"fmt"
"io"
"io/ioutil"
"math/rand"
"os"
"testing"
"time"

"crypto/tls"
"fmt"
"golang.org/x/net/websocket"
"math/rand"
"time"

"io"
pb "github.com/refraction-networking/gotapdance/protobuf"
"github.com/refraction-networking/gotapdance/tapdance"
)

func setupTestAssets() error {
Expand Down Expand Up @@ -62,7 +62,7 @@ func TestMain(m *testing.M) {
os.Exit(retCode)
}

func TestSendSeq(t *testing.T) {
func DisableTestSendSeq(t *testing.T) {
conn, err := tapdance.Dial("tcp", "sfrolov.io:443")
if err != nil {
t.Error(err)
Expand Down
31 changes: 31 additions & 0 deletions test_scripts/psiphon_digest_cc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

# This Script is a psiphon specific tool to
# 1. digest the clientConf of the current branch into the
# format used in psiphons embedded_config.go
# 2. Perform search and replace on the embedded_config.go file to
# remove the old clientconfig and replace with new digested value.
#
# Use:
# $ psiphon_digest_cc.sh $PATH_TO_ASSETS/ClientConf $PATH_TO_PSIPHON_CORE/psiphon/common/tapdance/embedded_config.go
#
# Note: This will replace the value inline in the Psiphon embedded config.

if [ "$#" -ne 2 ]; then
echo "Not enough input arguments:"
echo '$ psiphon_digest_cc.sh $PATH_TO_ASSETS/ClientConf $PATH_TO_PSIPHON_TD_CORE/embedded_config.go'
exit 1
fi

TMP_SEDFILE="build/embedded_config.sed"

# Digest the clienConf to hex
EMBEDDED_CC=$(hexdump -ve '"\\\\\\\\\x" 1/1 "%.2x"' $1);

# Create search and replace rule and store to sed scriptfile (can be too long for sed inline)
printf "s/embeddedClientConf = \"[x0-9a-fA-F\\]+\"/embeddedClientConf = \"$EMBEDDED_CC\"/g" > $TMP_SEDFILE

# Replace the old ClientConf from the psiphon config
sed -r -i '' -f $TMP_SEDFILE $2

rm $TMP_SEDFILE