diff --git a/.github/actions/before-build/action.yml b/.github/actions/before-build/action.yml
index a0f74cbaa6..9dbb3e1a4d 100644
--- a/.github/actions/before-build/action.yml
+++ b/.github/actions/before-build/action.yml
@@ -36,5 +36,5 @@ runs:
shell: bash
- name: "Build the project"
- run: lerna run build:prod --scope quiet
+ run: lerna run build:prod --scope @quiet/desktop
shell: bash
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 1087841c9b..80a688c61e 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -2,4 +2,11 @@
### Pull Request Checklist
- [ ] I have linked this PR to related GitHub issue.
-- [ ] I have updated the CHANGELOG.md file with relevant changes (the file is located at the root of monorepo).
\ No newline at end of file
+- [ ] I have updated the CHANGELOG.md file with relevant changes (the file is located at the root of monorepo).
+
+### (Optional) Mobile checklist
+
+Please ensure you completed the following checks if you did any changes to the mobile package:
+
+- [ ] I have run e2e tests for mobile
+- [ ] I have updated base screenshots for visual regression tests
diff --git a/.github/secrets/decrypt_secrets.sh b/.github/secrets/decrypt_secrets.sh
index e63edf9a6a..19dfa83dc7 100755
--- a/.github/secrets/decrypt_secrets.sh
+++ b/.github/secrets/decrypt_secrets.sh
@@ -1,11 +1,13 @@
#!/bin/sh
+set -e
+
gpg --quiet --batch --yes --decrypt --passphrase="$IOS_PROFILE_KEY" --output ./.github/secrets/match_AppStore_comquietmobile.mobileprovision ./.github/secrets/match_AppStore_comquietmobile.mobileprovision.gpg
gpg --quiet --batch --yes --decrypt --passphrase="$IOS_CERTIFICATE_KEY" --output ./.github/secrets/Certificates.p12 ./.github/secrets/Certificates.p12.gpg
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
-cp ./.github/secrets/match_AppStore_comquietmobile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/654a2214-095f-4939-a9e5-09f7a2ccf530.mobileprovision
+cp ./.github/secrets/match_AppStore_comquietmobile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/718ac015-309f-49b6-9653-f6cf84a6377c.mobileprovision
security create-keychain -p "" build.keychain
@@ -17,4 +19,3 @@ security unlock-keychain -p "" ~/Library/Keychains/build.keychain
security set-keychain-settings ~/Library/Keychains/build.keychain #this removes autolock
security set-key-partition-list -S apple-tool:,apple: -s -k "" ~/Library/Keychains/build.keychain
-
diff --git a/.github/secrets/match_AppStore_comquietmobile.mobileprovision.gpg b/.github/secrets/match_AppStore_comquietmobile.mobileprovision.gpg
index 27f3a9a038..4f35bf8199 100644
Binary files a/.github/secrets/match_AppStore_comquietmobile.mobileprovision.gpg and b/.github/secrets/match_AppStore_comquietmobile.mobileprovision.gpg differ
diff --git a/.github/workflows/waggle-tests.yml b/.github/workflows/backend-tests.yml
similarity index 94%
rename from .github/workflows/waggle-tests.yml
rename to .github/workflows/backend-tests.yml
index 3bf08f322d..1f41fdd237 100644
--- a/.github/workflows/waggle-tests.yml
+++ b/.github/workflows/backend-tests.yml
@@ -17,7 +17,7 @@ jobs:
- name: "Print OS"
run: echo ${{ matrix.os }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Setup environment"
uses: ./.github/actions/setup-env
@@ -38,7 +38,7 @@ jobs:
- name: "Print OS"
run: echo ${{ matrix.os }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Setup environment"
uses: ./.github/actions/setup-env
@@ -59,7 +59,7 @@ jobs:
- name: "Print OS"
run: echo ${{ matrix.os }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Setup environment"
uses: ./.github/actions/setup-env
diff --git a/.github/workflows/check-visual-regression.yml b/.github/workflows/check-desktop-visual-regression.yml
similarity index 86%
rename from .github/workflows/check-visual-regression.yml
rename to .github/workflows/check-desktop-visual-regression.yml
index dae9c165b4..f86cfc14fd 100644
--- a/.github/workflows/check-visual-regression.yml
+++ b/.github/workflows/check-desktop-visual-regression.yml
@@ -1,4 +1,4 @@
-name: Visual regressions
+name: Desktop visual regressions
on:
pull_request:
@@ -17,14 +17,14 @@ jobs:
- name: "Print OS"
run: echo ${{ matrix.os }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to retrieve git history
- name: Setup environment
uses: ./.github/actions/setup-env
with:
- bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,quiet,backend-bundle"
+ bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle"
- name: "Publish to Chromatic"
uses: chromaui/action@v1
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index f10ae5150a..7a05a53f69 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -16,7 +16,7 @@ jobs:
- name: "Print OS"
run: echo ${{ matrix.os }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Remove test files workaround (jest types conflicting with cypress types)"
if: ${{ runner.os == 'Windows' }}
@@ -27,14 +27,13 @@ jobs:
uses: ./.github/actions/setup-env
if: ${{ runner.os != 'Windows' }}
with:
- bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,quiet,@quiet/mobile,e2e-tests,backend-bundle"
+ bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,@quiet/mobile,e2e-tests,backend-bundle"
-
- name: "Setup environment for Windows"
uses: ./.github/actions/setup-env
if: ${{ runner.os == 'Windows' }}
with:
- bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,quiet,e2e-tests,backend-bundle"
+ bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,e2e-tests,backend-bundle"
- name: "Lint"
if: ${{ runner.os != 'Windows' }}
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 090aaa8b24..07ee9e671c 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -41,11 +41,11 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+ uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@a09933a12a80f87b87005513f0abb1494c27a716 # v2.21.4
+ uses: github/codeql-action/init@ddccb873888234080b77e9bc2d4764d5ccaaccf9 # v2.21.9
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -55,7 +55,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- uses: github/codeql-action/autobuild@a09933a12a80f87b87005513f0abb1494c27a716 # v2.21.4
+ uses: github/codeql-action/autobuild@ddccb873888234080b77e9bc2d4764d5ccaaccf9 # v2.21.9
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -68,6 +68,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@a09933a12a80f87b87005513f0abb1494c27a716 # v2.21.4
+ uses: github/codeql-action/analyze@ddccb873888234080b77e9bc2d4764d5ccaaccf9 # v2.21.9
with:
category: "/language:${{matrix.language}}"
\ No newline at end of file
diff --git a/.github/workflows/depencency-review.yml b/.github/workflows/depencency-review.yml
index 23044f791b..7989380270 100644
--- a/.github/workflows/depencency-review.yml
+++ b/.github/workflows/depencency-review.yml
@@ -17,6 +17,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+ uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: 'Dependency Review'
- uses: actions/dependency-review-action@0efb1d1d84fc9633afcdaad14c485cbbc90ef46c # v2.5.1
\ No newline at end of file
+ uses: actions/dependency-review-action@6c5ccdad469c9f8a2996bfecaec55a631a347034 # v3.1.0
diff --git a/.github/workflows/build-release.yml b/.github/workflows/desktop-build.yml
similarity index 92%
rename from .github/workflows/build-release.yml
rename to .github/workflows/desktop-build.yml
index 12a1ecdbf3..44822900ff 100644
--- a/.github/workflows/build-release.yml
+++ b/.github/workflows/desktop-build.yml
@@ -1,4 +1,4 @@
-name: Build release
+name: Desktop release build
on:
release:
@@ -6,18 +6,27 @@ on:
[released, prereleased]
jobs:
+
run-e2e-tests-linux:
+ if: |
+ startsWith(github.ref, 'refs/tags/@quiet/desktop')
uses: ./.github/workflows/e2e-linux.yml
+
run-e2e-tests-mac:
+ if: |
+ startsWith(github.ref, 'refs/tags/@quiet/desktop')
uses: ./.github/workflows/e2e-mac.yml
+
run-e2e-tests-win:
+ if: |
+ startsWith(github.ref, 'refs/tags/@quiet/desktop')
uses: ./.github/workflows/e2e-win.yml
build-linux:
# needs: run-e2e-tests-linux
runs-on: ubuntu-22.04
if: |
- startsWith(github.ref, 'refs/tags/quiet')
+ startsWith(github.ref, 'refs/tags/@quiet/desktop')
env:
TEST_MODE: ${{ github.event.action == 'prereleased' }}
@@ -25,12 +34,12 @@ jobs:
CHECKSUM_PATH: ${{ github.event.action == 'released' && 'packages/desktop/dist/latest-linux.yml' || 'packages/desktop/dist/alpha-linux.yml' }}
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup-env
with:
- bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,quiet,backend-bundle"
+ bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle"
- name: Install libfuse
run: sudo apt install libfuse2
@@ -52,7 +61,7 @@ jobs:
run: cd packages/desktop && USE_HARD_LINKS=false node_modules/.bin/electron-builder -p always --linux ${{ env.ELECTRON_BUILDER_PROPS }}
- name: "Calculate new checksum for electron updater"
- run: lerna run postBuild --scope quiet
+ run: lerna run postBuild --scope @quiet/desktop
- name: "Push electron-updater new checksum to S3"
uses: vinkabuki/upload-s3-action@master
@@ -89,14 +98,14 @@ jobs:
# needs: run-e2e-tests-mac
runs-on: macos-latest
if: |
- startsWith(github.ref, 'refs/tags/quiet')
+ startsWith(github.ref, 'refs/tags/@quiet/desktop')
env:
TEST_MODE: ${{ github.event.action == 'prereleased' }}
S3_BUCKET: ${{ github.event.action == 'released' && 'quiet' || 'test.quiet' }}
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- uses: actions-rs/components-nightly@v1
with:
@@ -111,7 +120,7 @@ jobs:
- name: Setup environment
uses: ./.github/actions/setup-env
with:
- bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,quiet,backend-bundle"
+ bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle"
- name: Before build
uses: ./.github/actions/before-build
@@ -162,14 +171,14 @@ jobs:
# needs: run-e2e-tests-win
runs-on: windows-2019
if: |
- startsWith(github.ref, 'refs/tags/quiet')
+ startsWith(github.ref, 'refs/tags/@quiet/desktop')
env:
TEST_MODE: ${{ github.event.action == 'prereleased' }}
S3_BUCKET: ${{ github.event.action == 'released' && 'quiet' || 'test.quiet' }}
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Fetch jsign"
shell: bash
@@ -189,7 +198,7 @@ jobs:
- name: Setup environment
uses: ./.github/actions/setup-env
with:
- bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,quiet,backend-bundle,e2e-tests"
+ bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle,e2e-tests"
- name: Before build
uses: ./.github/actions/before-build
diff --git a/.github/workflows/desktop-rtl-tests.yml b/.github/workflows/desktop-rtl-tests.yml
new file mode 100644
index 0000000000..8e8343b736
--- /dev/null
+++ b/.github/workflows/desktop-rtl-tests.yml
@@ -0,0 +1,31 @@
+name: Desktop - state-manager bracket tests (RTL)
+
+on:
+ pull_request:
+ paths:
+ - packages/desktop/**
+ - packages/state-manager/**
+
+jobs:
+ desktop-tests:
+ timeout-minutes: 25
+ runs-on: ${{ matrix.os }}
+
+ strategy:
+ matrix:
+ os: [ubuntu-20.04, macos-latest]
+
+ steps:
+ - name: "Print OS"
+ run: echo ${{ matrix.os }}
+
+ - uses: actions/checkout@v3
+
+ - name: "Setup environment"
+ uses: ./.github/actions/setup-env
+ with:
+ cachePrefix: "desktop-tests"
+ bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle"
+
+ - name: "Desktop - state-manager bracket tests"
+ run: lerna run rtl-test --scope @quiet/desktop --stream
diff --git a/.github/workflows/regression-test.yml b/.github/workflows/desktop-test-scroll.yml
similarity index 87%
rename from .github/workflows/regression-test.yml
rename to .github/workflows/desktop-test-scroll.yml
index 1df9b377dd..bb9a6c6a7c 100644
--- a/.github/workflows/regression-test.yml
+++ b/.github/workflows/desktop-test-scroll.yml
@@ -1,4 +1,4 @@
-name: Scroll regression tests
+name: Desktop scroll regression tests
on:
pull_request:
@@ -18,12 +18,12 @@ jobs:
- name: "Print OS"
run: echo ${{ matrix.os }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup-env
with:
- bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,quiet,backend-bundle"
+ bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle"
- name: "Install libs"
run: sudo apt-get update && sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
@@ -31,7 +31,7 @@ jobs:
- name: "Remove test files workaround"
run: find packages/desktop/src -name '*.test.*' -delete && find packages/backend/src -name '*.test.*' -delete
- - uses: cypress-io/github-action@v2
+ - uses: cypress-io/github-action@v6
with:
install: false
command: npm run regression-test:ci
diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/desktop-tests.yml
similarity index 71%
rename from .github/workflows/frontend-tests.yml
rename to .github/workflows/desktop-tests.yml
index 9fdf6487cb..bba3708c19 100644
--- a/.github/workflows/frontend-tests.yml
+++ b/.github/workflows/desktop-tests.yml
@@ -18,16 +18,13 @@ jobs:
- name: "Print OS"
run: echo ${{ matrix.os }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Setup environment"
uses: ./.github/actions/setup-env
with:
cachePrefix: "desktop-tests"
- bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,quiet,backend-bundle"
+ bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle"
- name: "Unit tests"
- run: lerna run test --scope quiet --stream
-
- - name: "desktop-state-manager bracket tests"
- run: lerna run rtl-test --scope quiet --stream
+ run: lerna run test --scope @quiet/desktop --stream
diff --git a/.github/workflows/e2e-android.yml b/.github/workflows/e2e-android.yml
new file mode 100644
index 0000000000..1181a13983
--- /dev/null
+++ b/.github/workflows/e2e-android.yml
@@ -0,0 +1,34 @@
+name: E2E Android
+
+on:
+ push:
+ paths:
+ - packages/mobile/**
+
+jobs:
+ detox-android:
+ timeout-minutes: 10
+ runs-on: [self-hosted, macOS, ARM64, android]
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install dependencies
+ run: |
+ npm i
+ npm run lerna bootstrap --scope @quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle
+
+ - name: Pull binaries
+ run: |
+ git lfs install
+ git lfs pull
+
+ - name: Build Detox
+ run: |
+ cd packages/mobile
+ detox build -c android.emu.debug.ci
+
+ - name: Run basic tests
+ run: |
+ cd packages/mobile
+ detox test starter -c android.emu.debug.ci
diff --git a/.github/workflows/e2e-crossplatform.yml b/.github/workflows/e2e-crossplatform.yml
index 42f4065efb..b45d5caddb 100644
--- a/.github/workflows/e2e-crossplatform.yml
+++ b/.github/workflows/e2e-crossplatform.yml
@@ -1,6 +1,14 @@
name: E2E cross platform
-on: [pull_request]
+on:
+ pull_request:
+ paths:
+ - packages/desktop/**
+ - packages/backend/**
+ - packages/state-manager/**
+ - packages/identity/**
+ - packages/common/**
+
jobs:
mac:
uses: ./.github/workflows/e2e-mac.yml
diff --git a/.github/workflows/e2e-ios.yml b/.github/workflows/e2e-ios.yml
new file mode 100644
index 0000000000..a834ada8e7
--- /dev/null
+++ b/.github/workflows/e2e-ios.yml
@@ -0,0 +1,39 @@
+name: E2E iOS
+
+on:
+ push:
+ paths:
+ - packages/mobile/**
+
+jobs:
+ detox-ios:
+ timeout-minutes: 10
+ runs-on: [self-hosted, macOS, ARM64, iOS]
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install dependencies
+ run: |
+ npm i
+ npm run lerna bootstrap --scope @quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle
+
+ - name: Pull binaries
+ run: |
+ git lfs install
+ git lfs pull
+
+ - name: Install pods
+ run: |
+ cd packages/mobile/ios
+ pod install
+
+ - name: Build Detox
+ run: |
+ cd packages/mobile
+ detox build -c ios.sim.debug.ci
+
+ - name: Run basic tests
+ run: |
+ cd packages/mobile
+ detox test starter -c ios.sim.debug.ci
diff --git a/.github/workflows/e2e-linux.yml b/.github/workflows/e2e-linux.yml
index 779cdfb836..3e957e1fe7 100644
--- a/.github/workflows/e2e-linux.yml
+++ b/.github/workflows/e2e-linux.yml
@@ -18,7 +18,7 @@ jobs:
TEST_MODE: true
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Install WM
run: sudo apt install fluxbox
@@ -30,7 +30,7 @@ jobs:
uses: ./.github/actions/setup-env
with:
cachePrefix: "e2e-crossplatform-linux"
- bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,quiet,backend-bundle,e2e-tests"
+ bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle,e2e-tests"
- name: Run X11
run: |
@@ -53,12 +53,12 @@ jobs:
max_attempts: 3
command: cd packages/e2e-tests && npm run test oneClient.test.ts
- - name: Run two clients test
+ - name: Run multiple clients test
uses: nick-fields/retry@v2
with:
timeout_minutes: 25
max_attempts: 3
- command: cd packages/e2e-tests && npm run test twoClients.test.ts
+ command: cd packages/e2e-tests && npm run test multipleClients.test.ts
- name: Run invitation link test - Includes 2 separate application clients
uses: nick-fields/retry@v2
diff --git a/.github/workflows/e2e-mac.yml b/.github/workflows/e2e-mac.yml
index 69df3d5d74..52154c22dd 100644
--- a/.github/workflows/e2e-mac.yml
+++ b/.github/workflows/e2e-mac.yml
@@ -11,13 +11,13 @@ jobs:
IS_E2E: true
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Setup environment"
uses: ./.github/actions/setup-env
with:
cachePrefix: "e2e-crossplatform-mac"
- bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,quiet,backend-bundle,e2e-tests"
+ bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle,e2e-tests"
- name: Before build
uses: ./.github/actions/before-build
@@ -61,11 +61,11 @@ jobs:
max_attempts: 3
command: cd packages/e2e-tests && npm run test oneClient.test.ts
- - name: Run two clients test
+ - name: Run multiple clients test
uses: nick-fields/retry@v2
with:
timeout_minutes: 25
max_attempts: 3
- command: cd packages/e2e-tests && npm run test twoClients.test.ts
+ command: cd packages/e2e-tests && npm run test multipleClients.test.ts
diff --git a/.github/workflows/e2e-win.yml b/.github/workflows/e2e-win.yml
index 12d617de4c..8a8b0fd498 100644
--- a/.github/workflows/e2e-win.yml
+++ b/.github/workflows/e2e-win.yml
@@ -13,13 +13,13 @@ jobs:
E2E: true
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Setup environment"
uses: ./.github/actions/setup-env
with:
cachePrefix: "e2e-crossplatform-windows"
- bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,quiet,backend-bundle,e2e-tests"
+ bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle,e2e-tests"
- name: "Fetch jsign"
shell: bash
@@ -66,13 +66,18 @@ jobs:
run: Start-Process "Quiet Setup ${{ steps.extract_version.outputs.version }}.exe" -Wait
working-directory: ./packages/desktop/dist
shell: powershell
+
+ - name: Check if Quiet installed properly
+ run: Get-ChildItem -Path C:\Users\runneradmin\AppData\Local\Programs\@quietdesktop
+ shell: powershell
- name: Kill Quiet
- run: Stop-Process -Name "Quiet" -Force
+ run: Get-Process -Name "Quiet" -ErrorAction SilentlyContinue | Stop-Process -Force
shell: powershell
+ if: always()
- name: Kill tor
- run: Stop-Process -Name "tor" -Force
+ run: Get-Process -Name "tor" -ErrorAction SilentlyContinue | Stop-Process -Force
shell: powershell
- name: Delay
@@ -87,13 +92,13 @@ jobs:
shell: bash
command: cd packages/e2e-tests && npm run test oneClient.test.ts
- - name: Run two clients test
+ - name: Run multiple clients test
uses: nick-fields/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
shell: bash
- command: cd packages/e2e-tests && npm run test twoClients.test.ts
+ command: cd packages/e2e-tests && npm run test multipleClients.test.ts
- name: Run invitation link test - Includes 2 separate application clients
uses: nick-fields/retry@v2
diff --git a/.github/workflows/identity-tests.yml b/.github/workflows/identity-tests.yml
index a553775f8c..033308b099 100644
--- a/.github/workflows/identity-tests.yml
+++ b/.github/workflows/identity-tests.yml
@@ -18,7 +18,7 @@ jobs:
- name: "Print OS"
run: echo ${{ matrix.os }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Setup environment"
uses: ./.github/actions/setup-env
diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml
index ed217a897e..18680ddb4f 100644
--- a/.github/workflows/integration-tests.yml
+++ b/.github/workflows/integration-tests.yml
@@ -20,7 +20,7 @@ jobs:
- name: 'Print OS'
run: echo ${{ matrix.os }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Setup environment"
uses: ./.github/actions/setup-env
diff --git a/.github/workflows/deploy-android.yaml b/.github/workflows/mobile-deploy-android.yaml
similarity index 95%
rename from .github/workflows/deploy-android.yaml
rename to .github/workflows/mobile-deploy-android.yaml
index 192e83131a..8ecd603c97 100644
--- a/.github/workflows/deploy-android.yaml
+++ b/.github/workflows/mobile-deploy-android.yaml
@@ -1,4 +1,4 @@
-name: Deploy Android to Google Play (internal testing)
+name: Deploy Android to Google Play
on:
release:
@@ -7,19 +7,20 @@ on:
jobs:
build-android:
+ # needs: detox-android
runs-on: ${{ matrix.os }}
if: |
startsWith(github.ref, 'refs/tags/@quiet/mobile')
strategy:
matrix:
- os: [ubuntu-20.04]
+ os: [ubuntu-latest-m]
steps:
- name: "Print OS"
run: echo ${{ matrix.os }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Set up JDK"
uses: actions/setup-java@v3
@@ -41,13 +42,13 @@ jobs:
- name: "Create gradle configuration directory"
run: mkdir -p $HOME/.gradle
-
+
- name: "Prepare ndk configuration"
run: |
printf "\
NDK_PATH=${{ steps.setup-ndk.outputs.ndk-path }}\n\
" > $HOME/.gradle/gradle.properties
-
+
- name: "Prepare signing configuration"
run: |
printf "\
diff --git a/.github/workflows/deploy-ios.yml b/.github/workflows/mobile-deploy-ios.yml
similarity index 94%
rename from .github/workflows/deploy-ios.yml
rename to .github/workflows/mobile-deploy-ios.yml
index cab540230a..e5c85d39f4 100644
--- a/.github/workflows/deploy-ios.yml
+++ b/.github/workflows/mobile-deploy-ios.yml
@@ -7,6 +7,7 @@ on:
jobs:
build-ios:
+ # needs: detox-ios
runs-on: ${{ matrix.os }}
if: |
startsWith(github.ref, 'refs/tags/@quiet/mobile')
@@ -19,7 +20,7 @@ jobs:
- name: "Print OS"
run: echo ${{ matrix.os }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
lfs: true
@@ -57,7 +58,7 @@ jobs:
-scheme Quiet \
-configuration Release \
-archivePath build/Quiet.xcarchive \
- PROVISIONING_PROFILE="654a2214-095f-4939-a9e5-09f7a2ccf530" \
+ PROVISIONING_PROFILE="718ac015-309f-49b6-9653-f6cf84a6377c" \
CODE_SIGN_IDENTITY="Apple Distribution: Zbay LLC (CTYKSWN9T4)"
- name: Export .ipa
diff --git a/.github/workflows/mobile-tests.yml b/.github/workflows/mobile-tests.yml
index cd57d786f3..46f8ba291c 100644
--- a/.github/workflows/mobile-tests.yml
+++ b/.github/workflows/mobile-tests.yml
@@ -18,7 +18,7 @@ jobs:
- name: "Print OS"
run: echo ${{ matrix.os }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup-env
diff --git a/.github/workflows/nectar-tests.yml b/.github/workflows/state-manager-tests.yml
similarity index 77%
rename from .github/workflows/nectar-tests.yml
rename to .github/workflows/state-manager-tests.yml
index 2eea110f1d..2ecad2b0b1 100644
--- a/.github/workflows/nectar-tests.yml
+++ b/.github/workflows/state-manager-tests.yml
@@ -18,15 +18,12 @@ jobs:
- name: "Print OS"
run: echo ${{ matrix.os }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Setup environment"
uses: ./.github/actions/setup-env
with:
- bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,quiet,backend-bundle"
+ bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle"
- name: "Unit tests"
run: lerna run test --scope @quiet/state-manager --stream
-
- - name: "desktop-state-manager bracket tests"
- run: lerna run rtl-test --scope quiet --stream
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0cc60a00a2..9a0e5e3cdb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,13 +1,37 @@
[unreleased]
+* Fixed mobile bugs - joining by QR code and not showing username taken screen for user who has unique name
+
+* Shorter dots-placeholder for invite link
+
+* Revert adjusting bootstrap scripts for developing on Windows
+
+[2.0.1-alpha.2]
+
+* UI layer for taken usernames for desktop and mobile
+
+* Change nickname for taken username
+
+* Map messages sent before changing username
+
+* Update registrar service to match new registration flow.
+
+* Add possible impersonation attack UI for desktop and mobile
+
+* Fix truncated long messages in channelInput component
+
* Unblock mobile e2e tests
* Prettify loading component on Chat screen (mobile)
* Running Chromatic tests for forked PRs
+* Added e2e test for user joining community when owner is offline. Improved e2e tests
+
* Bump github actions/* to versions using node16
+* Project can now be bootstraped on Windows (powershell)
+
* Placeholder(...) for community name
* No unregistered/duplicated label for system messages
diff --git a/README.md b/README.md
index 61769a5524..be52d08eba 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
Encrypted p2p team chat with no servers, just Tor.
- Downloads |
+ Downloads |
How it Works |
Features |
Threat Model |
@@ -52,7 +52,7 @@ See our [FAQ](https://github.com/TryQuiet/monorepo/wiki/Quiet-FAQ) for answers t
## Getting started
-To try Quiet, download the [latest release](https://github.com/TryQuiet/quiet/releases/tag/quiet%401.8.0) for your platform (.dmg for macOS, .exe for Windows, etc.) and install it in the normal way. Then create a community and open the community's settings to invite members.
+To try Quiet, download the [latest release](https://github.com/TryQuiet/quiet/releases/tag/quiet%401.9.5) for your platform (.dmg for macOS, .exe for Windows, etc.) and install it in the normal way. Then create a community and open the community's settings to invite members.
If you'd like to help develop Quiet, see [Contributing to Quiet](#contributing-to-quiet).
diff --git a/lerna.json b/lerna.json
index 2501ad2db2..aca35a8710 100644
--- a/lerna.json
+++ b/lerna.json
@@ -5,7 +5,7 @@
"version": "independent",
"command": {
"version": {
- "allowBranch": ["master", "develop", "workflows/require-e2e-before-build-release"],
+ "allowBranch": ["master", "develop"],
"conventionalCommits": true,
"createRelease": "github"
},
diff --git a/packages/backend-bundle/CHANGELOG.md b/packages/backend-bundle/CHANGELOG.md
index 043453cbc1..67dcd1d34e 100644
--- a/packages/backend-bundle/CHANGELOG.md
+++ b/packages/backend-bundle/CHANGELOG.md
@@ -3,7 +3,7 @@
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/ZbayApp/monorepo/compare/backend-bundle@2.0.1-alpha.0...backend-bundle@2.0.1-alpha.1) (2023-09-25)
+## [2.0.1-alpha.4](https://github.com/TryQuiet/quiet/compare/backend-bundle@2.0.1-alpha.3...backend-bundle@2.0.1-alpha.4) (2023-10-12)
**Note:** Version bump only for package backend-bundle
@@ -11,7 +11,39 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [2.0.1-alpha.0](https://github.com/ZbayApp/monorepo/compare/backend-bundle@1.7.0-alpha.0...backend-bundle@2.0.1-alpha.0) (2023-09-25)
+## [2.0.1-alpha.3](https://github.com/TryQuiet/quiet/compare/backend-bundle@2.0.1-alpha.2...backend-bundle@2.0.1-alpha.3) (2023-10-10)
+
+**Note:** Version bump only for package backend-bundle
+
+
+
+
+
+## [2.0.1-alpha.2](https://github.com/TryQuiet/quiet/compare/backend-bundle@1.6.1...backend-bundle@2.0.1-alpha.2) (2023-10-09)
+
+**Note:** Version bump only for package backend-bundle
+
+
+
+
+
+## [2.0.1-alpha.1](https://github.com/TryQuiet/quiet/compare/backend-bundle@2.0.1-alpha.0...backend-bundle@2.0.1-alpha.1) (2023-09-25)
+
+**Note:** Version bump only for package backend-bundle
+
+
+
+
+
+## [2.0.1-alpha.0](https://github.com/TryQuiet/quiet/compare/backend-bundle@1.7.0-alpha.0...backend-bundle@2.0.1-alpha.0) (2023-09-25)
+
+**Note:** Version bump only for package backend-bundle
+
+
+
+
+
+# [2.0.0-alpha.18](https://github.com/TryQuiet/quiet/compare/backend-bundle@1.6.1...backend-bundle@2.0.0-alpha.18) (2023-10-04)
**Note:** Version bump only for package backend-bundle
@@ -27,6 +59,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
+## [1.6.1](https://github.com/TryQuiet/quiet/compare/backend-bundle@1.6.0...backend-bundle@1.6.1) (2023-09-25)
+
+**Note:** Version bump only for package backend-bundle
+
+
+
+
+
# [1.6.0](/compare/backend-bundle@1.6.0-alpha.0...backend-bundle@1.6.0) (2023-08-28)
**Note:** Version bump only for package backend-bundle
@@ -51,7 +91,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [1.4.0](https://github.com/ZbayApp/monorepo/compare/backend-bundle@1.4.0-alpha.1...backend-bundle@1.4.0) (2023-07-28)
+# [1.4.0](https://github.com/TryQuiet/quiet/compare/backend-bundle@1.4.0-alpha.1...backend-bundle@1.4.0) (2023-07-28)
**Note:** Version bump only for package backend-bundle
@@ -67,7 +107,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [1.4.0-alpha.0](https://github.com/ZbayApp/monorepo/compare/backend-bundle@1.3.1...backend-bundle@1.4.0-alpha.0) (2023-06-19)
+# [1.4.0-alpha.0](https://github.com/TryQuiet/quiet/compare/backend-bundle@1.3.1...backend-bundle@1.4.0-alpha.0) (2023-06-19)
**Note:** Version bump only for package backend-bundle
@@ -243,7 +283,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [0.19.0-alpha.1](https://github.com/ZbayApp/monorepo/compare/backend-bundle@0.19.0-alpha.0...backend-bundle@0.19.0-alpha.1) (2023-01-27)
+# [0.19.0-alpha.1](https://github.com/TryQuiet/quiet/compare/backend-bundle@0.19.0-alpha.0...backend-bundle@0.19.0-alpha.1) (2023-01-27)
**Note:** Version bump only for package backend-bundle
diff --git a/packages/backend-bundle/package-lock.json b/packages/backend-bundle/package-lock.json
index 4f5e0be28f..e9ddad833f 100644
--- a/packages/backend-bundle/package-lock.json
+++ b/packages/backend-bundle/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "backend-bundle",
- "version": "2.0.1-alpha.1",
+ "version": "2.0.1-alpha.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "backend-bundle",
- "version": "2.0.1-alpha.1",
+ "version": "2.0.1-alpha.4",
"license": "ISC"
}
}
diff --git a/packages/backend-bundle/package.json b/packages/backend-bundle/package.json
index e8fa9798f3..567fbb7f47 100644
--- a/packages/backend-bundle/package.json
+++ b/packages/backend-bundle/package.json
@@ -1,10 +1,11 @@
{
"name": "backend-bundle",
- "version": "2.0.1-alpha.1",
+ "version": "2.0.1-alpha.4",
"description": "",
"main": "bundle.cjs",
"scripts": {},
"keywords": [],
"author": "",
- "license": "ISC"
+ "license": "ISC",
+ "private": true
}
diff --git a/packages/backend/CHANGELOG.md b/packages/backend/CHANGELOG.md
index ed9fbb993e..cbae8af270 100644
--- a/packages/backend/CHANGELOG.md
+++ b/packages/backend/CHANGELOG.md
@@ -3,6 +3,49 @@
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.6](https://github.com/TryQuiet/backend/compare/@quiet/backend@2.0.1-alpha.5...@quiet/backend@2.0.1-alpha.6) (2023-10-13)
+
+**Note:** Version bump only for package @quiet/backend
+
+
+
+
+
+## [2.0.1-alpha.5](https://github.com/TryQuiet/backend/compare/@quiet/backend@2.0.1-alpha.4...@quiet/backend@2.0.1-alpha.5) (2023-10-12)
+
+**Note:** Version bump only for package @quiet/backend
+
+
+
+
+
+## [2.0.1-alpha.4](https://github.com/TryQuiet/backend/compare/@quiet/backend@2.0.1-alpha.3...@quiet/backend@2.0.1-alpha.4) (2023-10-11)
+
+
+### Reverts
+
+* Revert "Adjust project bootstrap scripts to be windows-friendly (#1870)" (#1937) ([0811ea3](https://github.com/TryQuiet/backend/commit/0811ea3ea3f682dd763be72b12f626fe416bc036)), closes [#1870](https://github.com/TryQuiet/backend/issues/1870) [#1937](https://github.com/TryQuiet/backend/issues/1937) [#1870](https://github.com/TryQuiet/backend/issues/1870)
+
+
+
+
+
+## [2.0.1-alpha.3](https://github.com/TryQuiet/backend/compare/@quiet/backend@2.0.1-alpha.2...@quiet/backend@2.0.1-alpha.3) (2023-10-10)
+
+**Note:** Version bump only for package @quiet/backend
+
+
+
+
+
+## [2.0.1-alpha.2](https://github.com/TryQuiet/backend/compare/@quiet/backend@1.9.4...@quiet/backend@2.0.1-alpha.2) (2023-10-09)
+
+**Note:** Version bump only for package @quiet/backend
+
+
+
+
+
## [2.0.1-alpha.1](https://github.com/TryQuiet/backend/compare/@quiet/backend@2.0.1-alpha.0...@quiet/backend@2.0.1-alpha.1) (2023-09-25)
**Note:** Version bump only for package @quiet/backend
@@ -19,6 +62,30 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
+# [2.0.0-alpha.20](https://github.com/TryQuiet/backend/compare/@quiet/backend@2.0.0-alpha.19...@quiet/backend@2.0.0-alpha.20) (2023-10-09)
+
+**Note:** Version bump only for package @quiet/backend
+
+
+
+
+
+# [2.0.0-alpha.19](https://github.com/TryQuiet/backend/compare/@quiet/backend@2.0.0-alpha.18...@quiet/backend@2.0.0-alpha.19) (2023-10-04)
+
+**Note:** Version bump only for package @quiet/backend
+
+
+
+
+
+# [2.0.0-alpha.18](https://github.com/TryQuiet/backend/compare/@quiet/backend@1.9.4...@quiet/backend@2.0.0-alpha.18) (2023-10-04)
+
+**Note:** Version bump only for package @quiet/backend
+
+
+
+
+
# [2.0.0-alpha.5](https://github.com/TryQuiet/backend/compare/@quiet/backend@2.0.0-alpha.4...@quiet/backend@2.0.0-alpha.5) (2023-09-19)
**Note:** Version bump only for package @quiet/backend
@@ -66,8 +133,38 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-
# [1.10.0-alpha.0](https://github.com/TryQuiet/backend/compare/@quiet/backend@1.9.0...@quiet/backend@1.10.0-alpha.0) (2023-08-29)
+
+**Note:** Version bump only for package @quiet/backend
+
+
+
+
+
+## [1.9.4](https://github.com/TryQuiet/backend/compare/@quiet/backend@1.9.3...@quiet/backend@1.9.4) (2023-10-03)
+
+**Note:** Version bump only for package @quiet/backend
+
+
+
+
+
+## [1.9.3](https://github.com/TryQuiet/backend/compare/@quiet/backend@1.9.2...@quiet/backend@1.9.3) (2023-10-03)
+
+**Note:** Version bump only for package @quiet/backend
+
+
+
+
+
+## [1.9.2](https://github.com/TryQuiet/backend/compare/@quiet/backend@1.9.1...@quiet/backend@1.9.2) (2023-09-25)
+
+**Note:** Version bump only for package @quiet/backend
+
+
+
+
+
## [1.9.1](https://github.com/TryQuiet/backend/compare/@quiet/backend@1.9.0...@quiet/backend@1.9.1) (2023-09-15)
**Note:** Version bump only for package @quiet/backend
diff --git a/packages/backend/package-lock.json b/packages/backend/package-lock.json
index 7d62e5d957..5443150edb 100644
--- a/packages/backend/package-lock.json
+++ b/packages/backend/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@quiet/backend",
- "version": "2.0.1-alpha.1",
+ "version": "2.0.1-alpha.6",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@quiet/backend",
- "version": "2.0.1-alpha.1",
+ "version": "2.0.1-alpha.6",
"license": "MIT",
"dependencies": {
"@chainsafe/libp2p-gossipsub": "6.1.0",
@@ -20049,6 +20049,16 @@
"queue-microtask": "^1.2.2"
}
},
+ "node_modules/run-script-os": {
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/run-script-os/-/run-script-os-1.1.6.tgz",
+ "integrity": "sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==",
+ "dev": true,
+ "bin": {
+ "run-os": "index.js",
+ "run-script-os": "index.js"
+ }
+ },
"node_modules/rxjs": {
"version": "7.8.1",
"license": "Apache-2.0",
@@ -35445,6 +35455,12 @@
"queue-microtask": "^1.2.2"
}
},
+ "run-script-os": {
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/run-script-os/-/run-script-os-1.1.6.tgz",
+ "integrity": "sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==",
+ "dev": true
+ },
"rxjs": {
"version": "7.8.1",
"requires": {
diff --git a/packages/backend/package.json b/packages/backend/package.json
index 0fb305c40a..43ca6f284b 100644
--- a/packages/backend/package.json
+++ b/packages/backend/package.json
@@ -1,12 +1,13 @@
{
"name": "@quiet/backend",
- "version": "2.0.1-alpha.1",
+ "version": "2.0.1-alpha.6",
"description": "tlg-manager",
"types": "lib/index.d.ts",
"type": "module",
"exports": "lib/index.js",
"author": "",
"license": "MIT",
+ "private": true,
"scripts": {
"build": "tsc -p tsconfig.build.json",
"webpack": "webpack --env mode=development && cp ./lib/bundle.cjs ../backend-bundle/bundle.cjs",
@@ -16,7 +17,6 @@
"version": "git add -A src",
"lint": "eslint --ext .jsx,.js,.ts,.tsx ./src/ --fix",
"lint-ci": "eslint --ext .jsx,.js,.ts,.tsx ./src/",
- "test2": "cross-env NODE_OPTIONS=--experimental-vm-modules DEBUG=ipfs:*,backend:* node_modules/jest/bin/jest.js",
"test-nest": "cross-env NODE_OPTIONS=--experimental-vm-modules DEBUG=ipfs:*,backend:* node_modules/jest/bin/jest.js --detectOpenHandles --forceExit ./src/nest/**/*.spec.ts",
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules DEBUG=ipfs:*,backend:* node_modules/jest/bin/jest.js ./src/**/* --runInBand --verbose --testPathIgnorePatterns=\".src/(!?nodeTest*)|(.node_modules*)\"",
"test-ci": "cross-env NODE_OPTIONS=--experimental-vm-modules jest ./src/**/* --runInBand --colors --ci --silent --verbose --testPathIgnorePatterns=\".src/nest/(!?nodeTest*)|(.node_modules*)|src/nest/.*\\.tor.spec\\.(t|j)s|src/nest/ipfs-file-manager/big-files.long.spec.ts$\"",
@@ -53,8 +53,8 @@
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
- "@quiet/eslint-config": "^2.0.1-alpha.1",
- "@quiet/state-manager": "^2.0.1-alpha.1",
+ "@quiet/eslint-config": "^2.0.1-alpha.4",
+ "@quiet/state-manager": "^2.0.1-alpha.6",
"@types/crypto-js": "^4.0.2",
"@types/express": "^4.17.9",
"@types/jest": "28.1.8",
@@ -89,10 +89,10 @@
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@peculiar/webcrypto": "1.4.3",
- "@quiet/common": "^2.0.1-alpha.1",
- "@quiet/identity": "^2.0.1-alpha.1",
- "@quiet/logger": "^2.0.1-alpha.1",
- "@quiet/types": "^2.0.1-alpha.1",
+ "@quiet/common": "^2.0.1-alpha.4",
+ "@quiet/identity": "^2.0.1-alpha.4",
+ "@quiet/logger": "^2.0.1-alpha.4",
+ "@quiet/types": "^2.0.1-alpha.4",
"abortable-iterator": "^3.0.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.13.1",
diff --git a/packages/backend/src/nest/connections-manager/connections-manager.service.spec.ts b/packages/backend/src/nest/connections-manager/connections-manager.service.spec.ts
index abc3ad923e..4952b669a6 100644
--- a/packages/backend/src/nest/connections-manager/connections-manager.service.spec.ts
+++ b/packages/backend/src/nest/connections-manager/connections-manager.service.spec.ts
@@ -2,7 +2,7 @@ import { jest } from '@jest/globals'
import { LazyModuleLoader } from '@nestjs/core'
import { Test, TestingModule } from '@nestjs/testing'
import { getFactory, prepareStore, type Store, type communities, type identity } from '@quiet/state-manager'
-import { type Community, type Identity, type InitCommunityPayload, type LaunchRegistrarPayload } from '@quiet/types'
+import { type Community, type Identity, type InitCommunityPayload } from '@quiet/types'
import { type FactoryGirl } from 'factory-girl'
import PeerId from 'peer-id'
import { TestModule } from '../common/test.module'
@@ -108,10 +108,8 @@ describe('ConnectionsManagerService', () => {
await connectionsManagerService.closeAllServices()
const launchCommunitySpy = jest.spyOn(connectionsManagerService, 'launchCommunity').mockResolvedValue()
- const launchRegistrarSpy = jest.spyOn(registrationService, 'launchRegistrar').mockResolvedValue()
await connectionsManagerService.init()
- expect(launchRegistrarSpy).not.toHaveBeenCalled()
expect(launchCommunitySpy).toHaveBeenCalledWith(launchCommunityPayload)
})
diff --git a/packages/backend/src/nest/connections-manager/connections-manager.service.ts b/packages/backend/src/nest/connections-manager/connections-manager.service.ts
index 4df0b2ea68..c733bb55c1 100644
--- a/packages/backend/src/nest/connections-manager/connections-manager.service.ts
+++ b/packages/backend/src/nest/connections-manager/connections-manager.service.ts
@@ -30,11 +30,8 @@ import {
NetworkStats,
PushNotificationPayload,
RegisterOwnerCertificatePayload,
- RegisterUserCertificatePayload,
RemoveDownloadStatus,
ResponseCreateNetworkPayload,
- SaveCertificatePayload,
- SaveOwnerCertificatePayload,
SendCertificatesResponse,
SendMessagePayload,
SetChannelSubscribedPayload,
@@ -43,7 +40,6 @@ import {
UploadFilePayload,
PeerId as PeerIdType,
SaveCSRPayload,
- SendUserCertificatePayload,
CommunityMetadata,
CommunityMetadataPayload,
} from '@quiet/types'
@@ -178,10 +174,6 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
if (this.tor && !options.saveTor) {
await this.tor.kill()
}
- if (this.registrationService) {
- this.logger('Stopping registration service')
- await this.registrationService.stop()
- }
if (this.storageService) {
this.logger('Stopping orbitdb')
await this.storageService?.stopOrbitDb()
@@ -207,6 +199,7 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
this.serverIoProvider.io.close()
}
+ // This method is only used on iOS through rn-bridge for reacting on lifecycle changes
public async openSocket() {
await this.socketService.init()
}
@@ -361,7 +354,6 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
targetPort: this.ports.libp2pHiddenService,
peers,
}
- this.logger('libp2p params', params)
await this.libp2pService.createInstance(params)
// KACPER
@@ -395,15 +387,8 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
this.socketService.on(SocketActionTypes.CONNECTION_PROCESS_INFO, data => {
this.serverIoProvider.io.emit(SocketActionTypes.CONNECTION_PROCESS_INFO, data)
})
-
- this.registrationService.on(SocketActionTypes.CONNECTION_PROCESS_INFO, data => {
- this.serverIoProvider.io.emit(SocketActionTypes.CONNECTION_PROCESS_INFO, data)
- })
}
private attachRegistrationListeners() {
- this.registrationService.on(RegistrationEvents.REGISTRAR_STATE, (payload: ServiceState) => {
- this.registrarState = payload
- })
this.registrationService.on(SocketActionTypes.SAVED_OWNER_CERTIFICATE, payload => {
this.serverIoProvider.io.emit(SocketActionTypes.SAVED_OWNER_CERTIFICATE, payload)
})
@@ -520,7 +505,6 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
})
this.storageService.on(StorageEvents.LOAD_CERTIFICATES, (payload: SendCertificatesResponse) => {
this.serverIoProvider.io.emit(SocketActionTypes.RESPONSE_GET_CERTIFICATES, payload)
- this.registrationService.emit(RegistrationEvents.SET_CERTIFICATES, payload.certificates)
})
this.storageService.on(StorageEvents.LOAD_PUBLIC_CHANNELS, (payload: ChannelsReplicatedPayload) => {
this.serverIoProvider.io.emit(SocketActionTypes.CHANNELS_REPLICATED, payload)
@@ -575,11 +559,14 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
console.log('emitting deleted channel event back to state manager')
this.serverIoProvider.io.emit(SocketActionTypes.CHANNEL_DELETION_RESPONSE, payload)
})
- this.storageService.on(StorageEvents.REPLICATED_CSR, async (payload: string[]) => {
- console.log(`On ${StorageEvents.REPLICATED_CSR}`)
- this.serverIoProvider.io.emit(SocketActionTypes.RESPONSE_GET_CSRS, { csrs: payload })
- payload.forEach(csr => this.registrationService.emit(RegistrationEvents.REGISTER_USER_CERTIFICATE, csr))
- })
+ this.storageService.on(
+ StorageEvents.REPLICATED_CSR,
+ async (payload: { csrs: string[]; certificates: string[] }) => {
+ console.log(`On ${StorageEvents.REPLICATED_CSR}`)
+ this.serverIoProvider.io.emit(SocketActionTypes.RESPONSE_GET_CSRS, { csrs: payload.csrs })
+ this.registrationService.emit(RegistrationEvents.REGISTER_USER_CERTIFICATE, payload)
+ }
+ )
this.storageService.on(StorageEvents.REPLICATED_COMMUNITY_METADATA, (payload: CommunityMetadata) => {
console.log(`On ${StorageEvents.REPLICATED_COMMUNITY_METADATA}: ${payload}`)
const communityMetadataPayload: CommunityMetadataPayload = {
diff --git a/packages/backend/src/nest/ipfs-file-manager/ipfs-file-manager.service.ts b/packages/backend/src/nest/ipfs-file-manager/ipfs-file-manager.service.ts
index 31c5a9a538..b8cb12a034 100644
--- a/packages/backend/src/nest/ipfs-file-manager/ipfs-file-manager.service.ts
+++ b/packages/backend/src/nest/ipfs-file-manager/ipfs-file-manager.service.ts
@@ -2,6 +2,7 @@ import { Inject, Injectable } from '@nestjs/common'
import { EventEmitter, setMaxListeners } from 'events'
import fs from 'fs'
import path from 'path'
+import crypto from 'crypto'
import PQueue, { AbortError } from 'p-queue'
import { decode, PBNode } from '@ipld/dag-pb'
import * as base58 from 'multiformats/bases/base58'
@@ -433,13 +434,20 @@ export class IpfsFileManagerService extends EventEmitter {
private async assemblyFile(fileMetadata: FileMetadata) {
const _CID = CID.parse(fileMetadata.cid)
- const downloadDirectory = path.join(this.quietDir, 'downloads', fileMetadata.cid)
+ const downloadDirectory = path.join(this.quietDir, 'downloads')
createPaths([downloadDirectory])
- const fileName = fileMetadata.name + fileMetadata.ext
- const filePath = `${path.join(downloadDirectory, fileName)}`
-
- const writeStream = fs.createWriteStream(filePath)
+ // As a quick fix, using a UUID for filename ensures that we never
+ // save a file with a malicious filename. Perhaps it's also
+ // possible to use the CID, however let's verify that first.
+ let fileName: string
+ let filePath: string
+ do {
+ fileName = crypto.randomUUID()
+ filePath = `${path.join(downloadDirectory, fileName)}`
+ } while (fs.existsSync(filePath))
+
+ const writeStream = fs.createWriteStream(filePath, { flags: 'wx' })
const entries = this.ipfs.cat(_CID)
diff --git a/packages/backend/src/nest/registration/registration.functions.ts b/packages/backend/src/nest/registration/registration.functions.ts
index 43bde69f62..1363eae65e 100644
--- a/packages/backend/src/nest/registration/registration.functions.ts
+++ b/packages/backend/src/nest/registration/registration.functions.ts
@@ -1,31 +1,12 @@
-import {
- createUserCert,
- loadCSR,
- CertFieldsTypes,
- getReqFieldValue,
- keyFromCertificate,
- parseCertificate,
- getCertFieldValue,
-} from '@quiet/identity'
+import { createUserCert, keyFromCertificate } from '@quiet/identity'
import { IsBase64, IsNotEmpty, validate } from 'class-validator'
-import { CertificationRequest } from 'pkijs'
-import { Agent } from 'http'
-import AbortController from 'abort-controller'
-import fetch, { Response } from 'node-fetch'
-import { getUsersAddresses } from '../common/utils'
-import {
- ErrorCodes,
- ErrorMessages,
- ErrorPayload,
- PermsData,
- SocketActionTypes,
- SuccessfullRegistrarionResponse,
- UserCertificatePayload,
- UserData,
-} from '@quiet/types'
+import { ErrorPayload, PermsData, SocketActionTypes, SuccessfullRegistrarionResponse } from '@quiet/types'
import { CsrContainsFields, IsCsr } from './registration.validators'
import { RegistrationEvents } from './registration.types'
+import { loadCSR, CertFieldsTypes, getCertFieldValue, getReqFieldValue, parseCertificate } from '@quiet/identity'
+import { CertificationRequest } from 'pkijs'
import Logger from '../common/logger'
+import { load } from 'mock-fs'
const logger = Logger('registration.functions')
class UserCsrData {
@@ -37,51 +18,8 @@ class UserCsrData {
}
export interface RegistrarResponse {
- status: number
- body: any
-}
-
-// REFACTORING: Move this method to identity package
-export const pubKeyMatch = (cert: string, parsedCsr: CertificationRequest): boolean => {
- const parsedCertificate = parseCertificate(cert)
- const pubKey = keyFromCertificate(parsedCertificate)
- const pubKeyCsr = keyFromCertificate(parsedCsr)
-
- if (pubKey === pubKeyCsr) {
- return true
- }
- return false
-}
-
-export const registerOwner = async (userCsr: string, permsData: PermsData): Promise => {
- const userData = new UserCsrData()
- userData.csr = userCsr
- const validationErrors = await validate(userData)
- if (validationErrors.length > 0) {
- throw new Error(`Validation errors: ${validationErrors}`)
- }
- const userCert = await createUserCert(
- permsData.certificate,
- permsData.privKey,
- userCsr,
- new Date(),
- new Date(2030, 1, 1)
- )
- return userCert.userCertString
-}
-
-const certificateByUsername = (username: string, certificates: string[]): string | null => {
- /**
- * Check if given username is already in use
- */
- for (const cert of certificates) {
- const parsedCert = parseCertificate(cert)
- const certUsername = getCertFieldValue(parsedCert, CertFieldsTypes.nickName)
- if (certUsername?.localeCompare(username, undefined, { sensitivity: 'base' }) === 0) {
- return cert
- }
- }
- return null
+ cert: string | null
+ error: any
}
export interface RegistrationResponse {
@@ -89,194 +27,59 @@ export interface RegistrationResponse {
data: ErrorPayload | SuccessfullRegistrarionResponse
}
-export const sendCertificateRegistrationRequest = async (
- serviceAddress: string,
- userCsr: string,
- communityId: string,
- requestTimeout = 120000,
- socksProxyAgent: Agent
-): Promise => {
- const controller = new AbortController()
- const timeout = setTimeout(() => {
- controller.abort()
- }, requestTimeout)
-
- let options = {
- method: 'POST',
- body: JSON.stringify({ data: userCsr }),
- headers: { 'Content-Type': 'application/json' },
- signal: controller.signal,
- }
-
- options = Object.assign(
- {
- agent: socksProxyAgent,
- },
- options
- )
-
- let response: Response | null = null
+export const extractPendingCsrs = async (payload: { csrs: string[]; certificates: string[] }) => {
+ const certNames = new Set()
+ const pendingNames = new Set()
+ const parsedUniqueCsrs = new Map()
+ const pendingCsrs: string[] = []
- try {
- const start = new Date()
- response = await fetch(`${serviceAddress}/register`, options)
- const end = new Date()
- const fetchTime = (end.getTime() - start.getTime()) / 1000
- logger(`Fetched ${serviceAddress}, time: ${fetchTime}`)
- } catch (e) {
- logger.error(e)
- return {
- eventType: RegistrationEvents.ERROR,
- data: {
- type: SocketActionTypes.REGISTRAR,
- code: ErrorCodes.NOT_FOUND,
- message: ErrorMessages.REGISTRAR_NOT_FOUND,
- community: communityId,
- },
+ payload.certificates.forEach(cert => {
+ const parsedCert = parseCertificate(cert)
+ const username = getCertFieldValue(parsedCert, CertFieldsTypes.nickName)
+ if (username) {
+ certNames.add(username)
}
- } finally {
- clearTimeout(timeout)
- }
+ })
- switch (response?.status) {
- case 200:
- break
- case 400:
- return {
- eventType: RegistrationEvents.ERROR,
- data: {
- type: SocketActionTypes.REGISTRAR,
- code: ErrorCodes.BAD_REQUEST,
- message: ErrorMessages.INVALID_USERNAME,
- community: communityId,
- },
- }
- case 403:
- return {
- eventType: RegistrationEvents.ERROR,
- data: {
- type: SocketActionTypes.REGISTRAR,
- code: ErrorCodes.FORBIDDEN,
- message: ErrorMessages.USERNAME_TAKEN,
- community: communityId,
- },
- }
- case 404:
- return {
- eventType: RegistrationEvents.ERROR,
- data: {
- type: SocketActionTypes.REGISTRAR,
- code: ErrorCodes.NOT_FOUND,
- message: ErrorMessages.REGISTRAR_NOT_FOUND,
- community: communityId,
- },
- }
- default:
- logger.error(`Registrar responded with ${response?.status} "${response?.statusText}" (${communityId})`)
- return {
- eventType: RegistrationEvents.ERROR,
- data: {
- type: SocketActionTypes.REGISTRAR,
- code: ErrorCodes.SERVER_ERROR,
- message: ErrorMessages.REGISTRATION_FAILED,
- community: communityId,
- },
- }
+ for (const csr of payload.csrs.reverse()) {
+ const parsedCsr = await loadCSR(csr)
+ const pubKey = keyFromCertificate(parsedCsr)
+ if (!parsedUniqueCsrs.has(pubKey)) {
+ parsedUniqueCsrs.set(pubKey, csr)
+ }
}
- const registrarResponse: UserCertificatePayload = await response.json()
+ const uniqueCsrsArray = Array.from(parsedUniqueCsrs.values()).reverse()
- logger(`Sending user certificate (${communityId})`)
- return {
- eventType: SocketActionTypes.SEND_USER_CERTIFICATE,
- data: {
- communityId: communityId,
- payload: registrarResponse,
- },
+ for (const csr of uniqueCsrsArray) {
+ const parsedCsr = await loadCSR(csr)
+ const username = getReqFieldValue(parsedCsr, CertFieldsTypes.nickName)
+ if (username && !certNames.has(username) && !pendingNames.has(username)) {
+ pendingNames.add(username)
+ pendingCsrs.push(csr)
+ }
}
+ return pendingCsrs
}
-export const registerUser = async (
- csr: string,
- permsData: PermsData,
- certificates: string[],
- ownerCertificate: string
-): Promise => {
- let cert: string
+export const validateCsr = async (csr: string) => {
const userData = new UserCsrData()
userData.csr = csr
const validationErrors = await validate(userData)
- if (validationErrors.length > 0) {
- logger.error(`Received data is not valid: ${validationErrors.toString()}`)
- return {
- status: 400,
- body: JSON.stringify(validationErrors),
- }
- }
+ return validationErrors
+}
- const parsedCsr = await loadCSR(userData.csr)
- const username = getReqFieldValue(parsedCsr, CertFieldsTypes.nickName)
- if (!username) {
- logger.error(`Could not parse certificate for field type ${CertFieldsTypes.nickName}`)
+/**
+ * This function should only be called with pending CSRs (by calling extractPendingCsrs first which prevents signing CSRs for duplicate usernames).
+ */
+export const issueCertificate = async (userCsr: string, permsData: PermsData): Promise => {
+ const validationErrors = await validateCsr(userCsr)
+ if (validationErrors.length > 0) {
return {
- // Should be internal server error code 500
- status: 400,
- body: null,
- }
- }
- // Use map here
- const usernameCert = certificateByUsername(username, certificates)
- if (usernameCert) {
- if (!pubKeyMatch(usernameCert, parsedCsr)) {
- logger(`Username ${username} is taken`)
- return {
- // Should be conflict code 409
- status: 403,
- body: null,
- }
- } else {
- logger('Requesting same CSR again')
- cert = usernameCert
- }
- } else {
- logger('username doesnt have existing cert, creating new')
- try {
- cert = await registerCertificate(userData.csr, permsData)
- } catch (e) {
- logger.error(`Something went wrong with registering user: ${e.message as string}`)
- return {
- // Should be internal server error code 500
- status: 400,
- body: null,
- }
+ cert: null,
+ error: [validationErrors],
}
}
-
- const allUsers: UserData[] = []
- for (const cert of certificates) {
- const parsedCert = parseCertificate(cert)
- const onionAddress = getCertFieldValue(parsedCert, CertFieldsTypes.commonName)
- const peerId = getCertFieldValue(parsedCert, CertFieldsTypes.peerId)
- const username = getCertFieldValue(parsedCert, CertFieldsTypes.nickName)
- const dmPublicKey = getCertFieldValue(parsedCert, CertFieldsTypes.dmPublicKey)
- if (!onionAddress || !peerId || !username || !dmPublicKey) continue
- allUsers.push({ onionAddress, peerId, username, dmPublicKey })
- }
-
- const peerList = await getUsersAddresses(allUsers)
-
- return {
- status: 200,
- body: {
- certificate: cert,
- peers: peerList,
- rootCa: permsData.certificate,
- ownerCert: ownerCertificate,
- },
- }
-}
-
-export const registerCertificate = async (userCsr: string, permsData: PermsData): Promise => {
const userCert = await createUserCert(
permsData.certificate,
permsData.privKey,
@@ -284,5 +87,8 @@ export const registerCertificate = async (userCsr: string, permsData: PermsData)
new Date(),
new Date(2030, 1, 1)
)
- return userCert.userCertString
+ return {
+ cert: userCert.userCertString,
+ error: null,
+ }
}
diff --git a/packages/backend/src/nest/registration/registration.service.spec.ts b/packages/backend/src/nest/registration/registration.service.spec.ts
index 38719e3ec0..6355013592 100644
--- a/packages/backend/src/nest/registration/registration.service.spec.ts
+++ b/packages/backend/src/nest/registration/registration.service.spec.ts
@@ -2,29 +2,14 @@ import { Test, TestingModule } from '@nestjs/testing'
import { TestModule } from '../common/test.module'
import { RegistrationModule } from './registration.module'
import { RegistrationService } from './registration.service'
-import {
- configCrypto,
- createRootCA,
- createUserCert,
- createUserCsr,
- type RootCA,
- verifyUserCert,
- type UserCsr,
-} from '@quiet/identity'
+import { configCrypto, createRootCA, createUserCsr, type RootCA, verifyUserCert, type UserCsr } from '@quiet/identity'
import { type DirResult } from 'tmp'
-import { ErrorCodes, ErrorMessages, type PermsData, SocketActionTypes } from '@quiet/types'
+import { type PermsData } from '@quiet/types'
import { Time } from 'pkijs'
-import { registerOwner, registerUser, sendCertificateRegistrationRequest } from './registration.functions'
-import createHttpsProxyAgent from 'https-proxy-agent'
-import { RegistrationEvents } from './registration.types'
+import { issueCertificate, extractPendingCsrs } from './registration.functions'
import { jest } from '@jest/globals'
import { createTmpDir } from '../common/utils'
-// @ts-ignore
-const { Response } = jest.requireActual('node-fetch')
-
-jest.mock('node-fetch', () => jest.fn())
-
describe('RegistrationService', () => {
let module: TestingModule
let registrationService: RegistrationService
@@ -34,7 +19,6 @@ describe('RegistrationService', () => {
let permsData: PermsData
let userCsr: UserCsr
let invalidUserCsr: any
- let fetch: any
beforeEach(async () => {
module = await Test.createTestingModule({
@@ -60,7 +44,6 @@ describe('RegistrationService', () => {
hashAlg: configCrypto.hashAlg,
})
invalidUserCsr = 'invalidUserCsr'
- fetch = await import('node-fetch')
})
afterEach(async () => {
@@ -68,104 +51,99 @@ describe('RegistrationService', () => {
await module.close()
})
- it('registerOwner should return certificate if csr is valid', async () => {
- const result = await registerOwner(userCsr.userCsr, permsData)
- expect(result).toBeTruthy()
+ it('registerUser should return cert if csr is valid and cert should pass the verification', async () => {
+ const responseData = await issueCertificate(userCsr.userCsr, permsData)
+ expect(responseData.cert).toBeTruthy()
+ if (!responseData.cert) return null
+ const isProperUserCert = await verifyUserCert(certRoot.rootCertString, responseData.cert)
+ expect(isProperUserCert.result).toBe(true)
})
- it('registerOwner should throw error if csr is invalid', async () => {
- await expect(registerOwner(invalidUserCsr, permsData)).rejects.toThrow()
+ it('registrar should return errors array if csr is not valid and should not return any cert', async () => {
+ const responseData = await issueCertificate(invalidUserCsr, permsData)
+ expect(responseData.cert).toBeFalsy()
+ expect(responseData.error.length).toBeTruthy()
})
- it('registerUser should return 200 status code', async () => {
- const responseData = await registerUser(userCsr.userCsr, permsData, [], 'ownerCert')
- const isProperUserCert = await verifyUserCert(certRoot.rootCertString, responseData.body.certificate)
- expect(isProperUserCert.result).toBe(true)
+ it('extractPendingCsrs should return all csrs if there are no certificates and csrs do not contain duplicate usernames', async () => {
+ const certificates: string[] = []
+ const csrs: string[] = [userCsr.userCsr]
+ const payload: { certificates: string[]; csrs: string[] } = {
+ certificates: certificates,
+ csrs: csrs,
+ }
+ const pendingCsrs = await extractPendingCsrs(payload)
+ expect(pendingCsrs).toEqual(csrs)
})
- it('returns existing certificate if username is taken but csr and cert public keys match', async () => {
- const user = await createUserCsr({
- nickname: 'userName',
+ it('extractPendingCsrs should return all csrs if there are certificates, and csrs do not contain any name that is in certificates already', async () => {
+ const aliceCsr = await createUserCsr({
+ nickname: 'alice',
commonName: 'nqnw4kc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion',
peerId: 'Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6',
- dmPublicKey: 'testdmPublicKey1',
+ dmPublicKey: 'testdmPublicKey',
signAlg: configCrypto.signAlg,
hashAlg: configCrypto.hashAlg,
})
- const userCert = await createUserCert(
- certRoot.rootCertString,
- certRoot.rootKeyString,
- user.userCsr,
- new Date(),
- new Date(2030, 1, 1)
- )
- const responseData = await registerUser(user.userCsr, permsData, [userCert.userCertString], 'ownerCert')
- expect(responseData.status).toEqual(200)
- const isProperUserCert = await verifyUserCert(certRoot.rootCertString, responseData.body.certificate)
- expect(isProperUserCert.result).toBe(true)
- expect(responseData.body.peers.length).toBe(1)
- expect(responseData.body.rootCa).toBe(certRoot.rootCertString)
+ const aliceCert = await issueCertificate(aliceCsr.userCsr, permsData)
+ if (!aliceCert.cert) return
+ const certificates: string[] = [aliceCert.cert]
+ const csrs: string[] = [userCsr.userCsr]
+ const payload: { certificates: string[]; csrs: string[] } = {
+ certificates: certificates,
+ csrs: csrs,
+ }
+ const pendingCsrs = await extractPendingCsrs(payload)
+ expect(pendingCsrs).toEqual(csrs)
})
- it('returns 403 if username already exists and csr and cert public keys dont match', async () => {
- const user = await createUserCsr({
- nickname: 'userName',
+ it('extractPendingCsrs should return filtered csrs, excluding those that tries to claim username already present in certificate', async () => {
+ const userCert = await issueCertificate(userCsr.userCsr, permsData)
+ if (!userCert.cert) return
+ const certificates: string[] = [userCert.cert]
+ const csrs: string[] = [userCsr.userCsr]
+ const payload: { certificates: string[]; csrs: string[] } = {
+ certificates: certificates,
+ csrs: csrs,
+ }
+ const pendingCsrs = await extractPendingCsrs(payload)
+ expect(pendingCsrs.length).toEqual(0)
+ })
+
+ it('extractPendingCsrs should return all csrs if there are no duplicates in requested usernames', async () => {
+ const userCsr2 = await createUserCsr({
+ nickname: 'userName2',
commonName: 'nqnw4kc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion',
peerId: 'Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6',
- dmPublicKey: 'testdmPublicKey1',
+ dmPublicKey: 'testdmPublicKey',
signAlg: configCrypto.signAlg,
hashAlg: configCrypto.hashAlg,
})
- const userCert = await createUserCert(
- certRoot.rootCertString,
- certRoot.rootKeyString,
- user.userCsr,
- new Date(),
- new Date(2030, 1, 1)
- )
- const userNew = await createUserCsr({
- nickname: 'username',
- commonName: 'abcd.onion',
- peerId: 'QmS9vJkgbea9EgzHvVPqhj1u4tH7YKq7eteDN7gnG5zUmc',
- dmPublicKey: 'testdmPublicKey2',
+ const csrs: string[] = [userCsr.userCsr, userCsr2.userCsr]
+ const pendingCsrs = await extractPendingCsrs({ certificates: [], csrs: csrs })
+ expect(pendingCsrs.length).toEqual(csrs.length)
+ })
+
+ it('Extract pending csrs should return only csrs that have unique usernames', async () => {
+ const userCsr = await createUserCsr({
+ nickname: 'karol',
+ commonName: 'nqnw4kc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion',
+ peerId: 'Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6',
+ dmPublicKey: 'testdmPublicKey',
signAlg: configCrypto.signAlg,
hashAlg: configCrypto.hashAlg,
})
- const response = await registerUser(userNew.userCsr, permsData, [userCert.userCertString], 'ownerCert')
- expect(response.status).toEqual(403)
- })
-
- it('returns 400 if no csr in data or csr has wrong format', async () => {
- for (const invalidCsr of ['', 'abcd']) {
- const response = await registerUser(invalidCsr, permsData, [], 'ownerCert')
- expect(response.status).toEqual(400)
- }
- })
-
- it('returns 400 if csr is lacking a field', async () => {
- const csr =
- 'MIIBFTCBvAIBADAqMSgwFgYKKwYBBAGDjBsCARMIdGVzdE5hbWUwDgYDVQQDEwdaYmF5IENBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEGPGHpJzE/CvL7l/OmTSfYQrhhnWQrYw3GgWB1raCTSeFI/MDVztkBOlxwdUWSm10+1OtKVUWeMKaMtyIYFcPPqAwMC4GCSqGSIb3DQEJDjEhMB8wHQYDVR0OBBYEFLjaEh+cnNhsi5qDsiMB/ZTzZFfqMAoGCCqGSM49BAMCA0gAMEUCIFwlob/Igab05EozU0e/lsG7c9BxEy4M4c4Jzru2vasGAiEAqFTQuQr/mVqTHO5vybWm/iNDk8vh88K6aBCCGYqIfdw='
- const response = await registerUser(csr, permsData, [], 'ownerCert')
- expect(response.status).toEqual(400)
- })
-
- it('returns 404 if fetching registrar address throws error', async () => {
- console.log(fetch)
- fetch.default.mockRejectedValue('User aborted request')
- const communityId = 'communityID'
- const response = await sendCertificateRegistrationRequest(
- 'QmS9vJkgbea9EgzHvVPqhj1u4tH7YKq7eteDN7gnG5zUmc',
- userCsr.userCsr,
- communityId,
- 1000,
- createHttpsProxyAgent({ port: '12311', host: 'localhost' })
- )
- expect(response.eventType).toBe(RegistrationEvents.ERROR)
- expect(response.data).toEqual({
- type: SocketActionTypes.REGISTRAR,
- code: ErrorCodes.NOT_FOUND,
- message: ErrorMessages.REGISTRAR_NOT_FOUND,
- community: communityId,
+ const userCsr2 = await createUserCsr({
+ nickname: 'karol',
+ commonName: 'nnnnnnc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion',
+ peerId: 'QmffffffqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6',
+ dmPublicKey: 'testdmPublicKey',
+ signAlg: configCrypto.signAlg,
+ hashAlg: configCrypto.hashAlg,
})
+ const csrs: string[] = [userCsr.userCsr, userCsr2.userCsr]
+ const pendingCsrs = await extractPendingCsrs({ certificates: [], csrs: csrs })
+ expect(pendingCsrs.length).toEqual(1)
+ expect(pendingCsrs[0]).toBe(userCsr.userCsr)
})
})
diff --git a/packages/backend/src/nest/registration/registration.service.ts b/packages/backend/src/nest/registration/registration.service.ts
index 4c7c180f8b..c788d1cb7c 100644
--- a/packages/backend/src/nest/registration/registration.service.ts
+++ b/packages/backend/src/nest/registration/registration.service.ts
@@ -1,98 +1,39 @@
-import { Inject, Injectable, OnModuleInit } from '@nestjs/common'
-import express from 'express'
-import getPort from 'get-port'
-import { Agent, Server } from 'http'
+import { Injectable, OnModuleInit } from '@nestjs/common'
import { EventEmitter } from 'events'
-import {
- registerOwner,
- registerUser,
- RegistrarResponse,
- RegistrationResponse,
- sendCertificateRegistrationRequest,
-} from './registration.functions'
-import {
- ConnectionProcessInfo,
- ErrorCodes,
- ErrorMessages,
- LaunchRegistrarPayload,
- PermsData,
- RegisterOwnerCertificatePayload,
- SocketActionTypes,
-} from '@quiet/types'
-import { EXPRESS_PROVIDER } from '../const'
+import { extractPendingCsrs, issueCertificate } from './registration.functions'
+import { ErrorCodes, ErrorMessages, PermsData, RegisterOwnerCertificatePayload, SocketActionTypes } from '@quiet/types'
import { RegistrationEvents } from './registration.types'
-import { ServiceState } from '../connections-manager/connections-manager.types'
import Logger from '../common/logger'
@Injectable()
export class RegistrationService extends EventEmitter implements OnModuleInit {
private readonly logger = Logger(RegistrationService.name)
- private _server: Server
- private _port: number
- public registrationService: any
public certificates: string[] = []
private _permsData: PermsData
- private _ownerCertificate: string
- constructor(@Inject(EXPRESS_PROVIDER) public readonly _app: express.Application) {
+ constructor() {
super()
}
onModuleInit() {
- this.on(RegistrationEvents.SET_CERTIFICATES, certs => {
- this.setCertificates(certs)
- })
- this.on(RegistrationEvents.REGISTER_USER_CERTIFICATE, async (csr: string) => {
- if (!this._permsData) {
- console.log('NO PERMS DATA')
- return
- }
- await this.registerUser(csr)
- })
- this.setRouting()
- }
-
- public setCertificates(certs: string[]) {
- this.certificates = certs
- }
-
- private pendingPromise: Promise | null = null
-
- private setRouting() {
- // @ts-ignore
- this._app.use(express.json())
- this._app.post('/register', async (req, res): Promise => {
- if (this.pendingPromise) return
- this.pendingPromise = this.registerUser(req.body.data)
- const result = await this.pendingPromise
- if (result) {
- res.status(result.status).send(result.body)
+ this.on(
+ RegistrationEvents.REGISTER_USER_CERTIFICATE,
+ async (payload: { csrs: string[]; certificates: string[] }) => {
+ // Lack of permsData means that we are not the owner of the community in the official model of the app, however anyone can modify the source code, put malicious permsData here, issue false certificates and try to trick other users.
+ await this.issueCertificates(payload)
}
- this.pendingPromise = null
- })
- }
-
- public async listen(): Promise {
- return await new Promise(resolve => {
- this._server = this._app.listen(this._port, () => {
- this.logger(`Certificate registration service listening on port: ${this._port}`)
- resolve()
- })
- })
+ )
}
- public async stop(): Promise {
- return await new Promise(resolve => {
- if (!this._server) resolve()
- this._server.close(() => {
- this.logger('Certificate registration service closed')
- resolve()
- })
+ private async issueCertificates(payload: { csrs: string[]; certificates: string[] }) {
+ if (!this._permsData) return
+ const pendingCsrs = await extractPendingCsrs(payload)
+ pendingCsrs.forEach(async csr => {
+ await this.registerUserCertificate(csr)
})
}
public set permsData(perms: PermsData) {
- console.log('Setting owner perms data')
this._permsData = {
certificate: perms.certificate,
privKey: perms.privKey,
@@ -100,79 +41,28 @@ export class RegistrationService extends EventEmitter implements OnModuleInit {
}
public async registerOwnerCertificate(payload: RegisterOwnerCertificatePayload): Promise {
- let cert: string
- try {
- cert = await registerOwner(payload.userCsr.userCsr, payload.permsData)
- } catch (e) {
- this.logger.error(`Registering owner failed: ${e.message}`)
+ // FIXME: We should resolve problems with events order and we should set permsData only on LAUNCH_REGISTRART socket event in connectionsManager.
+ this._permsData = payload.permsData
+ const result = await issueCertificate(payload.userCsr.userCsr, this._permsData)
+ if (result?.cert) {
+ this.emit(SocketActionTypes.SAVED_OWNER_CERTIFICATE, {
+ communityId: payload.communityId,
+ network: { certificate: result.cert },
+ })
+ } else {
this.emit(SocketActionTypes.ERROR, {
type: SocketActionTypes.REGISTRAR,
code: ErrorCodes.SERVER_ERROR,
message: ErrorMessages.REGISTRATION_FAILED,
community: payload.communityId,
})
- return
- }
- this.emit(SocketActionTypes.SAVED_OWNER_CERTIFICATE, {
- communityId: payload.communityId,
- network: { certificate: cert, peers: [] },
- })
- this._ownerCertificate = cert
- }
-
- public async sendCertificateRegistrationRequest(
- serviceAddress: string,
- userCsr: string,
- communityId: string,
- requestTimeout = 120000,
- socksProxyAgent: Agent
- ): Promise {
- const response: RegistrationResponse = await sendCertificateRegistrationRequest(
- serviceAddress,
- userCsr,
- communityId,
- requestTimeout,
- socksProxyAgent
- )
- this.emit(SocketActionTypes.CONNECTION_PROCESS_INFO, ConnectionProcessInfo.CONNECTING_TO_COMMUNITY)
- this.emit(response.eventType, response.data)
- }
-
- public async registerUser(csr: string): Promise<{ status: number; body: any }> {
- const result = await registerUser(csr, this._permsData, this.certificates, this._ownerCertificate)
- if (result?.status === 200) {
- this.emit(RegistrationEvents.NEW_USER, { certificate: result.body.certificate, rootPermsData: this._permsData })
}
- return result
}
- public async launchRegistrar(payload: LaunchRegistrarPayload): Promise {
- this.emit(RegistrationEvents.REGISTRAR_STATE, ServiceState.LAUNCHING)
- this._permsData = {
- certificate: payload.rootCertString,
- privKey: payload.rootKeyString,
- }
- this.logger(`Initializing registration service for peer ${payload.peerId}...`)
- try {
- await this.init(payload.privateKey)
- } catch (err) {
- this.logger.error(`Couldn't initialize certificate registration service: ${err as string}`)
- return
- }
- try {
- await this.listen()
- } catch (err) {
- this.logger.error(`Certificate registration service couldn't start listening: ${err as string}`)
+ public async registerUserCertificate(csr: string): Promise {
+ const result = await issueCertificate(csr, this._permsData)
+ if (result?.cert) {
+ this.emit(RegistrationEvents.NEW_USER, { certificate: result.cert })
}
- this.emit(RegistrationEvents.REGISTRAR_STATE, ServiceState.LAUNCHED)
- }
-
- public async init(privKey: string): Promise {
- this._port = await getPort()
- this.emit(RegistrationEvents.SPAWN_HS_FOR_REGISTRAR, {
- port: this._port,
- privateKey: privKey,
- targetPort: 80,
- })
}
}
diff --git a/packages/backend/src/nest/registration/registration.types.ts b/packages/backend/src/nest/registration/registration.types.ts
index dcffe9d7f9..02da49c0d6 100644
--- a/packages/backend/src/nest/registration/registration.types.ts
+++ b/packages/backend/src/nest/registration/registration.types.ts
@@ -1,8 +1,5 @@
export enum RegistrationEvents {
ERROR = 'error',
- SPAWN_HS_FOR_REGISTRAR = 'spawnHsForRegistrar',
NEW_USER = 'newUser',
- SET_CERTIFICATES = 'setCertificates',
- REGISTRAR_STATE = 'registrarState',
REGISTER_USER_CERTIFICATE = 'registerUserCertificate',
}
diff --git a/packages/backend/src/nest/socket/socket.service.spec.ts b/packages/backend/src/nest/socket/socket.service.spec.ts
index 8afab44c23..f32ba21103 100644
--- a/packages/backend/src/nest/socket/socket.service.spec.ts
+++ b/packages/backend/src/nest/socket/socket.service.spec.ts
@@ -24,7 +24,7 @@ describe('SocketService', () => {
module.init()
- client = io(`http://localhost:${TEST_DATA_PORT}`)
+ client = io(`http://127.0.0.1:${TEST_DATA_PORT}`)
})
afterAll(async () => {
diff --git a/packages/backend/src/nest/socket/socket.service.ts b/packages/backend/src/nest/socket/socket.service.ts
index 332263f3f2..5d687fe2a2 100644
--- a/packages/backend/src/nest/socket/socket.service.ts
+++ b/packages/backend/src/nest/socket/socket.service.ts
@@ -35,20 +35,22 @@ export class SocketService extends EventEmitter implements OnModuleInit {
@Inject(CONFIG_OPTIONS) public readonly configOptions: ConfigOptions
) {
super()
+
+ this.readyness = new Promise(resolve => {
+ this.resolveReadyness = resolve
+ })
}
async onModuleInit() {
this.logger('init:started')
+
this.attachListeners()
await this.init()
+
this.logger('init:finished')
}
public async init() {
- this.readyness = new Promise(resolve => {
- this.resolveReadyness = resolve
- })
-
const connection = new Promise(resolve => {
this.serverIoProvider.io.on(SocketActionTypes.CONNECTION, socket => {
this.logger('init: connection')
@@ -172,9 +174,6 @@ export class SocketService extends EventEmitter implements OnModuleInit {
ownerCertificate: payload.certificate,
rootCa: payload.permsData.certificate,
}
-
- console.log('Metadata from state-manager', communityMetadataPayload)
-
this.emit(SocketActionTypes.SEND_COMMUNITY_METADATA, communityMetadataPayload)
})
@@ -214,7 +213,7 @@ export class SocketService extends EventEmitter implements OnModuleInit {
public listen = async (port = this.configOptions.socketIOPort): Promise => {
return await new Promise(resolve => {
if (this.serverIoProvider.server.listening) resolve()
- this.serverIoProvider.server.listen(this.configOptions.socketIOPort, () => {
+ this.serverIoProvider.server.listen(this.configOptions.socketIOPort, '127.0.0.1', () => {
this.logger(`Data server running on port ${this.configOptions.socketIOPort}`)
resolve()
})
diff --git a/packages/backend/src/nest/storage/storage.service.spec.ts b/packages/backend/src/nest/storage/storage.service.spec.ts
index 9012cf0785..a4e0fb0ada 100644
--- a/packages/backend/src/nest/storage/storage.service.spec.ts
+++ b/packages/backend/src/nest/storage/storage.service.spec.ts
@@ -295,26 +295,6 @@ describe('StorageService', () => {
expect(result).toBe(true)
})
- it('is not saved to db if did not pass verification', async () => {
- const oldUserCertificate = await createUserCert(
- rootPermsData.certificate,
- rootPermsData.privKey,
- // @ts-expect-error userCsr can be undefined
- alice.userCsr?.userCsr,
- new Date(2021, 1, 1),
- new Date(2021, 1, 2)
- )
-
- await storageService.init(peerId)
-
- const result = await storageService.saveCertificate({
- certificate: oldUserCertificate.userCertString,
- rootPermsData,
- })
-
- expect(result).toBe(false)
- })
-
it('is not saved to db if empty', async () => {
await storageService.init(peerId)
diff --git a/packages/backend/src/nest/storage/storage.service.ts b/packages/backend/src/nest/storage/storage.service.ts
index dbe0a8622b..62f1d6ba88 100644
--- a/packages/backend/src/nest/storage/storage.service.ts
+++ b/packages/backend/src/nest/storage/storage.service.ts
@@ -397,36 +397,18 @@ export class StorageService extends EventEmitter {
write: ['*'],
},
})
- this.certificatesRequests.events.on('replicate.progress', async (_address, _hash, entry, _progress, _total) => {
- const csr: string = entry.payload.value
- this.logger('Replicated csr')
- let parsedCSR: CertificationRequest
- try {
- parsedCSR = parseCertificationRequest(csr)
- } catch (e) {
- this.logger.error(`csrs replicate.progress: could not parse certificate request`)
- return
- }
-
- const username = getReqFieldValue(parsedCSR, CertFieldsTypes.nickName)
- if (!username) {
- this.logger.error(
- `csrs replicate.progress: could not parse certificate request for field type ${CertFieldsTypes.nickName}`
- )
- return
- }
- this.emit(StorageEvents.REPLICATED_CSR, [csr])
- })
this.certificatesRequests.events.on('replicated', async () => {
this.logger('REPLICATED: CSRs')
const allCsrs = this.getAllEventLogEntries(this.certificatesRequests)
- this.emit(StorageEvents.REPLICATED_CSR, allCsrs)
+ const allCertificates = this.getAllEventLogEntries(this.certificates)
+ this.emit(StorageEvents.REPLICATED_CSR, { csrs: allCsrs, certificates: allCertificates })
await this.updatePeersList()
})
this.certificatesRequests.events.on('write', async (_address, entry) => {
const csr: string = entry.payload.value
this.logger('Saved CSR locally')
- this.emit(StorageEvents.REPLICATED_CSR, [csr])
+ const allCertificates = this.getAllEventLogEntries(this.certificates)
+ this.emit(StorageEvents.REPLICATED_CSR, { csrs: [csr], certificates: allCertificates })
await this.updatePeersList()
})
@@ -849,12 +831,6 @@ export class StorageService extends EventEmitter {
this.logger('Certificate is either null or undefined, not saving to db')
return false
}
- const verification = await verifyUserCert(payload.rootPermsData.certificate, payload.certificate)
- if (verification.resultCode !== 0) {
- this.logger.error('Certificate is not valid')
- this.logger.error(verification.resultMessage)
- return false
- }
this.logger('Saving certificate...')
await this.certificates.add(payload.certificate)
return true
diff --git a/packages/backend/src/nest/websocketOverTor/websocketOverTor.tor.spec.ts b/packages/backend/src/nest/websocketOverTor/websocketOverTor.tor.spec.ts
index 1ffde5daa4..f8fc150f63 100644
--- a/packages/backend/src/nest/websocketOverTor/websocketOverTor.tor.spec.ts
+++ b/packages/backend/src/nest/websocketOverTor/websocketOverTor.tor.spec.ts
@@ -118,7 +118,8 @@ describe('websocketOverTor', () => {
await listener?.close()
})
- it.each([
+ // Those are randomly failing and we do not use wss atm anyway.
+ it.skip.each([
['string', String],
['array', Array],
])('connects successfully with CA passed as %s', async (_name: string, caType: (ca: string) => any) => {
diff --git a/packages/common/CHANGELOG.md b/packages/common/CHANGELOG.md
index 70f2bab02a..d6ed3f912d 100644
--- a/packages/common/CHANGELOG.md
+++ b/packages/common/CHANGELOG.md
@@ -3,7 +3,7 @@
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/ZbayApp/monorepo/compare/@quiet/common@2.0.1-alpha.0...@quiet/common@2.0.1-alpha.1) (2023-09-25)
+## [2.0.1-alpha.4](https://github.com/TryQuiet/quiet/compare/@quiet/common@2.0.1-alpha.3...@quiet/common@2.0.1-alpha.4) (2023-10-12)
**Note:** Version bump only for package @quiet/common
@@ -11,7 +11,39 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [2.0.1-alpha.0](https://github.com/ZbayApp/monorepo/compare/@quiet/common@2.0.0-alpha.3...@quiet/common@2.0.1-alpha.0) (2023-09-25)
+## [2.0.1-alpha.3](https://github.com/TryQuiet/quiet/compare/@quiet/common@2.0.1-alpha.2...@quiet/common@2.0.1-alpha.3) (2023-10-10)
+
+**Note:** Version bump only for package @quiet/common
+
+
+
+
+
+## [2.0.1-alpha.2](https://github.com/TryQuiet/quiet/compare/@quiet/common@2.0.1-alpha.1...@quiet/common@2.0.1-alpha.2) (2023-10-09)
+
+**Note:** Version bump only for package @quiet/common
+
+
+
+
+
+## [2.0.1-alpha.1](https://github.com/TryQuiet/quiet/compare/@quiet/common@2.0.1-alpha.0...@quiet/common@2.0.1-alpha.1) (2023-09-25)
+
+**Note:** Version bump only for package @quiet/common
+
+
+
+
+
+## [2.0.1-alpha.0](https://github.com/TryQuiet/quiet/compare/@quiet/common@2.0.0-alpha.3...@quiet/common@2.0.1-alpha.0) (2023-09-25)
+
+**Note:** Version bump only for package @quiet/common
+
+
+
+
+
+# [2.0.0-alpha.18](https://github.com/TryQuiet/quiet/compare/@quiet/common@2.0.0-alpha.3...@quiet/common@2.0.0-alpha.18) (2023-10-04)
**Note:** Version bump only for package @quiet/common
@@ -94,7 +126,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [1.6.0](https://github.com/ZbayApp/monorepo/compare/@quiet/common@1.5.1-alpha.0...@quiet/common@1.6.0) (2023-07-28)
+# [1.6.0](https://github.com/TryQuiet/quiet/compare/@quiet/common@1.5.1-alpha.0...@quiet/common@1.6.0) (2023-07-28)
**Note:** Version bump only for package @quiet/common
@@ -102,7 +134,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [1.5.1-alpha.0](https://github.com/ZbayApp/monorepo/compare/@quiet/common@1.5.0-alpha.0...@quiet/common@1.5.1-alpha.0) (2023-07-28)
+## [1.5.1-alpha.0](https://github.com/TryQuiet/quiet/compare/@quiet/common@1.5.0-alpha.0...@quiet/common@1.5.1-alpha.0) (2023-07-28)
**Note:** Version bump only for package @quiet/common
@@ -110,7 +142,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [1.5.0-alpha.0](https://github.com/ZbayApp/monorepo/compare/@quiet/common@1.4.0-alpha.1...@quiet/common@1.5.0-alpha.0) (2023-07-26)
+# [1.5.0-alpha.0](https://github.com/TryQuiet/quiet/compare/@quiet/common@1.4.0-alpha.1...@quiet/common@1.5.0-alpha.0) (2023-07-26)
**Note:** Version bump only for package @quiet/common
@@ -126,7 +158,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [1.4.0-alpha.0](https://github.com/ZbayApp/monorepo/compare/@quiet/common@1.3.1...@quiet/common@1.4.0-alpha.0) (2023-06-19)
+# [1.4.0-alpha.0](https://github.com/TryQuiet/quiet/compare/@quiet/common@1.3.1...@quiet/common@1.4.0-alpha.0) (2023-06-19)
**Note:** Version bump only for package @quiet/common
@@ -222,7 +254,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [1.2.0-alpha.21](https://github.com/ZbayApp/monorepo/compare/@quiet/common@1.2.0-alpha.20...@quiet/common@1.2.0-alpha.21) (2023-04-07)
+# [1.2.0-alpha.21](https://github.com/TryQuiet/quiet/compare/@quiet/common@1.2.0-alpha.20...@quiet/common@1.2.0-alpha.21) (2023-04-07)
**Note:** Version bump only for package @quiet/common
diff --git a/packages/common/package-lock.json b/packages/common/package-lock.json
index 29a0c3fd52..e3ab0a7f16 100644
--- a/packages/common/package-lock.json
+++ b/packages/common/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@quiet/common",
- "version": "2.0.1-alpha.1",
+ "version": "2.0.1-alpha.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@quiet/common",
- "version": "2.0.1-alpha.1",
+ "version": "2.0.1-alpha.4",
"license": "ISC",
"dependencies": {
"cross-env": "^5.2.0",
diff --git a/packages/common/package.json b/packages/common/package.json
index b16151d680..f9f6eb49f0 100644
--- a/packages/common/package.json
+++ b/packages/common/package.json
@@ -1,12 +1,13 @@
{
"name": "@quiet/common",
- "version": "2.0.1-alpha.1",
+ "version": "2.0.1-alpha.4",
"description": "Common monorepo utils",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"files": [
"lib/**/*"
],
+ "private": true,
"scripts": {
"build": "tsc -p tsconfig.build.json",
"prepare": "npm run build",
@@ -17,7 +18,7 @@
"rmDist": "rimraf lib/"
},
"devDependencies": {
- "@quiet/eslint-config": "^2.0.1-alpha.1",
+ "@quiet/eslint-config": "^2.0.1-alpha.4",
"@types/jest": "^26.0.23",
"@types/node": "^17.0.21",
"jest": "^26.6.3",
@@ -25,7 +26,7 @@
"typescript": "^4.9.3"
},
"dependencies": {
- "@quiet/types": "^2.0.1-alpha.1",
+ "@quiet/types": "^2.0.1-alpha.4",
"cross-env": "^5.2.0",
"debug": "^4.3.1"
},
diff --git a/packages/desktop/CHANGELOG.md b/packages/desktop/CHANGELOG.md
index ad1c5fa131..0b01b712c7 100644
--- a/packages/desktop/CHANGELOG.md
+++ b/packages/desktop/CHANGELOG.md
@@ -3,7 +3,66 @@
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/ZbayApp/monorepo/compare/quiet@2.0.1-alpha.0...quiet@2.0.1-alpha.1) (2023-09-25)
+## [2.0.1-alpha.7](https://github.com/TryQuiet/quiet/compare/@quiet/desktop@2.0.1-alpha.6...@quiet/desktop@2.0.1-alpha.7) (2023-10-16)
+
+**Note:** Version bump only for package @quiet/desktop
+
+
+
+
+
+## [2.0.1-alpha.6](https://github.com/TryQuiet/quiet/compare/@quiet/desktop@2.0.1-alpha.5...@quiet/desktop@2.0.1-alpha.6) (2023-10-13)
+
+**Note:** Version bump only for package @quiet/desktop
+
+
+
+
+
+## [2.0.1-alpha.5](https://github.com/TryQuiet/quiet/compare/@quiet/desktop@2.0.1-alpha.4...@quiet/desktop@2.0.1-alpha.5) (2023-10-12)
+
+**Note:** Version bump only for package @quiet/desktop
+
+
+
+
+
+## [2.0.1-alpha.4](https://github.com/TryQuiet/quiet/compare/@quiet/desktop@2.0.1-alpha.3...@quiet/desktop@2.0.1-alpha.4) (2023-10-11)
+
+
+### Reverts
+
+* Revert "Adjust project bootstrap scripts to be windows-friendly (#1870)" (#1937) ([0811ea3](https://github.com/TryQuiet/quiet/commit/0811ea3ea3f682dd763be72b12f626fe416bc036)), closes [#1870](https://github.com/TryQuiet/quiet/issues/1870) [#1937](https://github.com/TryQuiet/quiet/issues/1937) [#1870](https://github.com/TryQuiet/quiet/issues/1870)
+
+
+
+
+
+## [2.0.1-alpha.3](https://github.com/TryQuiet/quiet/compare/@quiet/desktop@2.0.1-alpha.2...@quiet/desktop@2.0.1-alpha.3) (2023-10-10)
+
+**Note:** Version bump only for package @quiet/desktop
+
+
+
+
+
+## 2.0.1-alpha.2 (2023-10-09)
+
+
+### Bug Fixes
+
+* add conditional checksum path ([8164b50](https://github.com/TryQuiet/quiet/commit/8164b50774f32856d9886f75d1bb25788f1e03c4))
+
+
+### Reverts
+
+* Revert "Remove afterAllArtifactBuild for linux" ([975d0df](https://github.com/TryQuiet/quiet/commit/975d0df58494bdfba1270f6845152af4969e77ea))
+
+
+
+
+
+## [2.0.1-alpha.1](https://github.com/TryQuiet/quiet/compare/quiet@2.0.1-alpha.0...quiet@2.0.1-alpha.1) (2023-09-25)
**Note:** Version bump only for package quiet
@@ -11,7 +70,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [2.0.1-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@2.0.0-alpha.12...quiet@2.0.1-alpha.0) (2023-09-25)
+## [2.0.1-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@2.0.0-alpha.12...quiet@2.0.1-alpha.0) (2023-09-25)
**Note:** Version bump only for package quiet
@@ -124,6 +183,37 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
# [1.10.0-alpha.0](/compare/quiet@1.9.0...quiet@1.10.0-alpha.0) (2023-08-29)
+
+**Note:** Version bump only for package quiet
+
+
+
+
+
+## [1.9.4](https://github.com/TryQuiet/quiet/compare/quiet@1.9.3...quiet@1.9.4) (2023-10-03)
+
+**Note:** Version bump only for package quiet
+
+
+
+
+
+## [1.9.3](https://github.com/TryQuiet/quiet/compare/quiet@1.9.2...quiet@1.9.3) (2023-10-03)
+
+**Note:** Version bump only for package quiet
+
+
+
+
+
+## [1.9.2](https://github.com/TryQuiet/quiet/compare/quiet@1.9.1...quiet@1.9.2) (2023-09-25)
+
+**Note:** Version bump only for package quiet
+
+
+
+
+
## [1.9.1](https://github.com/TryQuiet/quiet/compare/quiet@1.9.0...quiet@1.9.1) (2023-09-15)
**Note:** Version bump only for package quiet
@@ -188,7 +278,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [1.7.0](https://github.com/ZbayApp/monorepo/compare/quiet@1.6.1-alpha.0...quiet@1.7.0) (2023-07-28)
+# [1.7.0](https://github.com/TryQuiet/quiet/compare/quiet@1.6.1-alpha.0...quiet@1.7.0) (2023-07-28)
**Note:** Version bump only for package quiet
@@ -196,7 +286,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [1.6.1-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@1.6.0-alpha.0...quiet@1.6.1-alpha.0) (2023-07-28)
+## [1.6.1-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@1.6.0-alpha.0...quiet@1.6.1-alpha.0) (2023-07-28)
**Note:** Version bump only for package quiet
@@ -204,7 +294,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [1.6.0-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@1.5.0-alpha.0...quiet@1.6.0-alpha.0) (2023-07-26)
+# [1.6.0-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@1.5.0-alpha.0...quiet@1.6.0-alpha.0) (2023-07-26)
**Note:** Version bump only for package quiet
@@ -212,7 +302,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [1.5.0-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@1.4.2-alpha.1...quiet@1.5.0-alpha.0) (2023-07-18)
+# [1.5.0-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@1.4.2-alpha.1...quiet@1.5.0-alpha.0) (2023-07-18)
**Note:** Version bump only for package quiet
@@ -220,7 +310,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [1.4.2-alpha.1](https://github.com/ZbayApp/monorepo/compare/quiet@1.4.2-alpha.0...quiet@1.4.2-alpha.1) (2023-07-17)
+## [1.4.2-alpha.1](https://github.com/TryQuiet/quiet/compare/quiet@1.4.2-alpha.0...quiet@1.4.2-alpha.1) (2023-07-17)
**Note:** Version bump only for package quiet
@@ -228,7 +318,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [1.4.2-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@1.4.1-alpha.0...quiet@1.4.2-alpha.0) (2023-07-17)
+## [1.4.2-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@1.4.1-alpha.0...quiet@1.4.2-alpha.0) (2023-07-17)
**Note:** Version bump only for package quiet
@@ -252,7 +342,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [1.4.0-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@1.3.1...quiet@1.4.0-alpha.0) (2023-06-19)
+# [1.4.0-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@1.3.1...quiet@1.4.0-alpha.0) (2023-06-19)
**Note:** Version bump only for package quiet
@@ -420,7 +510,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [1.2.0-alpha.24](https://github.com/ZbayApp/monorepo/compare/quiet@1.2.0-alpha.23...quiet@1.2.0-alpha.24) (2023-04-07)
+# [1.2.0-alpha.24](https://github.com/TryQuiet/quiet/compare/quiet@1.2.0-alpha.23...quiet@1.2.0-alpha.24) (2023-04-07)
**Note:** Version bump only for package quiet
@@ -728,7 +818,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [1.0.0-alpha.16](https://github.com/ZbayApp/monorepo/compare/quiet@1.0.0-alpha.15...quiet@1.0.0-alpha.16) (2023-02-20)
+# [1.0.0-alpha.16](https://github.com/TryQuiet/quiet/compare/quiet@1.0.0-alpha.15...quiet@1.0.0-alpha.16) (2023-02-20)
**Note:** Version bump only for package quiet
@@ -1091,7 +1181,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [0.19.0-alpha.1](https://github.com/ZbayApp/monorepo/compare/quiet@0.18.7-alpha.1...quiet@0.19.0-alpha.1) (2023-01-27)
+# [0.19.0-alpha.1](https://github.com/TryQuiet/quiet/compare/quiet@0.18.7-alpha.1...quiet@0.19.0-alpha.1) (2023-01-27)
**Note:** Version bump only for package quiet
@@ -1155,7 +1245,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.18.1-alpha.1](https://github.com/ZbayApp/monorepo/compare/quiet@0.18.1-alpha.0...quiet@0.18.1-alpha.1) (2023-01-14)
+## [0.18.1-alpha.1](https://github.com/TryQuiet/quiet/compare/quiet@0.18.1-alpha.0...quiet@0.18.1-alpha.1) (2023-01-14)
**Note:** Version bump only for package quiet
@@ -1179,7 +1269,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [0.18.0-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.17.0-alpha.4...quiet@0.18.0-alpha.0) (2023-01-13)
+# [0.18.0-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.17.0-alpha.4...quiet@0.18.0-alpha.0) (2023-01-13)
**Note:** Version bump only for package quiet
@@ -1211,7 +1301,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [0.17.0-alpha.1](https://github.com/ZbayApp/monorepo/compare/quiet@0.16.0...quiet@0.17.0-alpha.1) (2023-01-11)
+# [0.17.0-alpha.1](https://github.com/TryQuiet/quiet/compare/quiet@0.16.0...quiet@0.17.0-alpha.1) (2023-01-11)
**Note:** Version bump only for package quiet
@@ -1219,7 +1309,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [0.17.0-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.16.0...quiet@0.17.0-alpha.0) (2023-01-11)
+# [0.17.0-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.16.0...quiet@0.17.0-alpha.0) (2023-01-11)
**Note:** Version bump only for package quiet
@@ -1235,7 +1325,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [0.16.0-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.14.4...quiet@0.16.0-alpha.0) (2022-12-14)
+# [0.16.0-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.14.4...quiet@0.16.0-alpha.0) (2022-12-14)
**Note:** Version bump only for package quiet
@@ -1243,7 +1333,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [0.15.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.14.4...quiet@0.15.0) (2022-12-14)
+# [0.15.0](https://github.com/TryQuiet/quiet/compare/quiet@0.14.4...quiet@0.15.0) (2022-12-14)
**Note:** Version bump only for package quiet
@@ -1251,7 +1341,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [0.15.0-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.14.4...quiet@0.15.0-alpha.0) (2022-12-14)
+# [0.15.0-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.14.4...quiet@0.15.0-alpha.0) (2022-12-14)
**Note:** Version bump only for package quiet
@@ -1259,7 +1349,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.14.5-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.14.4...quiet@0.14.5-alpha.0) (2022-12-09)
+## [0.14.5-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.14.4...quiet@0.14.5-alpha.0) (2022-12-09)
**Note:** Version bump only for package quiet
@@ -1379,7 +1469,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.13](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.3-alpha.7...quiet@0.11.3-alpha.13) (2022-09-22)
+## [0.11.3-alpha.13](https://github.com/TryQuiet/quiet/compare/quiet@0.11.3-alpha.7...quiet@0.11.3-alpha.13) (2022-09-22)
**Note:** Version bump only for package quiet
@@ -1387,7 +1477,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.12](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.3-alpha.7...quiet@0.11.3-alpha.12) (2022-09-21)
+## [0.11.3-alpha.12](https://github.com/TryQuiet/quiet/compare/quiet@0.11.3-alpha.7...quiet@0.11.3-alpha.12) (2022-09-21)
**Note:** Version bump only for package quiet
@@ -1395,7 +1485,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.11](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.3-alpha.7...quiet@0.11.3-alpha.11) (2022-09-21)
+## [0.11.3-alpha.11](https://github.com/TryQuiet/quiet/compare/quiet@0.11.3-alpha.7...quiet@0.11.3-alpha.11) (2022-09-21)
**Note:** Version bump only for package quiet
@@ -1403,7 +1493,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.10](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.3-alpha.7...quiet@0.11.3-alpha.10) (2022-09-21)
+## [0.11.3-alpha.10](https://github.com/TryQuiet/quiet/compare/quiet@0.11.3-alpha.7...quiet@0.11.3-alpha.10) (2022-09-21)
**Note:** Version bump only for package quiet
@@ -1411,7 +1501,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.9](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.3-alpha.7...quiet@0.11.3-alpha.9) (2022-09-21)
+## [0.11.3-alpha.9](https://github.com/TryQuiet/quiet/compare/quiet@0.11.3-alpha.7...quiet@0.11.3-alpha.9) (2022-09-21)
**Note:** Version bump only for package quiet
@@ -1419,7 +1509,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.8](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.3-alpha.7...quiet@0.11.3-alpha.8) (2022-09-21)
+## [0.11.3-alpha.8](https://github.com/TryQuiet/quiet/compare/quiet@0.11.3-alpha.7...quiet@0.11.3-alpha.8) (2022-09-21)
**Note:** Version bump only for package quiet
@@ -1427,7 +1517,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.7](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.2...quiet@0.11.3-alpha.7) (2022-09-21)
+## [0.11.3-alpha.7](https://github.com/TryQuiet/quiet/compare/quiet@0.11.2...quiet@0.11.3-alpha.7) (2022-09-21)
**Note:** Version bump only for package quiet
@@ -1435,7 +1525,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.6](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.2...quiet@0.11.3-alpha.6) (2022-09-20)
+## [0.11.3-alpha.6](https://github.com/TryQuiet/quiet/compare/quiet@0.11.2...quiet@0.11.3-alpha.6) (2022-09-20)
**Note:** Version bump only for package quiet
@@ -1443,7 +1533,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.5](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.2...quiet@0.11.3-alpha.5) (2022-09-17)
+## [0.11.3-alpha.5](https://github.com/TryQuiet/quiet/compare/quiet@0.11.2...quiet@0.11.3-alpha.5) (2022-09-17)
**Note:** Version bump only for package quiet
@@ -1451,7 +1541,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.4](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.2...quiet@0.11.3-alpha.4) (2022-09-16)
+## [0.11.3-alpha.4](https://github.com/TryQuiet/quiet/compare/quiet@0.11.2...quiet@0.11.3-alpha.4) (2022-09-16)
**Note:** Version bump only for package quiet
@@ -1459,7 +1549,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.3](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.2...quiet@0.11.3-alpha.3) (2022-09-16)
+## [0.11.3-alpha.3](https://github.com/TryQuiet/quiet/compare/quiet@0.11.2...quiet@0.11.3-alpha.3) (2022-09-16)
**Note:** Version bump only for package quiet
@@ -1467,7 +1557,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.2](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.2...quiet@0.11.3-alpha.2) (2022-09-16)
+## [0.11.3-alpha.2](https://github.com/TryQuiet/quiet/compare/quiet@0.11.2...quiet@0.11.3-alpha.2) (2022-09-16)
**Note:** Version bump only for package quiet
@@ -1475,7 +1565,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.1](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.2...quiet@0.11.3-alpha.1) (2022-09-16)
+## [0.11.3-alpha.1](https://github.com/TryQuiet/quiet/compare/quiet@0.11.2...quiet@0.11.3-alpha.1) (2022-09-16)
**Note:** Version bump only for package quiet
@@ -1483,7 +1573,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.11.3-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.11.2...quiet@0.11.3-alpha.0) (2022-09-16)
+## [0.11.3-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.11.2...quiet@0.11.3-alpha.0) (2022-09-16)
**Note:** Version bump only for package quiet
@@ -1555,7 +1645,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.10.2-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.10.1-alpha.1...quiet@0.10.2-alpha.0) (2022-08-26)
+## [0.10.2-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.10.1-alpha.1...quiet@0.10.2-alpha.0) (2022-08-26)
**Note:** Version bump only for package quiet
@@ -1563,7 +1653,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.10.1-alpha.1](https://github.com/ZbayApp/monorepo/compare/quiet@0.10.0...quiet@0.10.1-alpha.1) (2022-08-16)
+## [0.10.1-alpha.1](https://github.com/TryQuiet/quiet/compare/quiet@0.10.0...quiet@0.10.1-alpha.1) (2022-08-16)
**Note:** Version bump only for package quiet
@@ -1571,7 +1661,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.10.1-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.10.0...quiet@0.10.1-alpha.0) (2022-08-11)
+## [0.10.1-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.10.0...quiet@0.10.1-alpha.0) (2022-08-11)
**Note:** Version bump only for package quiet
@@ -1579,7 +1669,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [0.10.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.9.7-alpha.7...quiet@0.10.0) (2022-08-10)
+# [0.10.0](https://github.com/TryQuiet/quiet/compare/quiet@0.9.7-alpha.7...quiet@0.10.0) (2022-08-10)
**Note:** Version bump only for package quiet
@@ -1595,7 +1685,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.9.7-alpha.6](https://github.com/ZbayApp/monorepo/compare/quiet@0.9.7-alpha.5...quiet@0.9.7-alpha.6) (2022-08-04)
+## [0.9.7-alpha.6](https://github.com/TryQuiet/quiet/compare/quiet@0.9.7-alpha.5...quiet@0.9.7-alpha.6) (2022-08-04)
**Note:** Version bump only for package quiet
@@ -1603,7 +1693,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.9.7-alpha.5](https://github.com/ZbayApp/monorepo/compare/quiet@0.9.7-alpha.3...quiet@0.9.7-alpha.5) (2022-08-04)
+## [0.9.7-alpha.5](https://github.com/TryQuiet/quiet/compare/quiet@0.9.7-alpha.3...quiet@0.9.7-alpha.5) (2022-08-04)
**Note:** Version bump only for package quiet
@@ -1611,7 +1701,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.9.7-alpha.4](https://github.com/ZbayApp/monorepo/compare/quiet@0.9.7-alpha.3...quiet@0.9.7-alpha.4) (2022-08-04)
+## [0.9.7-alpha.4](https://github.com/TryQuiet/quiet/compare/quiet@0.9.7-alpha.3...quiet@0.9.7-alpha.4) (2022-08-04)
**Note:** Version bump only for package quiet
@@ -1643,7 +1733,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.9.7-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.8.6...quiet@0.9.7-alpha.0) (2022-07-15)
+## [0.9.7-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.8.6...quiet@0.9.7-alpha.0) (2022-07-15)
**Note:** Version bump only for package quiet
@@ -1651,7 +1741,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.9.6-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.9.5-alpha.1...quiet@0.9.6-alpha.0) (2022-07-15)
+## [0.9.6-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.9.5-alpha.1...quiet@0.9.6-alpha.0) (2022-07-15)
**Note:** Version bump only for package quiet
@@ -1659,7 +1749,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.9.5-alpha.1](https://github.com/ZbayApp/monorepo/compare/quiet@0.9.5-alpha.0...quiet@0.9.5-alpha.1) (2022-07-15)
+## [0.9.5-alpha.1](https://github.com/TryQuiet/quiet/compare/quiet@0.9.5-alpha.0...quiet@0.9.5-alpha.1) (2022-07-15)
**Note:** Version bump only for package quiet
@@ -1667,7 +1757,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.9.5-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.9.4-alpha.0...quiet@0.9.5-alpha.0) (2022-07-07)
+## [0.9.5-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.9.4-alpha.0...quiet@0.9.5-alpha.0) (2022-07-07)
**Note:** Version bump only for package quiet
@@ -1675,7 +1765,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.9.4-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.9.3-alpha.0...quiet@0.9.4-alpha.0) (2022-07-06)
+## [0.9.4-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.9.3-alpha.0...quiet@0.9.4-alpha.0) (2022-07-06)
**Note:** Version bump only for package quiet
@@ -1683,7 +1773,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.9.3-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.9.2-alpha.0...quiet@0.9.3-alpha.0) (2022-07-06)
+## [0.9.3-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.9.2-alpha.0...quiet@0.9.3-alpha.0) (2022-07-06)
**Note:** Version bump only for package quiet
@@ -1691,7 +1781,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.9.2-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.9.1-alpha.0...quiet@0.9.2-alpha.0) (2022-07-05)
+## [0.9.2-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.9.1-alpha.0...quiet@0.9.2-alpha.0) (2022-07-05)
**Note:** Version bump only for package quiet
@@ -1699,7 +1789,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.9.1-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.9.0-alpha.0...quiet@0.9.1-alpha.0) (2022-07-05)
+## [0.9.1-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.9.0-alpha.0...quiet@0.9.1-alpha.0) (2022-07-05)
**Note:** Version bump only for package quiet
@@ -1707,7 +1797,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [0.9.0-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.8.6...quiet@0.9.0-alpha.0) (2022-07-05)
+# [0.9.0-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.8.6...quiet@0.9.0-alpha.0) (2022-07-05)
**Note:** Version bump only for package quiet
@@ -1750,7 +1840,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.8.3-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.8.2-alpha.0...quiet@0.8.3-alpha.0) (2022-06-21)
+## [0.8.3-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.8.2-alpha.0...quiet@0.8.3-alpha.0) (2022-06-21)
**Note:** Version bump only for package quiet
@@ -1758,7 +1848,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.8.2-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.8.1-alpha.1...quiet@0.8.2-alpha.0) (2022-06-21)
+## [0.8.2-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.8.1-alpha.1...quiet@0.8.2-alpha.0) (2022-06-21)
**Note:** Version bump only for package quiet
@@ -1766,7 +1856,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.8.1-alpha.2](https://github.com/ZbayApp/monorepo/compare/quiet@0.8.1-alpha.1...quiet@0.8.1-alpha.2) (2022-06-21)
+## [0.8.1-alpha.2](https://github.com/TryQuiet/quiet/compare/quiet@0.8.1-alpha.1...quiet@0.8.1-alpha.2) (2022-06-21)
**Note:** Version bump only for package quiet
@@ -1774,7 +1864,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.8.1-alpha.1](https://github.com/ZbayApp/monorepo/compare/quiet@0.8.1-alpha.0...quiet@0.8.1-alpha.1) (2022-06-16)
+## [0.8.1-alpha.1](https://github.com/TryQuiet/quiet/compare/quiet@0.8.1-alpha.0...quiet@0.8.1-alpha.1) (2022-06-16)
**Note:** Version bump only for package quiet
@@ -1782,7 +1872,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.8.1-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.8.0-alpha.0...quiet@0.8.1-alpha.0) (2022-06-14)
+## [0.8.1-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.8.0-alpha.0...quiet@0.8.1-alpha.0) (2022-06-14)
**Note:** Version bump only for package quiet
@@ -1790,7 +1880,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [0.8.0-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.7.1-alpha.2...quiet@0.8.0-alpha.0) (2022-06-14)
+# [0.8.0-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.7.1-alpha.2...quiet@0.8.0-alpha.0) (2022-06-14)
**Note:** Version bump only for package quiet
@@ -1798,7 +1888,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.7.1-alpha.2](https://github.com/ZbayApp/monorepo/compare/quiet@0.7.1-alpha.1...quiet@0.7.1-alpha.2) (2022-06-03)
+## [0.7.1-alpha.2](https://github.com/TryQuiet/quiet/compare/quiet@0.7.1-alpha.1...quiet@0.7.1-alpha.2) (2022-06-03)
**Note:** Version bump only for package quiet
@@ -1806,7 +1896,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.7.1-alpha.1](https://github.com/ZbayApp/monorepo/compare/quiet@0.7.1-alpha.0...quiet@0.7.1-alpha.1) (2022-06-03)
+## [0.7.1-alpha.1](https://github.com/TryQuiet/quiet/compare/quiet@0.7.1-alpha.0...quiet@0.7.1-alpha.1) (2022-06-03)
**Note:** Version bump only for package quiet
@@ -1814,7 +1904,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.7.1-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.7.0-alpha.0...quiet@0.7.1-alpha.0) (2022-06-03)
+## [0.7.1-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.7.0-alpha.0...quiet@0.7.1-alpha.0) (2022-06-03)
**Note:** Version bump only for package quiet
@@ -1822,7 +1912,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-# [0.7.0-alpha.0](https://github.com/ZbayApp/monorepo/compare/quiet@0.6.1-alpha.0...quiet@0.7.0-alpha.0) (2022-06-03)
+# [0.7.0-alpha.0](https://github.com/TryQuiet/quiet/compare/quiet@0.6.1-alpha.0...quiet@0.7.0-alpha.0) (2022-06-03)
**Note:** Version bump only for package quiet
diff --git a/packages/desktop/README.md b/packages/desktop/README.md
index c58c4b3d5c..2ad572c2fc 100644
--- a/packages/desktop/README.md
+++ b/packages/desktop/README.md
@@ -1,6 +1,7 @@
# Quiet Desktop
-Running the desktop version of Quiet should be straightforward on Mac, Windows, and Linux. Here are the steps:
+Running the desktop version of Quiet should be straightforward on Mac and Linux. On Windows we recommend using git-bash or just wsl.
+Here are the steps:
0. Use `Node 18.12.1` and `npm 8.19.2`. We recommend [nvm](https://github.com/nvm-sh/nvm) for easily switching Node versions, and if this README gets out of date you can see the actual version used by CI [here](https://github.com/TryQuiet/quiet/blob/master/.github/actions/setup-env/action.yml). If you are using nvm, you can run `nvm use` in the project's root to switch to the correct version.
1. In `quiet/` (project's root) install monorepo's dependencies and bootstrap the project with lerna. It will take care of the package's dependencies and trigger a prepublish script which builds them.
diff --git a/packages/desktop/package-lock.json b/packages/desktop/package-lock.json
index 3ba957e99d..766696fb1a 100644
--- a/packages/desktop/package-lock.json
+++ b/packages/desktop/package-lock.json
@@ -1,12 +1,12 @@
{
- "name": "quiet",
- "version": "2.0.1-alpha.1",
+ "name": "@quiet/desktop",
+ "version": "2.0.1-alpha.7",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
- "name": "quiet",
- "version": "2.0.1-alpha.1",
+ "name": "@quiet/desktop",
+ "version": "2.0.1-alpha.7",
"license": "ISC",
"dependencies": {
"@electron/remote": "^2.0.8",
diff --git a/packages/desktop/package.json b/packages/desktop/package.json
index d5b5dd0d8d..6a151ec6a4 100644
--- a/packages/desktop/package.json
+++ b/packages/desktop/package.json
@@ -1,5 +1,5 @@
{
- "name": "quiet",
+ "name": "@quiet/desktop",
"productName": "Quiet",
"author": {
"name": "Zbay LLC",
@@ -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-alpha.7",
"description": "Decentralized team chat",
"main": "dist/main/main.js",
"scripts": {
@@ -125,11 +125,11 @@
"dependencies": {
"@electron/remote": "^2.0.8",
"@peculiar/webcrypto": "1.4.3",
- "@quiet/common": "^2.0.1-alpha.1",
- "@quiet/logger": "^2.0.1-alpha.1",
- "@quiet/types": "^2.0.1-alpha.1",
+ "@quiet/common": "^2.0.1-alpha.4",
+ "@quiet/logger": "^2.0.1-alpha.4",
+ "@quiet/types": "^2.0.1-alpha.4",
"@sentry/electron": "^2.5.4",
- "backend-bundle": "^2.0.1-alpha.1",
+ "backend-bundle": "^2.0.1-alpha.4",
"electron-debug": "^3.0.1",
"electron-localshortcut": "^3.2.1",
"electron-store": "^8.0.1",
@@ -155,9 +155,9 @@
"@mui/icons-material": "^5.10.15",
"@mui/lab": "^5.0.0-alpha.109",
"@mui/material": "~5.10.15",
- "@quiet/eslint-config": "^2.0.1-alpha.1",
- "@quiet/identity": "^2.0.1-alpha.1",
- "@quiet/state-manager": "^2.0.1-alpha.1",
+ "@quiet/eslint-config": "^2.0.1-alpha.4",
+ "@quiet/identity": "^2.0.1-alpha.4",
+ "@quiet/state-manager": "^2.0.1-alpha.6",
"@redux-saga/types": "^1.1.0",
"@reduxjs/toolkit": "^1.9.1",
"@sentry/browser": "^6.19.7",
diff --git a/packages/desktop/scripts/setEnvs.js b/packages/desktop/scripts/setEnvs.js
index 16989b9382..de94f06d28 100644
--- a/packages/desktop/scripts/setEnvs.js
+++ b/packages/desktop/scripts/setEnvs.js
@@ -19,7 +19,7 @@ exports.default = async function (context) {
childProcess.execSync(`${context.artifactPaths[0]} --appimage-extract`)
childProcess.execSync(`mv ./squashfs-root ${context.outDir}/squashfs-root`)
const data = fs.readFileSync(`${context.outDir}/squashfs-root/AppRun`, 'utf8').split('\n')
- const index = data.findIndex(text => text === 'BIN="$APPDIR/quiet"')
+ const index = data.findIndex(text => text === 'BIN="$APPDIR/@quietdesktop"')
if (index !== -1) {
data[index - 1] = 'export LD_PRELOAD="${APPDIR}/usr/lib/libssl.so"'
fs.writeFileSync(`${context.outDir}/squashfs-root/AppRun`, data.join('\n'), 'utf8')
diff --git a/packages/desktop/src/renderer/Root.tsx b/packages/desktop/src/renderer/Root.tsx
index 8717893233..608060d374 100644
--- a/packages/desktop/src/renderer/Root.tsx
+++ b/packages/desktop/src/renderer/Root.tsx
@@ -31,7 +31,8 @@ import ChannelCreationModal from './components/ChannelCreationModal/ChannelCreat
import { SaveStateComponent } from './components/SaveState/SaveStateComponent'
import UnregisteredModalContainer from './components/widgets/userLabel/unregistered/UnregisteredModal.container'
import DuplicateModalContainer from './components/widgets/userLabel/duplicate/DuplicateModal.container'
-// Trigger lerna
+import UsernameTakenModalContainer from './components/widgets/usernameTakenModal/UsernameTakenModal.container'
+import PossibleImpersonationAttackModalContainer from './components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.container'
export const persistor = persistStore(store)
export default () => {
@@ -48,7 +49,9 @@ export default () => {
+
+
diff --git a/packages/desktop/src/renderer/components/Channel/File/FileComponent/FileComponent.stories.tsx b/packages/desktop/src/renderer/components/Channel/File/FileComponent/FileComponent.stories.tsx
index 31ae7a82af..0c33e712ab 100644
--- a/packages/desktop/src/renderer/components/Channel/File/FileComponent/FileComponent.stories.tsx
+++ b/packages/desktop/src/renderer/components/Channel/File/FileComponent/FileComponent.stories.tsx
@@ -1,6 +1,5 @@
import React from 'react'
import { ComponentStory, ComponentMeta } from '@storybook/react'
-
import FileComponent, { FileComponentProps } from './FileComponent'
import { withTheme } from '../../../../storybook/decorators'
import { DownloadState } from '@quiet/types'
diff --git a/packages/desktop/src/renderer/components/CreateUsername/CreateUsername.test.tsx b/packages/desktop/src/renderer/components/CreateUsername/CreateUsername.test.tsx
index 0f8656a6c4..e5b406d690 100644
--- a/packages/desktop/src/renderer/components/CreateUsername/CreateUsername.test.tsx
+++ b/packages/desktop/src/renderer/components/CreateUsername/CreateUsername.test.tsx
@@ -4,8 +4,10 @@ import userEvent from '@testing-library/user-event'
import { screen, waitFor } from '@testing-library/dom'
import { renderComponent } from '../../testUtils/renderComponent'
-import CreateUsernameComponent from './CreateUsernameComponent'
+import CreateUsernameComponent, { UsernameVariant } from './CreateUsernameComponent'
import { FieldErrors, UsernameErrors } from '../../forms/fieldsErrors'
+import { keyFromCertificate, parseCertificate } from '@quiet/identity'
+import { UserData } from '@quiet/types'
describe('Create username', () => {
it.each([
@@ -48,3 +50,201 @@ describe('Create username', () => {
expect(message).toBeVisible()
})
})
+
+describe('Username taken', () => {
+ const userCertData = {
+ username: 'userName',
+ onionAddress: 'nqnw4kc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion',
+ peerId: 'Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6',
+ dmPublicKey: '0bfb475810c0e26c9fab590d47c3d60ec533bb3c451596acc3cd4f21602e9ad9',
+ }
+
+ const userCertString =
+ 'MIICaDCCAg6gAwIBAgIGAYBqyuV2MAoGCCqGSM49BAMCMBkxFzAVBgNVBAMTDnF1aWV0Y29tbXVuaXR5MB4XDTEwMTIyODEwMTAxMFoXDTMwMTIyODEwMTAxMFowSTFHMEUGA1UEAxM+bnFudzRrYzRjNzdmYjQ3bGs1Mm01bDU3aDR0Y3hjZW83eW14ZWtmbjd5aDVtNjZ0NGp2Mm9sYWQub25pb24wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQZBMmiVmRBRvw+QiL5DYg7WGFUVgA7u90KMpJg4qCaCJJNh7wH2tl0EDsN4FeGmR9AkvtCGd+5vYL0nGcX/oLdo4IBEDCCAQwwCQYDVR0TBAIwADALBgNVHQ8EBAMCAIAwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMC8GCSqGSIb3DQEJDAQiBCAL+0dYEMDibJ+rWQ1Hw9YOxTO7PEUVlqzDzU8hYC6a2TAYBgorBgEEAYOMGwIBBAoTCHVzZXJOYW1lMD0GCSsGAQIBDwMBAQQwEy5RbWYzeVNrWXFMRVQ5eHRBdER6dkFyNVBwM2VnSzFIM0M1aUpBWm0xU3BMRXA2MEkGA1UdEQRCMECCPm5xbnc0a2M0Yzc3ZmI0N2xrNTJtNWw1N2g0dGN4Y2VvN3lteGVrZm43eWg1bTY2dDRqdjJvbGFkLm9uaW9uMAoGCCqGSM49BAMCA0gAMEUCIF63rnIq8vd86NT9RHSFj7borwwODqyfE7Pw64tGElpIAiEA5ZDSdrDd8OGf+kv7wxByM1Xgmc5m/aydUk+WorbO3Gg='
+ const parsedCert = parseCertificate(userCertString)
+ const userPubKey = keyFromCertificate(parsedCert)
+
+ const registeredUsers: Record = {
+ [userPubKey]: userCertData,
+ }
+ it('renders component ', () => {
+ const result = renderComponent(
+ {}}
+ open={true}
+ currentUsername={'jack'}
+ variant={UsernameVariant.TAKEN}
+ registeredUsers={registeredUsers}
+ registerUsername={() => {}}
+ />
+ )
+ expect(result.baseElement).toMatchInlineSnapshot(`
+
+
+
+
+ `)
+ })
+})
diff --git a/packages/desktop/src/renderer/components/CreateUsername/CreateUsername.tsx b/packages/desktop/src/renderer/components/CreateUsername/CreateUsername.tsx
index a0be2008c5..2e0e904b3b 100644
--- a/packages/desktop/src/renderer/components/CreateUsername/CreateUsername.tsx
+++ b/packages/desktop/src/renderer/components/CreateUsername/CreateUsername.tsx
@@ -32,7 +32,11 @@ const CreateUsername = () => {
dispatch(errors.actions.clearError(error))
}
- dispatch(identity.actions.registerUsername(nickname))
+ dispatch(
+ identity.actions.registerUsername({
+ nickname,
+ })
+ )
dispatch(network.actions.setLoadingPanelType(LoadingPanelType.Joining))
loadingPanelModal.handleOpen()
}
diff --git a/packages/desktop/src/renderer/components/CreateUsername/CreateUsernameComponent.tsx b/packages/desktop/src/renderer/components/CreateUsername/CreateUsernameComponent.tsx
index b26d4b49a5..b8d9e64e94 100644
--- a/packages/desktop/src/renderer/components/CreateUsername/CreateUsernameComponent.tsx
+++ b/packages/desktop/src/renderer/components/CreateUsername/CreateUsernameComponent.tsx
@@ -4,18 +4,15 @@ import classNames from 'classnames'
import { Controller, useForm } from 'react-hook-form'
import Typography from '@mui/material/Typography'
import Grid from '@mui/material/Grid'
-
import WarningIcon from '@mui/icons-material/Warning'
-
import Modal from '../ui/Modal/Modal'
-
import { LoadingButton } from '../ui/LoadingButton/LoadingButton'
import { TextInput } from '../../forms/components/textInput'
import { userNameField } from '../../forms/fields/createUserFields'
-
import { parseName } from '@quiet/common'
+import { UserData } from '@quiet/types'
-const PREFIX = 'CreateUsernameComponent'
+const PREFIX = 'CreateUsernameComponent-'
const classes = {
focus: `${PREFIX}focus`,
@@ -31,6 +28,10 @@ const classes = {
rootBar: `${PREFIX}rootBar`,
progressBar: `${PREFIX}progressBar`,
info: `${PREFIX}info`,
+ inputLabel: `${PREFIX}inputLabel`,
+ marginMedium: `${PREFIX}marginMedium`,
+ buttonModern: `${PREFIX}buttonModern`,
+ buttonMargin: `${PREFIX}buttonMargin`,
}
const StyledModalContent = styled(Grid)(({ theme }) => ({
@@ -81,6 +82,11 @@ const StyledModalContent = styled(Grid)(({ theme }) => ({
fontWeight: 'normal',
},
+ [`& .${classes.buttonModern}`]: {
+ borderRadius: 8,
+ width: 110,
+ },
+
[`& .${classes.title}`]: {
marginBottom: 24,
},
@@ -113,6 +119,16 @@ const StyledModalContent = styled(Grid)(({ theme }) => ({
lineHeight: '19px',
color: theme.palette.colors.darkGray,
},
+
+ [`& .${classes.inputLabel}`]: {
+ marginTop: 24,
+ marginBottom: 2,
+ color: theme.palette.colors.black30,
+ },
+
+ [`& .${classes.marginMedium}`]: {
+ marginTop: 24,
+ },
}))
const userFields = {
@@ -123,12 +139,20 @@ interface CreateUserValues {
userName: string
}
+export enum UsernameVariant {
+ NEW = 'new',
+ TAKEN = 'taken',
+}
+
export interface CreateUsernameComponentProps {
open: boolean
registerUsername: (name: string) => void
certificateRegistrationError?: string
certificate?: string | null
handleClose: () => void
+ registeredUsers?: Record
+ currentUsername?: string
+ variant?: UsernameVariant
}
export const CreateUsernameComponent: React.FC = ({
@@ -137,7 +161,13 @@ export const CreateUsernameComponent: React.FC = (
certificateRegistrationError,
certificate,
handleClose,
+ currentUsername,
+ registeredUsers,
+ variant = UsernameVariant.NEW,
}) => {
+ const isNewUser = variant === UsernameVariant.NEW
+ const [isUsernameRequested, setIsUsernameRequested] = useState(false)
+
const [formSent, setFormSent] = useState(false)
const [userName, setUserName] = useState('')
const [parsedNameDiffers, setParsedNameDiffers] = useState(false)
@@ -151,12 +181,18 @@ export const CreateUsernameComponent: React.FC = (
setValue,
setError,
control,
+ clearErrors,
} = useForm({
mode: 'onTouched',
})
const onSubmit = (values: CreateUserValues) => {
- submitForm(registerUsername, values, setFormSent)
+ if (isNewUser) {
+ submitForm(registerUsername, values, setFormSent)
+ } else {
+ registerUsername(parseName(values.userName))
+ setIsUsernameRequested(true)
+ }
}
const submitForm = (
@@ -169,9 +205,16 @@ export const CreateUsernameComponent: React.FC = (
}
const onChange = (name: string) => {
+ clearErrors('userName')
const parsedName = parseName(name)
setUserName(parsedName)
setParsedNameDiffers(name !== parsedName)
+ if (registeredUsers && !isNewUser) {
+ const allUsersSet = new Set(Object.values(registeredUsers).map(user => user.username))
+ if (allUsersSet.has(name)) {
+ setError('userName', { message: `${name} is already taken` })
+ }
+ }
}
React.useEffect(() => {
@@ -188,77 +231,136 @@ export const CreateUsernameComponent: React.FC = (
}, [certificateRegistrationError])
return (
-
+
- <>
-
+ >
+ ) : (
+ <>
+
+ Great! Your new username should be registered automatically the next time the community owner is online.
+
+
+
+ >
+ )}
)
diff --git a/packages/desktop/src/renderer/components/Settings/Tabs/Invite/Invite.component.test.tsx b/packages/desktop/src/renderer/components/Settings/Tabs/Invite/Invite.component.test.tsx
index abdd1b2118..926d0e39fe 100644
--- a/packages/desktop/src/renderer/components/Settings/Tabs/Invite/Invite.component.test.tsx
+++ b/packages/desktop/src/renderer/components/Settings/Tabs/Invite/Invite.component.test.tsx
@@ -76,7 +76,7 @@ describe('CopyLink', () => {
class="MuiTypography-root MuiTypography-body2 InviteToCommunitylink css-16d47hw-MuiTypography-root"
data-testid="invitation-link"
>
- •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
+ ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••