Skip to content

Commit 6d47e33

Browse files
jigar-fmyleshortonclaudejay-418atavism
authored
Sync user follow up (#8509)
* Sync private server with radiance. * Add back account updates * Added support delete server * Added split tunnling methods * Remove unused methods * Remove unused code * Add with_clash_api,with_conntrack build tags to CI tests (#8510) The Makefile already uses these tags for all production builds, but the go.yml CI workflow ran tests without them. This meant conntrack (connection tracking) was disabled in tests, so code paths like graceful connection draining were never exercised in CI. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * remove pre-releases sooner and more thoroughly (#8506) * remove pre-releases sooner and more thoroughly * allow non-main nightlies, but cleanup the release * don't make releases for nightly builds, either * added support for ServerCredential and fixed UI issues * more update * OAuth account updates (#8513) * update delete account flow * save OAuth provider and map to delete account * Fixed some more Oauth issues * Fix issue on while signup using OAuth * use remote radiance * update IOS method channel * Update lantern_generated_bindings.dart * code review updates * More improvements * ran format * fix animaiton issue * more imporvements * fix account issue * update radiance with OAuth fix * Fix account delete dialog * Update en.po * Match last build version and number * code review updates (#8514) --------- Co-authored-by: atavism <atavism@users.noreply.github.com> * be selective on paths when running ci (#8507) * centerlize local saving logic * Remove more unused code * code review updates * ran format * update radiance * Update ffi.go * remove duplication. --------- Co-authored-by: Myles Horton <afisk@getlantern.org> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Jay <110402935+jay-418@users.noreply.github.com> Co-authored-by: atavism <atavism@users.noreply.github.com>
1 parent c5d67ef commit 6d47e33

98 files changed

Lines changed: 1773 additions & 2274 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/go.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@ name: Go CI
33
on:
44
push:
55
branches: [main]
6+
paths:
7+
- 'lantern-core/**'
8+
- 'go.mod'
9+
- 'go.sum'
10+
- '.github/workflows/go.yml'
611
pull_request:
7-
branches: [main]
12+
paths:
13+
- 'lantern-core/**'
14+
- 'go.mod'
15+
- 'go.sum'
16+
- '.github/workflows/go.yml'
817

918
jobs:
1019
build:
@@ -43,4 +52,4 @@ jobs:
4352
fi
4453
4554
- name: Run tests
46-
run: CGO_ENABLED=1 go test -v ./...
55+
run: CGO_ENABLED=1 go test -v -tags with_clash_api,with_conntrack ./...

.github/workflows/release-cleanup.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: |
2828
set -euo pipefail
2929
30-
DAYS_OLD=7
30+
DAYS_OLD=1
3131
CUTOFF_DATE=$(date -u -d "${DAYS_OLD} days ago" +%Y-%m-%dT%H:%M:%SZ)
3232
3333
gh release list -R "$GITHUB_REPOSITORY" \
@@ -38,7 +38,7 @@ jobs:
3838
if [[ "$DRY_RUN" == "true" ]]; then
3939
echo "DRY-RUN: $tag"
4040
else
41-
if ! gh release delete "$tag" -R "$GITHUB_REPOSITORY" --yes; then
41+
if ! gh release delete "$tag" --cleanup-tag -R "$GITHUB_REPOSITORY" --yes; then
4242
echo "Error: release deletion: $tag" >&2
4343
exit 1
4444
else

.github/workflows/release.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,18 @@ concurrency:
3939

4040
jobs:
4141
set-metadata:
42-
# Allow only tag-push releases, and only allow scheduled/manual release
43-
# workflows from the repository default branch (or jay/signpath for testing).
44-
if: ${{ startsWith(github.ref, 'refs/tags/') || (github.event_name != 'push' && (github.ref_name == github.event.repository.default_branch || github.ref_name == 'jay/signpath')) }}
42+
# Allow tag-push releases, scheduled builds from default branch,
43+
# and workflow_dispatch from any branch (non-main branches create
44+
# draft releases that are immediately deleted for testing).
45+
if: ${{ startsWith(github.ref, 'refs/tags/') || (github.event_name == 'schedule' && github.ref_name == github.event.repository.default_branch) || github.event_name == 'workflow_dispatch' }}
4546
runs-on: ubuntu-latest
4647
outputs:
4748
build_type: ${{ steps.meta.outputs.build_type }}
4849
release_tag: ${{ steps.meta.outputs.release_tag }}
4950
version: ${{ steps.meta.outputs.version }}
5051
installer_base_name: ${{ steps.meta.outputs.installer_base_name }}
5152
platform: ${{ steps.meta.outputs.platform }}
53+
is_test_run: ${{ steps.meta.outputs.is_test_run }}
5254
steps:
5355
- name: Checkout repo
5456
uses: actions/checkout@v4
@@ -144,11 +146,22 @@ jobs:
144146
echo " Platform: $PLATFORM"
145147
echo " Installer: $INSTALLER_BASE_NAME"
146148
149+
# Test run: workflow_dispatch from non-default branch
150+
IS_TEST_RUN="false"
151+
if [[ "$EVENT" == "workflow_dispatch" ]]; then
152+
DEFAULT_BRANCH="${{ github.event.repository.default_branch }}"
153+
if [[ "${{ github.ref_name }}" != "$DEFAULT_BRANCH" ]]; then
154+
IS_TEST_RUN="true"
155+
echo "Test run: draft release will be deleted after build"
156+
fi
157+
fi
158+
147159
echo "build_type=$BUILD_TYPE" >> $GITHUB_OUTPUT
148160
echo "release_tag=$RELEASE_TAG" >> $GITHUB_OUTPUT
149161
echo "version=$VERSION" >> $GITHUB_OUTPUT
150162
echo "platform=$PLATFORM" >> $GITHUB_OUTPUT
151163
echo "installer_base_name=$INSTALLER_BASE_NAME" >> $GITHUB_OUTPUT
164+
echo "is_test_run=$IS_TEST_RUN" >> $GITHUB_OUTPUT
152165
153166
- name: Update pubspec.yaml version
154167
shell: bash
@@ -564,7 +577,9 @@ jobs:
564577
runs-on: ubuntu-latest
565578
env:
566579
RELEASE_TAG: ${{ needs.set-metadata.outputs.release_tag }}
580+
BUILD_TYPE: ${{ needs.set-metadata.outputs.build_type }}
567581
CLEANUP_ON_FAILURE: ${{ github.event.inputs.cleanup_on_failure != 'false' }}
582+
IS_TEST_RUN: ${{ needs.set-metadata.outputs.is_test_run }}
568583
steps:
569584
- name: Checkout code
570585
uses: actions/checkout@v4
@@ -573,6 +588,8 @@ jobs:
573588

574589
- name: Publish release on success
575590
if: |
591+
env.IS_TEST_RUN != 'true' &&
592+
env.BUILD_TYPE != 'nightly' &&
576593
needs.upload-s3.result == 'success' &&
577594
needs.upload-release-artifacts.result == 'success' &&
578595
(needs.upload-google-play.result == 'success' || needs.upload-google-play.result == 'skipped') &&
@@ -583,21 +600,31 @@ jobs:
583600
echo "All steps succeeded - publishing draft release"
584601
gh release edit "$RELEASE_TAG" --draft=false
585602
586-
- name: Delete draft on failure (cleanup enabled)
603+
- name: Delete draft release
587604
if: |
588-
env.CLEANUP_ON_FAILURE == 'true' &&
589-
!(needs.upload-s3.result == 'success' &&
590-
needs.upload-release-artifacts.result == 'success' &&
591-
(needs.upload-google-play.result == 'success' || needs.upload-google-play.result == 'skipped') &&
592-
(needs.upload-testflight.result == 'success' || needs.upload-testflight.result == 'skipped'))
605+
env.IS_TEST_RUN == 'true' ||
606+
env.BUILD_TYPE == 'nightly' ||
607+
(env.CLEANUP_ON_FAILURE == 'true' &&
608+
!(needs.upload-s3.result == 'success' &&
609+
needs.upload-release-artifacts.result == 'success' &&
610+
(needs.upload-google-play.result == 'success' || needs.upload-google-play.result == 'skipped') &&
611+
(needs.upload-testflight.result == 'success' || needs.upload-testflight.result == 'skipped')))
593612
env:
594613
GH_TOKEN: ${{ github.token }}
595614
run: |
596-
echo "Build failed or cancelled - cleaning up draft release"
615+
if [[ "$IS_TEST_RUN" == "true" ]]; then
616+
echo "Test run from non-main branch - deleting draft release"
617+
elif [[ "$BUILD_TYPE" == "nightly" ]]; then
618+
echo "Nightly build - deleting draft release"
619+
else
620+
echo "Build failed or cancelled - cleaning up draft release"
621+
fi
597622
gh release delete "$RELEASE_TAG" --yes || true
598623
599624
- name: Report failure (cleanup disabled)
600625
if: |
626+
env.IS_TEST_RUN != 'true' &&
627+
env.BUILD_TYPE != 'nightly' &&
601628
env.CLEANUP_ON_FAILURE != 'true' &&
602629
!(needs.upload-s3.result == 'success' &&
603630
needs.upload-release-artifacts.result == 'success' &&

.github/workflows/transifex-push.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: "Push to transifex"
33
on:
44
push:
55
branches: [main]
6+
paths:
7+
- 'assets/locales/**'
8+
- '.tx/config'
9+
- '.github/workflows/transifex-push.yml'
610
workflow_dispatch:
711

812
jobs:

android/app/src/main/kotlin/org/getlantern/lantern/handler/MethodHandler.kt

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ enum class Methods(val method: String) {
9090
InviteToServerManagerInstance("inviteToServerManagerInstance"),
9191
RevokeServerManagerInstance("revokeServerManagerInstance"),
9292
AddServerBasedOnURLs("addServerBasedOnURLs"),
93-
93+
DeletePrivateServerByName("deletePrivateServerByName"),
94+
UpdatePrivateServerName("updatePrivateServerName"),
9495

9596
//custom/lantern servers
9697
GetLanternAvailableServers("getLanternAvailableServers"),
@@ -103,6 +104,8 @@ enum class Methods(val method: String) {
103104
RemoveSplitTunnelItem("removeSplitTunnelItem"),
104105
AddAllItems("addAllItems"),
105106
RemoveAllItems("removeAllItems"),
107+
GetSplitTunnelItems("getSplitTunnelItems"),
108+
GetSplitTunnelState("getSplitTunnelState"),
106109
InstalledApps("installedApps"),
107110
GetAppIcon("getAppIcon"),
108111

@@ -671,7 +674,8 @@ class MethodHandler : FlutterPlugin,
671674
val map = call.arguments as Map<*, *>
672675
val email = map["email"] as String? ?: error("Missing email")
673676
val password = map["password"] as String? ?: error("Missing password")
674-
val bytes = Mobile.deleteAccount(email, password)
677+
val isSSO = map["isSSO"] as Boolean? ?: error("Missing isSSO")
678+
val bytes = Mobile.deleteAccount(email, password,isSSO)
675679
withContext(Dispatchers.Main) {
676680
success(bytes)
677681
}
@@ -933,6 +937,66 @@ class MethodHandler : FlutterPlugin,
933937
}
934938
}
935939

940+
Methods.DeletePrivateServerByName.method -> {
941+
scope.launch {
942+
result.runCatching {
943+
val name = call.arguments as String? ?: error("Missing serverName")
944+
Mobile.deletePrivateServerByName(name)
945+
withContext(Dispatchers.Main) {
946+
success("ok")
947+
}
948+
}.onFailure { e ->
949+
result.error(
950+
"DELETE_PRIVATE_SERVER_ERROR",
951+
e.localizedMessage ?: "Error deleting private server",
952+
e
953+
)
954+
}
955+
}
956+
}
957+
958+
// Methods.UpdatePrivateServerName.method -> {
959+
// scope.launch {
960+
// result.runCatching {
961+
// val oldName = call.argument<String>("oldName") ?: error("Missing oldName")
962+
// val newName = call.argument<String>("newName") ?: error("Missing newName")
963+
// Mobile.updatePrivateServerName(oldName, newName)
964+
// withContext(Dispatchers.Main) {
965+
// success("ok")
966+
// }
967+
// }.onFailure { e ->
968+
// result.error(
969+
// "UPDATE_PRIVATE_SERVER_NAME_ERROR",
970+
// e.localizedMessage ?: "Error updating private server name",
971+
// e
972+
// )
973+
// }
974+
// }
975+
// }
976+
977+
Methods.GetSplitTunnelItems.method -> {
978+
scope.launch {
979+
result.runCatching {
980+
val filterType = call.argument<String>("filterType") ?: error("Missing filterType")
981+
val json = Mobile.getSplitTunnelItems(filterType)
982+
withContext(Dispatchers.Main) { success(json) }
983+
}.onFailure { e ->
984+
result.error("GET_SPLIT_TUNNEL_ITEMS_ERROR", e.localizedMessage ?: "Failed to get split tunnel items", e)
985+
}
986+
}
987+
}
988+
989+
Methods.GetSplitTunnelState.method -> {
990+
scope.launch {
991+
result.runCatching {
992+
val json = Mobile.getSplitTunnelStateJSON()
993+
withContext(Dispatchers.Main) { success(json) }
994+
}.onFailure { e ->
995+
result.error("GET_SPLIT_TUNNEL_STATE_ERROR", e.localizedMessage ?: "Failed to get split tunnel state", e)
996+
}
997+
}
998+
}
999+
9361000
Methods.FeatureFlag.method -> {
9371001
scope.launch {
9381002
result.runCatching {

assets/locales/en.po

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,6 +1485,22 @@ msgstr "System"
14851485
msgid "lantern_email"
14861486
msgstr "Lantern Email"
14871487

1488+
msgid "confirm_with_account"
1489+
msgstr "To confirm deletion please verify with your %s account below:"
1490+
1491+
msgid "oauth_different_account"
1492+
msgstr "The account you are trying to sign in with does not match the account associated with this email. Please sign in with the correct account or choose a different email."
1493+
1494+
msgid "account_deleted"
1495+
msgstr "Account Deleted"
1496+
1497+
msgid "account_deleted_message"
1498+
msgstr "Your account has been permanently deleted."
1499+
1500+
msgid "verify_with"
1501+
msgstr "Verify with %s"
1502+
1503+
14881504

14891505

14901506

0 commit comments

Comments
 (0)