diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..395480a7d --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +open_collective: simplex-chat diff --git a/README.md b/README.md index cfd9e96c4..a0d4b9d3a 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ See [simplex-chat](https://github.com/simplex-chat/simplex-chat) terminal UI for ## Using SMP server and SMP agent -You can either run your own SMP server locally or deploy using Linode or DigitalOcean recipe, or try local SMP agent with the deployed demo server: +You can either run your own SMP server locally or deploy using [Linode StackScript](#deploy-smp-server-on-linode), or try local SMP agent with the deployed demo server: `smp1.simplex.im:5223#pLdiGvm0jD1CMblnov6Edd/391OrYsShw+RgdfR0ChA=` @@ -78,17 +78,17 @@ Deployment on [Linode](https://www.linode.com/) is performed via StackScripts, w Please submit an [issue](https://github.com/simplex-chat/simplexmq/issues) if any problems occur. -[digitalocean](TODO) +[linode](https://marketplace.digitalocean.com/apps/simplex-server) ## Deploy SMP server on DigitalOcean -[DigitalOcean](https://cloud.digitalocean.com) operates on the concept of Droplets. Droplet is a unit of deployment instantiated based on a Snapshot. You can deploy SMP server using provided [Snapshot](TODO): +You can deploy SMP server using [SimpleX Server 1-click app](https://marketplace.digitalocean.com/apps/simplex-server) from DigitalOcean marketplace: - Create a DigitalOcean account or login with an already existing one. -- [Create Droplet](https://cloud.digitalocean.com/droplets/new?size=s-1vcpu-1gb®ion=fra1). +- Click 'Create SimpleX server Droplet' button. - Choose the region and plan according to your requirements (cheapest Regular plan should be sufficient). -- Provide [ssh key](https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys-2) and confirm Droplet creation. -- Ssh to created Droplet (`ssh root@`) to get SMP server public key hash - either from the welcome message or from `/etc/opt/simplex/pub_key_hash`. DigitalOcean has a good guide on [how to login to Droplet via ssh](https://docs.digitalocean.com/products/droplets/how-to/connect-with-ssh/). +- Provide ssh key and confirm Droplet creation. +- SSH to created Droplet (`ssh root@`) to get SMP server public key hash - either from the welcome message or from `/etc/opt/simplex/pub_key_hash`. DigitalOcean has a good guide on [how to login to Droplet via ssh](https://docs.digitalocean.com/products/droplets/how-to/connect-with-ssh/). - Great, your own SMP server is ready! Use `ip_address#hash` as SMP server address in the client. Please submit an [issue](https://github.com/simplex-chat/simplexmq/issues) if any problems occur. diff --git a/apps/smp-server/Main.hs b/apps/smp-server/Main.hs index b7e87f703..b71bed5d4 100644 --- a/apps/smp-server/Main.hs +++ b/apps/smp-server/Main.hs @@ -115,6 +115,7 @@ printConfig ServerConfig {serverPrivateKey, storeLog} = do initializeServer :: ServerOpts -> IO ServerConfig initializeServer opts = do + createDirectoryIfMissing False cfgDir ini <- createIni opts pk <- createKey ini storeLog <- openStoreLog opts ini @@ -213,7 +214,6 @@ readKey IniOpts {serverKeyFile} = do createKey :: IniOpts -> IO C.FullPrivateKey createKey IniOpts {serverKeyFile} = do - createDirectoryIfMissing True cfgDir (_, pk) <- C.generateKeyPair newKeySize S.writeKeyFile S.TraditionalFormat serverKeyFile [PrivKeyRSA $ C.rsaPrivateKey pk] pure pk diff --git a/img/digitalocean.png b/img/digitalocean.png new file mode 100644 index 000000000..1eada09c7 Binary files /dev/null and b/img/digitalocean.png differ diff --git a/img/digitalocean.svg b/img/digitalocean.svg deleted file mode 100644 index 30404ce4c..000000000 --- a/img/digitalocean.svg +++ /dev/null @@ -1 +0,0 @@ -TODO \ No newline at end of file diff --git a/rfcs/2021-01-26-crypto.md b/rfcs/2021-01-26-crypto.md index 6e397da18..39ca6eb70 100644 --- a/rfcs/2021-01-26-crypto.md +++ b/rfcs/2021-01-26-crypto.md @@ -145,9 +145,9 @@ For each message, the agent performs the following actions to encrypt it: 3. Encrypt the message using this AES256 key with [AES-GCM-SIV](https://hackage.haskell.org/package/cryptonite-0.28/docs/Crypto-Cipher-AESGCMSIV.html) (AEAD scheme) using the function `encrypt` with a random nonce. 4. Encrypt the AES256 key with public encryption key for the queue using RSA-OAEP [encrypt](https://hackage.haskell.org/package/cryptonite-0.28/docs/Crypto-PubKey-RSA-OAEP.html#v:encrypt) function parameterized with [SHA256](https://hackage.haskell.org/package/cryptonite-0.28/docs/Crypto-Hash-Algorithms.html#t:SHA256) algorithm. 5. The message to send is concatenation of: - 1. encrypted AES256 key, - 2. AuthTag from encryption in step 3, - 3. encrypted message (in this order) + 1. encrypted AES256 key, + 2. AuthTag from encryption in step 3, + 3. encrypted message (in this order). As there is no additional data that is sent e2e in clear text, we potentially need some simpler algorithm, possibly the one implemented in the tutorial, that implements authenticated encryption without additional (unencrypted) data. @@ -155,7 +155,7 @@ Or we could use this algorithm to allow some data that is sent e2e in clear text ### Message decryption -Agent decrypt the message following the same steps in the opposite order +Agent decrypts the message following the same steps in the opposite order: 1. Split encrypted message to AES256 key, AuthTag and encrypted message - tag and key have fixed size (?). 2. Decrypt AES256 key using the decryption key (the private key that recipient has).