Compare commits

..

14 Commits
main ... 5.7.x

Author SHA1 Message Date
Evan Hahn 9329db949d v5.7.1 2021-06-30 12:32:13 -05:00
Evan Hahn 1c522ff99a
Update translations 2021-06-30 12:23:28 -05:00
Fedor Indutny 795fb9ee0f
Subscribe to native theme changes 2021-06-30 10:07:42 -07:00
automated-signal bb457dd086
Improve readability of image captions
Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>
2021-06-29 19:28:38 -05:00
automated-signal b3b210a9c5
Unify audio playback under App component
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
2021-06-29 13:23:28 -07:00
automated-signal f344811e64
Create missing index for markRead
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
2021-06-29 12:05:11 -05:00
Evan Hahn 601495babb v5.7.0 2021-06-28 13:53:56 -05:00
Evan Hahn 30514328e3 v5.7.0-beta.2 2021-06-28 13:53:56 -05:00
Fedor Indutny 24d969bbb3
Ensure that messages are in redux when scrolling 2021-06-28 13:52:18 -05:00
Evan Hahn 299d4b2807
Update translations 2021-06-28 13:40:22 -05:00
automated-signal e04476f2ca
Fix disappearing composition are during incoming call
Co-authored-by: Josh Perez <60019601+josh-signal@users.noreply.github.com>
2021-06-25 14:05:44 -07:00
automated-signal 16ada5f734
Fix UI for GIFs in groups
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
2021-06-24 16:45:07 -05:00
automated-signal 2f7a2b19f2
Fix rendering of GIFs
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
2021-06-24 12:25:52 -07:00
automated-signal 7fab45ef8d
Forwarded messages must use different timestamps
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
2021-06-24 11:43:36 -07:00
2280 changed files with 457720 additions and 589653 deletions

12
.aptly.conf Normal file
View File

@ -0,0 +1,12 @@
{
"S3PublishEndpoints": {
"signal-desktop-apt": {
"region": "us-east-1",
"bucket": "updates.signal.org",
"prefix": "desktop/apt",
"acl": "public-read",
"plusWorkaround": false,
"disableMultiDel": false
}
}
}

View File

@ -8,10 +8,8 @@ module.exports = {
plugins: [
'react-hot-loader/babel',
'lodash',
'@babel/plugin-transform-typescript',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
// This plugin converts commonjs to esmodules which is required for
// importing commonjs modules from esmodules in storybook. As a part of
// converting to TypeScript we should use esmodules and can eventually

View File

@ -1,3 +1,4 @@
build/**
components/**
coverage/**
dist/**
@ -14,17 +15,21 @@ libtextsecure/components.js
libtextsecure/test/test.js
test/test.js
sticker-creator/dist/**
ts/protobuf/compiled.d.ts
# Third-party files
js/Mp3LameEncoder.min.js
js/WebAudioRecorderMp3.js
js/libphonenumber-util.js
libtextsecure/test/blanket_mocha.js
test/blanket_mocha.js
# TypeScript generated files
app/**/*.js
ts/**/*.js
sticker-creator/**/*.js
!sticker-creator/preload.js
**/*.d.ts
.eslintrc.js
webpack.config.ts
preload.bundle.*

View File

@ -1,4 +1,4 @@
// Copyright 2018-2022 Signal Messenger, LLC
// Copyright 2018-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
// For reference: https://github.com/airbnb/javascript
@ -15,13 +15,13 @@ const rules = {
},
],
// No omitting braces, keep on the same line
'brace-style': ['error', '1tbs', { allowSingleLine: false }],
curly: ['error', 'all'],
// Always use === and !== except when directly comparing to null
// (which only will equal null or undefined)
eqeqeq: ['error', 'always', { null: 'never' }],
// Overrides recommended by typescript-eslint
// https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-useless-constructor': ['error'],
'no-shadow': 'off',
'no-useless-constructor': 'off',
// prevents us from accidentally checking in exclusive tests (`.only`):
'mocha/no-exclusive-tests': 'error',
@ -31,13 +31,12 @@ const rules = {
// it helps readability to put public API at top,
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
// useful for unused or internal fields
'no-underscore-dangle': 'off',
// Temp: We have because TypeScript's `allowUnreachableCode` option is on.
'no-unreachable': 'error',
// useful for unused parameters
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
// though we have a logger, we still remap console to log to disk
'no-console': 'error',
@ -56,8 +55,6 @@ const rules = {
],
'no-continue': 'off',
'lines-between-class-members': 'off',
'class-methods-use-this': 'off',
// Prettier overrides:
'arrow-parens': 'off',
@ -96,6 +93,9 @@ const rules = {
'jsx-a11y/label-has-associated-control': ['error', { assert: 'either' }],
// Upgrade from a warning
'@typescript-eslint/explicit-module-boundary-types': 'error',
'no-restricted-syntax': [
'error',
{
@ -109,6 +109,11 @@ const rules = {
message:
'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
},
{
selector: 'ForOfStatement',
message:
'iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.',
},
{
selector: 'LabeledStatement',
message:
@ -120,54 +125,7 @@ const rules = {
'`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
},
],
};
const typescriptRules = {
...rules,
// Override brace style to enable typescript-specific syntax
'brace-style': 'off',
'@typescript-eslint/brace-style': [
'error',
'1tbs',
{ allowSingleLine: false },
],
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
'no-restricted-imports': 'off',
'@typescript-eslint/no-restricted-imports': [
'error',
{
paths: [
{
name: 'chai',
importNames: ['expect', 'should', 'Should'],
message: 'Please use assert',
allowTypeImports: true,
},
],
},
],
// Overrides recommended by typescript-eslint
// https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-useless-constructor': ['error'],
'no-shadow': 'off',
'no-useless-constructor': 'off',
// useful for unused parameters
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
// Upgrade from a warning
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
// Already enforced by TypeScript
'consistent-return': 'off',
curly: 'error',
};
module.exports = {
@ -185,14 +143,7 @@ module.exports = {
overrides: [
{
files: [
'ts/**/*.ts',
'ts/**/*.tsx',
'app/**/*.ts',
'sticker-creator/**/*.ts',
'sticker-creator/**/*.tsx',
'build/intl-linter/**/*.ts',
],
files: ['ts/**/*.ts', 'ts/**/*.tsx', 'app/**/*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
@ -209,17 +160,32 @@ module.exports = {
'plugin:react/recommended',
'airbnb-typescript-prettier',
],
rules: typescriptRules,
rules,
},
{
files: [
'**/*.stories.tsx',
'ts/build/**',
'ts/test-*/**',
'build/intl-linter/**/*.ts',
files: ['sticker-creator/**/*.ts', 'sticker-creator/**/*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './sticker-creator/tsconfig.json',
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'airbnb-typescript-prettier',
],
rules,
},
{
files: ['**/*.stories.tsx', 'ts/build/**', 'ts/test-*/**'],
rules: {
...typescriptRules,
...rules,
'import/no-extraneous-dependencies': 'off',
'react/no-array-index-key': 'off',
},
@ -227,6 +193,4 @@ module.exports = {
],
rules,
reportUnusedDisableDirectives: true,
};

View File

@ -27,17 +27,6 @@ Lastly, be sure to preview your issue before saving. Thanks!
https://github.com/signalapp/Signal-Desktop/issues?utf8=%E2%9C%93&q=is%3Aissue
Replace [ ] with [X] once you've searched
-->
- [ ] I am using Signal-Desktop as provided by the Signal team, not a 3rd-party package.
<!--
If you're using a 3rd-party package, please report it to them first.
For flatpak:
- https://github.com/flathub/org.signal.Signal/issues
For snap:
- https://github.com/flathub/org.signal.Signal/issues
For archlinux:
- https://aur.archlinux.org/packages/signal-desktop-beta/
etc.
-->
---
@ -80,7 +69,7 @@ Operating System:
Linked Device Version:
<!-- Android: Settings -> Help, iOS: Settings -> General -> About -->
<!-- Android: Settings -> Advanced, iOS: Settings -> General -> About -->
### Link to Debug Log

View File

@ -1,6 +1,3 @@
# Copyright 2021 Signal Messenger, LLC
# SPDX-License-Identifier: AGPL-3.0-only
blank_issues_enabled: false
contact_links:
- name: ✨ Feature request
@ -16,7 +13,7 @@ contact_links:
url: https://community.signalusers.org/c/support/
about: Feel free to ask anything
- name: 📖 Contribution instructions
url: https://github.com/signalapp/Signal-Desktop/blob/main/CONTRIBUTING.md
url: https://github.com/signalapp/Signal-Desktop/blob/development/CONTRIBUTING.md
about: Want to contribute to Signal Desktop? Start here.
- name: ❓ Other issue?
url: https://community.signalusers.org/

View File

@ -14,9 +14,9 @@ Remember, you can preview this before saving it.
### Contributor checklist:
- [ ] My contribution is **not** related to translations.
- [ ] My contribution is **not** related to translations. _Please submit translation changes via our [Signal Desktop Transifex project](https://www.transifex.com/signalapp/signal-desktop/)._
- [ ] My commits are in nice logical chunks with [good commit messages](http://chris.beams.io/posts/git-commit/)
- [ ] My changes are [rebased](https://medium.com/free-code-camp/git-rebase-and-the-golden-rule-explained-70715eccc372) on the latest [`main`](https://github.com/signalapp/Signal-Desktop/tree/main) branch
- [ ] My changes are [rebased](https://medium.freecodecamp.org/git-rebase-and-the-golden-rule-explained-70715eccc372) on the latest [`development`](https://github.com/signalapp/Signal-Desktop/tree/development) branch
- [ ] A `yarn ready` run passes successfully ([more about tests here](https://github.com/signalapp/Signal-Desktop/blob/master/CONTRIBUTING.md#tests))
- [ ] My changes are ready to be shipped to users

71
.github/stale.yml vendored
View File

@ -1,71 +0,0 @@
# Copyright 2021-2022 Signal Messenger, LLC
# SPDX-License-Identifier: AGPL-3.0-only
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 90
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 7
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels: []
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- Accessibility
- Bug
- Regression
- "Don't mark stale"
- "Feature Request"
- "Good starter task"
- "Upstream Change Needed"
- "PR: Needs Review"
- "PR: Ready to Merge"
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: true
# Label to use when marking as stale
staleLabel: stale
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when removing the stale label.
# unmarkComment: >
# Your comment here.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
This issue has been closed due to inactivity.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 5
# Limit to only `issues` or `pulls`
# only: issues
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
# pulls:
# daysUntilStale: 30
# markComment: >
# This pull request has been automatically marked as stale because it has not had
# recent activity. It will be closed if no further activity occurs. Thank you
# for your contributions.
# issues:
# exemptLabels:
# - confirmed

View File

@ -1,4 +1,5 @@
# Copyright 2021-2022 Signal Messenger, LLC
# Copyright 2021 Signal Messenger, LLC
# SPDX-License-Identifier: AGPL-3.0-only
name: Backport
@ -15,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
token: ${{ secrets.AUTOMATED_GITHUB_PAT }}
repository: signalapp/Signal-Backport-Action-Private

View File

@ -1,20 +1,14 @@
# Copyright 2020-2022 Signal Messenger, LLC
# Copyright 2020-2021 Signal Messenger, LLC
# SPDX-License-Identifier: AGPL-3.0-only
name: Benchmark
on:
push:
branches:
- development
- main
- '[0-9]+.[0-9]+.x'
pull_request:
on: push
jobs:
linux:
runs-on: ubuntu-latest
if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' }}
timeout-minutes: 30
steps:
- name: Get system specs
@ -23,109 +17,72 @@ jobs:
run: uname -a
- name: Clone Desktop repo
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Clone Mock-Server repo
uses: actions/checkout@v2
with:
repository: 'signalapp/Mock-Signal-Server-Private'
path: 'Mock-Server'
token: ${{ secrets.AUTOMATED_GITHUB_PAT }}
- name: Setup node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v2
with:
node-version: '16.15.0'
node-version: '14.16.0'
- name: Install global dependencies
run: npm install -g yarn@1.22.10
run: npm install -g yarn@1.22.10 ts-node
- name: Install xvfb
run: sudo apt-get install xvfb
- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
key: ${{ runner.os }}-${{ hashFiles('yarn.lock', 'patches/**') }}
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Install Mock-Server node_modules
run: npm ci
working-directory: Mock-Server
- name: Build typescript
run: yarn generate
run: yarn grunt
- name: Bundle
run: yarn build:webpack
- name: Run startup benchmarks
- name: Copy CI configuration
run: cp -rf ./Mock-Server/config/local-development.json ./config/
- name: Setup hosts
run: sudo echo "127.0.0.1 mock.signal.org" | sudo tee -a /etc/hosts
- name: Run benchmarks
run: |
set -o pipefail
xvfb-run --auto-servernum node ts/test-mock/benchmarks/startup_bench.js |
tee benchmark-startup.log
xvfb-run --auto-servernum \
ts-node Mock-Server/scripts/load-test.ts ./node_modules/.bin/electron . | tee benchmark.log || \
(cat /home/runner/.config/Signal-mock/logs/{app,main}.log && exit 1)
timeout-minutes: 10
env:
NODE_ENV: production
RUN_COUNT: 10
ELECTRON_ENABLE_STACK_DUMPING: on
ARTIFACTS_DIR: artifacts/startup
- name: Run send benchmarks
run: |
set -o pipefail
rm -rf /tmp/mock
xvfb-run --auto-servernum node ts/test-mock/benchmarks/send_bench.js |
tee benchmark-send.log
timeout-minutes: 10
env:
NODE_ENV: production
RUN_COUNT: 100
ELECTRON_ENABLE_STACK_DUMPING: on
ARTIFACTS_DIR: artifacts/send
- name: Run group send benchmarks
run: |
set -o pipefail
rm -rf /tmp/mock
xvfb-run --auto-servernum node \
ts/test-mock/benchmarks/group_send_bench.js | \
tee benchmark-group-send.log
timeout-minutes: 10
env:
NODE_ENV: production
RUN_COUNT: 100
ELECTRON_ENABLE_STACK_DUMPING: on
ARTIFACTS_DIR: artifacts/group-send
- name: Run conversation open benchmarks
run: |
set -o pipefail
rm -rf /tmp/mock
xvfb-run --auto-servernum node \
ts/test-mock/benchmarks/convo_open_bench.js | \
tee benchmark-convo-open.log
timeout-minutes: 10
env:
NODE_ENV: production
RUN_COUNT: 100
ELECTRON_ENABLE_STACK_DUMPING: on
ARTIFACTS_DIR: artifacts/convo-open
- name: Upload benchmark logs on failure
if: failure()
uses: actions/upload-artifact@v3
with:
name: logs
path: artifacts
- name: Clone benchmark repo
uses: actions/checkout@v3
- name: Clone benchmark branch
uses: actions/checkout@v2
with:
repository: 'signalapp/Signal-Desktop-Benchmarks-Private'
path: 'benchmark-results'
token: ${{ secrets.AUTOMATED_GITHUB_PAT }}
- name: Push benchmark repo
- name: Push benchmark branch
working-directory: benchmark-results
run: |
npm ci
node ./bin/collect.js ../benchmark-startup.log data/startup.json
node ./bin/collect.js ../benchmark-send.log data/send.json
node ./bin/collect.js ../benchmark-group-send.log data/group-send.json
node ./bin/collect.js ../benchmark-convo-open.log data/convo-open.json
node ./bin/collect.js ../benchmark.log data.json
npm run build
git config --global user.email "no-reply@signal.org"
git config --global user.name "Signal Bot"

View File

@ -1,35 +1,28 @@
# Copyright 2020-2022 Signal Messenger, LLC
# Copyright 2020-2021 Signal Messenger, LLC
# SPDX-License-Identifier: AGPL-3.0-only
name: CI
on:
push:
branches:
- development
- main
- '[0-9]+.[0-9]+.x'
pull_request:
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- run: lsb_release -a
- run: uname -a
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.15.0'
node-version: '14.16.0'
- run: npm install -g yarn@1.22.10
- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
key: ${{ runner.os }}-${{ hashFiles('yarn.lock', 'patches/**') }}
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
@ -43,62 +36,55 @@ jobs:
macos:
needs: lint
runs-on: macos-latest
if: github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
timeout-minutes: 30
if: github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master'
steps:
- run: uname -a
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.15.0'
node-version: '14.16.0'
- run: npm install -g yarn@1.22.10
- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
key: ${{ runner.os }}-${{ hashFiles('yarn.lock', 'patches/**') }}
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- run: yarn generate
- run: yarn prepare-beta-build
- run: yarn build
- run: yarn test-node
- run: yarn test-electron
timeout-minutes: 5
- run: yarn build
env:
DISABLE_INSPECT_FUSE: on
- name: Rebuild native modules for x64
run: yarn electron:install-app-deps
- run: yarn test-release
- run: yarn grunt test-release:osx
env:
NODE_ENV: production
linux:
needs: lint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- run: lsb_release -a
- run: uname -a
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.15.0'
node-version: '14.16.0'
- run: sudo apt-get install xvfb
- run: npm install -g yarn@1.22.10
- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
key: ${{ runner.os }}-${{ hashFiles('yarn.lock', 'patches/**') }}
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
@ -106,112 +92,48 @@ jobs:
- run: yarn generate
- run: yarn prepare-beta-build
- run: yarn build
env:
DISABLE_INSPECT_FUSE: on
- run: xvfb-run --auto-servernum yarn test-node
- run: xvfb-run --auto-servernum yarn test-electron
timeout-minutes: 5
env:
LANG: en_US
LANGUAGE: en_US
- run: xvfb-run --auto-servernum yarn test-release
- run: xvfb-run --auto-servernum yarn grunt test-release:linux
env:
NODE_ENV: production
windows:
needs: lint
runs-on: windows-latest
timeout-minutes: 30
steps:
- run: systeminfo
- run: git config --global core.autocrlf false
- run: git config --global core.eol lf
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.15.0'
node-version: '14.16.0'
- run: npm install -g yarn@1.22.10
- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('patches/**') }}
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- run: yarn generate
- run: node build\grunt.js
- run: yarn test-node
- run: copy package.json temp.json
- run: del package.json
- run: type temp.json | findstr /v certificateSubjectName | findstr /v certificateSha1 > package.json
- run: yarn prepare-beta-build
- run: yarn build
env:
DISABLE_INSPECT_FUSE: on
- run: yarn test-electron
timeout-minutes: 5
- run: yarn test-release
- run: node build\grunt.js test
- run: node build\grunt.js test-release:win
env:
SIGNAL_ENV: production
mock-tests:
needs: lint
runs-on: ubuntu-latest
if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' }}
timeout-minutes: 30
steps:
- name: Get system specs
run: lsb_release -a
- name: Get other system specs
run: uname -a
- name: Clone Desktop repo
uses: actions/checkout@v3
- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: '16.15.0'
- name: Install global dependencies
run: npm install -g yarn@1.22.10
- name: Install xvfb
run: sudo apt-get install xvfb
- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Build typescript
run: yarn generate
- name: Bundle
run: yarn build:webpack
- name: Run mock server tests
run: |
set -o pipefail
xvfb-run --auto-servernum yarn test-mock
timeout-minutes: 10
env:
NODE_ENV: production
DEBUG: mock:test:*
ARTIFACTS_DIR: artifacts/startup
- name: Upload mock server test logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs
path: artifacts

View File

@ -1,32 +0,0 @@
# Copyright 2020-2022 Signal Messenger, LLC
# SPDX-License-Identifier: AGPL-3.0-only
name: CI
on:
pull_request:
jobs:
danger:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch all history
- uses: actions/setup-node@v3
with:
node-version: '16.15.0'
- run: npm install -g yarn@1.22.10
- name: Cache danger node_modules
id: cache-desktop-modules
uses: actions/cache@v3
with:
path: danger/node_modules
key: danger-${{ runner.os }}-${{ hashFiles('danger/package.json', 'danger/yarn.lock') }}
- name: Install danger node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: cd danger && yarn install --frozen-lockfile
- name: Run DangerJS
run: yarn danger:ci
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.AUTOMATED_GITHUB_PAT }}

28
.github/workflows/snyk.yml vendored Normal file
View File

@ -0,0 +1,28 @@
# Copyright 2020-2021 Signal Messenger, LLC
# SPDX-License-Identifier: AGPL-3.0-only
name: Snyk
on:
schedule:
- cron: '0 12 * * *'
jobs:
snyk:
runs-on: ubuntu-latest
if: github.repository != 'signalapp/Signal-Desktop'
steps:
- run: lsb_release -a
- run: uname -a
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14.16.0'
- run: npm install -g yarn@1.22.10
- run: npm install -g snyk@1.316.1
- run: yarn install --frozen-lockfile
- run: snyk auth "$SNYK_TOKEN"
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- run: snyk test --show-vulnerable-paths=all

17
.gitignore vendored
View File

@ -1,5 +1,4 @@
node_modules
node_modules_bkp
.sass-cache
coverage/*
build/curve25519_compiled.js
@ -12,21 +11,19 @@ config/local-*.json
release/
/dev-app-update.yml
.nyc_output/
*.sublime*
/sql/
/start.sh
.eslintcache
tsconfig.tsbuildinfo
.smartling-source.sh
# generated files
js/components.js
js/util_worker.js
libtextsecure/components.js
libtextsecure/test/test.js
stylesheets/*.css
/storybook-static/
preload.bundle.*
ts/sql/mainWorker.bundle.js.LICENSE.txt
test/test.js
# React / TypeScript
app/*.js
@ -39,10 +36,8 @@ sticker-creator/**/*.js
# Sticker Creator
sticker-creator/dist/*
sticker-creator/**/*.js
# Editors
/.idea
/.vscode
*.sublime*
*.map
/storybook-static/
preload.bundle.*
ts/sql/mainWorker.bundle.js.LICENSE.txt

2
.nvmrc
View File

@ -1 +1 @@
16.15.0
14.16.0

View File

@ -3,7 +3,6 @@
# Generated files
app/**/*.js
sticker-creator/**/*.js
config/local-*.json
config/local.json
dist/**
@ -14,7 +13,6 @@ libtextsecure/test/test.js
stylesheets/*.css
test/test.js
ts/**/*.js
!ts/**/.eslintrc.js
ts/protobuf/*.d.ts
ts/protobuf/*.js
stylesheets/manifest.css
@ -27,14 +25,21 @@ components/**
js/curve/**
js/Mp3LameEncoder.min.js
js/WebAudioRecorderMp3.js
libtextsecure/test/blanket_mocha.js
test/blanket_mocha.js
# Assets
/images/
/fixtures/
# Test fixtures
test/fixtures.js
# Github workflows
.github/**
# Managed by Transifex:
# Note: the negate pattern only works because it's targeting the same depth as the
# glob on the previous line.
_locales/**/*.json
!_locales/en/messages.json
# Managed by package manager (`bower` and `yarn`/`npm`):
/bower.json
/package.json

View File

@ -1,9 +0,0 @@
#!/bin/bash
# Copyright 2022 Signal Messenger, LLC
# SPDX-License-Identifier: AGPL-3.0-only
# run this before yarn get-strings/push-strings:
# source .smartling-source.sh
export SMARTLING_USER="your token 'user identifier' here"
export SMARTLING_SECRET="your token secret here"

View File

@ -1,7 +0,0 @@
# Copyright 2022 Signal Messenger, LLC
# SPDX-License-Identifier: AGPL-3.0-only
# https://github.com/Smartling/smartling-cli/wiki/examples.md
account_id: '92ff14ad'
project_id: 'ef62d1ebb'

184
.snyk Normal file
View File

@ -0,0 +1,184 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.13.5
ignore: {}
patch:
'npm:moment:20170905':
- bunyan > moment:
patched: '2020-04-30T19:26:25.236Z'
'npm:debug:20170905':
- websocket > debug:
patched: '2020-04-30T19:26:25.236Z'
- ref-array-napi > array-index > debug:
patched: '2020-04-30T19:26:25.236Z'
- babel-template > babel-traverse > debug:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-traverse > debug:
patched: '2020-04-30T19:26:25.236Z'
- zkgroup > ref-array-napi > array-index > debug:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-template > babel-traverse > debug:
patched: '2020-04-30T19:26:25.236Z'
- array-index > debug:
patched: '2020-04-30T19:26:25.236Z'
SNYK-JS-LODASH-450202:
- babel-template > lodash:
patched: '2020-04-30T19:26:25.236Z'
- babel-generator > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- babel-template > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-generator > lodash:
patched: '2020-04-30T19:26:25.236Z'
- babel-template > babel-traverse > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-traverse > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-template > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-generator > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- babel-template > babel-traverse > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-traverse > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-template > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-template > babel-traverse > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-template > babel-traverse > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- lodash:
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/generator > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/generator > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/template > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/generator > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/template > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/generator > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/helper-function-name > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/helper-split-export-declaration > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/generator > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/helper-function-name > @babel/template > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/generator > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/helper-function-name > @babel/helper-get-function-arity > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/helper-function-name > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/helper-split-export-declaration > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@emotion/core > @emotion/css > babel-plugin-emotion > @babel/helper-module-imports > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/helper-function-name > @babel/template > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/helper-function-name > @babel/helper-get-function-arity > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- babel-generator > lodash:
patched: '2020-04-30T19:26:25.236Z'
SNYK-JS-LODASH-567746:
- babel-template > lodash:
patched: '2020-04-30T19:26:25.236Z'
- babel-generator > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- babel-template > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-generator > lodash:
patched: '2020-04-30T19:26:25.236Z'
- babel-template > babel-traverse > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-traverse > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-template > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-generator > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- babel-template > babel-traverse > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-traverse > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-template > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-template > babel-traverse > lodash:
patched: '2020-04-30T19:26:25.236Z'
- istanbul-lib-instrument > babel-template > babel-traverse > babel-types > lodash:
patched: '2020-04-30T19:26:25.236Z'
- lodash:
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/generator > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/generator > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/template > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/generator > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/template > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/generator > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/helper-function-name > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/helper-split-export-declaration > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/generator > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/helper-function-name > @babel/template > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/generator > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/traverse > @babel/helper-function-name > @babel/helper-get-function-arity > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/helper-function-name > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/helper-split-export-declaration > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@emotion/core > @emotion/css > babel-plugin-emotion > @babel/helper-module-imports > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/helper-function-name > @babel/template > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- '@babel/core > @babel/helpers > @babel/traverse > @babel/helper-function-name > @babel/helper-get-function-arity > @babel/types > lodash':
patched: '2020-04-30T19:26:25.236Z'
- babel-generator > lodash:
patched: '2020-04-30T19:26:25.236Z'

View File

@ -1,7 +0,0 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Context } from 'react';
import type { ThemeType } from '../ts/types/Util';
export const StorybookThemeContext: Context<ThemeType>;

View File

@ -1,7 +0,0 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { createContext } from 'react';
import { ThemeType } from '../ts/types/Util';
export const StorybookThemeContext = createContext(ThemeType.light);

5
.storybook/addons.js Normal file
View File

@ -0,0 +1,5 @@
// Copyright 2019-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import '@storybook/addon-knobs/register';
import '@storybook/addon-actions/register';

121
.storybook/config.js Normal file
View File

@ -0,0 +1,121 @@
// Copyright 2019-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as React from 'react';
import { addDecorator, addParameters, configure } from '@storybook/react';
import { withKnobs, boolean, optionsKnob } from '@storybook/addon-knobs';
import classnames from 'classnames';
import * as styles from './styles.scss';
import messages from '../_locales/en/messages.json';
import { I18n } from '../sticker-creator/util/i18n';
import { ClassyProvider } from '../ts/components/PopperRootContext';
const optionsConfig = {
display: 'inline-radio',
};
const persistKnob = id => knob => {
const value = knob(localStorage.getItem(id));
localStorage.setItem(id, value);
return value;
};
const makeThemeKnob = pane =>
persistKnob(`${pane}-pane-theme`)(localValue =>
optionsKnob(
`${pane} Pane Theme`,
{ Light: '', Dark: classnames('dark-theme', styles.darkTheme) },
localValue || '',
optionsConfig,
`${pane} Pane`
)
);
const makeModeKnob = pane =>
persistKnob(`${pane}-pane-mode`)(localValue =>
optionsKnob(
`${pane} Pane Mode`,
{ Mouse: 'mouse-mode', Keyboard: 'keyboard-mode' },
localValue || 'mouse-mode',
optionsConfig,
`${pane} Pane`
)
);
addDecorator(withKnobs);
addDecorator((storyFn /* , context */) => {
const contents = storyFn();
const firstPaneTheme = makeThemeKnob('First');
const firstPaneMode = makeModeKnob('First');
const secondPane = persistKnob('second-pane-active')(localValue =>
boolean('Second Pane Active', localValue !== 'false', 'Second Pane')
);
const secondPaneTheme = makeThemeKnob('Second');
const secondPaneMode = makeModeKnob('Second');
// Adding it to the body as well so that we can cover modals and other
// components that are rendered outside of this decorator container
if (firstPaneTheme === '') {
document.body.classList.remove('dark-theme');
} else {
document.body.classList.add('dark-theme');
}
if (firstPaneMode === 'mouse-mode') {
document.body.classList.remove('keyboard-mode');
document.body.classList.add('mouse-mode');
} else {
document.body.classList.remove('mouse-mode');
document.body.classList.add('keyboard-mode');
}
return (
<div className={styles.container}>
<ClassyProvider themes={['dark']}>
<div
className={classnames(styles.panel, firstPaneTheme, firstPaneMode)}
>
{contents}
</div>
</ClassyProvider>
{secondPane ? (
<div
className={classnames(styles.panel, secondPaneTheme, secondPaneMode)}
>
{contents}
</div>
) : null}
</div>
);
});
// Hack to enable hooks in stories: https://github.com/storybookjs/storybook/issues/5721#issuecomment-473869398
addDecorator(Story => <Story />);
addDecorator(story => <I18n messages={messages}>{story()}</I18n>);
addParameters({
axe: {
disabledRules: ['html-has-lang'],
},
});
configure(() => {
// Load main app stories
const tsComponentsContext = require.context(
'../ts/components',
true,
/\.stories.tsx?$/
);
tsComponentsContext.keys().forEach(f => tsComponentsContext(f));
// Load sticker creator stories
const stickerCreatorContext = require.context(
'../sticker-creator',
true,
/\.stories\.tsx?$/
);
stickerCreatorContext.keys().forEach(f => stickerCreatorContext(f));
}, module);

View File

@ -1,23 +0,0 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
module.exports = {
stories: [
'../ts/components/**/*.stories.tsx',
'../sticker-creator/**/*.stories.tsx',
],
addons: [
'@storybook/addon-a11y',
'@storybook/addon-actions',
'@storybook/addon-controls',
'@storybook/addon-measure',
'@storybook/addon-toolbars',
'@storybook/addon-viewport',
// This must be imported last.
'@storybook/addon-interactions',
// Deprecated! Please remove when all uses have been migrated to controls.
'@storybook/addon-knobs',
],
};

View File

@ -1,19 +1,10 @@
<!-- Copyright 2019-2022 Signal Messenger, LLC -->
<!-- Copyright 2019-2021 Signal Messenger, LLC -->
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
<!-- prettier-ignore -->
<link rel="stylesheet" href="../stylesheets/manifest.css" />
<link
href="../node_modules/@indutny/frameless-titlebar/dist/styles.css"
rel="stylesheet"
type="text/css"
/>
<script>
// eslint-disable-next-line
const noop = () => {};
window.SignalWindow = window.SignalWindow || {};
window.SignalWindow.log = {
window.log = {
fatal: console.error.bind(console),
error: console.error.bind(console),
warn: console.warn.bind(console),
@ -21,28 +12,4 @@
debug: console.debug.bind(console),
trace: console.trace.bind(console),
};
window.SignalContext = {
activeWindowService: {
isActive: () => true,
registerForActive: noop,
unregisterForActive: noop,
registerForChange: noop,
unregisterForChange: noop,
},
nativeThemeListener: {
getSystemValue: async () => 'light',
subscribe: noop,
unsubscribe: noop,
},
Settings: {
themeSetting: {
getValue: async () => 'light',
},
waitForChange: () => new Promise(noop),
},
OS: {
hasCustomTitleBar: () => false,
},
};
</script>

View File

@ -1,87 +0,0 @@
// Copyright 2019-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import classnames from 'classnames';
import { withKnobs, boolean, optionsKnob } from '@storybook/addon-knobs';
import * as styles from './styles.scss';
import messages from '../_locales/en/messages.json';
import { ClassyProvider } from '../ts/components/PopperRootContext';
import { I18n } from '../sticker-creator/util/i18n';
import { StorybookThemeContext } from './StorybookThemeContext';
import { ThemeType } from '../ts/types/Util';
export const globalTypes = {
mode: {
name: 'Mode',
description: 'Application mode',
defaultValue: 'mouse',
toolbar: {
dynamicTitle: true,
icon: 'circlehollow',
items: ['mouse', 'keyboard'],
showName: true,
},
},
theme: {
name: 'Theme',
description: 'Global theme for components',
defaultValue: 'light',
toolbar: {
dynamicTitle: true,
icon: 'circlehollow',
items: ['light', 'dark'],
showName: true,
},
},
};
const withModeAndThemeProvider = (Story, context) => {
const theme =
context.globals.theme === 'light' ? ThemeType.light : ThemeType.dark;
const mode = context.globals.mode;
// Adding it to the body as well so that we can cover modals and other
// components that are rendered outside of this decorator container
if (theme === 'light') {
document.body.classList.remove('dark-theme');
} else {
document.body.classList.add('dark-theme');
}
if (mode === 'mouse') {
document.body.classList.remove('keyboard-mode');
document.body.classList.add('mouse-mode');
} else {
document.body.classList.remove('mouse-mode');
document.body.classList.add('keyboard-mode');
}
document.body.classList.add('page-is-visible');
return (
<div className={styles.container}>
<StorybookThemeContext.Provider value={theme}>
<Story {...context} />
</StorybookThemeContext.Provider>
</div>
);
};
const withI18n = (Story, context) => (
<I18n messages={messages} locale="en">
<Story {...context} />
</I18n>
);
export const decorators = [
withModeAndThemeProvider,
withI18n,
];
export const parameters = {
axe: {
disabledRules: ['html-has-lang'],
},
};

View File

@ -4,10 +4,19 @@
@import '../stylesheets/variables';
.container {
align-content: stretch;
display: flex;
flex-direction: row;
align-items: stretch;
align-content: stretch;
width: 100vw;
height: 100vh;
}
.panel {
flex: 1;
padding: 16px;
height: 100%;
width: 100%;
overflow: auto;
}
.dark-theme {

View File

@ -1,8 +1,6 @@
// Copyright 2019-2022 Signal Messenger, LLC
// Copyright 2019-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
const webpack = require('webpack');
module.exports = ({ config }) => {
config.entry.unshift(
'!!style-loader!css-loader!sanitize.css',
@ -10,6 +8,11 @@ module.exports = ({ config }) => {
);
config.module.rules.unshift(
{
test: /\.[jt]sx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.scss$/,
loaders: [
@ -20,6 +23,8 @@ module.exports = ({ config }) => {
}
);
config.resolve.extensions = ['.tsx', '.ts', '.jsx', '.js'];
config.externals = {
net: 'net',
};

8
.tx/config Normal file
View File

@ -0,0 +1,8 @@
[main]
host = https://www.transifex.com
[signal-desktop.messagesjson-electron]
file_filter = _locales/<lang>/messages.json
source_file = _locales/en/messages.json
source_lang = en
type = CHROME

View File

@ -5,6 +5,7 @@ tests
powered-test
# asset directories
docs
doc
website
images

View File

@ -1,66 +1,10 @@
<!-- Copyright 2020-2022 Signal Messenger, LLC -->
<!-- Copyright 2020-2021 Signal Messenger, LLC -->
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
# Acknowledgments
Signal Desktop makes use of the following open source projects.
## @formatjs/fast-memoize
License: MIT
## @indutny/frameless-titlebar
MIT License
Copyright (c) 2019 Cristian Ponce
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## @popperjs/core
License: MIT
## @react-spring/web
MIT License
Copyright (c) 2018-present Paul Henschel, react-spring, all contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## @sindresorhus/is
MIT License
@ -73,7 +17,31 @@ Signal Desktop makes use of the following open source projects.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## @types/fabric
## @types/pino
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
## @types/pino-multi-stream
MIT License
@ -547,31 +515,6 @@ Signal Desktop makes use of the following open source projects.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## bezier-easing
Copyright (c) 2014 Gaëtan Renaudeau
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
## blob-util
Apache License
@ -776,6 +719,30 @@ Signal Desktop makes use of the following open source projects.
See the License for the specific language governing permissions and
limitations under the License.
## blueimp-canvas-to-blob
MIT License
Copyright © 2012 Sebastian Tschan, https://blueimp.net
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## blueimp-load-image
MIT License
@ -887,53 +854,6 @@ Signal Desktop makes use of the following open source projects.
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## dicer
Copyright Brian White. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
## direction
(The MIT License)
Copyright (c) 2014 Titus Wormer <tituswormer@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## emoji-datasource
The MIT License (MIT)
@ -1024,25 +944,6 @@ Signal Desktop makes use of the following open source projects.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## fabric
Copyright (c) 2008-2015 Printio (Juriy Zaytsev, Maxim Chernyak)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## fast-glob
The MIT License (MIT)
@ -1121,30 +1022,6 @@ Signal Desktop makes use of the following open source projects.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## focus-trap-react
The MIT License (MIT)
Copyright (c) 2015 David Clark
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## form-data
Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
@ -1637,10 +1514,6 @@ Signal Desktop makes use of the following open source projects.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## heic-convert
License: ISC
## history
MIT License
@ -1838,210 +1711,6 @@ Signal Desktop makes use of the following open source projects.
licenses; we recommend you read them, as their terms may differ from the
terms above.
## long
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
## lru-cache
The ISC License
@ -2131,33 +1800,6 @@ Signal Desktop makes use of the following open source projects.
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
## mp4box
Copyright (c) 2012. Telecom ParisTech/TSI/MM/GPAC Cyril Concolato
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
## mustache
The MIT License
@ -2533,6 +2175,18 @@ Signal Desktop makes use of the following open source projects.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
## os-locale
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## p-map
MIT License
@ -2561,19 +2215,7 @@ Signal Desktop makes use of the following open source projects.
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## p-timeout
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@ -2652,6 +2294,14 @@ Signal Desktop makes use of the following open source projects.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## pino-multi-stream
License: MIT
## popper.js
License: MIT
## protobufjs
This license applies to all parts of protobuf.js except those files
@ -2698,10 +2348,6 @@ Signal Desktop makes use of the following open source projects.
License: MIT
## qrcode-generator
License: MIT
## quill
Copyright (c) 2014, Jason Chen
@ -2863,10 +2509,6 @@ Signal Desktop makes use of the following open source projects.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## react-intl
License: BSD-3-Clause
## react-measure
The MIT License (MIT)
@ -2991,29 +2633,6 @@ Signal Desktop makes use of the following open source projects.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## react-textarea-autosize
The MIT License (MIT)
Copyright (c) 2013 Andrey Popp
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## react-virtualized
The MIT License (MIT)
@ -3182,6 +2801,34 @@ Signal Desktop makes use of the following open source projects.
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
## rotating-file-stream
The MIT License (MIT)
Copyright (c) 2015-2020 Daniele Ricci
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## sanitize-filename
License: WTFPL OR ISC
## sanitize.css
License: CC0-1.0
@ -3398,9 +3045,11 @@ Signal Desktop makes use of the following open source projects.
See the License for the specific language governing permissions and
limitations under the License.
## split2
## tar
Copyright (c) 2014-2018, Matteo Collina <hello@matteocollina.com>
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@ -3447,11 +3096,33 @@ Signal Desktop makes use of the following open source projects.
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
## tmp
The MIT License (MIT)
Copyright (c) 2014 KARASZI István
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## typeface-inter
Copyright (c) 2016-2020 The Inter Project Authors.
"Inter" is trademark of Rasmus Andersson.
https://github.com/rsms/inter
Copyright (c) 2016-2018 The Inter Project Authors (me@rsms.me)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:

View File

@ -1,4 +1,4 @@
<!-- Copyright 2015-2022 Signal Messenger, LLC -->
<!-- Copyright 2015-2020 Signal Messenger, LLC -->
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
# Contributor Guidelines
@ -13,15 +13,14 @@ It's a good idea to gauge interest in your intended work by finding the current
for it or creating a new one yourself. You can use also that issue as a place to signal
your intentions and get feedback from the users most likely to appreciate your changes.
Once you've spent a little bit of time planning your solution, you can go
Once you've spent a little bit of time planning your solution, it's a good idea to go
back to the issue and talk about your approach. We'd be happy to provide feedback. [An
ounce of prevention, as they say!](https://www.goodreads.com/quotes/247269-an-ounce-of-prevention-is-worth-a-pound-of-cure)
## Developer Setup
First, you'll need [Node.js](https://nodejs.org/) which matches our current version.
You can check [`.nvmrc` in the `main` branch](https://github.com/signalapp/Signal-Desktop/blob/main/.nvmrc)
to see what the current version is. If you have [nvm](https://github.com/creationix/nvm)
You can check [`.nvmrc` in the `development` branch](https://github.com/signalapp/Signal-Desktop/blob/development/.nvmrc) to see what the current version is. If you have [nvm](https://github.com/creationix/nvm)
you can just run `nvm use` in the project directory and it will switch to the project's
desired Node.js version. [nvm for windows](https://github.com/coreybutler/nvm-windows) is
still useful, but it doesn't support `.nvmrc` files.
@ -44,22 +43,23 @@ Install the [Xcode Command-Line Tools](http://osxdaily.com/2014/02/12/install-co
### Linux
1. Pick your favorite package manager.
1. Install `python` (Python 3.6+)
1. Install `python` (Python 2.7+)
1. Install `gcc`
1. Install `g++`
1. Install `make`
1. Install `git-lfs`
### All platforms
Now, run these commands in your preferred terminal in a good directory for development:
```
git lfs install # Setup Git LFS.
npm install --global yarn # Make sure you have have `yarn`
git clone https://github.com/signalapp/Signal-Desktop.git
cd Signal-Desktop
git-lfs install # Setup Git LFS.
npm install --global yarn # (only if you dont already have `yarn`)
yarn install --frozen-lockfile # Install and build dependencies (this will take a while)
yarn generate # Generate final JS and CSS assets
yarn grunt # Generate final JS and CSS assets
yarn build:webpack # Build parts of the app that use webpack (Sticker Creator)
yarn test # A good idea to make sure tests run first
yarn start # Start Signal!
@ -72,14 +72,13 @@ is no automatic restart mechanism. Alternatively, keep the developer tools open
(Windows & Linux).
Also, note that the assets loaded by the application are not necessarily the same files
youre touching. You may not see your changes until you run `yarn generate` on the
youre touching. You may not see your changes until you run `yarn grunt` on the
command-line like you did during setup. You can make it easier on yourself by generating
the latest built assets when you change a file. Run each of these in their own terminal
instance while you make changes - they'll run until you stop them:
the latest built assets when you change a file. Run this in its own terminal instance
while you make changes:
```
yarn transpile --watch # recompiles when you change .ts files
yarn sass-manifest --watch # recompiles when you change .scss files
yarn grunt dev # runs until you stop it, re-generating built assets on file changes
```
If you miss the `git-lfs` step, run `yarn cache clean` and remove `node_modules` before trying again.
@ -181,9 +180,17 @@ Please write tests! Our testing framework is
[mocha](http://mochajs.org/) and our assertion library is
[chai](http://chaijs.com/api/assert/).
The easiest way to run all tests at once is `yarn test`, which will run them on the
command line. You can run the client-side tests in an interactive session with
`NODE_ENV=test yarn run start`.
The easiest way to run all tests at once is `yarn test`.
You can browse tests from the command line with `grunt unit-tests` or in an
interactive session with `NODE_ENV=test yarn run start`.
If you want to run the `libtextsecure` tests, you can run `yarn run test-electron`,
which also runs the unit tests.
To run Node.js tests, you can run `yarn test-server` from the command line. You can get
code coverage numbers for this kind of run via `yarn test-server-coverage`, then display
the report with `yarn open-coverage`.
## Pull requests
@ -191,16 +198,19 @@ So you wanna make a pull request? Please observe the following guidelines.
- First, make sure that your `yarn ready` run passes - it's very similar to what our
Continuous Integration servers do to test the app.
- Please do not submit pull requests for translation fixes.
- Please do not submit pull requests for translation fixes. Anyone can update
the translations in
[Transifex](https://www.transifex.com/projects/p/signal-desktop).
- Never use plain strings right in the source code - pull them from `messages.json`!
You **only** need to modify the default locale
[`_locales/en/messages.json`](_locales/en/messages.json). Other locales are generated
automatically based on that file and then periodically translated.
automatically based on that file and then periodically uploaded to Transifex for
translation.
- [Rebase](https://nathanleclaire.com/blog/2014/09/14/dont-be-scared-of-git-rebase/) your
changes on the latest `main` branch, resolving any conflicts.
changes on the latest `development` branch, resolving any conflicts.
This ensures that your changes will merge cleanly when you open your PR.
- Be sure to add and run tests!
- Make sure the diff between the development branch and your branch contains only the
- Make sure the diff between our master and your branch contains only the
minimal set of changes needed to implement your feature or bugfix. This will
make it easier for the person reviewing your code to approve the changes.
Please do not submit a PR with commented out code or unfinished features.
@ -236,7 +246,7 @@ iOS and Android apps are locked to the production servers. To test all scenarios
staging, your best bet is to pull down the development version of the iOS or Android app,
and register it with one of your extra phone numbers:
First, build Signal for Android or iOS from source, and point its service URL to `chat.staging.signal.org`:
First, build Signal for Android or iOS from source, and point its service URL to `textsecure-service-staging.whispersystems.org`:
**on Android:** Replace the `SIGNAL_URL` value in [build.gradle](https://github.com/signalapp/Signal-Android/blob/master/build.gradle)
@ -271,4 +281,16 @@ yarn generate
yarn build
```
Then, run the tests using `yarn test-release`.
Then, run the tests using `grunt test-release:osx --dir=release`, replacing `osx` with `linux` or `win` depending on your platform.
## Translations
To pull the latest translations, follow these steps:
1. Download Transifex client:
https://docs.transifex.com/client/installing-the-client
2. Create Transifex account: https://transifex.com
3. Generate API token: https://www.transifex.com/user/settings/api/
4. Create `~/.transifexrc` configuration:
https://docs.transifex.com/client/client-configuration#-transifexrc
5. Run `yarn grunt tx`.

430
Gruntfile.js Normal file
View File

@ -0,0 +1,430 @@
// Copyright 2014-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
const { join } = require('path');
const importOnce = require('node-sass-import-once');
const rimraf = require('rimraf');
const mkdirp = require('mkdirp');
const spectron = require('spectron');
const asar = require('asar');
const fs = require('fs');
const assert = require('assert');
const sass = require('node-sass');
const packageJson = require('./package.json');
/* eslint-disable more/no-then, no-console */
module.exports = grunt => {
const bower = grunt.file.readJSON('bower.json');
const components = [];
// eslint-disable-next-line guard-for-in, no-restricted-syntax
for (const i in bower.concat.app) {
components.push(bower.concat.app[i]);
}
const libtextsecurecomponents = [];
// eslint-disable-next-line guard-for-in, no-restricted-syntax
for (const i in bower.concat.libtextsecure) {
libtextsecurecomponents.push(bower.concat.libtextsecure[i]);
}
grunt.loadNpmTasks('grunt-sass');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
components: {
src: components,
dest: 'js/components.js',
},
libtextsecurecomponents: {
src: libtextsecurecomponents,
dest: 'libtextsecure/components.js',
},
test: {
src: [
'node_modules/mocha/mocha.js',
'node_modules/chai/chai.js',
'test/_test.js',
],
dest: 'test/test.js',
},
libtextsecuretest: {
src: [
'node_modules/jquery/dist/jquery.js',
'components/mock-socket/dist/mock-socket.js',
'node_modules/mocha/mocha.js',
'node_modules/chai/chai.js',
'libtextsecure/test/_test.js',
],
dest: 'libtextsecure/test/test.js',
},
},
sass: {
options: {
implementation: sass,
sourceMap: true,
importer: importOnce,
},
dev: {
files: {
'stylesheets/manifest.css': 'stylesheets/manifest.scss',
'stylesheets/manifest_bridge.css': 'stylesheets/manifest_bridge.scss',
},
},
},
copy: {
deps: {
files: [
{
src: 'components/mp3lameencoder/lib/Mp3LameEncoder.js',
dest: 'js/Mp3LameEncoder.min.js',
},
{
src: 'components/webaudiorecorder/lib/WebAudioRecorderMp3.js',
dest: 'js/WebAudioRecorderMp3.js',
},
],
},
},
watch: {
libtextsecure: {
files: ['./libtextsecure/*.js', './libtextsecure/storage/*.js'],
tasks: ['concat:libtextsecure'],
},
protobuf: {
files: ['./protos/SignalService.proto'],
tasks: ['exec:build-protobuf'],
},
sass: {
files: ['./stylesheets/*.scss', './stylesheets/**/*.scss'],
tasks: ['sass'],
},
},
exec: {
'tx-pull-new': {
cmd: 'tx pull -a --minimum-perc=80',
},
'tx-pull': {
cmd: 'tx pull',
},
transpile: {
cmd: 'yarn transpile',
},
'build-protobuf': {
cmd: 'yarn build-protobuf',
},
},
'test-release': {
osx: {
archive: `mac/${packageJson.productName}.app/Contents/Resources/app.asar`,
exe: `mac/${packageJson.productName}.app/Contents/MacOS/${packageJson.productName}`,
},
mas: {
archive: 'mas/Signal.app/Contents/Resources/app.asar',
exe: `mas/${packageJson.productName}.app/Contents/MacOS/${packageJson.productName}`,
},
linux: {
archive: 'linux-unpacked/resources/app.asar',
exe: `linux-unpacked/${packageJson.name}`,
},
win: {
archive: 'win-unpacked/resources/app.asar',
exe: `win-unpacked/${packageJson.productName}.exe`,
},
},
gitinfo: {}, // to be populated by grunt gitinfo
});
Object.keys(grunt.config.get('pkg').devDependencies).forEach(key => {
if (/^grunt(?!(-cli)?$)/.test(key)) {
// ignore grunt and grunt-cli
grunt.loadNpmTasks(key);
}
});
// Transifex does not understand placeholders, so this task patches all non-en
// locales with missing placeholders
grunt.registerTask('locale-patch', () => {
const en = grunt.file.readJSON('_locales/en/messages.json');
grunt.file.recurse('_locales', (abspath, rootdir, subdir, filename) => {
if (subdir === 'en' || filename !== 'messages.json') {
return;
}
const messages = grunt.file.readJSON(abspath);
// eslint-disable-next-line no-restricted-syntax
for (const key in messages) {
if (en[key] !== undefined && messages[key] !== undefined) {
if (
en[key].placeholders !== undefined &&
messages[key].placeholders === undefined
) {
messages[key].placeholders = en[key].placeholders;
}
}
}
grunt.file.write(abspath, `${JSON.stringify(messages, null, 4)}\n`);
});
});
grunt.registerTask('getExpireTime', () => {
grunt.task.requires('gitinfo');
const gitinfo = grunt.config.get('gitinfo');
const committed = gitinfo.local.branch.current.lastCommitTime;
const time = Date.parse(committed) + 1000 * 60 * 60 * 24 * 90;
grunt.file.write(
'config/local-production.json',
`${JSON.stringify({ buildExpiration: time })}\n`
);
});
grunt.registerTask('clean-release', () => {
rimraf.sync('release');
mkdirp.sync('release');
});
function runTests(environment, cb) {
let failure;
const { Application } = spectron;
const electronBinary =
process.platform === 'win32' ? 'electron.cmd' : 'electron';
const path = join(__dirname, 'node_modules', '.bin', electronBinary);
const args = [join(__dirname, 'main.js')];
console.log('Starting path', path, 'with args', args);
const app = new Application({
path,
args,
env: {
NODE_ENV: environment,
},
requireName: 'unused',
});
function getMochaResults() {
// eslint-disable-next-line no-undef
return window.mochaResults;
}
app
.start()
.then(() => {
console.log('App started. Now waiting for test results...');
return app.client.waitUntil(
() =>
app.client
.execute(getMochaResults)
.then(data => Boolean(data.value)),
25000,
'Expected to find window.mochaResults set!'
);
})
.then(() => app.client.execute(getMochaResults))
.then(data => {
const results = data.value;
if (!results) {
failure = () => grunt.fail.fatal("Couldn't extract test results.");
return app.client.log('browser');
}
if (results.failures > 0) {
console.error(results.reports);
failure = () =>
grunt.fail.fatal(`Found ${results.failures} failing unit tests.`);
return app.client.log('browser');
}
grunt.log.ok(`${results.passes} tests passed.`);
return null;
})
.then(logs => {
if (logs) {
console.error();
console.error('Because tests failed, printing browser logs:');
console.error(logs);
}
})
.catch(error => {
failure = () =>
grunt.fail.fatal(
`Something went wrong: ${error.message} ${error.stack}`
);
})
.then(() => {
// We need to use the failure variable and this early stop to clean up before
// shutting down. Grunt's fail methods are the only way to set the return value,
// but they shut the process down immediately!
if (failure) {
console.log();
console.log('Main process logs:');
return app.client.getMainProcessLogs().then(logs => {
logs.forEach(log => {
console.log(log);
});
return app.stop();
});
}
return app.stop();
})
.then(() => {
if (failure) {
failure();
}
cb();
})
.catch(error => {
console.error('Second-level error:', error.message, error.stack);
if (failure) {
failure();
}
cb();
});
}
grunt.registerTask(
'unit-tests',
'Run unit tests w/Electron',
function thisNeeded() {
const environment = grunt.option('env') || 'test';
const done = this.async();
runTests(environment, done);
}
);
grunt.registerTask(
'lib-unit-tests',
'Run libtextsecure unit tests w/Electron',
function thisNeeded() {
const environment = grunt.option('env') || 'test-lib';
const done = this.async();
runTests(environment, done);
}
);
grunt.registerMultiTask(
'test-release',
'Test packaged releases',
function thisNeeded() {
const dir = grunt.option('dir') || 'release';
const environment = grunt.option('env') || 'production';
const config = this.data;
const archive = [dir, config.archive].join('/');
const files = [
'config/default.json',
`config/${environment}.json`,
`config/local-${environment}.json`,
];
console.log(this.target, archive);
const releaseFiles = files.concat(config.files || []);
releaseFiles.forEach(fileName => {
console.log(fileName);
try {
asar.statFile(archive, fileName);
return true;
} catch (e) {
console.log(e);
throw new Error(`Missing file ${fileName}`);
}
});
if (config.appUpdateYML) {
const appUpdateYML = [dir, config.appUpdateYML].join('/');
if (fs.existsSync(appUpdateYML)) {
console.log('auto update ok');
} else {
throw new Error(`Missing auto update config ${appUpdateYML}`);
}
}
const done = this.async();
// A simple test to verify a visible window is opened with a title
const { Application } = spectron;
const path = [dir, config.exe].join('/');
console.log('Starting path', path);
const app = new Application({
path,
});
const sleep = millis =>
new Promise(resolve => setTimeout(resolve, millis));
Promise.race([app.start(), sleep(15000)])
.then(() => {
if (!app.isRunning()) {
throw new Error('Application failed to start');
}
return app.client.getWindowCount();
})
.then(count => {
assert.equal(count, 1);
console.log('window opened');
})
.then(() =>
// Verify the window's title
app.client.waitUntil(
async () =>
(await app.client.getTitle()) === packageJson.productName,
{
timeoutMsg: `Expected window title to be ${JSON.stringify(
packageJson.productName
)}`,
}
)
)
.then(() => {
console.log('title ok');
})
.then(() => {
assert(
app.chromeDriver.logLines.indexOf(`NODE_ENV ${environment}`) > -1
);
console.log('environment ok');
})
.then(
() =>
// Successfully completed test
app.stop(),
error =>
// Test failed!
app.stop().then(() => {
grunt.fail.fatal(`Test failed: ${error.message} ${error.stack}`);
})
)
.catch(error => {
console.log('Main process logs:');
app.client.getMainProcessLogs().then(logs => {
logs.forEach(log => {
console.log(log);
});
// Test failed!
grunt.fail.fatal(`Failure! ${error.message} ${error.stack}`);
});
})
.then(done);
}
);
grunt.registerTask('tx', [
'exec:tx-pull-new',
'exec:tx-pull',
'locale-patch',
]);
grunt.registerTask('dev', ['default', 'watch']);
grunt.registerTask('test', ['unit-tests', 'lib-unit-tests']);
grunt.registerTask('date', ['gitinfo', 'getExpireTime']);
grunt.registerTask('default', [
'exec:build-protobuf',
'exec:transpile',
'concat',
'copy:deps',
'sass',
'date',
]);
};

42
LICENSE
View File

@ -617,45 +617,3 @@ Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

View File

@ -1,11 +1,21 @@
<!-- Copyright 2014-2022 Signal Messenger, LLC -->
<!-- Copyright 2014-2020 Signal Messenger, LLC -->
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
# Signal Desktop
Signal Desktop links with Signal on [Android](https://github.com/signalapp/Signal-Android) or [iOS](https://github.com/signalapp/Signal-iOS) and lets you message from your Windows, macOS, and Linux computers.
Signal Desktop is an Electron application that links with Signal
on [Android](https://github.com/signalapp/Signal-Android)
or [iOS](https://github.com/signalapp/Signal-iOS).
[Install the production version](https://signal.org/download/) or help us out by [installing the beta version](https://support.signal.org/hc/articles/360007318471-Signal-Beta).
## Install the production version: https://signal.org/download/
## Install the beta
You can install the beta version of Signal Desktop alongside the production version. The beta uses different data and install locations.
- _Windows:_ First, download [this file](https://updates.signal.org/desktop/beta.yml) and look for the `url` property that specifies the location for the latest beta installer. Download the installer by constructing a final URL that looks like this: `https://updates.signal.org/desktop/<installer location>`. Then run the installer.
- _macOS:_ First, download [this file](https://updates.signal.org/desktop/beta-mac.yml) and look for the `url` property that specifies the location for the latest beta installer. Download the installer by constructing a final URL that looks like this: `https://updates.signal.org/desktop/<package location>`. Then unzip that package and copy the `.app` file into the `/Applications` folder using Finder.
- _Linux:_ Follow the production instructions to set up the APT repository and run `apt install signal-desktop-beta`.
## Got a question?
@ -20,9 +30,15 @@ Please search for any [existing issues](https://github.com/signalapp/Signal-Desk
Please use our community forum: https://community.signalusers.org/
## Contributing Translations
Interested in helping to translate Signal? Contribute here:
https://www.transifex.com/projects/p/signal-desktop
## Contributing Code
Please see [CONTRIBUTING.md](https://github.com/signalapp/Signal-Desktop/blob/main/CONTRIBUTING.md)
Please see [CONTRIBUTING.md](https://github.com/signalapp/Signal-Desktop/blob/master/CONTRIBUTING.md)
for setup instructions and guidelines for new contributors. Don't forget to sign the [CLA](https://signal.org/cla/).
## Contributing Funds
@ -40,6 +56,6 @@ The form and manner of this distribution makes it eligible for export under the
## License
Copyright 20132022 Signal, a 501c3 nonprofit
Copyright 20132021 Signal, a 501c3 nonprofit
Licensed under the AGPLv3: https://opensource.org/licenses/agpl-3.0

File diff suppressed because it is too large Load Diff

5602
_locales/af/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5602
_locales/bg/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5620
_locales/bn/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5602
_locales/cy/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5602
_locales/eo/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5602
_locales/et/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5602
_locales/fa/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5602
_locales/hi/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5602
_locales/hr/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5624
_locales/is/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5602
_locales/km/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5620
_locales/kn/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5602
_locales/ku/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5602
_locales/lo/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5602
_locales/lt/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5602
_locales/mk/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5602
_locales/mr/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5624
_locales/nn/messages.json Normal file

File diff suppressed because it is too large Load Diff

5602
_locales/no/messages.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More