Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare IOS 8.0.3 and CI changes for IOS #1266

Merged
merged 18 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 8 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
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
p12-file-base64: ${{ secrets.MACOS_BNS_CERT }}
p12-password: ${{ secrets.MACOS_BNS_CERT_PASS }}

- name: Install the Apple certificate and provisioning profile
- name: Install the Apple certificate and provisioning profile IOS
if: matrix.platform == 'ios'
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.IOS_CERTIFICATE_P12_BASE64 }}
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
echo -n "$BUILD_TUNNEL_PROVISION_PROFILE_BASE64" | base64 --decode -o $TPP_PATH
cp $TPP_PATH ~/Library/MobileDevice/Provisioning\ Profiles

# Create ExportOptions.plist
# Create ExportOptions.plist
echo "$EXPORT_OPTIONS" | base64 --decode > "$EXPORT_OPTIONS_PATH"

- name: Setup Sentry CLI on Android
Expand Down Expand Up @@ -196,7 +196,6 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: "stable"

- run: flutter --version

- name: Setup JDK
Expand Down Expand Up @@ -298,7 +297,11 @@ jobs:
if: matrix.platform == 'android' && matrix.target == 'aab'
run: make debug-symbols

- name: Build Flutter app
- name: Setup Sentry CLI on IOS
if: matrix.platform == 'ios'
uses: mathieu-bour/setup-sentry-cli@v2

- name: Build Flutter app (iOS, Linux, macOS)
if: matrix.platform != 'windows' && matrix.platform != 'android'
run: make ${{ matrix.platform }}-release
env:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@ jobs:
vf = 'version-android-dev.txt'
version = '9999.99.99-dev'
else:
a = ref.strip().replace('refs/tags/lantern-', '')
tag = ref.strip()
if tag.startswith('refs/tags/android-lantern-'):
a = tag.replace('refs/tags/android-lantern-', '')
elif tag.startswith('refs/tags/ios-lantern-'):
a = tag.replace('refs/tags/ios-lantern-', '')
elif tag.startswith('refs/tags/desktop-lantern-'):
a = tag.replace('refs/tags/desktop-lantern-', '')
else:
a = tag.replace('refs/tags/lantern-', '')
parts = a.split('-',1)
suffix = parts[1] if len(parts)>1 else ''
beta = 'beta' in suffix
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ set-version:
NEXT_BUILD=$$(($$CURRENT_BUILD + 1)); \
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $$NEXT_BUILD" $(INFO_PLIST)

ios: macos build-framework ffigen
#ios: macos build-framework ffigen
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this supposed to be commented out? There's a step in CI that depends on this to build the Lantern library:

      - name: Build Lantern Library
        shell: bash
        run: make ${{matrix.platform}}
        env:
          VERSION: ${{ env.version }}

We still need to do make build-framework, right?

Copy link
Contributor Author

@jigar-f jigar-f Dec 19, 2024

Choose a reason for hiding this comment

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

No, we don't, build-framework was renamed to ios.


ios-release: set-version guard-SENTRY_AUTH_TOKEN guard-SENTRY_ORG guard-SENTRY_PROJECT_IOS pubget
ios-release:require-version set-version guard-SENTRY_AUTH_TOKEN guard-SENTRY_ORG guard-SENTRY_PROJECT_IOS
@echo "Flutter Clean"
flutter clean
@echo "Flutter pub get"
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ require (
github.com/getlantern/eventual/v2 v2.0.2
github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c
github.com/getlantern/flashlight/v7 v7.6.165
github.com/getlantern/fronted v0.0.0-20241212194832-a55b6db2616e
github.com/getlantern/geolookup v0.0.0-20230327091034-aebe73c6eef4
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
Expand Down Expand Up @@ -87,8 +89,6 @@ require (
github.com/cloudflare/circl v1.3.7 // indirect
github.com/coder/websocket v1.8.12 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/getlantern/fronted v0.0.0-20241212194832-a55b6db2616e // indirect
github.com/getlantern/geolookup v0.0.0-20230327091034-aebe73c6eef4 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/gookit/color v1.5.4 // indirect
github.com/lithammer/fuzzysearch v1.1.8 // indirect
Expand Down
21 changes: 17 additions & 4 deletions internalsdk/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ type AuthClient interface {

// NewClient creates a new instance of AuthClient
func NewClient(baseURL string, userConfig func() common.UserConfig) AuthClient {
var httpClient *http.Client

if strings.HasSuffix(baseURL, common.APIBaseUrl) {
log.Debugf("Using Fronted proxy for auth client")
// iOS
// There is no use of chnained proxy in iOS since all requests will fail
httpClient = &http.Client{
Transport: proxied.Fronted("authClient-ios"),
Timeout: 30 * time.Second,
}
} else {
httpClient = &http.Client{
Transport: proxied.ChainedThenFronted(),
Timeout: 30 * time.Second,
}
}
rc := webclient.NewRESTClient(&webclient.Opts{
BaseURL: baseURL,
OnBeforeRequest: func(client *resty.Client, req *http.Request) error {
Expand All @@ -59,10 +75,7 @@ func NewClient(baseURL string, userConfig func() common.UserConfig) AuthClient {
},
// The Auth client uses an http.Client that first attempts to connect via chained proxies
// and then falls back to using domain fronting with the custom op name above
HttpClient: &http.Client{
Transport: proxied.ChainedThenFronted(),
Timeout: 30 * time.Second,
},
HttpClient: httpClient,
UserConfig: userConfig,
})
return &authClient{rc}
Expand Down
14 changes: 8 additions & 6 deletions internalsdk/ios/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type UserConfig struct {
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))
log.Debugf("Configured completed in %v seconds", time.Since(start).Seconds())
}(time.Now())
result := &ConfigResult{}
if err := cf.writeUserConfig(); err != nil {
Expand All @@ -128,12 +128,13 @@ func (cf *configurer) Configure(userID int, proToken string, refreshProxies bool
var globalUpdated, proxiesUpdated bool

setupFronting := func() error {
start := time.Now()
log.Debug("Setting up fronting")
defer log.Debug("Set up fronting")
if frontingErr := cf.configureFronting(global, shortFrontedAvailableTimeout); frontingErr != nil {
defer log.Debugf("Setting up fronting completed in %v", time.Since(start).Seconds())
if frontingErr := cf.configureFronting(global); 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.DefaultTransport, global, globalEtag, "https://raw.githubusercontent.com/getlantern/lantern-binaries/main/cloud.yaml.gz")
return cf.configureFronting(global, longFrontedAvailableTimeout)
return cf.configureFronting(global)
}
return nil
}
Expand All @@ -158,10 +159,11 @@ func (cf *configurer) Configure(userID int, proToken string, refreshProxies bool
log.Errorf("Unable to save updated UserConfig with country and allow probes: %v", err)
}
}()

globalStart := time.Now()
log.Debug("Updating global config")
global, globalUpdated = cf.updateGlobal(cf.rt, global, globalEtag, "https://globalconfig.flashlightproxy.com/global.yaml.gz")
log.Debug("Updated global config")
log.Debugf("Global config update completed in %v seconds", time.Since(globalStart).Seconds())
if refreshProxies {
log.Debug("Refreshing proxies")
proxies, proxiesUpdated = cf.updateProxies(proxies, proxiesEtag)
Expand Down Expand Up @@ -409,7 +411,7 @@ func (cf *configurer) doUpdateFromWeb(rt http.RoundTripper, name string, etag st
return bytes, newEtag, nil
}

func (cf *configurer) configureFronting(global *config.Global, timeout time.Duration) error {
func (cf *configurer) configureFronting(global *config.Global) error {
log.Debug("Configuring fronting")
certs, err := global.TrustedCACerts()
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions internalsdk/ios/ios.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const (
maxDNSGrabAge = 1 * time.Hour // this doesn't need to be long because our fake DNS records have a TTL of only 1 second. We use a smaller value than on Android to be conservative with memory usag.

quotaSaveInterval = 1 * time.Minute
shortFrontedAvailableTimeout = 30 * time.Second
longFrontedAvailableTimeout = 5 * time.Minute

logMemoryInterval = 5 * time.Second
forceGCInterval = 250 * time.Millisecond
Expand Down
18 changes: 14 additions & 4 deletions internalsdk/pro/pro.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,27 @@ type ProClient interface {

// NewClient creates a new instance of ProClient
func NewClient(baseURL string, userConfig func() common.UserConfig) ProClient {
var httpClient *http.Client
if common.Platform == "ios" {
//For iOS use fronted proxy chined proxy does not work with iOS at the moment
httpClient = &http.Client{
Transport: proxied.Fronted("proclient-ios"),
Timeout: 30 * time.Second,
}
} else {
httpClient = &http.Client{
Transport: proxied.ParallelForIdempotent(),
Timeout: 30 * time.Second,
}
}
return &proClient{
userConfig: userConfig,
backoffRunner: &backoffRunner{},
RESTClient: webclient.NewRESTClient(&webclient.Opts{
// The default http.RoundTripper used by the ProClient is ParallelForIdempotent which
// attempts to send requests through both chained and direct fronted routes in parallel
// for HEAD and GET requests and ChainedThenFronted for all others.
HttpClient: &http.Client{
Transport: proxied.ParallelForIdempotent(),
Timeout: 30 * time.Second,
},
HttpClient: httpClient,
OnBeforeRequest: func(client *resty.Client, req *http.Request) error {
prepareProRequest(req, common.ProAPIHost, userConfig())
return nil
Expand Down
4 changes: 2 additions & 2 deletions internalsdk/session_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (m *SessionModel) setupIosConfigure(configPath string, userId int, token st
return
}
m.iosConfigurer = global
log.Debugf("Found global config IOS configure done %v", global)
log.Debug("Found global config IOS configure done")
return // Exit the loop after success
}
log.Debugf("global config not available, retrying...")
Expand Down Expand Up @@ -506,7 +506,7 @@ func (m *SessionModel) doInvokeMethod(method string, arguments Arguments) (inter
ttlSeconds := arguments.Get("ttlSeconds").Int()
err := m.BandwidthUpdate(percent, mibUsed, mibAllowed, ttlSeconds)
if err != nil {
return nil, err
return nil, log.Errorf("Error while updating bandwidth %v", err)
}
return true, nil
case "isUserFirstTimeVisit":
Expand Down
61 changes: 31 additions & 30 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ PODS:
- fluttertoast (0.0.2):
- Flutter
- Toast
- Google-Mobile-Ads-SDK (11.2.0):
- Google-Mobile-Ads-SDK (11.10.0):
- GoogleUserMessagingPlatform (>= 1.1)
- google_mobile_ads (5.1.0):
- google_mobile_ads (5.2.0):
- Flutter
- Google-Mobile-Ads-SDK (~> 11.2.0)
- Google-Mobile-Ads-SDK (~> 11.10.0)
- webview_flutter_wkwebview
- GoogleUserMessagingPlatform (2.6.0)
- GoogleUserMessagingPlatform (2.7.0)
- in_app_purchase_storekit (0.0.1):
- Flutter
- FlutterMacOS
Expand Down Expand Up @@ -109,23 +109,23 @@ PODS:
- qr_code_scanner (0.2.0):
- Flutter
- MTBBarcodeScanner
- SDWebImage (5.19.7):
- SDWebImage/Core (= 5.19.7)
- SDWebImage/Core (5.19.7)
- SDWebImage (5.20.0):
- SDWebImage/Core (= 5.20.0)
- SDWebImage/Core (5.20.0)
- SDWebImageWebPCoder (0.14.6):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.17)
- Sentry/HybridSDK (8.36.0)
- sentry_flutter (8.9.0):
- Sentry/HybridSDK (8.40.1)
- sentry_flutter (8.10.1):
- Flutter
- FlutterMacOS
- Sentry/HybridSDK (= 8.36.0)
- Sentry/HybridSDK (= 8.40.1)
- share_plus (0.0.1):
- Flutter
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite (0.0.3):
- sqflite_darwin (0.0.4):
- Flutter
- FlutterMacOS
- SwiftyGif (5.4.5)
Expand All @@ -141,6 +141,7 @@ PODS:
- libwebp
- webview_flutter_wkwebview (0.0.1):
- Flutter
- FlutterMacOS

DEPENDENCIES:
- app_links (from `.symlinks/plugins/app_links/ios`)
Expand All @@ -167,12 +168,12 @@ DEPENDENCIES:
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
- sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
- Toast-Swift (~> 5.0.1)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
- video_thumbnail (from `.symlinks/plugins/video_thumbnail/ios`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/darwin`)

SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
Expand Down Expand Up @@ -241,23 +242,23 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/share_plus/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite:
:path: ".symlinks/plugins/sqflite/darwin"
sqflite_darwin:
:path: ".symlinks/plugins/sqflite_darwin/darwin"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/darwin"
video_thumbnail:
:path: ".symlinks/plugins/video_thumbnail/ios"
webview_flutter_wkwebview:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
:path: ".symlinks/plugins/webview_flutter_wkwebview/darwin"

SPEC CHECKSUMS:
Alamofire: 814429acc853c6c54ff123fc3d2ef66803823ce0
app_links: e7a6750a915a9e161c58d91bc610e8cd1d4d0ad0
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d
connectivity_plus: 4c41c08fc6d7c91f63bc7aec70ffe3730b04f563
device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
emoji_picker_flutter: fe2e6151c5b548e975d546e6eeb567daf0962a58
Expand All @@ -266,38 +267,38 @@ SPEC CHECKSUMS:
flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e
flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
flutter_local_notifications: df98d66e515e1ca797af436137b4459b160ad8c9
flutter_pdfview: 25f53dd6097661e6395b17de506e6060585946bd
flutter_uploader: 2b07c4d41cf1218f25e6d5b8bcfa2d913838e27c
fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c
Google-Mobile-Ads-SDK: 5a6d005a6cb5b5e8f4c7b69ca05cdea79c181139
google_mobile_ads: 9379c80fdfa9988fb0e105a407890ff8deb3cf86
GoogleUserMessagingPlatform: 0c3a08353e53ce8c2feab7addd0b652cde522450
Google-Mobile-Ads-SDK: 13e6e98edfd78ad8d8a791edb927658cc260a56f
google_mobile_ads: 2a538d8e42b1813809782792e48f8cf4374c2180
GoogleUserMessagingPlatform: a8b56893477f67212fbc8411c139e61d463349f5
in_app_purchase_storekit: 8c3b0b3eb1b0f04efbff401c3de6266d4258d433
integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3
SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
Sentry: f8374b5415bc38dfb5645941b3ae31230fbeae57
sentry_flutter: 0eb93e5279eb41e2392212afe1ccd2fecb4f8cbe
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
Sentry: e9215d7b17f7902692b4f8700e061e4f853e3521
sentry_flutter: 927eed60d66951d1b0f1db37fe94ff5cb7c80231
share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
Toast-Swift: 9b6a70f28b3bf0b96c40d46c0c4b9d6639846711
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
video_thumbnail: c4e2a3c539e247d4de13cd545344fd2d26ffafd1
webview_flutter_wkwebview: 2a23822e9039b7b1bc52e5add778e5d89ad488d1
webview_flutter_wkwebview: 0982481e3d9c78fd5c6f62a002fcd24fc791f1e4

PODFILE CHECKSUM: edbeaea3b499feb7b2b276309b09c237de1a6cff

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
Loading
Loading