Skip to content

Commit

Permalink
Feat: PowerSync encryption with SQLCipher (#194)
Browse files Browse the repository at this point in the history
* Setup powersync core

* Fix tests running in core

* Move setup web script to core

* Remove dependencies from powersync

* Add back lints dev dependency to powersync

* - Working sqlcipher factory with tests
- Package refactoring and cleanup

* Download dynamic library for sqlciper tests

* Remove sqlcipher tests

* Clean up versions

* Cleanup print statement

* Cleanup powersync export

* Update locked versions

* Add license and notice

* Update pubspec.lock

* Move setup_web script back to powersync

* Fix tests
quoteString for encryption key

* Update readme and dependencies

* Copy powersync_db_worker to powersync_core for tests

* Update READMEs

* Update readme

* Update readme

* Readme polish

* More polish

* Explainer of the 3 SDKs, MySQL updates

* Update readme and lower initial release versions

* Improve dart demo

* Fix changelog versions

* Fix sed command for build numbers

* Update packages/powersync/README.md

Co-authored-by: Ralf Kistner <ralf@journeyapps.com>

* Fix preCommit version script

* New user agent based on core package

* chore(release): publish packages
 - powersync@1.10.0
 - powersync_core@1.0.0
 - powersync_sqlcipher@0.1.0
 - powersync_attachments_helper@0.6.16

* Trigger publish on new packages

---------

Co-authored-by: benitav <benitav@users.noreply.github.com>
Co-authored-by: benitav <benita@journeyapps.com>
Co-authored-by: Ralf Kistner <ralf@journeyapps.com>
  • Loading branch information
4 people authored Nov 12, 2024
1 parent 2286830 commit ea6186d
Show file tree
Hide file tree
Showing 145 changed files with 1,322 additions and 265 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- "powersync-v[0-9]+.[0-9]+.[0-9]+"
- "powersync_attachments_helper-v[0-9]+.[0-9]+.[0-9]+*"
- "powersync_flutter_libs-v[0-9]+.[0-9]+.[0-9]+*"
- "powersync_core-v[0-9]+.[0-9]+.[0-9]+*"
- "powersync_sqlcipher-v[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -35,7 +37,7 @@ jobs:
env:
GITHUBREF: ${{ github.ref }}
run: |
PACKAGE_NAME=$(sed -E 's/refs\/tags\/([a-z0-9_]+)-v([0-9]+\.[0-9]+\.[0-9]+)/\1/' <<< $GITHUBREF) && \
PACKAGE_NAME=$(sed -E 's/refs\/tags\/([a-z0-9_]+)-v([0-9]+\.[0-9]+\.[0-9]+(\+[0-9]+)?)/\1/' <<< $GITHUBREF) && \
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
echo "Package name: $PACKAGE_NAME"
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,34 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2024-11-12

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`powersync` - `v1.10.0`](#powersync---v1100)
- [`powersync_attachments_helper` - `v0.6.16`](#powersync_attachments_helper---v0616)
- [`powersync_core` - `v1.0.0`](#powersync_core---v100)
- [`powersync_sqlcipher` - `v0.1.0`](#powersync_sqlcipher---v010)

---

#### `powersync` - `v1.10.0`

#### `powersync_attachments_helper` - `v0.6.16`

#### `powersync_core` - `v1.0.0`

#### `powersync_sqlcipher` - `v0.1.0`


## 2024-11-11

### Changes
Expand Down
1 change: 1 addition & 0 deletions demos/benchmarks/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions demos/benchmarks/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
44 changes: 44 additions & 0 deletions demos/benchmarks/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
1 change: 1 addition & 0 deletions demos/benchmarks/macos/Flutter/Flutter-Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
1 change: 1 addition & 0 deletions demos/benchmarks/macos/Flutter/Flutter-Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
43 changes: 43 additions & 0 deletions demos/benchmarks/macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
platform :osx, '10.14'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
7 changes: 7 additions & 0 deletions demos/benchmarks/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,13 @@ packages:
relative: true
source: path
version: "1.9.2"
powersync_core:
dependency: "direct overridden"
description:
path: "../../packages/powersync_core"
relative: true
source: path
version: "0.0.1"
powersync_flutter_libs:
dependency: "direct overridden"
description:
Expand Down
2 changes: 1 addition & 1 deletion demos/benchmarks/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
powersync: ^1.9.3
powersync: ^1.10.0
path_provider: ^2.1.1
path: ^1.8.3
logging: ^1.2.0
Expand Down
7 changes: 7 additions & 0 deletions demos/django-todolist/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,13 @@ packages:
relative: true
source: path
version: "1.9.2"
powersync_core:
dependency: "direct overridden"
description:
path: "../../packages/powersync_core"
relative: true
source: path
version: "0.0.1"
powersync_flutter_libs:
dependency: "direct overridden"
description:
Expand Down
2 changes: 1 addition & 1 deletion demos/django-todolist/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
powersync: ^1.9.3
powersync: ^1.10.0
path_provider: ^2.1.1
path: ^1.8.3
logging: ^1.2.0
Expand Down
7 changes: 7 additions & 0 deletions demos/supabase-anonymous-auth/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,13 @@ packages:
relative: true
source: path
version: "1.9.2"
powersync_core:
dependency: "direct overridden"
description:
path: "../../packages/powersync_core"
relative: true
source: path
version: "0.0.1"
powersync_flutter_libs:
dependency: "direct overridden"
description:
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-anonymous-auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter

powersync: ^1.9.3
powersync: ^1.10.0
path_provider: ^2.1.1
supabase_flutter: ^2.0.2
path: ^1.8.3
Expand Down
7 changes: 7 additions & 0 deletions demos/supabase-edge-function-auth/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,13 @@ packages:
relative: true
source: path
version: "1.9.2"
powersync_core:
dependency: "direct overridden"
description:
path: "../../packages/powersync_core"
relative: true
source: path
version: "0.0.1"
powersync_flutter_libs:
dependency: "direct overridden"
description:
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-edge-function-auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter

powersync: ^1.9.3
powersync: ^1.10.0
path_provider: ^2.1.1
supabase_flutter: ^2.0.2
path: ^1.8.3
Expand Down
7 changes: 7 additions & 0 deletions demos/supabase-simple-chat/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,13 @@ packages:
relative: true
source: path
version: "1.9.2"
powersync_core:
dependency: "direct overridden"
description:
path: "../../packages/powersync_core"
relative: true
source: path
version: "0.0.1"
powersync_flutter_libs:
dependency: "direct overridden"
description:
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-simple-chat/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies:

supabase_flutter: ^2.0.2
timeago: ^3.6.0
powersync: ^1.9.3
powersync: ^1.10.0
path_provider: ^2.1.1
path: ^1.8.3
logging: ^1.2.0
Expand Down
7 changes: 7 additions & 0 deletions demos/supabase-todolist-drift/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,13 @@ packages:
relative: true
source: path
version: "0.6.15+1"
powersync_core:
dependency: "direct overridden"
description:
path: "../../packages/powersync_core"
relative: true
source: path
version: "0.0.1"
powersync_flutter_libs:
dependency: "direct overridden"
description:
Expand Down
4 changes: 2 additions & 2 deletions demos/supabase-todolist-drift/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ environment:
dependencies:
flutter:
sdk: flutter
powersync_attachments_helper: ^0.6.15+2
powersync: ^1.9.3
powersync_attachments_helper: ^0.6.16
powersync: ^1.10.0
path_provider: ^2.1.1
supabase_flutter: ^2.0.1
path: ^1.8.3
Expand Down
7 changes: 7 additions & 0 deletions demos/supabase-todolist-optional-sync/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,13 @@ packages:
relative: true
source: path
version: "1.9.2"
powersync_core:
dependency: "direct overridden"
description:
path: "../../packages/powersync_core"
relative: true
source: path
version: "0.0.1"
powersync_flutter_libs:
dependency: "direct overridden"
description:
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-todolist-optional-sync/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
powersync: ^1.9.3
powersync: ^1.10.0
path_provider: ^2.1.1
supabase_flutter: ^2.0.1
path: ^1.8.3
Expand Down
Loading

0 comments on commit ea6186d

Please sign in to comment.