Skip to content

Commit

Permalink
Merge pull request #867 from loki-project/clearnet
Browse files Browse the repository at this point in the history
Preparation for v1.0.2
  • Loading branch information
vincentbavitz committed Feb 17, 2020
2 parents 7e68bc8 + 292100c commit 50280a9
Show file tree
Hide file tree
Showing 50 changed files with 1,099 additions and 655 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = {
// high value as a buffer to let Prettier control the line length:
code: 999,
// We still want to limit comments as before:
comments: 90,
comments: 150,
ignoreUrls: true,
ignoreRegExpLiterals: true,
},
Expand Down
29 changes: 10 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,22 @@
# Session

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

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/).
# Session Desktop

## Summary

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 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).

**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 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 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).
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 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 [Session Whitepaper](https://getsession.org/whitepaper).
<br/><br/>
![DesktopSession](https://i.imgur.com/ZnHvYjo.jpg)

## 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.
Please search for any [existing issues](https://github.com/loki-project/session-desktop/issues) that describe your bugs in order to avoid duplicate submissions. <br><br>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 [BUILDING.md](BUILDING.md).

## License

Copyright 2018- Current, Loki Foundation
Copyright 2014-2018, Open Whisper Systems
Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html
Copyright 2011 Whisper Systems<br/>
Copyright 2013-2017 Open Whisper Systems<br/>
Copyright 2019-2020 The Loki Project<br/>
Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html<br/>
68 changes: 52 additions & 16 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@
"message": "You don't have any messages, yet."
},
"noMessagesSubtitle": {
"message": "Would you like to join Session's public chat?"
"message": "Would you like to join Session's open group?"
},
"pairNewDevice": {
"message": "Pair New Device"
Expand Down Expand Up @@ -1011,6 +1011,9 @@
"showPairingWordsTitle": {
"message": "Pairing Secret Words"
},
"secretPrompt": {
"message": "Here is your secret"
},
"confirmUnpairingTitle": {
"message": "Please confirm you want to unpair the following device:"
},
Expand Down Expand Up @@ -1705,7 +1708,7 @@
}
},
"timerOption_0_seconds": {
"message": "off",
"message": "Off",
"description":
"Label for option to turn off message expiration in the timer menu"
},
Expand Down Expand Up @@ -2128,7 +2131,7 @@
},
"banUser": {
"message": "Ban User",
"description": "Ban user from public chat by public key."
"description": "Ban user from open group by public key."
},
"banUserConfirm": {
"message": "Are you sure you want to ban user?",
Expand Down Expand Up @@ -2201,19 +2204,23 @@
"message": "Edit Profile",
"description": "Button action that the user can click to edit their profile"
},
"editGroupName": {
"message": "Edit group name",
"description": "Button action that the user can click to edit a group name"
},
"createGroupDialogTitle": {
"message": "Creating a Private Group Chat",
"message": "Creating a Closed Group",
"description": "Title for the dialog box used to create a new private group"
},
"updateGroupDialogTitle": {
"message": "Updating a Private Group Chat",
"message": "Updating a Closed Group",
"description":
"Title for the dialog box used to update an existing private group"
},
"updatePublicGroupDialogTitle": {
"message": "Updating a Public Chat Channel",
"message": "Updating a open group Channel",
"description":
"Title for the dialog box used to update an existing public chat channel"
"Title for the dialog box used to update an existing open group channel"
},
"showSeed": {
"message": "Show Seed",
Expand Down Expand Up @@ -2404,7 +2411,7 @@
"message": "Failed to connect to server. Check URL"
},
"connectToServerSuccess": {
"message": "Successfully connected to new public chat server"
"message": "Successfully connected to new open group server"
},
"setPasswordFail": {
"message": "Failed to set password"
Expand Down Expand Up @@ -2481,9 +2488,6 @@
"message": "Profile name cannot be empty",
"description": "Error message displayed on empty profile name"
},
"maxGroupMembersError": {
"message": "Max number of members for small group chats is: "
},
"nonAdminDeleteMember": {
"message": "Only group admin can remove members!"
},
Expand Down Expand Up @@ -2526,6 +2530,9 @@
"noFriendsToAdd": {
"message": "No friends to add"
},
"noMembersInThisGroup": {
"message": "No other members in this group"
},
"noModeratorsToRemove": {
"message": "no moderators to remove"
},
Expand Down Expand Up @@ -2606,14 +2613,11 @@
},
"ByUsingThisService...": {
"message":
"By using this service, you agree to our <a href=\"https://getsession.org/privacy-policy/\">Terms and Conditions</a> and <a href=\"https://getsession.org/privacy-policy/\" target=\"_blank\">Privacy Statement</a>"
"By using this service, you agree to our <a href=\"https://getsession.org/legal/#tos\">Terms of Service</a> and <a href=\"https://getsession.org/privacy-policy/\" target=\"_blank\">Privacy Policy</a>"
},
"beginYourSession": {
"message": "Begin<br />your<br />Session."
},
"welcomeToSession": {
"message": "Welcome to Session"
},
"welcomeToYourSession": {
"message": "Welcome to your Session"
},
Expand All @@ -2626,6 +2630,9 @@
"newSession": {
"message": "New Session"
},
"freindRequestsButton": {
"message": "Requests"
},
"searchForAKeyPhrase": {
"message": "Search for a key phrase or contact"
},
Expand Down Expand Up @@ -2767,7 +2774,7 @@
"message": "Join Open Group"
},
"joinPublicChat": {
"message": "Join Public Chat"
"message": "Join open group"
},
"next": {
"message": "Next"
Expand All @@ -2789,5 +2796,34 @@
},
"devicePairedSuccessfully": {
"message": "Device linked successfully"
},
"invalidGroupName": {
"message": "Group Name length must be between 1 to $maxSize$",
"description": "Error message displayed on invalid group name",
"placeholders": {
"maxSize": {
"content": "$1",
"example": "125"
}
}
},
"invalidGroupSize": {
"message": "Closed Group size must be between 1 to $maxSize$",
"description": "Error message displayed on invalid closed group size",
"placeholders": {
"maxSize": {
"content": "$1",
"example": "10"
}
}
},
"maxGroupMembersError": {
"message": "Max number of members for small group chats is $maxSize$",
"placeholders": {
"maxSize": {
"content": "$1",
"example": "10"
}
}
}
}
4 changes: 2 additions & 2 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
<div class='commitHash'></div>
<div class='environment'></div>
<div>
<a href="https://loki.network">loki.network</a>
<a href="https://getsession.org">loki.network</a>
</div>
<br>
<div>
<a class="privacy" href="https://loki.network">Terms &amp; Privacy Policy</a>
<a class="privacy" href="https://getsession.org">Terms &amp; Privacy Policy</a>
</div>

<script type='text/javascript' src='node_modules/jquery/dist/jquery.js'></script>
Expand Down
71 changes: 0 additions & 71 deletions background.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
</script>

<script type='text/x-tmpl-mustache' id='two-column'>
<div id='session-toast-container'></div>
<div id='session-confirm-container'></div>
<div class='gutter'>
<div class='network-status-container'></div>
<div class='left-pane-placeholder'></div>
Expand Down Expand Up @@ -156,75 +154,6 @@ <h4>{{ title }}</h4>
</div>
</div>
</script>
<script type='text/x-tmpl-mustache' id='password-change-dialog'>
<div class="content">
{{ #title }}
<h4>{{ title }}</h4>
{{ /title }}
<input type='password' id='old-password' placeholder='Old password' autofocus>
<input type='password' id='new-password' placeholder='New password' autofocus>
<input type='password' id='new-password-confirmation' placeholder='Type in your new password again' autofocus>
<div class='error'></div>
<div class='buttons'>
<button class='cancel' tabindex='2'>{{ cancel }}</button>
<button class='ok' tabindex='1'>{{ ok }}</button>
</div>
</div>
</script>
<script type='text/x-tmpl-mustache' id='nickname-dialog'>
<div class="content">
{{ #title }}
<h4>{{ title }}</h4>
{{ /title }}
<input type='text' name='name' class='name' placeholder='Type a name' autofocus maxlength='25'>
{{ #message }}
<div class='message'>{{ message }}</div>
{{ /message }}
<div class='buttons'>
<button class='cancel' tabindex='2'>{{ cancel }}</button>
<button class='ok' tabindex='1'>{{ ok }}</button>
</div>
</div>
</script>

<script type='text/x-tmpl-mustache' id='device-pairing-words-dialog'>
<div class="content">
<h4>{{ title }}</h4>
<p>{{ secretWords }}</p>
<button id='close'>{{ closeText }}</button>
</div>
</script>

<script type='text/x-tmpl-mustache' id='connecting-to-server-template'>
<div class="content">
{{ #title }}
<h4>{{ title }}</h4>
{{ /title }}
<div class='buttons'>
<button class='cancel' tabindex='2'>{{ cancel }}</button>
</div>
</div>
</script>
<script type='text/x-tmpl-mustache' id='add-server-template'>
<div class="content">
{{ #title }}
<h4>{{ title }}</h4>
{{ /title }}
<input type='text' id='server-url' placeholder='Server Url' autofocus>
<div class='error'></div>
<div class='buttons'>
<button class='cancel' tabindex='2'>{{ cancel }}</button>
<button class='ok' tabindex='1'>{{ ok }}</button>
</div>
</div>
</script>
<script type='text/x-tmpl-mustache' id='qr-code-template'>
<div class="content">
<div id="qr">
</div>
<button class='ok' tabindex='1'>{{ ok }}</button>
</div>
</script>
<script type='text/x-tmpl-mustache' id='identicon-svg'>
<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'>
<circle cx='50' cy='50' r='40' fill='{{ color }}' />
Expand Down
13 changes: 9 additions & 4 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@

window.confirmationDialog = params => {
const confirmDialog = new Whisper.SessionConfirmView({
el: $('#session-confirm-container'),
el: $('body'),
title: params.title,
message: params.message,
messageSub: params.messageSub || undefined,
Expand Down Expand Up @@ -969,7 +969,7 @@
window.toasts.set(
toastID,
new Whisper.SessionToastView({
el: $('#session-toast-container'),
el: $('body'),
})
);

Expand Down Expand Up @@ -1135,9 +1135,14 @@
}
});

Whisper.events.on('updateGroup', async groupConvo => {
Whisper.events.on('updateGroupName', async groupConvo => {
if (appView) {
appView.showUpdateGroupDialog(groupConvo);
appView.showUpdateGroupNameDialog(groupConvo);
}
});
Whisper.events.on('updateGroupMembers', async groupConvo => {
if (appView) {
appView.showUpdateGroupMembersDialog(groupConvo);
}
});

Expand Down
4 changes: 3 additions & 1 deletion js/modules/loki_app_dot_net_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,9 @@ class LokiAppDotNetServerAPI {
`serverRequest ${mode} error`,
e.code,
e.message,
`json: ${txtResponse}`, 'attempting connection to', url
`json: ${txtResponse}`,
'attempting connection to',
url
);
} else {
log.info(
Expand Down
5 changes: 2 additions & 3 deletions js/modules/metadata/SecretSessionCipher.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ SecretSessionCipher.prototype = {

// private byte[] decrypt(UnidentifiedSenderMessageContent message)
_decryptWithUnidentifiedSenderMessage(message) {
const { SessionCipher } = this;
const signalProtocolStore = this.storage;

const sender = new libsignal.SignalProtocolAddress(
Expand All @@ -485,12 +484,12 @@ SecretSessionCipher.prototype = {

switch (message.type) {
case CiphertextMessage.WHISPER_TYPE:
return new SessionCipher(
return new libloki.crypto.LokiSessionCipher(
signalProtocolStore,
sender
).decryptWhisperMessage(message.content);
case CiphertextMessage.PREKEY_TYPE:
return new SessionCipher(
return new libloki.crypto.LokiSessionCipher(
signalProtocolStore,
sender
).decryptPreKeyWhisperMessage(message.content);
Expand Down

0 comments on commit 50280a9

Please sign in to comment.