Skip to content

Commit

Permalink
2.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
xal committed Jun 22, 2021
1 parent 754ab5d commit 0d6baaf
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 40 deletions.
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased
## [2.5.0] [internal] 2021 June 22

### Added
* Push notifications rich layouts: big text, big image, default
* Push notifications actions: reply to chat/mention, accept/reject follow request.

### Changed
* update Readme: describe receive_sharing_intent and iOS group ids
* remove empty time ago prefixes from localization
* **BREAKING. Push notifications rework**. Add support for new **version of PushRelayServer which don't decrypts message on server side**.
Fedi don't decrypt pushes too(it is not easy too implement and will be added later). Fedi use encrypted push message as trigger to load latest notification and display it to user. See more in Readme
* You should **re-subscribe for push notifications inside app to use new push relay server**. Otherwise you will see old behaviour.
* Update Readme: describe receive_sharing_intent and iOS group ids
* Update Readme: push notifications
* Remove empty time ago prefixes from localization


## [2.4.2] [internal] 2021 June 18

Expand Down
74 changes: 62 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,68 @@ Web Push Relay is Ruby on Rails server which handle Web pushes and proxy them to

* LINK TO PUSH RELAY REPO **(coming soon)**

Push Relay Server and Fedi can work in two modes:

* **Without server-side decryption (`2.5.0` and newver)** - Push Relay Server proxy simple proxy encr
* **With server-side decryption (before `2.5.0`)** - Decrypt messages and have access to notification content and user `access_token`. Not used from `2.5.0` version, but still supported in Fedi(see below why you still may want to use it).

### Without server-side decryption way
**(Used in AppStore/GooglePlay versions from `2.5.0`)**

1. Fedi subscribe to `/api/v1/push/subscription` with `subscription[endpoint]` set to relay server URL
2. Instances send Web push notifications to relay server
3. Relay server proxy decrypt notifications (will be removed in the future, Fedi will decrypt notifications on client side)
3. Relay server proxy **don't decrypt** message
4. Relay server proxy notifications to Fedi app via FCM
5. Fedi display notifications
5. Relay server proxy **don't decrypt** message and use FCM message with encrypted data as simple trigger to load latest notification via REST API (this will be improved in future releases)
6. Fedi display notification

##### Which data Push Relay server have without decryption?


```
{
:mutable_content=>true,
:content_available=>true,
:priority=>"high",
:data=>{
:crypto_key=>"dh=BF7CAl3J1o7jNf8i0dHxTwvY5QNx0v5LUN5CgjO6BUIUxa8q5RP9ML8HDWON9JplrMhwxWdM5EQZ0kfw3IXy_7Q;p256ecdsa=BMwPQzjwXKDqt5xZz6rGAa9iSWiEsO73UmNRoZwkaGOOQeW7_EEFcTVpzP-AqoZKcjiV_h88zSBAtaAYpBBwp5Y",
:salt=>"salt=PC48KPkE4izfdQilBfOF_w",
:payload=>"9crGlId2xj5RVjxig1MS-g3B3CX2jVOnTY8gxsFo_yUVWLN_y_oAU0wrh-YG6PWC_W0t8Ub9tQEoySHJSeOJ7l3euiTKUeccxowV6lcF-V9Vhi9yx4bX52eKxKjII9n9WNCByU1J6oHcGo3CwHMyr0Tyn3HVwqzm9hJ2-TjP3Y2Iir-aor96mskTehbes7SY-QCYVT1FoI6xvgGFE0NmduKwYCe6BwqHqsuNSwIXiaWANwa07aLAtv3zlqFkBkSD-NwAVxJ2MTmsRGnEPoNb05k4Wbl6Kkct6ZqWoFd6C_FVDwtVG6Odo_RPWXsIEw3qh4koUMZwGve_MK3mGYejNbxWqjFxXcooZd6KedMrZ8200fcDWhToPyB52rgRARLp0JamBi4Q99nrIKPIHI0c4numKk7zJE9-6mwxN1T84NliWTMVKRUORwtnpjnodIumhg==",
:account=>"jffdev",
:server=>"fedi.app"
}
}
```

Since PushRelayServer don't know private decryption keys, it is can't access any privacy data.

##### Pros
* **Don't have access to user private data**
* Use rich notifications layouts and actions provided by [`awesome_notifications`](https://pub.dev/packages/awesome_notifications)

* Notifications are not enabled by default and Fedi ask you about notification after login.
* You can also disable notifications later in any time.
* You can completely remove FCM and Push Relay Usage(or use your own FCM credentials and Push Relay server instance)

### Which data Push Relay server have access after decryption?
##### Cons
* Delivery may be delayed. Because server send FCM push message without `notification` (FCM calls it data message). Read [`awesome_notifications`](https://pub.dev/packages/awesome_notifications) and [`firebase_messaging`](https://pub.dev/packages/firebase_messaging) documentation for details. Fedi use `:mutable_content=>true,` `:content_available=>true,` `:priority=>"high",` to increase priority

##### Whe Fedi don't decrypt message on client-side?

Because it is hard to implement with Flutter. There are no 3rd Flutter libraries to decrypt `ECDH` `p256v1` by now.
It is possible to decrypt in Kotlin/Swift and it will be done in the future.

### With server-side decryption way
**(Not used in AppStore/GooglePlay versions from `2.5.0`)**

1. Fedi subscribe to `/api/v1/push/subscription` with `subscription[endpoint]` set to relay server URL
2. Instances send Web push notifications to relay server
3. Relay server proxy **decrypt** notifications
4. Relay server proxy notifications to Fedi app via FCM
5. Fedi display notification

##### Which data Push Relay server have access after decryption?


```
{
{
"access_token""=>""QiQGKu6wAsF6M3bWJ3FMTvfK_rW...",
"body""=>"@jffdev2: @jffdev hello world",
"icon""=>""https://fedi.app/images/avi.png",
Expand All @@ -132,12 +179,14 @@ Web Push Relay is Ruby on Rails server which handle Web pushes and proxy them to
* As you can see server sent `body` which may have private data(like private Status body) and `access_token`
* `access_token` is sensitive data. It is possible to login to your account if someone know `access_token`

Currently Wep Push Relay server known about Private and Public keys used for decryption notification messages.
It was not possible to decrypt message on Flutter side and display notification. Main issue was with FCM library.
However latest FCM library release and another 3rd party libraries like [`awesome_notifications](https://pub.dev/packages/awesome_notifications)
provides API to move all decryption logic on Flutter side and Fedi will implement this logic ASAP.
##### Pros
* Faster push delivery. Because FCM push message are actial FCM message type with `notification.title` and `notification.body`. Which have higher priority than message without `notification.title` & `notification.body` fields. Actually it is more affects iOS, than Android. Read [`awesome_notifications`](https://pub.dev/packages/awesome_notifications) and [`firebase_messaging`](https://pub.dev/packages/firebase_messaging) documentation for details. Anyway both ways usually deliver notification in ~1min

##### Cons
* **Private data access is main reason why Fedi moved to `Without server-side decryption way`**
* Don't use rich notifications layouts and actions provided by [`awesome_notifications`](https://pub.dev/packages/awesome_notifications)


Push Relay will know nothing(everything will be encrypted) once decryption logic will be moved to Flutter side.

## Localization

Expand Down Expand Up @@ -219,6 +268,7 @@ More info you can found in FVM documentation
- `flutter_intl` for localization via `.arb` files
- A lot of UI-related(like [`pull_to_refresh`](https://pub.dev/packages/pull_to_refresh)) and Platform-dependent(like [`permission_handler`](https://pub.dev/packages/permission_handler)) libraries
- [`flutter_config`](https://pub.dev/packages/flutter_config) to config via .env files
- [`firebase_messaging`](https://pub.dev/packages/firebase_messaging) and [`awesome_notifications`](https://pub.dev/packages/awesome_notifications) for push notifications

You can find full list in [`pubspec.yaml`](./pubspec.yaml) where each library have comment why it's used

Expand Down
48 changes: 24 additions & 24 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-prod";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 264;
CURRENT_PROJECT_VERSION = 265;
CUSTOM_GROUP_ID = group.fediverse.app;
DEVELOPMENT_TEAM = 3NTC8QAP8B;
ENABLE_BITCODE = NO;
Expand All @@ -697,7 +697,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.fediverse.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -771,7 +771,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-dev";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-dev.entitlements";
CURRENT_PROJECT_VERSION = 264;
CURRENT_PROJECT_VERSION = 265;
CUSTOM_GROUP_ID = group.com.fediverse.app2;
DEVELOPMENT_TEAM = 5877VK992M;
ENABLE_BITCODE = NO;
Expand All @@ -785,7 +785,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.fediverse.app2;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -855,7 +855,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-dev";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-dev.entitlements";
CURRENT_PROJECT_VERSION = 264;
CURRENT_PROJECT_VERSION = 265;
CUSTOM_GROUP_ID = group.com.fediverse.app2;
DEVELOPMENT_TEAM = 5877VK992M;
ENABLE_BITCODE = NO;
Expand All @@ -869,7 +869,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.fediverse.app2;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -937,7 +937,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-dev";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerProfile-dev.entitlements";
CURRENT_PROJECT_VERSION = 264;
CURRENT_PROJECT_VERSION = 265;
CUSTOM_GROUP_ID = group.com.fediverse.app2;
DEVELOPMENT_TEAM = 5877VK992M;
ENABLE_BITCODE = NO;
Expand All @@ -951,7 +951,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.fediverse.app2;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -1075,7 +1075,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-prod";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 264;
CURRENT_PROJECT_VERSION = 265;
CUSTOM_GROUP_ID = group.fediverse.app;
DEVELOPMENT_TEAM = 3NTC8QAP8B;
ENABLE_BITCODE = NO;
Expand All @@ -1089,7 +1089,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.fediverse.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand All @@ -1109,7 +1109,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-prod";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 264;
CURRENT_PROJECT_VERSION = 265;
CUSTOM_GROUP_ID = group.fediverse.app;
DEVELOPMENT_TEAM = 3NTC8QAP8B;
ENABLE_BITCODE = NO;
Expand All @@ -1123,7 +1123,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.fediverse.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -1169,7 +1169,7 @@
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 264;
CURRENT_PROJECT_VERSION = 265;
CUSTOM_GROUP_ID = group.fediverse.app;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 3NTC8QAP8B;
Expand All @@ -1192,7 +1192,7 @@
INFOPLIST_FILE = "Share Extension/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -1244,7 +1244,7 @@
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share ExtensionDebug-dev.entitlements";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 264;
CURRENT_PROJECT_VERSION = 265;
CUSTOM_GROUP_ID = group.com.fediverse.app2;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 5877VK992M;
Expand All @@ -1267,7 +1267,7 @@
INFOPLIST_FILE = "Share Extension/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -1319,7 +1319,7 @@
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 264;
CURRENT_PROJECT_VERSION = 265;
CUSTOM_GROUP_ID = group.fediverse.app;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 3NTC8QAP8B;
Expand All @@ -1336,7 +1336,7 @@
INFOPLIST_FILE = "Share Extension/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.fediverse.app.Share-ExtensionNew";
Expand Down Expand Up @@ -1387,7 +1387,7 @@
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share ExtensionRelease-dev.entitlements";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 264;
CURRENT_PROJECT_VERSION = 265;
CUSTOM_GROUP_ID = group.com.fediverse.app2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 5877VK992M;
Expand All @@ -1404,7 +1404,7 @@
INFOPLIST_FILE = "Share Extension/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.fediverse.app2.Share-Extension";
Expand Down Expand Up @@ -1455,7 +1455,7 @@
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 264;
CURRENT_PROJECT_VERSION = 265;
CUSTOM_GROUP_ID = group.fediverse.app;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 3NTC8QAP8B;
Expand All @@ -1472,7 +1472,7 @@
INFOPLIST_FILE = "Share Extension/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.fediverse.app.Share-ExtensionNew";
Expand Down Expand Up @@ -1523,7 +1523,7 @@
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share ExtensionProfile-dev.entitlements";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 264;
CURRENT_PROJECT_VERSION = 265;
CUSTOM_GROUP_ID = group.com.fediverse.app2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 5877VK992M;
Expand All @@ -1540,7 +1540,7 @@
INFOPLIST_FILE = "Share Extension/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.fediverse.app2.Share-Extension";
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: A new Flutter project.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.4.2+264
version: 2.5.0+265

publish_to: none

Expand Down

0 comments on commit 0d6baaf

Please sign in to comment.