Skip to content

Commit

Permalink
Merge branch 'develop' into fix/1966
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiM committed Jan 24, 2024
2 parents 903760e + e54b57c commit adf5d3e
Show file tree
Hide file tree
Showing 25 changed files with 39 additions and 169 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[2.1.0] - unreleased

* refactor: Remove SAVE_OWNER_CERTIFICATE event

* refactor: Remove registrar remainders and rename LAUNCH_REGISTRAR

* refactor: Remove unused SEND_USER_CERTIFICATE event
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Encrypted p2p team chat with no servers, just Tor.
<br />
<!-- <a href="https://tryquiet.org"><strong>tryquiet.org »</strong></a> -->
<a href="https://github.com/TryQuiet/quiet/releases/tag/%40quiet%2Fdesktop%402.0.0"><strong>Downloads</strong></a> |
<a href="https://github.com/TryQuiet/quiet/releases/tag/%40quiet%2Fdesktop%402.0.1"><strong>Downloads</strong></a> |
<a href="#how-it-works"><strong>How it Works</strong></a> |
<a href="#features"><strong>Features</strong></a> |
<a href="https://github.com/TryQuiet/monorepo/wiki/Threat-Model"><strong>Threat Model</strong></a> |
Expand Down Expand Up @@ -137,6 +137,6 @@ Join us, and let's figure this out.

Even though Quiet is completely peer-to-peer, it is mostly written in TypeScript and will be familiar to anyone accustomed to Node.js web development. Desktop and mobile versions share a common Node.js [backend](https://github.com/TryQuiet/monorepo/tree/develop/packages/backend) and React [state manager](https://github.com/TryQuiet/monorepo/tree/develop/packages/state-manager), with [Tor](https://torproject.org) binaries for each platform and architecture, using Electron and React Native and for their respective frontends.

To get started hacking on Quiet, follow the instructions for [Quiet Desktop](https://github.com/TryQuiet/quiet/blob/develop/packages/desktop/README.md) or [Quiet Mobile](https://github.com/TryQuiet/monorepo/tree/develop/packages/mobile#readme). (If you're new to the project, start with Quiet Desktop, as it's more stable and vastly easier to start hacking on.) Here are some [good first issues](https://github.com/orgs/TryQuiet/projects/3/views/1?filterQuery=label%3A%22good+first+issue%22), and you can see upcoming priorities in our [project board](https://github.com/orgs/TryQuiet/projects/3/views/1).
To get started hacking on Quiet, follow the instructions for [Quiet Desktop](https://github.com/TryQuiet/quiet/blob/develop/packages/desktop/README.md) or [Quiet Mobile](https://github.com/TryQuiet/monorepo/tree/develop/packages/mobile#readme). (If you're new to the project, start with Quiet Desktop, as it's more stable and vastly easier to start hacking on.) Here are some [good first issues](https://github.com/orgs/TryQuiet/projects/3/views/4?filterQuery=label%3A%22good+first+issue%22), and you can see upcoming priorities in our [project board](https://github.com/orgs/TryQuiet/projects/3/views/4).

Most of all, if you're interested in contributing, be in touch! Drop us a line at [[email protected]](mailto:[email protected]) and we'll add you to the project's Quiet community and (if you like) plan an onboarding session.
1 change: 0 additions & 1 deletion packages/backend/src/nest/socket/socket.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ describe('SocketService', () => {
SocketActionTypes.LAUNCH_COMMUNITY.valueOf(),
SocketActionTypes.REGISTER_OWNER_CERTIFICATE.valueOf(),
SocketActionTypes.REGISTER_USER_CERTIFICATE.valueOf(),
SocketActionTypes.SAVE_OWNER_CERTIFICATE.valueOf(),
SocketActionTypes.SAVE_USER_CSR.valueOf(),
SocketActionTypes.SEND_COMMUNITY_METADATA.valueOf(),
]
Expand Down
13 changes: 0 additions & 13 deletions packages/backend/src/nest/socket/socket.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,6 @@ export class SocketService extends EventEmitter implements OnModuleInit {
this.emit(SocketActionTypes.CONNECTION_PROCESS_INFO, ConnectionProcessInfo.REGISTERING_OWNER_CERTIFICATE)
})

socket.on(SocketActionTypes.SAVE_OWNER_CERTIFICATE, async (payload: SaveOwnerCertificatePayload) => {
this.logger(`Saving owner certificate (${payload.peerId}), community: ${payload.id}`)

this.emit(SocketActionTypes.SAVED_OWNER_CERTIFICATE, payload)

const communityMetadataPayload: CommunityMetadata = {
id: payload.id,
rootCa: payload.permsData.certificate,
ownerCertificate: payload.certificate,
}
this.emit(SocketActionTypes.SEND_COMMUNITY_METADATA, communityMetadataPayload)
})

// ====== Community ======
socket.on(SocketActionTypes.SEND_COMMUNITY_METADATA, (payload: CommunityMetadata) => {
this.emit(SocketActionTypes.SEND_COMMUNITY_METADATA, payload)
Expand Down
16 changes: 0 additions & 16 deletions packages/desktop/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.0.1-alpha.1](https://github.com/TryQuiet/quiet/compare/@quiet/[email protected]...@quiet/[email protected]) (2024-01-22)


### Bug Fixes

* Make community name field text visible on create community page ([#2233](https://github.com/TryQuiet/quiet/issues/2233)) ([70697ad](https://github.com/TryQuiet/quiet/commit/70697ad76e50d084e217bb7035e9c94f34e15d77))





[2.0.1]

# Fixes:
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
},
"homepage": "https://github.com/TryQuiet",
"@comment version": "To build new version for specific platform, just replace platform in version tag to one of following linux, mac, windows",
"version": "2.0.1-alpha.1",
"version": "2.0.1",
"description": "Decentralized team chat",
"main": "dist/main/main.js",
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion packages/desktop/src/rtl-tests/community.create.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ describe('User', () => {
"Network/addInitializedCommunity",
"Communities/clearInvitationCodes",
"Communities/sendCommunityMetadata",
"Identity/saveOwnerCertToDb",
"PublicChannels/createGeneralChannel",
"Identity/saveUserCsr",
"PublicChannels/channelsReplicated",
Expand Down
1 change: 0 additions & 1 deletion packages/desktop/src/rtl-tests/community.join.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ describe('User', () => {
"Files/checkForMissingFiles",
"Network/addInitializedCommunity",
"Communities/clearInvitationCodes",
"Communities/sendCommunityMetadata",
"PublicChannels/channelsReplicated",
"PublicChannels/addChannel",
"Messages/addPublicChannelsMessagesBase",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('General channel', () => {

expect(actions).toMatchInlineSnapshot(`
Array [
"Identity/saveOwnerCertToDb",
"Communities/sendCommunityMetadata",
"PublicChannels/createGeneralChannel",
"Identity/saveUserCsr",
"PublicChannels/createChannel",
Expand Down
13 changes: 0 additions & 13 deletions packages/mobile/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.0.1-alpha.1](https://github.com/TryQuiet/quiet/compare/@quiet/[email protected]...@quiet/[email protected]) (2024-01-22)

**Note:** Version bump only for package @quiet/mobile





[2.0.1]

# Fixes:
Expand Down
4 changes: 2 additions & 2 deletions packages/mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ android {
applicationId "com.quietmobile"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 390
versionName "2.0.1-alpha.1"
versionCode 391
versionName "2.0.1"
resValue "string", "build_config_package", "com.quietmobile"
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/ios/Quiet/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>347</string>
<string>348</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false />
<key>LSRequiresIPhoneOS</key>
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/ios/QuietTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>347</string>
<string>348</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions packages/mobile/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@quiet/mobile",
"version": "2.0.1-alpha.1",
"version": "2.0.1",
"scripts": {
"build": "tsc -p tsconfig.build.json --noEmit",
"storybook-android": "ENVFILE=.env.storybook react-native run-android --variant=storybookDebug --appIdSuffix=storybook.debug",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@ import { apply, select } from 'typed-redux-saga'
import { applyEmitParams, type Socket } from '../../../types'
import { communitiesSelectors } from '../communities.selectors'
import { communitiesActions } from '../communities.slice'
import { identitySelectors } from '../../identity/identity.selectors'

export function* sendCommunityMetadataSaga(
socket: Socket,
_action: PayloadAction<ReturnType<typeof communitiesActions.sendCommunityMetadata>['payload']>
): Generator {
const identity = yield* select(identitySelectors.currentIdentity)
const community = yield* select(communitiesSelectors.currentCommunity)

if (!identity?.userCertificate) {
console.error('Cannot send community metadata, no owner certificate')
return
}

if (!community) {
console.error('Cannot send community metadata, no community')
return
Expand All @@ -22,9 +30,10 @@ export function* sendCommunityMetadataSaga(

const communityMetadataPayload: CommunityMetadata = {
id: community.id,
ownerCertificate: community.CA.rootCertString,
rootCa: community?.rootCa,
ownerCertificate: identity.userCertificate,
rootCa: community.rootCa,
}

yield* apply(
socket,
socket.emit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { type Socket } from '../../types'
import { all, takeEvery } from 'typed-redux-saga'
import { identityActions } from './identity.slice'
import { registerCertificateSaga } from './registerCertificate/registerCertificate.saga'
import { saveOwnerCertToDbSaga } from './saveOwnerCertToDb/saveOwnerCertToDb.saga'
import { registerUsernameSaga } from './registerUsername/registerUsername.saga'
import { verifyJoinTimestampSaga } from './verifyJoinTimestamp/verifyJoinTimestamp.saga'
import { saveUserCsrSaga } from './saveUserCsr/saveUserCsr.saga'
Expand All @@ -15,7 +14,6 @@ export function* identityMasterSaga(socket: Socket): Generator {
yield all([
takeEvery(identityActions.registerUsername.type, registerUsernameSaga, socket),
takeEvery(identityActions.registerCertificate.type, registerCertificateSaga, socket),
takeEvery(identityActions.saveOwnerCertToDb.type, saveOwnerCertToDbSaga, socket),
takeEvery(identityActions.savedOwnerCertificate.type, savedOwnerCertificateSaga, socket),
takeEvery(identityActions.verifyJoinTimestamp.type, verifyJoinTimestampSaga),
takeEvery(identityActions.checkLocalCsr.type, checkLocalCsrSaga),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const identitySlice = createSlice({
identityAdapter.addOne(state.identities, action.payload)
},
createUserCsr: (state, _action: PayloadAction<CreateUserCsrPayload>) => state,
saveOwnerCertToDb: state => state,
savedOwnerCertificate: (state, _action: PayloadAction<string>) => state,
registerUsername: (state, _action: PayloadAction<RegisterUsernamePayload>) => state,
registerCertificate: (state, action: PayloadAction<RegisterCertificatePayload>) => {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export enum SocketActionTypes {
RESPONSE_GET_PRIVATE_CONVERSATIONS = 'responseGetPrivateConversations',
REQUEST_PEER_ID = 'requestPeerId',
// S
SAVE_OWNER_CERTIFICATE = 'saveOwnerCertificate',
SAVED_OWNER_CERTIFICATE = 'savedOwnerCertificate',
SEND_DIRECT_MESSAGE = 'sendDirectMessage',
SEND_MESSAGE = 'sendMessage',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export function subscribe(socket: Socket) {
| ReturnType<typeof errorsActions.handleError>
| ReturnType<typeof identityActions.storeUserCertificate>
| ReturnType<typeof identityActions.throwIdentityError>
| ReturnType<typeof identityActions.saveOwnerCertToDb>
| ReturnType<typeof identityActions.savedOwnerCertificate>
| ReturnType<typeof identityActions.checkLocalCsr>
| ReturnType<typeof communitiesActions.storePeerList>
Expand Down Expand Up @@ -161,10 +160,20 @@ export function subscribe(socket: Socket) {
})

// Community
socket.on(SocketActionTypes.NEW_COMMUNITY, (_payload: ResponseCreateCommunityPayload) => {
console.log('on SocketActionTypes.NEW_COMMUNITY')
emit(identityActions.saveOwnerCertToDb())

socket.on(SocketActionTypes.NEW_COMMUNITY, async (payload: ResponseCreateCommunityPayload) => {
log(`${SocketActionTypes.NEW_COMMUNITY}: ${payload}`)
// We can also set community metadata when we register the
// owner's certificate. I think the only issue is that we
// register the owner's certificate before initializing the
// community and thus the storage service.
emit(communitiesActions.sendCommunityMetadata())
emit(publicChannelsActions.createGeneralChannel())
// We also save the owner's CSR after registering their
// certificate. It works, but it might make more sense to get
// all the backend services up and running and then save the
// CSR, register the owner's certificate and set community
// metadata.
emit(identityActions.saveUserCsr())
})
socket.on(SocketActionTypes.PEER_LIST, (payload: StorePeerListPayload) => {
Expand All @@ -182,8 +191,6 @@ export function subscribe(socket: Socket) {
emit(filesActions.checkForMissingFiles(payload.id))
emit(networkActions.addInitializedCommunity(payload.id))
emit(communitiesActions.clearInvitationCodes())
// For backward compatibility (old community):
emit(communitiesActions.sendCommunityMetadata())
})
// Errors
socket.on(SocketActionTypes.ERROR, (payload: ErrorPayload) => {
Expand Down
Loading

0 comments on commit adf5d3e

Please sign in to comment.