Skip to content

Commit

Permalink
chore: Merge branch 'develop' into fix/1847
Browse files Browse the repository at this point in the history
  • Loading branch information
siepra committed Nov 14, 2023
2 parents 905f0af + ba5fd3e commit 2f99930
Show file tree
Hide file tree
Showing 99 changed files with 1,119 additions and 691 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[unreleased]

* Backward incompatible change: use pre shared key as connection protector in libp2p. Add libp2p psk to invitation link

[2.0.3-alpha.1]

* Temporarily hiding leave community button from Possible impersonation attack
Expand Down
16 changes: 16 additions & 0 deletions packages/backend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.0.3-alpha.5](https://github.com/TryQuiet/backend/compare/@quiet/[email protected]...@quiet/[email protected]) (2023-11-14)

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





## [2.0.3-alpha.4](https://github.com/TryQuiet/backend/compare/@quiet/[email protected]...@quiet/[email protected]) (2023-11-14)

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





## [2.0.3-alpha.3](https://github.com/TryQuiet/backend/compare/@quiet/[email protected]...@quiet/[email protected]) (2023-11-13)

**Note:** Version bump only for package @quiet/backend
Expand Down
26 changes: 16 additions & 10 deletions packages/backend/package-lock.json

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

14 changes: 7 additions & 7 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@quiet/backend",
"version": "2.0.3-alpha.3",
"version": "2.0.3-alpha.5",
"description": "tlg-manager",
"types": "lib/index.d.ts",
"type": "module",
Expand Down Expand Up @@ -54,7 +54,7 @@
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@quiet/eslint-config": "^2.0.2-alpha.0",
"@quiet/state-manager": "^2.0.2-alpha.1",
"@quiet/state-manager": "^2.0.2-alpha.3",
"@types/crypto-js": "^4.0.2",
"@types/express": "^4.17.9",
"@types/jest": "28.1.8",
Expand All @@ -65,7 +65,7 @@
"@types/orbit-db": "git+https://github.com/orbitdb/orbit-db-types.git",
"@types/supertest": "^2.0.11",
"@types/tmp": "^0.2.3",
"@types/validator": "^13.1.4",
"@types/validator": "^13.11.5",
"@types/ws": "8.5.3",
"babel-jest": "^29.3.1",
"cross-env": "^5.2.0",
Expand All @@ -89,10 +89,10 @@
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@peculiar/webcrypto": "1.4.3",
"@quiet/common": "^2.0.2-alpha.0",
"@quiet/identity": "^2.0.2-alpha.0",
"@quiet/common": "^2.0.2-alpha.1",
"@quiet/identity": "^2.0.2-alpha.2",
"@quiet/logger": "^2.0.2-alpha.0",
"@quiet/types": "^2.0.2-alpha.0",
"@quiet/types": "^2.0.2-alpha.1",
"abortable-iterator": "^3.0.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.13.1",
Expand Down Expand Up @@ -134,7 +134,7 @@
"socks-proxy-agent": "^5.0.0",
"string-replace-loader": "3.1.0",
"ts-jest-resolver": "^2.0.0",
"validator": "^13.6.0"
"validator": "^13.11.0"
},
"overrides": {
"level": "$level",
Expand Down
7 changes: 4 additions & 3 deletions packages/backend/src/nest/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import crypto from 'crypto'
import { type PermsData } from '@quiet/types'
import { TestConfig } from '../const'
import logger from './logger'
import { createCertificatesTestHelper } from './client-server'
import { Libp2pNodeParams } from '../libp2p/libp2p.types'
import { createLibp2pAddress, createLibp2pListenAddress } from '@quiet/common'
import { Libp2pService } from '../libp2p/libp2p.service'

const log = logger('test')

export interface Ports {
Expand Down Expand Up @@ -189,20 +190,20 @@ export const testBootstrapMultiaddrs = [
]

export const libp2pInstanceParams = async (): Promise<Libp2pNodeParams> => {
const pems = await createCertificatesTestHelper('address1.onion', 'address2.onion')
const port = await getPort()
const peerId = await createPeerId()
const address = '0.0.0.0'
const peerIdRemote = await createPeerId()
const remoteAddress = createLibp2pAddress(address, peerIdRemote.toString())

const libp2pKey = Libp2pService.generateLibp2pPSK().fullKey
return {
peerId,
listenAddresses: [createLibp2pListenAddress('localhost')],
agent: createHttpsProxyAgent({ port: 1234, host: 'localhost' }),
localAddress: createLibp2pAddress('localhost', peerId.toString()),
targetPort: port,
peers: [remoteAddress],
psk: libp2pKey,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ beforeEach(async () => {
localDbService = await module.resolve(LocalDbService)
registrationService = await module.resolve(RegistrationService)
tor = await module.resolve(Tor)

console.log('tor ', tor)
await tor.init()

const torPassword = crypto.randomBytes(16).toString('hex')
Expand All @@ -106,6 +104,9 @@ beforeEach(async () => {
connectionsManagerService.libp2pService = libp2pService

quietDir = await module.resolve(QUIET_DIR)

const pskBase64 = Libp2pService.generateLibp2pPSK().psk
await localDbService.put(LocalDBKeys.PSK, pskBase64)
})

afterEach(async () => {
Expand All @@ -117,11 +118,6 @@ afterEach(async () => {
})

describe('Connections manager', () => {
it('runs tor by default', async () => {
await connectionsManagerService.init()
console.log(connectionsManagerService.isTorInit)
})

it('saves peer stats when peer has been disconnected', async () => {
class RemotePeerEventDetail {
peerId: string
Expand All @@ -135,7 +131,6 @@ describe('Connections manager', () => {
}
}
const emitSpy = jest.spyOn(libp2pService, 'emit')
// const emitSpy = jest.spyOn(libp2pService, 'emit')

const launchCommunityPayload: InitCommunityPayload = {
id: community.id,
Expand Down
Loading

0 comments on commit 2f99930

Please sign in to comment.