Compare commits
8 commits
Author | SHA1 | Date | |
---|---|---|---|
d3c07e19b8 | |||
6b6a25f28a | |||
d2b779540b | |||
3dda921db2 | |||
|
a9c0e7592e | ||
|
8ceb715798 | ||
|
558b2dff35 | ||
|
c91a1c105b |
10 changed files with 477 additions and 538 deletions
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
|
@ -1 +1,2 @@
|
|||
github: [hexagon]
|
||||
ko_fi: hexagon_56k
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
FROM node:16-alpine
|
||||
FROM keymetrics/pm2:16-alpine
|
||||
COPY . /usr/src/app
|
||||
WORKDIR /usr/src/app
|
||||
RUN npm install --no-cache
|
||||
RUN npm install --no-cache --production
|
||||
EXPOSE 8080
|
||||
RUN chmod +x /usr/src/app/docker-entrypoint.sh
|
||||
ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh", "npm", "start"]
|
||||
CMD [ "pm2-runtime", "start", "pm2.json" ]
|
||||
|
|
274
README.md
274
README.md
|
@ -1,137 +1,137 @@
|
|||

|
||||
|
||||

|
||||
[](https://badge.fury.io/js/cryptalk)
|
||||
[](LICENSE.md)
|
||||
[](https://www.codacy.com/gh/Hexagon/cryptalk/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Hexagon/cryptalk&utm_campaign=Badge_Grade)
|
||||
|
||||
# Cryptalk
|
||||
|
||||
Cyptalk is a HTML5/Node.js based, client side (E2EE) encrypted instant chat
|
||||
|
||||
## Features
|
||||
|
||||
* Client side AES-256-CBC encryption/decryption (the server is just a messenger)
|
||||
* 256 bit key derived from your passphrase using PBKDF2
|
||||
* Messages torched after a configurable delay, default is 600s.
|
||||
* Simple setup using npm, Docker or Heroku
|
||||
* Notification sounds (mutable)
|
||||
* Native popup notifications
|
||||
* Configurable page title
|
||||
* Nicknames, optional.
|
||||
* Quick-links using http://server/#Room:Passphrase, optional and insecure
|
||||
|
||||
## Installing
|
||||
|
||||
### Docker setup
|
||||
|
||||
To run latest cryptalk with docker, exposed on host port 80, simply run the following command to pull it from docker hub
|
||||
|
||||
```bash
|
||||
sudo docker run -d --restart=always -p 80:8080 hexagon/cryptalk
|
||||
```
|
||||
|
||||
### Heroku setup
|
||||
|
||||
Click the button below
|
||||
|
||||
[](https://heroku.com/deploy?template=https://github.com/hexagon/cryptalk)
|
||||
|
||||
### Docker setup without using docker hub
|
||||
|
||||
Clone this repo, enter the new directory.
|
||||
|
||||
Build image
|
||||
```bash
|
||||
docker build . --tag="hexagon/cryptalk"
|
||||
```
|
||||
|
||||
Run container, enable start on boot, expose to port 80 at host
|
||||
```bash
|
||||
sudo docker run -d --restart=always -p 80:8080 hexagon/cryptalk
|
||||
```
|
||||
|
||||
Browse to ```http://<ip-of-server>/```
|
||||
|
||||
Done!
|
||||
|
||||
### npm setup
|
||||
|
||||
Install node.js, exact procedure is dependant on platform and distribution.
|
||||
|
||||
Install the app from npm
|
||||
```bash
|
||||
npm install cryptalk -g
|
||||
````
|
||||
|
||||
Then issue the following to start the app
|
||||
|
||||
```bash
|
||||
cryptalk
|
||||
```
|
||||
|
||||
Browse to ```http://localhost:8080```
|
||||
|
||||
Done!
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
|
||||
Available commands:
|
||||
|
||||
Client:
|
||||
/key StrongPassphrase Sets encryption key
|
||||
/nick NickName Sets an optional nick
|
||||
/mute Audio on
|
||||
/unmute Audio off
|
||||
/clear Clear on-screen buffer
|
||||
/help This
|
||||
/title Set your local page title
|
||||
/torch AfterSeconds Console messages are torched
|
||||
after this amount of seconds
|
||||
(default 600).
|
||||
|
||||
Room:
|
||||
/join RoomId Join a room
|
||||
/leave Leave the room
|
||||
/count Count participants
|
||||
|
||||
Host:
|
||||
/connect Connect to host
|
||||
/disconnect Disconnect from host
|
||||
|
||||
You can select any of the five last commands/messages with up/down key.
|
||||
|
||||
Due to security reasons, /key command is not saved, and command
|
||||
history is automatically cleared after one minute of inactivity.
|
||||
|
||||
It is highly recommended to use incognito mode while chatting,
|
||||
to prevent browsers from keeping history or cache.
|
||||
|
||||
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Install node.js (development require >=12.0), exact procedure is dependant on platform and distribution.
|
||||
|
||||
Clone this repo
|
||||
```bash
|
||||
git clone https://github.com/Hexagon/cryptalk.git
|
||||
cd cryptalk
|
||||
```
|
||||
|
||||
Pull dependencies from npm
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
Start server
|
||||
```bash
|
||||
npm run start
|
||||
```
|
||||
|
||||
Browse to ```http://localhost:8080```
|
||||
|
||||
To work on the JavaScript, edit the code in ```client/source/```. To test the changes, first run ```npm run build``` to lint, build and minify the code. Then restart the server.
|
||||

|
||||
|
||||

|
||||
[](https://badge.fury.io/js/cryptalk)
|
||||
[](LICENSE.md)
|
||||
[](https://www.codacy.com/gh/Hexagon/cryptalk/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Hexagon/cryptalk&utm_campaign=Badge_Grade)
|
||||
|
||||
# Cryptalk
|
||||
|
||||
Cyptalk is a HTML5/Node.js based, client side (E2EE) encrypted instant chat
|
||||
|
||||
## Features
|
||||
|
||||
* Client side AES-256-CBC encryption/decryption (the server is just a messenger)
|
||||
* 256 bit key derived from your passphrase using PBKDF2
|
||||
* Messages torched after a configurable delay, default is 600s.
|
||||
* Simple setup using npm, Docker or Heroku
|
||||
* Notification sounds (mutable)
|
||||
* Native popup notifications
|
||||
* Configurable page title
|
||||
* Nicknames, optional.
|
||||
* Quick-links using http://server/#Room:Passphrase, optional and insecure
|
||||
|
||||
## Installing
|
||||
|
||||
### Docker setup
|
||||
|
||||
To run latest cryptalk with docker, exposed on host port 80, simply run the following command to pull it from docker hub
|
||||
|
||||
```bash
|
||||
sudo docker run -d --restart=always -p 80:8080 hexagon/cryptalk
|
||||
```
|
||||
|
||||
### Heroku setup
|
||||
|
||||
Click the button below
|
||||
|
||||
[](https://heroku.com/deploy?template=https://github.com/hexagon/cryptalk)
|
||||
|
||||
### Docker setup without using docker hub
|
||||
|
||||
Clone this repo, enter the new directory.
|
||||
|
||||
Build image
|
||||
```bash
|
||||
docker build . --tag="hexagon/cryptalk"
|
||||
```
|
||||
|
||||
Run container, enable start on boot, expose to port 80 at host
|
||||
```bash
|
||||
sudo docker run -d --restart=always -p 80:8080 hexagon/cryptalk
|
||||
```
|
||||
|
||||
Browse to ```http://<ip-of-server>/```
|
||||
|
||||
Done!
|
||||
|
||||
### npm setup
|
||||
|
||||
Install node.js, exact procedure is dependant on platform and distribution.
|
||||
|
||||
Install the app from npm
|
||||
```bash
|
||||
npm install cryptalk -g
|
||||
````
|
||||
|
||||
Then issue the following to start the app
|
||||
|
||||
```bash
|
||||
cryptalk
|
||||
```
|
||||
|
||||
Browse to ```http://localhost:8080```
|
||||
|
||||
Done!
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
|
||||
Available commands:
|
||||
|
||||
Client:
|
||||
/key StrongPassphrase Sets encryption key
|
||||
/nick NickName Sets an optional nick
|
||||
/mute Audio on
|
||||
/unmute Audio off
|
||||
/clear Clear on-screen buffer
|
||||
/help This
|
||||
/title Set your local page title
|
||||
/torch AfterSeconds Console messages are torched
|
||||
after this amount of seconds
|
||||
(default 600).
|
||||
|
||||
Room:
|
||||
/join RoomId Join a room
|
||||
/leave Leave the room
|
||||
/count Count participants
|
||||
|
||||
Host:
|
||||
/connect Connect to host
|
||||
/disconnect Disconnect from host
|
||||
|
||||
You can select any of the five last commands/messages with up/down key.
|
||||
|
||||
Due to security reasons, /key command is not saved, and command
|
||||
history is automatically cleared after one minute of inactivity.
|
||||
|
||||
It is highly recommended to use incognito mode while chatting,
|
||||
to prevent browsers from keeping history or cache.
|
||||
|
||||
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Install node.js (development require >=12.0), exact procedure is dependant on platform and distribution.
|
||||
|
||||
Clone this repo
|
||||
```bash
|
||||
git clone https://github.com/Hexagon/cryptalk.git
|
||||
cd cryptalk
|
||||
```
|
||||
|
||||
Pull dependencies from npm
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
Start server
|
||||
```bash
|
||||
npm run start
|
||||
```
|
||||
|
||||
Browse to ```http://localhost:8080```
|
||||
|
||||
To work on the JavaScript, edit the code in ```client/source/```. To test the changes, first run ```npm run build``` to lint, build and minify the code. Then restart the server.
|
||||
|
|
2
client/public/js/cryptalk.min.js
vendored
2
client/public/js/cryptalk.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,42 +1,34 @@
|
|||
export default {
|
||||
|
||||
title: 'Cryptalk - Online',
|
||||
|
||||
ttl: 600000,
|
||||
|
||||
motd: '<pre>\n\n' +
|
||||
'▄████▄ ██▀███ ▓██ ██▓ ██▓███ ▄▄▄█████▓ ▄▄▄ ██▓ ██ ▄█▀ \n' +
|
||||
'▒██▀ ▀█ ▓██ ▒ ██▒▒██ ██▒▓██░ ██▒▓ ██▒ ▓▒▒████▄ ▓██▒ ██▄█▒ \n' +
|
||||
'▒▓█ ▄ ▓██ ░▄█ ▒ ▒██ ██░▓██░ ██▓▒▒ ▓██░ ▒░▒██ ▀█▄ ▒██░ ▓███▄░ \n' +
|
||||
'▒▓▓▄ ▄██▒▒██▀▀█▄ ░ ▐██▓░▒██▄█▓▒ ▒░ ▓██▓ ░ ░██▄▄▄▄██ ▒██░ ▓██ █▄ \n' +
|
||||
'▒ ▓███▀ ░░██▓ ▒██▒ ░ ██▒▓░▒██▒ ░ ░ ▒██▒ ░ ▓█ ▓██▒░██████▒▒██▒ █▄ \n' +
|
||||
'░ ░▒ ▒ ░░ ▒▓ ░▒▓░ ██▒▒▒ ▒▓▒░ ░ ░ ▒ ░░ ▒▒ ▓▒█░░ ▒░▓ ░▒ ▒▒ ▓▒ \n' +
|
||||
' ░ ▒ ░▒ ░ ▒░▓██ ░▒░ ░▒ ░ ░ ▒ ▒▒ ░░ ░ ▒ ░░ ░▒ ▒░ \n' +
|
||||
'░ ░░ ░ ▒ ▒ ░░ ░░ ░ ░ ▒ ░ ░ ░ ░░ ░ \n' +
|
||||
'░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ \n' +
|
||||
'░ ░ ░ \n' +
|
||||
' https://github.com/hexagon/cryptalk \n' +
|
||||
' \n' +
|
||||
' Tip of the day: /help \n' +
|
||||
'----------------------------------------------------------------------' +
|
||||
'</pre>',
|
||||
|
||||
nick: {
|
||||
maxLen: 20,
|
||||
minLen: 2,
|
||||
},
|
||||
|
||||
key: {
|
||||
maxLen: 1024,
|
||||
minLen: 8,
|
||||
},
|
||||
|
||||
room: {
|
||||
minLen: 1,
|
||||
maxLen: 64
|
||||
},
|
||||
|
||||
notifications: {
|
||||
maxOnePerMs: 3000
|
||||
}
|
||||
};
|
||||
export default {
|
||||
|
||||
title: 'Claytonia Chat',
|
||||
|
||||
ttl: 600000,
|
||||
|
||||
motd: '<pre>\n\n' +
|
||||
' Welcome to Claytonia Chat \n' +
|
||||
' Tip of the day: /help \n' +
|
||||
' Public Room: /join Claytonia \n' +
|
||||
' Public Key: /key Claytonia \n' +
|
||||
' Everyone in the room must have the same key to decrypt messages. \n' +
|
||||
'----------------------------------------------------------------------' +
|
||||
'</pre>',
|
||||
|
||||
nick: {
|
||||
maxLen: 20,
|
||||
minLen: 2,
|
||||
},
|
||||
|
||||
key: {
|
||||
maxLen: 1024,
|
||||
minLen: 8,
|
||||
},
|
||||
|
||||
room: {
|
||||
minLen: 1,
|
||||
maxLen: 64
|
||||
},
|
||||
|
||||
notifications: {
|
||||
maxOnePerMs: 3000
|
||||
}
|
||||
};
|
||||
|
|
17
cryptalk.service
Normal file
17
cryptalk.service
Normal file
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Cryptalk Node.js App
|
||||
Documentation=https://github.com/Hexagon/cryptalk
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/npm run start
|
||||
WorkingDirectory=/home/cryptochat/cryptalk
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
Environment=NODE_ENV=production
|
||||
Environment=PATH=/usr/bin
|
||||
User=cryptochat
|
||||
Group=cryptochat
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,11 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# /usr/src/app/external-public kan be mounted as a volume on host to expose
|
||||
# statics to be hosted by host nginx
|
||||
if [ -d /usr/src/app/external-public ]; then
|
||||
cp -R /usr/src/app/client/public/* /usr/src/app/external-public/
|
||||
fi
|
||||
|
||||
exec "$@"
|
614
package-lock.json
generated
614
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cryptalk",
|
||||
"version": "1.2.6",
|
||||
"version": "1.2.9",
|
||||
"description": "Encrypted HTML5/Node.JS instant chat",
|
||||
"main": "server/server.js",
|
||||
"preferGlobal": true,
|
||||
|
|
11
pm2.json
Normal file
11
pm2.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "cryptalk",
|
||||
"script": "server/server.js",
|
||||
"instances": "1",
|
||||
"env": {
|
||||
"NODE_ENV": "development"
|
||||
},
|
||||
"env_production" : {
|
||||
"NODE_ENV": "production"
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue