diff --git a/README.md b/README.md index 4e6594113..62fb440ab 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,9 @@ SimpleXMQ is implemented in Haskell - it benefits from robust software transacti ### SMP server -[SMP server](https://github.com/simplex-chat/simplexmq/blob/master/apps/smp-server/Main.hs) can be run on any Linux distribution without any dependencies, including low power/low memory devices. +[SMP server](https://github.com/simplex-chat/simplexmq/blob/master/apps/smp-server/Main.hs) can be run on any Linux distribution, including low power/low memory devices. OpenSSL library is required for initialization. -To initialize the server use `smp-server init` command - it will generate keys and certificates for TLS transport. The fingerprint of offline certificate is used as part of the server address to protect client/server connection against man-in-the-middle attacks: `smp://@[:5223]`. +To initialize the server use `smp-server init -n ` (or `smp-server init --ip ` for IP based address) command - it will generate keys and certificates for TLS transport. The fingerprint of offline certificate is used as part of the server address to protect client/server connection against man-in-the-middle attacks: `smp://@[:5223]`. SMP server uses in-memory persistence with an optional append-only log of created queues that allows to re-start the server without losing the connections. This log is compacted on every server restart, permanently removing suspended and removed queues. @@ -87,6 +87,26 @@ You can either run your own SMP server locally or deploy using [Linode StackScri It's the easiest to try SMP agent via a prototype [simplex-chat](https://github.com/simplex-chat/simplex-chat) terminal UI. +## Deploy SMP server on Linux + +You can run your SMP server as a Linux process, optionally using a service manager for booting and restarts. + +- For Ubuntu you can download a binary from [the latest release](https://github.com/simplex-chat/simplexmq/releases). + + If you're using other Linux distribution and the binary is incompatible with it, you can build from source using [Haskell stack](https://docs.haskellstack.org/en/stable/README/): + + ```shell + curl -sSL https://get.haskellstack.org/ | sh + ... + stack install + ``` + +- Initialize SMP server with `smp-server init [-l] -n ` or `smp-server init [-l] --ip ` - depending on how you initialize it, either FQDN or IP will be used for server's address. + +- Run `smp-server start` to start SMP server, or you can configure a service manager to run it as a service. + +See [this section](#smp-server) for more information. Run `smp-server -h` and `smp-server init -h` for explanation of commands and options. + [Linode](https://cloud.linode.com/stackscripts/748014) ## Deploy SMP server on Linode diff --git a/apps/smp-server/Main.hs b/apps/smp-server/Main.hs index 2a5afa049..163b312c8 100644 --- a/apps/smp-server/Main.hs +++ b/apps/smp-server/Main.hs @@ -131,8 +131,7 @@ cliCommandP = <*> strOption ( long "ip" <> help - "Server IP address used as Subject Alternative Name for TLS online certificate, \ - \also used as Common Name if FQDN is not supplied" + "Server IP address, used as Common Name for TLS online certificate if FQDN is not supplied" <> value "127.0.0.1" <> showDefault <> metavar "IP" @@ -140,7 +139,7 @@ cliCommandP = <*> (optional . strOption) ( long "fqdn" <> short 'n' - <> help "Server FQDN used as Common Name and Subject Alternative Name for TLS online certificate" + <> help "Server FQDN used as Common Name for TLS online certificate" <> showDefault <> metavar "FQDN" )