diff --git a/README.md b/README.md index 488c373ed..93e4a95f9 100644 --- a/README.md +++ b/README.md @@ -54,13 +54,12 @@ All these dependencies must be in your PATH. Some of this is Android specific, s ### 🚀 Setup Project: * Install all prerequisites -* Run `git submodule update --init --recursive` * Run `git lfs install && git pull`. * Put the [app.env](https://my.1password.com/app#/everything/AllItems/whdjlkyj7ku6pumtyc7nh5vg4yadqasjh2hspgjgvgfllyekhcrq) file (Frontend vault) from 1Password in the repo root. -* Go to the **SDK MANAGER** +* Go to the **SDK MANAGER** (Tools->SDK Manager in Android Studio) * Select **Android SDK** * Check the SDK from android 5.0(LOLLIPOP) up to the Latest Version at the moment. -* Go to **SDK Tools** and check the option **Show Package Details** +* Go to the **SDK Tools** tab in the same window and check the option **Show Package Details** * On the Android SDK Build-Tools, check from: SDK 30 up to the latest at the moment. (is optional if you wish to add more SDK alternatives such as 27.0, 28 or 29). * On the NDK(Side by side) check the latest version of 22.x (not anything newer) * Make sure that you have the latest **Android SDK Command-line Tools** @@ -75,17 +74,17 @@ All these dependencies must be in your PATH. Some of this is Android specific, s * Click on Apply and accept the Terms and Conditions. * Open Xcode first time open Xcode and install necessary components * Download Certificate and provisioning profile from 1Pass [Search [IOS Certificates and profiles](https://my.1password.com/vaults/all/allitems)] -* Lastly `Flutter Doctor` to confirm that your setup is correct and ready! +* Lastly `flutter doctor` to confirm that your setup is correct and ready! ### 🤖 Running the project on Android -* `make android-lib ANDROID_ARCH` (you need to generated liblantern-all.aar containing the Go backend code in order for the project to compile.) +* `make android` (you need to generated liblantern-all.aar containing the Go backend code in order for the project to compile.) * `flutter pub get` * `flutter run --flavor prod` ### 🍏 Running the project on iOS -* `make build-framework` (you need to generated Internalsdk.xcframework. containing the Go backend code in order for the project to compile.) +* `make ios` (you need to generated Internalsdk.xcframework. containing the Go backend code in order for the project to compile.) * `flutter pub get` * `flutter run --flavor prod` diff --git a/go.mod b/go.mod index b1ac1de01..a29220215 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/getlantern/lantern-client -go 1.22.4 +go 1.22.6 -toolchain go1.22.8 +toolchain go1.22.10 // replace github.com/getlantern/flashlight/v7 => ../flashlight @@ -39,8 +39,8 @@ require ( github.com/getlantern/eventual v1.0.0 github.com/getlantern/eventual/v2 v2.0.2 github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c - github.com/getlantern/flashlight/v7 v7.6.150 - github.com/getlantern/fronted v0.0.0-20241120203013-eedcd71609d2 + github.com/getlantern/flashlight/v7 v7.6.160 + github.com/getlantern/fronted v0.0.0-20241212194832-a55b6db2616e github.com/getlantern/golog v0.0.0-20230503153817-8e72de7e0a65 github.com/getlantern/hidden v0.0.0-20220104173330-f221c5a24770 github.com/getlantern/i18n v0.0.0-20181205222232-2afc4f49bb1c @@ -77,11 +77,16 @@ require ( golang.org/x/mobile v0.0.0-20241016134751-7ff83004ec2c golang.org/x/net v0.30.0 golang.org/x/sys v0.26.0 - google.golang.org/protobuf v1.34.2 + google.golang.org/protobuf v1.35.2 nhooyr.io/websocket v1.8.17 ) -require github.com/coder/websocket v1.8.12 // indirect +require ( + github.com/alitto/pond/v2 v2.1.5 // indirect + github.com/cloudflare/circl v1.3.7 // indirect + github.com/coder/websocket v1.8.12 // indirect + github.com/golang/protobuf v1.5.4 // indirect +) require ( filippo.io/edwards25519 v1.0.0 // indirect @@ -144,7 +149,6 @@ require ( github.com/enobufs/go-nats v0.0.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/frankban/quicktest v1.14.6 // indirect - github.com/gaukas/godicttls v0.0.4 // indirect github.com/gaukas/wazerofs v0.1.0 // indirect github.com/getlantern/algeneva v0.0.0-20240605225338-caba0b3edf03 // indirect github.com/getlantern/broflake v0.0.0-20241127130800-763b7ebbf090 // indirect @@ -164,7 +168,7 @@ require ( github.com/getlantern/event v0.0.0-20210901195647-a7e3145142e6 // indirect github.com/getlantern/fdcount v0.0.0-20210503151800-5decd65b3731 // indirect github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede // indirect - github.com/getlantern/geo v0.0.0-20240108161311-50692a1b69a9 // indirect + github.com/getlantern/geo v0.0.0-20241129152027-2fc88c10f91e // indirect github.com/getlantern/go-socks5 v0.0.0-20171114193258-79d4dd3e2db5 // indirect github.com/getlantern/go-update v0.0.0-20230221120840-8d795213a8bc // indirect github.com/getlantern/gonat v0.0.0-20201001145726-634575ba87fb // indirect @@ -172,7 +176,7 @@ require ( github.com/getlantern/grtrack v0.0.0-20231025115619-bfbfadb228f3 // indirect github.com/getlantern/hellosplitter v0.1.1 // indirect github.com/getlantern/hex v0.0.0-20220104173244-ad7e4b9194dc // indirect - github.com/getlantern/http-proxy-lantern/v2 v2.10.1-0.20240614175233-0df4a97b806e // indirect + github.com/getlantern/http-proxy-lantern/v2 v2.10.1 // indirect github.com/getlantern/httpseverywhere v0.0.0-20201210200013-19ae11fc4eca // indirect github.com/getlantern/iptool v0.0.0-20230112135223-c00e863b2696 // indirect github.com/getlantern/kcp-go/v5 v5.0.0-20220503142114-f0c1cd6e1b54 // indirect @@ -196,9 +200,9 @@ require ( github.com/getlantern/telemetry v0.0.0-20230523155019-be7c1d8cd8cb // indirect github.com/getlantern/tinywss v0.0.0-20211216020538-c10008a7d461 // indirect github.com/getlantern/tlsdefaults v0.0.0-20171004213447-cf35cfd0b1b4 // indirect - github.com/getlantern/tlsdialer/v3 v3.0.3 // indirect + github.com/getlantern/tlsdialer/v3 v3.0.5 // indirect github.com/getlantern/tlsmasq v0.4.7-0.20230302000139-6e479a593298 // indirect - github.com/getlantern/tlsresumption v0.0.0-20211216020551-6a3f901d86b9 // indirect + github.com/getlantern/tlsresumption v0.0.0-20241210052744-a1c6aacc1d4d // indirect github.com/getlantern/tlsutil v0.5.3 // indirect github.com/getlantern/uuid v1.2.0 // indirect github.com/getlantern/winsvc v0.0.0-20160824205134-8bb3a5dbcc1d // indirect @@ -214,7 +218,6 @@ require ( github.com/golang/gddo v0.0.0-20210115222349-20d68f94ee1f // indirect github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.3 // indirect github.com/google/go-cmp v0.6.0 // indirect @@ -284,7 +287,7 @@ require ( github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/quic-go/quic-go v0.48.0 // indirect - github.com/refraction-networking/utls v1.3.3 // indirect + github.com/refraction-networking/utls v1.6.7 github.com/refraction-networking/water v0.7.0-alpha // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect diff --git a/go.sum b/go.sum index 9c9712082..8e0f51b8e 100644 --- a/go.sum +++ b/go.sum @@ -54,6 +54,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alextanhongpin/go-bandit v0.0.0-20191125130111-30de60d69bae h1:ZrWHh+wXI877HHdIHLWCtQmL0u4CW6GPqTBOvYlO6Ts= github.com/alextanhongpin/go-bandit v0.0.0-20191125130111-30de60d69bae/go.mod h1:FaUXXpw8d7DBpg3M5wrQAj6RAGuVVoV35hvKKguVyNc= +github.com/alitto/pond/v2 v2.1.5 h1:2pp/KAPcb02NSpHsjjnxnrTDzogMLsq+vFf/L0DB84A= +github.com/alitto/pond/v2 v2.1.5/go.mod h1:xkjYEgQ05RSpWdfSd1nM3OVv7TBhLdy7rMp3+2Nq+yE= github.com/anacrolix/chansync v0.5.1 h1:j+R9DtotkXm40VFjZ8rJTSJkg2Gv1ldZt8kl96lyJJ0= github.com/anacrolix/chansync v0.5.1/go.mod h1:DZsatdsdXxD0WiwcGl0nJVwyjCKMDv+knl1q2iBjA2k= github.com/anacrolix/confluence v1.15.0 h1:4BcfG2ZqLSSsShbDgwhC/ynW2ulkg0PebPuHe97Rqi4= @@ -152,6 +154,8 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= @@ -224,8 +228,6 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/garyburd/redigo v1.1.1-0.20170914051019-70e1b1943d4f/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk= -github.com/gaukas/godicttls v0.0.4/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI= github.com/gaukas/wazerofs v0.1.0 h1:wIkW1bAxSnpaaVkQ5LOb1tm1BXdVap3eKjJpVWIqt2E= github.com/gaukas/wazerofs v0.1.0/go.mod h1:+JECB9Fwt0taPqSgHckG9lmT3tcoVK+9VJozTsq9UlI= github.com/getlantern/algeneva v0.0.0-20240605225338-caba0b3edf03 h1:VaBQdRGkP47xBr8OIAkQFt52KLXMZQhbYrwZiOK7rPw= @@ -293,14 +295,14 @@ github.com/getlantern/fdcount v0.0.0-20210503151800-5decd65b3731/go.mod h1:XZwE+ github.com/getlantern/filepersist v0.0.0-20160317154340-c5f0cd24e799/go.mod h1:8DGAx0LNUfXNnEH+fXI0s3OCBA/351kZCiz/8YSK3i8= github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c h1:mcz27xtAkb1OuOLBct/uFfL1p3XxAIcFct82GbT+UZM= github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c/go.mod h1:8DGAx0LNUfXNnEH+fXI0s3OCBA/351kZCiz/8YSK3i8= -github.com/getlantern/flashlight/v7 v7.6.150 h1:ttR2n9Q5w7yuLf8ZU5zQYhJjwDN5jMr6bUdQmBiPL5U= -github.com/getlantern/flashlight/v7 v7.6.150/go.mod h1:sLQXxC8MW4gqHXFjINLxbbz1GOPEf6Hwvs30gdVsAk8= +github.com/getlantern/flashlight/v7 v7.6.160 h1:7mj6XpwCRzenV7KE0xwz1NdvVMmx9n4ylHTGOwE9/rI= +github.com/getlantern/flashlight/v7 v7.6.160/go.mod h1:CxdSP/qxaiapDHOqyIbhquQu6jp18VL3Lnwj5ynxMC0= github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede h1:yrU6Px3ZkvCsDLPryPGi6FN+2iqFPq+JeCb7EFoDBhw= github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede/go.mod h1:nhnoiS6DE6zfe+BaCMU4YI01UpsuiXnDqM5S8jxHuuI= -github.com/getlantern/fronted v0.0.0-20241120203013-eedcd71609d2 h1:h3TZ7ye/1fqOLqfwTho4iRSEQqTMKVJIsOF+5XNyhus= -github.com/getlantern/fronted v0.0.0-20241120203013-eedcd71609d2/go.mod h1:NfZDG8pmTL3wvo/s/sflpJFsgIL7etelgwzDRtO4HIM= -github.com/getlantern/geo v0.0.0-20240108161311-50692a1b69a9 h1:mSg57/+t59Q08AqArlhW+3N1AVPn5ox0dTOYonRps6w= -github.com/getlantern/geo v0.0.0-20240108161311-50692a1b69a9/go.mod h1:RjQ0krF8NTCc5xo2Q1995/vZBnYg33h8svn15do7dLg= +github.com/getlantern/fronted v0.0.0-20241212194832-a55b6db2616e h1:qk62Xhg+ha1sW6FhOmGPGbd3xnCC5n9Mr87vDToE0cM= +github.com/getlantern/fronted v0.0.0-20241212194832-a55b6db2616e/go.mod h1:UOynqDcVIlDMFk3sdUyHzNyY1cz4GHtJ+8qvWESHWhg= +github.com/getlantern/geo v0.0.0-20241129152027-2fc88c10f91e h1:vpikNz6IzvEoqVYmiK5Uq+lE4TCzvMDqbZdxFbtGK1g= +github.com/getlantern/geo v0.0.0-20241129152027-2fc88c10f91e/go.mod h1:RjQ0krF8NTCc5xo2Q1995/vZBnYg33h8svn15do7dLg= github.com/getlantern/go-socks5 v0.0.0-20171114193258-79d4dd3e2db5 h1:RBKofGGMt2k6eGBwX8mky9qunjL+KnAp9JdzXjiRkRw= github.com/getlantern/go-socks5 v0.0.0-20171114193258-79d4dd3e2db5/go.mod h1:kGHRXch95rnGLHjER/GhhFiHvfnqNz7KqWD9kGfATHY= github.com/getlantern/go-tun2socks v1.16.12-0.20201218023150-b68f09e5ae93 h1:CFLw2b6vgOmpxsRWRiTd46tiR6YKg2crIuTu4cINYcY= @@ -330,8 +332,8 @@ github.com/getlantern/hex v0.0.0-20220104173244-ad7e4b9194dc/go.mod h1:D9RWpXy/E github.com/getlantern/hidden v0.0.0-20190325191715-f02dbb02be55/go.mod h1:6mmzY2kW1TOOrVy+r41Za2MxXM+hhqTtY3oBKd2AgFA= github.com/getlantern/hidden v0.0.0-20220104173330-f221c5a24770 h1:cSrD9ryDfTV2yaur9Qk3rHYD414j3Q1rl7+L0AylxrE= github.com/getlantern/hidden v0.0.0-20220104173330-f221c5a24770/go.mod h1:GOQsoDnEHl6ZmNIL+5uVo+JWRFWozMEp18Izcb++H+A= -github.com/getlantern/http-proxy-lantern/v2 v2.10.1-0.20240614175233-0df4a97b806e h1:qNYdR1Zb/HrE9QxOWkktuS4cG2TRjuoO/ssLDFR1rPE= -github.com/getlantern/http-proxy-lantern/v2 v2.10.1-0.20240614175233-0df4a97b806e/go.mod h1:gdTIGBw1dSTKkQV+3XHI27R++69ENeWPiWSnq3zLF8g= +github.com/getlantern/http-proxy-lantern/v2 v2.10.1 h1:KzsIrWiK8FLc+PDLCaYaYETZGerfuuobCY0wxi7Mv9M= +github.com/getlantern/http-proxy-lantern/v2 v2.10.1/go.mod h1:b8uUKHs0yO4e/e+H/j2T7Z6ht96RoCDbqZ81asggEB0= github.com/getlantern/httpseverywhere v0.0.0-20201210200013-19ae11fc4eca h1:Of3VwFEfKbVnK5/VGy05XUbi6QvTs5Y2eLDfPv3O50E= github.com/getlantern/httpseverywhere v0.0.0-20201210200013-19ae11fc4eca/go.mod h1:TNC/xJFmctsSGyXqcnVWwCRCPD/4zGQP7yBVnLDRa/U= github.com/getlantern/i18n v0.0.0-20181205222232-2afc4f49bb1c h1:+JnT+Rwa/3rksc4Zi0u6fJ/WX+tPK58GtsrcXWVUU2U= @@ -342,7 +344,6 @@ github.com/getlantern/idletiming v0.0.0-20231030193830-6767b09f86db h1:w/Br8vclv github.com/getlantern/idletiming v0.0.0-20231030193830-6767b09f86db/go.mod h1:kW4RHAFReMopujQCzcYxjOAg4XZOeuSrybIcM9FNGto= github.com/getlantern/ipproxy v0.0.0-20240923151842-ff95aca6e3dc h1:6yCC6u18l/RcxiEZsJaV6BxTBSRDA4TdtHayRpGJMKQ= github.com/getlantern/ipproxy v0.0.0-20240923151842-ff95aca6e3dc/go.mod h1:rkY8JPMJmzi29/uTE6o/6BbtOjt1lcMsrI+QwZK4MU8= -github.com/getlantern/iptool v0.0.0-20210721034953-519bf8ce0147/go.mod h1:hfspzdRcvJ130tpTPL53/L92gG0pFtvQ6ln35ppwhHE= github.com/getlantern/iptool v0.0.0-20230112135223-c00e863b2696 h1:D7wbL2Ww6QN5SblEDMiQcFulqz2jgcvawKaNBTzHLvQ= github.com/getlantern/iptool v0.0.0-20230112135223-c00e863b2696/go.mod h1:hfspzdRcvJ130tpTPL53/L92gG0pFtvQ6ln35ppwhHE= github.com/getlantern/jibber_jabber v0.0.0-20210901195950-68955124cc42 h1:h/VSx9E2MCHR/dSqwQmcRSGI+VSCFwuu4AcSMpXJ2Pg= @@ -354,7 +355,6 @@ github.com/getlantern/kcpwrapper v0.0.0-20230327091313-c12d7c17c6de/go.mod h1:UV github.com/getlantern/keepcurrent v0.0.0-20221014183517-fcee77376b89 h1:gjlTAADW8ZUrIey+u1ZtbVlI91bqI0Bu+GBxvRlBBqo= github.com/getlantern/keepcurrent v0.0.0-20221014183517-fcee77376b89/go.mod h1:EtJEobtQH/HiQsZLyRjlrnq/fu7vfgnTMzhbmUqkZ3M= github.com/getlantern/keyman v0.0.0-20180207174507-f55e7280e93a/go.mod h1:FMf0g72BHs14jVcD8i8ubEk4sMB6JdidBn67d44i3ws= -github.com/getlantern/keyman v0.0.0-20200819205636-76fef27c39f1/go.mod h1:FMf0g72BHs14jVcD8i8ubEk4sMB6JdidBn67d44i3ws= github.com/getlantern/keyman v0.0.0-20230503155501-4e864ca2175b h1:iyEuk8ARQC9HfraqC4r3leBhU55R1TV7bAiyPYE54kA= github.com/getlantern/keyman v0.0.0-20230503155501-4e864ca2175b/go.mod h1:ZJ+yDaZkJ/JU9j7EQa3UUh6ouedrNDDLA5OiowS1Iuk= github.com/getlantern/lampshade v0.0.0-20201109225444-b06082e15f3a h1:z7G1v79GB1qRrkcbzF0nrLzV/+dwdGmamEZAp0ff+z0= @@ -382,7 +382,6 @@ github.com/getlantern/multipath v0.0.0-20230510135141-717ed305ef50/go.mod h1:uzx github.com/getlantern/nettest v1.0.0 h1:xg8vq9JrGzrFGFkFGwZwIJ5+kwtvyqNDIADwrANvhQg= github.com/getlantern/nettest v1.0.0/go.mod h1:8wY0QwrdpkayCBQXjhZoJuwu2IHfp4UErrxgwaJ2UM4= github.com/getlantern/netx v0.0.0-20190110220209-9912de6f94fd/go.mod h1:wKdY0ikOgzrWSeB9UyBVKPRhjXQ+vTb+BPeJuypUuNE= -github.com/getlantern/netx v0.0.0-20211206143627-7ccfeb739cbd/go.mod h1:WEXF4pfIfnHBUAKwLa4DW7kcEINtG6wjUkbL2btwXZQ= github.com/getlantern/netx v0.0.0-20240830183145-c257516187f0 h1:1K7Rbp2V/XGlZohPRz4IncT6C5RTiSGI2IB9YF34pbI= github.com/getlantern/netx v0.0.0-20240830183145-c257516187f0/go.mod h1:JbzAvxJWngaUtz5QqKz9w6zHU0Efw21cuY0aNN209Kc= github.com/getlantern/notifier v0.0.0-20240830181717-11f4c6c3fa95 h1:vrS7lr+avjlKMoyVS1oW3Fmj6Yr0IgyzmsPGvCQG7Xk= @@ -438,12 +437,12 @@ github.com/getlantern/tinywss v0.0.0-20211216020538-c10008a7d461 h1:3HOWV/uUGde6 github.com/getlantern/tinywss v0.0.0-20211216020538-c10008a7d461/go.mod h1:ZLyPOKtNWU4vWnAiRiNQ7hbfLMqCEuj1DgQWBtHp7tQ= github.com/getlantern/tlsdefaults v0.0.0-20171004213447-cf35cfd0b1b4 h1:73U3J4msGw3cXeKtCEbY7hbOdD6aX8gJv8BOu+VagF8= github.com/getlantern/tlsdefaults v0.0.0-20171004213447-cf35cfd0b1b4/go.mod h1:f8WmDYKFOaC5/y0d3GWl6UKf1ZbSlIoMzkuC8x7pUhg= -github.com/getlantern/tlsdialer/v3 v3.0.3 h1:OXzzAqO8YojBOu2Kk8wquX2zbFmgJjji41RpaT6knLg= -github.com/getlantern/tlsdialer/v3 v3.0.3/go.mod h1:hwA0X81pnrgx7GEwddaGWSxqr6eLBm7A0rrUMK2J7KY= +github.com/getlantern/tlsdialer/v3 v3.0.5 h1:xdLBQDgz0PXLK6T27hjtZU25MyucRiUKj58aqyQZvP4= +github.com/getlantern/tlsdialer/v3 v3.0.5/go.mod h1:aXHS9CXIzgsdHwlTcFmmPzFbw0l6QBLxkCdSCmclqDI= github.com/getlantern/tlsmasq v0.4.7-0.20230302000139-6e479a593298 h1:GxhCQ6zLnIeaIw2gtZsM7hSlpXHdd8DoXSEPObSHMuk= github.com/getlantern/tlsmasq v0.4.7-0.20230302000139-6e479a593298/go.mod h1:vcDVZe3TGEqd0nD0tVvqKoyGHY+5bPxCa+IklxroKd0= -github.com/getlantern/tlsresumption v0.0.0-20211216020551-6a3f901d86b9 h1:onWhy3gmWhoeNEdHI/e2q39d5ab7Giwa5j93ZDsFUOw= -github.com/getlantern/tlsresumption v0.0.0-20211216020551-6a3f901d86b9/go.mod h1:HsendE/ereHNDfzgO2DcEDSlPF4aDZ9aIMSKgWKa9dc= +github.com/getlantern/tlsresumption v0.0.0-20241210052744-a1c6aacc1d4d h1:CM+1DbLVMvsrf5cvQnPF2txKKRI1H2sDj0+WvDrZ6zU= +github.com/getlantern/tlsresumption v0.0.0-20241210052744-a1c6aacc1d4d/go.mod h1:YaLhn/xKC6Z0FUizXdCcPuNn/ODQ9fibA7q33dtuH9g= github.com/getlantern/tlsutil v0.2.0/go.mod h1:Vxsyr9DVnYwsqHaEzMYkg9fT8aBrnO2eI+gdICMQbQU= github.com/getlantern/tlsutil v0.5.3 h1:g1FjuG4/OTZe8kkbEmpSxvT9rXzYOG9jO4jHiDeQIxM= github.com/getlantern/tlsutil v0.5.3/go.mod h1:lVgvr4nxuQ1ocOho90UB6LnHFlpP16TXAGpHR8Z0QnI= @@ -837,10 +836,8 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/quic-go/quic-go v0.48.0 h1:2TCyvBrMu1Z25rvIAlnp2dPT4lgh/uTqLqiXVpp5AeU= github.com/quic-go/quic-go v0.48.0/go.mod h1:yBgs3rWBOADpga7F+jJsb6Ybg1LSYiQvwWlLX+/6HMs= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/refraction-networking/utls v0.0.0-20190415193640-32987941ebd3/go.mod h1:tz9gX959MEFfFN5whTIocCLUG57WiILqtdVxI8c6Wj0= -github.com/refraction-networking/utls v0.0.0-20190909200633-43c36d3c1f57/go.mod h1:tz9gX959MEFfFN5whTIocCLUG57WiILqtdVxI8c6Wj0= -github.com/refraction-networking/utls v1.3.3 h1:f/TBLX7KBciRyFH3bwupp+CE4fzoYKCirhdRcC490sw= -github.com/refraction-networking/utls v1.3.3/go.mod h1:DlecWW1LMlMJu+9qpzzQqdHDT/C2LAe03EdpLUz/RL8= +github.com/refraction-networking/utls v1.6.7 h1:zVJ7sP1dJx/WtVuITug3qYUq034cDq9B2MR1K67ULZM= +github.com/refraction-networking/utls v1.6.7/go.mod h1:BC3O4vQzye5hqpmDTWUqi4P5DDhzJfkV1tdqtawQIH0= github.com/refraction-networking/water v0.7.0-alpha h1:yLMAvIi0lHHD2mvwx63GLnptpjvnmBCWFvTHTWLykLk= github.com/refraction-networking/water v0.7.0-alpha/go.mod h1:VPQENA6E5+2V5RlX/yaBlTCKeFQ25j49DUc/pmmwkXE= github.com/refraction-networking/wazero v1.7.1-w h1:z7Ty5PsMkJEDBCsn3ELUjceQGBT0FMVGldOSpDK3giQ= @@ -1022,7 +1019,6 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1242,8 +1238,8 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internalsdk/android.go b/internalsdk/android.go index 04c294be9..8ff57c1ff 100644 --- a/internalsdk/android.go +++ b/internalsdk/android.go @@ -46,10 +46,9 @@ var ( startOnce sync.Once - clEventual = eventual.NewValue() - dnsGrabEventual = eventual.NewValue() - dnsGrabAddrEventual = eventual.NewValue() - errNoAdProviderAvailable = errors.New("no ad provider available") + clEventual = eventual.NewValue() + dnsGrabEventual = eventual.NewValue() + dnsGrabAddrEventual = eventual.NewValue() ) type Settings interface { @@ -352,22 +351,6 @@ func (s *panickingSessionImpl) SetOnSuccess(fetached bool) { s.wrapped.SetOnSuccess(fetached) } -func getClient(ctx context.Context) *client.Client { - _cl, _ := clEventual.Get(ctx) - if _cl == nil { - return nil - } - return _cl.(*client.Client) -} - -func getDNSGrab(ctx context.Context) dnsgrab.Server { - _dg, _ := dnsGrabEventual.Get(ctx) - if _dg == nil { - return nil - } - return _dg.(dnsgrab.Server) -} - type SurveyInfo struct { Enabled bool `json:"enabled"` Probability float64 `json:"probability"` @@ -385,18 +368,6 @@ type StartResult struct { DNSGrabAddr string } -type adSettings struct { - wrapped *config.AdSettings -} - -func (s *adSettings) GetAdProvider(isPro bool, countryCode string, daysSinceInstalled int) (AdProvider, error) { - adProvider := s.wrapped.GetAdProvider(isPro, countryCode, daysSinceInstalled) - if adProvider == nil { - return nil, errNoAdProviderAvailable - } - return adProvider, nil -} - type Updater autoupdate.Updater // Start starts a HTTP and SOCKS proxies at random addresses. It blocks up till diff --git a/internalsdk/doh/doh.go b/internalsdk/doh/doh.go index 00af9f45d..08cbcf9d6 100644 --- a/internalsdk/doh/doh.go +++ b/internalsdk/doh/doh.go @@ -16,7 +16,7 @@ import ( "bytes" "context" "encoding/json" - "io/ioutil" + "io" "net/http" "strings" @@ -80,11 +80,10 @@ func MakeDohRequest(ctx context.Context, return nil, log.Errorf("getting idna for domain [%v]: %v", domain, err) } - req, err := http.NewRequest("GET", "https://cloudflare-dns.com/dns-query", nil) + req, err := http.NewRequestWithContext(ctx, "GET", "https://cloudflare-dns.com/dns-query", nil) if err != nil { return nil, log.Errorf("building doh request to cloudflare %v", err) } - req = req.WithContext(ctx) req.Header.Set("accept", "application/dns-json") q := req.URL.Query() q.Add("name", name) @@ -96,7 +95,7 @@ func MakeDohRequest(ctx context.Context, } defer resp.Body.Close() - bodyBuf, err := ioutil.ReadAll(resp.Body) + bodyBuf, err := io.ReadAll(resp.Body) if err != nil { return nil, log.Errorf("read doh response body %v", err) } diff --git a/internalsdk/ios/config.go b/internalsdk/ios/config.go index 840045ae8..933cfb921 100644 --- a/internalsdk/ios/config.go +++ b/internalsdk/ios/config.go @@ -15,7 +15,6 @@ import ( "time" "github.com/getlantern/errors" - "github.com/getlantern/fronted" "github.com/getlantern/yaml" commonconfig "github.com/getlantern/common/config" @@ -23,6 +22,9 @@ import ( "github.com/getlantern/flashlight/v7/email" "github.com/getlantern/flashlight/v7/embeddedconfig" "github.com/getlantern/flashlight/v7/geolookup" + "github.com/getlantern/flashlight/v7/proxied" + + "context" "github.com/getlantern/lantern-client/internalsdk/common" ) @@ -71,6 +73,7 @@ func Configure(configFolderPath string, userID int, proToken, deviceID string, r configFolderPath: configFolderPath, hardcodedProxies: hardcodedProxies, uc: uc, + rt: proxied.ParallelPreferChained(), } return cf.Configure(userID, proToken, refreshProxies) } @@ -100,8 +103,11 @@ type UserConfig struct { // TODO: Implement a timeout mechanism to handle prolonged execution times and potentially execute this method in the background to maintain smooth UI startup performance. func (cf *configurer) Configure(userID int, proToken string, refreshProxies bool) (*ConfigResult, error) { + // Log the full method run time. + defer func(start time.Time) { + log.Debugf("Configured completed in %v", time.Since(start)) + }(time.Now()) result := &ConfigResult{} - start := time.Now() if err := cf.writeUserConfig(); err != nil { return nil, err } @@ -125,7 +131,7 @@ func (cf *configurer) Configure(userID int, proToken string, refreshProxies bool defer log.Debug("Set up fronting") if frontingErr := cf.configureFronting(global, shortFrontedAvailableTimeout); frontingErr != nil { log.Errorf("Unable to configure fronting on first try, update global config directly from GitHub and try again: %v", frontingErr) - global, globalUpdated = cf.updateGlobal(&http.Transport{}, global, globalEtag, "https://raw.githubusercontent.com/getlantern/lantern-binaries/main/cloud.yaml.gz") + global, globalUpdated = cf.updateGlobal(http.DefaultTransport, global, globalEtag, "https://raw.githubusercontent.com/getlantern/lantern-binaries/main/cloud.yaml.gz") return cf.configureFronting(global, longFrontedAvailableTimeout) } return nil @@ -187,8 +193,6 @@ func (cf *configurer) Configure(userID int, proToken string, refreshProxies bool log.Debugf("Added %v", host) } } - seconds := time.Since(start).Seconds() - log.Debugf("Configured completed in %v seconds", seconds) email.SetDefaultRecipient(global.ReportIssueEmail) @@ -328,7 +332,9 @@ func (cf *configurer) updateFromWeb(rt http.RoundTripper, name string, etag stri } func (cf *configurer) doUpdateFromWeb(rt http.RoundTripper, name string, etag string, cfg interface{}, url string) ([]byte, string, error) { - req, err := http.NewRequest(http.MethodGet, url, nil) + ctx, cancel := context.WithTimeout(context.Background(), 40*time.Second) + defer cancel() + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) if err != nil { return nil, "", errors.New("Unable to construct request to fetch %v from %v: %v", name, url, err) } @@ -410,25 +416,12 @@ func (cf *configurer) configureFronting(global *config.Global, timeout time.Dura return errors.New("Unable to read trusted CAs from global config, can't configure domain fronting: %v", err) } - fronted.Configure(certs, global.Client.FrontedProviders(), "cloudfront", cf.fullPathTo("masquerade_cache")) - rt, ok := fronted.NewFronted(timeout) - if !ok { - return errors.New("Timed out waiting for fronting to finish configuring") - } + proxied.OnNewFronts(certs, global.Client.FrontedProviders()) - cf.rt = rt log.Debug("Configured fronting") return nil } -func (cf *configurer) openFile(filename string) (*os.File, error) { - file, err := os.Open(cf.fullPathTo(filename)) - if err != nil { - err = errors.New("Unable to open %v: %v", filename, err) - } - return file, err -} - func (cf *configurer) saveConfig(name string, bytes []byte) { err := os.WriteFile(cf.fullPathTo(name), bytes, 0644) if err != nil { diff --git a/internalsdk/ios/ios.go b/internalsdk/ios/ios.go index 9dffbf9d9..fe7f81037 100644 --- a/internalsdk/ios/ios.go +++ b/internalsdk/ios/ios.go @@ -16,7 +16,6 @@ import ( "github.com/getlantern/flashlight/v7/chained" "github.com/getlantern/flashlight/v7/dialer" "github.com/getlantern/flashlight/v7/stats" - "github.com/getlantern/ipproxy" "github.com/getlantern/lantern-client/internalsdk/common" ) @@ -117,7 +116,6 @@ type cw struct { ipStack io.WriteCloser client *iosClient dialer dialer.Dialer - ipp ipproxy.Proxy quotaTextPath string } @@ -157,7 +155,6 @@ type iosClient struct { memChecker MemChecker configDir string - ipp ipproxy.Proxy mtu int capturedDNSHost string realDNSHost string @@ -347,10 +344,6 @@ func (c *iosClient) loadDialers() ([]dialer.ProxyDialer, error) { return dialers, nil } -func partialUserConfigFor(deviceID string) *UserConfig { - return userConfigFor(0, "", deviceID) -} - func userConfigFor(userID int, proToken, deviceID string) *UserConfig { // TODO: plug in implementation of fetching timezone for iOS to work around https://github.com/golang/go/issues/20455 return &UserConfig{ diff --git a/internalsdk/ios/thread_limiting_conn.go b/internalsdk/ios/thread_limiting_conn.go index 09c58626c..d2e2ef752 100644 --- a/internalsdk/ios/thread_limiting_conn.go +++ b/internalsdk/ios/thread_limiting_conn.go @@ -91,7 +91,7 @@ func (c *threadLimitingUDPConn) WriteFrom(b []byte, addr *net.UDPAddr) (int, err writeResult := make(chan *safechannels.IOResult) c.writeWorker.tasks <- func() { n, err := c.UDPConn.WriteFrom(b, addr) - writeResult <- &safechannels.IOResult{n, err} + writeResult <- &safechannels.IOResult{N: n, Err: err} } result := <-writeResult return result.N, result.Err diff --git a/internalsdk/session_model.go b/internalsdk/session_model.go index f7dc06b46..2e9beddd5 100644 --- a/internalsdk/session_model.go +++ b/internalsdk/session_model.go @@ -1068,7 +1068,8 @@ func storePaymentProviders(m *SessionModel, paymentMethodsResponse pro.PaymentMe return log.Errorf("Android Providers not found") } var paymentProviders []*protos.PaymentProviders - for index, provider := range providers { + for index := range providers { + provider := &providers[index] paymentProviders = nil path := pathPaymentMethods + ToString(int64(index)) for _, paymentMethod := range provider.Providers { @@ -1111,12 +1112,13 @@ func (session *SessionModel) getStripePubKey() (string, error) { } -func setPlans(m *baseModel, plans []protos.Plan) error { +func setPlans(m *baseModel, allPlans []protos.Plan) error { return pathdb.Mutate(m.db, func(tx pathdb.TX) error { - for _, plans := range plans { - log.Debugf("Plans Values %+v", &plans) + for i := range allPlans { + plans := &allPlans[i] + log.Debugf("Plans Values %+v", plans) pathPlanId := pathPlans + strings.Split(plans.Id, "-")[0] - err := pathdb.Put(tx, pathPlanId, &plans, "") + err := pathdb.Put(tx, pathPlanId, plans, "") if err != nil { log.Debugf("Error while addding price") return err