Skip to content

Commit

Permalink
Session v1.0 changes (#802)
Browse files Browse the repository at this point in the history
* correct typo in readme

* include log

* decrypt file server response, remove debug, handle crypt before _sendToProxy, improve json parsing failure logging

* support file uploads on file proxy, fix _sendToProxy calling

* bump form-data to 3.0

* initial refactor of feaure flag detection statements in serverRequest()

* fix  send-message line-height with multiple lines

* fix lint

* fix position of delete account modal

* Profile picture upload, fixes and copy

* Various changes suggested by redesign overview

* Scrolling button updated and animations to modals

* Display subscriber count for open chats

* Prevent illegal username and passwords

* Delete channel / group merge

* Solidification of minor changes w appview injections

* hide description field in group panel for now

* fix join publicgroups pulls

* increase min height respecting ratio

* allow space inside a display name but not at start or end

* fix height of leftpane overlay view

* add back typing indicator and read receipt setting under privacy

* Auto-focus new open chat input box

* Password lock screen and delete data screen

* touchups

* Resolving Bilb revisions

* Disable link previews as default per Kee on signup

* remove date, we have git

* add missing semicolon

* _sendToProxy pass headers/handle response refactor, lint

* fix my yarn conflict/resolve

* include IV in server response

* Sealed sender support

* Support sealed sender for friend requests

* fix lint

* Remove unused destinationRegistrationId; lint

* Update messages.json

* pull RSS through file proxy

* fix unit tests: remove not used count in scrolldown view and assert svg
present

* Disable auto-joining default loki open groups

* session-id-editable-textarea

* fix the textscramble for sessionID on registration

* speed up lint, add lint-full/format-full, make sure use lint-full

* add skipToken to establishConnection options, smuggle out secureRpcPubKey

* get latest version through snode proxy, remove clearfix from ExpiredAlertBanner

* expose semver and LokiAppDotNetServerAPI because we can't get ourKey from storage early enough

* update note

* fix upgrade link, wrap expiredWarning in span for styling, use br to clear the float, trim trailing whitespace

* designalify

* designalify

* designalify user agent

* continue designalification

* make expired banner legible

* remove ugly TLS hack

* disable unauthorization rejection when making https requests limited to lokiRpc

* Update main.js

Aspect ratio amendment

* Constants rework

* local commit

* event listeners

* address missing comma for lint

* fix header sessions message section

* fix profile image size conversation list with pending friend request

* textarea centering

* refresh files in group in group panel

* Looking into keyboard navigation

* Remove P2P

* cache eslint on `lint` but not `ready`

* Cleanup media view formatting

* force locale to be EN until our files are updated and translated

* Simplification of keyup

* Updated all icon references

* SASS fixup

* fix disabled state of message input on sent friendrequest

* trim pubkey when user can enter one to remove whitespaces

* remove lZ in path which fixes errors on svg and does not alter rendering

* fix text scramble animation on registration

* reload app on ctrl-r or f5 from anywhere

* add back file which should have not been deleted

* fix lint and clean code

* fix lint

* add .loki to have a self-signed cert

* Remove mixpanel

* use local shortcut instead of global shortcut

otherwise, ctrl+r is only caught bu the last loaded instance

* open the conversation when accepting a friend request

also, it does what is needed to show the new friend in the friend list

* make sure token comms are done over fileProxy, other notes, logging adjustment

* leftpane sections titles are Wasa bold

* minor refactor

* onboarding messageview

* linter

* fix padding buttons overlay

* do not render session-id-editable border when textarea disabled

* textarea sessionID SpaceMono font

* various touchups

* fix font of description to sfprodisplay

* reduce triple dots conversation header icon size

* reduce size of conversationHeader title font size

* fix font for session-search-input

* make conversationlistitem title font wasa

* fix green and white border under title in leftpane

* fix panel-text-divider font-size and family

* disable completely borders for profile images

* make profile image which where 48pixels big 36 noew, as no more border

* Complete conditional message onboarding

* cache file deletions

* Link preview warning on setting toggle

* Messages.json amendments

* Join channel generalisation

* Localise global vars

* remove eslintcache

* rm global launchcount

* Remove source field from envelope

* Session public chat icon

* CLosed groups ui initial listprops

* Desktop: enable useSnodeProxy feature flag

* file proxy needs to be able to talk to snode

- disable TLS check for fileProxy
- lokiHttpsAgent => snodeHttpsAgent (since we use for two different things now)

* enable useSealedSender too per Maxim

* lint

* lint

* window.extension.expiredPromise version

* better error checking

* use promise version to see if we're expired

* fix typo

* lint

* put back seemingly now required process.env.NODE_TLS_REJECT_UNAUTHORIZED

* fix querystring in file-proxy

* lint

* fix typo

* Remove more references to signal.org

* make sure TLS is forced on open groups, improve serverRequest error message

* Closed groups UI

* function params changes

* turn off snode proxy logging

* include useful info on error

* actually validate URL before starting up a bunch of timers

* Closed groups overlay integration

* move comments from connecting_to_server_dialog_view

* use attempt from window object to reduce code duplication

* refactor out validServer()

* lint

* lint caught typo

* Rename BACKGROUND_FRIEND_REQUEST to SESSION_REQUEST.
Don't trigger friend request logic if a message is aimed at a group.

* Linting

* Closed group joining completed w/o backend

* Fix friend request messages being sent to users you don't have a session in closed groups.
Disable typing messages and read receipts in groups.
Send out session request messages if you don't have a session with a member in the group.

* Remove unneeded boolean condition.

* Closed group update message stylgin

* constants renaming

* Message deletion fix

* gruntify

* fix grunt error

* expose isRss, don't close uncloseable Rss conversation on deleteMessages

* remove copyId and block user on RSS feeds

* remove options from RSS feed that don't make any sense and don't work

* fix grunt error

* squelch RSS duplicate messages

* extension.expiredStatus(), adjustable timers, improve guards

* allowing sending of messages if we're still waiting to hear back

* markRandomNodeUnreachable() refactor, notes/logging

* improve logging

* improve logging

* no need to validate empty token, support lokinet/getession file domains, mark broken snodes as bad, improve logging

* try to address travis-osx lint complaints

* not designed to have a period at the end of titleIsNow

* put period back at the end

* Catch a stray loki messenger

* fix stray loki messenger

* loki messenger isnt a thing

* lint

* Fix open group joining.

* guards incase there are no members yet, fixes dialog not showing up

* fixed file server holding up message sender init.
fix joining closed groups.

* Clean

* Don't wait for file server to return tokens when establishing home connection.

* Disable join public chat prompt

Co-authored-by: Audric Ackermann <[email protected]>
Co-authored-by: Ryan Tharp <[email protected]>
Co-authored-by: Vince <[email protected]>
Co-authored-by: Maxim Shishmarev <[email protected]>
  • Loading branch information
5 people committed Feb 6, 2020
1 parent c841c93 commit 625fe0f
Show file tree
Hide file tree
Showing 522 changed files with 123,042 additions and 14,535 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dist/**
mnemonic_languages/**

# Generated files
js/curve/*
js/components.js
js/libtextsecure.js
js/libloki.js
Expand Down
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ module.exports = {
},
],

// Enforce curlies always
curly: ['error', 'all'],
'brace-style': ['error', '1tbs'],

// prevents us from accidentally checking in exclusive tests (`.only`):
'mocha/no-exclusive-tests': 'error',

Expand All @@ -45,7 +49,7 @@ module.exports = {
quotes: [
'error',
'single',
{ avoidEscape: true, allowTemplateLiterals: false },
{ avoidEscape: true, allowTemplateLiterals: true },
],

// Prettier overrides:
Expand All @@ -61,6 +65,7 @@ module.exports = {
// We still want to limit comments as before:
comments: 90,
ignoreUrls: true,
ignoreRegExpLiterals: true,
},
],
},
Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
Expand All @@ -17,6 +16,7 @@ Steps to reproduce the behavior:
If applicable, add screenshots or log files to help explain your problem.

**Other information (please complete the following information):**
- Device: [e.g. PC, Mac]
- OS: [e.g. Ubuntu 16.04, Windows 10]
- Loki messenger Version or Git commit hash:

* Device: [e.g. PC, Mac]
* OS: [e.g. Ubuntu 16.04, Windows 10]
* Session Version or Git commit hash:
36 changes: 36 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--
Thanks for contributing to the project!
Please help us keep this project in good shape by going through this checklist.
Replace the empty checkboxes [ ] below with checked ones [X] as they are completed
Remember, you can preview this before saving it.
-->

<!-- You can remove this first section if you have contributed before -->

### First time contributor checklist:

* [ ] I have read the [README](https://github.com/loki-project/loki-messenger/blob/master/README.md) and [Contributor Guidelines](https://github.com/loki-project/loki-messenger/blob/master/CONTRIBUTING.md)

### Contributor checklist:

* [ ] My commits are in nice logical chunks with [good commit messages](http://chris.beams.io/posts/git-commit/)
* [ ] My changes are [rebased](https://medium.freecodecamp.org/git-rebase-and-the-golden-rule-explained-70715eccc372) on the latest [`clearnet`](https://github.com/loki-project/loki-messenger/tree/development) branch
* [ ] A `yarn ready` run passes successfully ([more about tests here](https://github.com/loki-project/loki-messenger/blob/master/CONTRIBUTING.md#tests))
* [ ] My changes are ready to be shipped to users

### Description

<!--
Describe briefly what your pull request changes. Focus on the value provided to users.
Does it address any outstanding issues in this project?
https://github.com/loki-project/loki-messenger/issues?utf8=%E2%9C%93&q=is%3Aissue
Reference an issue with the hash symbol: "#222"
If you're fixing it, use something like "Fixes #222"
Please write a summary of your test approach:
- What kind of manual testing did you do?
- Did you write any new tests?
- What operating systems did you test with? (please use specific versions: http://whatsmyos.com/)
- What other devices did you test with? (other Desktop devices, Android, Android Simulator, iOS, iOS Simulator)
-->
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
.sass-cache
.eslintcache
coverage/*
build/curve25519_compiled.js
build/icons/*
Expand Down Expand Up @@ -30,3 +31,9 @@ test/test.js
# React / TypeScript
ts/**/*.js
ts/protobuf/*.d.ts

# Swapfiles
**/*.swp

# Ctags
tags
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ linux:
- yarn install --frozen-lockfile
- export SIGNAL_ENV=production
- yarn generate
- $(yarn bin)/build --config.extraMetadata.environment=$SIGNAL_ENV --config.mac.bundleVersion='$CI_COMMIT_REF_SLUG' --publish=never --config.directories.output=release
- $(yarn bin)/electron-builder --config.extraMetadata.environment=$SIGNAL_ENV --config.mac.bundleVersion='$CI_COMMIT_REF_SLUG' --publish=never --config.directories.output=release
cache:
paths:
- node_modules/
Expand All @@ -27,7 +27,7 @@ osx:
- yarn install --frozen-lockfile
- export SIGNAL_ENV=production
- yarn generate
- $(yarn bin)/build --config.extraMetadata.environment=$SIGNAL_ENV --config.mac.bundleVersion='$CI_COMMIT_REF_SLUG' --publish=never --config.directories.output=release
- $(yarn bin)/electron-builder --config.extraMetadata.environment=$SIGNAL_ENV --config.mac.bundleVersion='$CI_COMMIT_REF_SLUG' --publish=never --config.directories.output=release
cache:
paths:
- node_modules/
Expand All @@ -51,7 +51,7 @@ windows:
- call yarn generate
- call node build\grunt.js
- call yarn prepare-beta-build
- call node_modules\.bin\build --config.extraMetadata.environment=%SIGNAL_ENV% --publish=never --config.directories.output=release
- call node_modules\.bin\electron-builder --config.extraMetadata.environment=%SIGNAL_ENV% --publish=never --config.directories.output=release
- call node build\grunt.js test-release:win
cache:
paths:
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ libloki/test/components.js
# Third-party files
node_modules/**
components/**
js/curve/**
js/Mp3LameEncoder.min.js
js/WebAudioRecorderMp3.js
js/libsignal-protocol-worker.js
Expand Down
11 changes: 0 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,3 @@ matrix:
- export LC_ALL=en_US
- name: 'OSX'
os: osx
- name: 'Windows'
os: windows
cache: false
env:
- YARN_GPG=no
before_install:
- cd ../..
- mv $TRAVIS_REPO_SLUG _old
- git config --global core.autocrlf false
- git clone --depth=50 _old $TRAVIS_REPO_SLUG
- cd $TRAVIS_REPO_SLUG
58 changes: 58 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--recursive",
"--exit",
"test/app",
"test/modules",
"ts/test",
"libloki/test/node"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "Launch node Program",
"program": "${file}"
},
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${file}"
},
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}"
},
{
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"env": {
"NODE_APP_INSTANCE": "1"
},
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"args": ["."],
"sourceMaps": true,
"outputCapture": "std"
}
]
}
15 changes: 9 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ yarn install --frozen-lockfile # Install and build dependencies (this will take
yarn grunt # Generate final JS and CSS assets
yarn icon-gen # Generate full set of icons for Electron
yarn test # A good idea to make sure tests run first
yarn start # Start Loki Messenger!
yarn start # Start Session!
```

You'll need to restart the application regularly to see your changes, as there
Expand All @@ -84,16 +84,16 @@ yarn grunt dev # runs until you stop it, re-generating built assets on file chan

## Additional storage profiles

Since there is no registration for Loki Messenger, you can create as many accounts as you
Since there is no registration for Session, you can create as many accounts as you
can public keys. To test the P2P functionality on the same machine, however, requries
that each client binds their message server to a different port.

You can use the following command to start a client bound to a different port.

```
yarn start-multi
```


For more than 2 clients, you can setup additional storage profiles and switch
between them using the `NODE_APP_INSTANCE` environment variable and specifying a
new localServerPort in the config.
Expand Down Expand Up @@ -149,12 +149,15 @@ So you wanna make a pull request? Please observe the following guidelines.
the translations in
[Transifex](https://www.transifex.com/projects/p/signal-desktop).
-->

* First, make sure that your `yarn ready` run passes - it's very similar to what our
Continuous Integration servers do to test the app.
* 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).
<!-- TODO:
Other locales are generated automatically based on that file and then periodically
uploaded to Transifex for translation. -->
<!-- TODO:
Other locales are generated 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 `development` branch, resolving any conflicts.
This ensures that your changes will merge cleanly when you open your PR.
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ module.exports = grunt => {
tasks: ['sass'],
},
transpile: {
files: ['./ts/**/*.ts', './ts/**/*.tsx'],
files: ['./ts/**/*.ts', './ts/**/*.tsx', './ts/**/**/*.tsx'],
tasks: ['exec:transpile'],
},
},
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Loki Messenger
# Session

[![Build Status](https://travis-ci.org/loki-project/loki-messenger.svg?branch=development)](https://travis-ci.org/loki-project/loki-messenger)

Loki Messenger allows for truly decentralized and end to end and private encrypted chats, Loki Messenger is built to handle both online and fully Asynchronous offline messages , Loki messenger implements the Signal protocol for message encryption, Our Client interface is a fork of [Signal Messenger](https://signal.org/). All communication that passes through Loki messenger is routed through [Lokinet](https://github.com/loki-project/loki-network).
Session allows for truly decentralized, end to end, and private encrypted chats. Session is built to handle both online and fully Asynchronous offline messages. Session implements the Signal protocol for message encryption. Our Client interface is a fork of [Signal Messenger](https://signal.org/). All communication that passes through Session is routed through [Lokinet](https://github.com/loki-project/loki-network).

## Summary

Loki messenger integrates directly with Loki Service Nodes, which are a set of distributed, decentralized and Sybil resistant nodes. Service Nodes act as both federated servers which store messages offline, and a set of nodes which allow for onion routing functionality obfuscating users IP Addresses. For a full understanding of how Loki messenger works, read the [Loki whitepaper](https://loki.network/whitepaper)
Session integrates directly with Loki [Service Nodes](https://lokidocs.com/ServiceNodes/SNOverview/), which are a set of distributed, decentralized and Sybil resistant nodes. Service Nodes act as both federated servers which store messages offline, and a set of nodes which allow for onion routing functionality obfuscating users IP Addresses. For a full understanding of how Session works, read the [Loki whitepaper](https://loki.network/whitepaper).

**Online Messages**

If Alice and Bob are both online they can simply resolve each others public keys, to introduction sets, this functionality is handled by interfacing with [Lokinet](https://github.com/loki-project/loki-network). With the appropriate introduction sets Alice and Bob can create a path and using onion routing pass messages through the Loki network without giving away personally identifiable information like their IP address.

**Offline messages**

Offline messaging uses Swarms, given any users public key the user can resolve a public key to a specific grouping of Service Nodes (AKA Swarm) each user in Loki Messenger belongs to a Swarm. When routing a message offline the user selects a Service node in the destination users Swarm, when the user comes online they query any node in their Swarm, if the Swarm is holding any messages for the user they disseminate those messages to the user.
Offline messaging uses Swarms, given any users public key the user can resolve a public key to a specific grouping of Service Nodes (AKA Swarm) each user in Session belongs to a Swarm. When routing a message offline the user selects a Service node in the destination users Swarm, when the user comes online they query any node in their Swarm, if the Swarm is holding any messages for the user they disseminate those messages to the user.

![Swarm Messaging](https://i.imgur.com/o13Knds.png)

Spam protections for Loki Messenger are based on a Proof of Work which is attached to any message that exceeds a default size or Time To Live, this process is discussed further in the [Loki whitepaper](https://loki.network/whitepaper).
Spam protections for Session are based on a Proof of Work which is attached to any message that exceeds a default size or Time To Live, this process is discussed further in the [Loki whitepaper](https://loki.network/whitepaper).

## Want to Contribute? Found a Bug or Have a feature request?

Please search for any [existing issues](https://github.com/loki-project/loki-messenger/issues) that describe your bugs in order to avoid duplicate submissions. Submissions can be made by making a pull request to our development branch, if you don't know where to start contributing , try reading the Github issues page for ideas.

## Build instruction

build instructions can be found in [CONTRIBUTING.md](CONTRIBUTING.md)
Build instructions can be found in [CONTRIBUTING.md](CONTRIBUTING.md).

## License

Expand Down
Loading

0 comments on commit 625fe0f

Please sign in to comment.