From 3ee8a7bed22baf789c1cf4b1a55205c52385b78a Mon Sep 17 00:00:00 2001 From: epoberezkin Date: Mon, 14 Oct 2024 08:38:53 +0000 Subject: [PATCH] deploy: f8f5c3c6be52004c532c089d3d87cbdc9c90f5ce --- ...y-review-better-calls-user-experience.html | 513 ++++++++++++++++ blog/index.html | 2 + docs/protocol/simplex-chat.html | 2 +- docs/server.html | 552 +++++++++++++++--- feed.atom | 2 +- 5 files changed, 1000 insertions(+), 71 deletions(-) create mode 100644 blog/20241014-simplex-network-v6-1-security-review-better-calls-user-experience.html diff --git a/blog/20241014-simplex-network-v6-1-security-review-better-calls-user-experience.html b/blog/20241014-simplex-network-v6-1-security-review-better-calls-user-experience.html new file mode 100644 index 0000000000..22797b5b7c --- /dev/null +++ b/blog/20241014-simplex-network-v6-1-security-review-better-calls-user-experience.html @@ -0,0 +1,513 @@ + + + + + + + + SimpleX blog: SimpleX network: cryptographic design review by Trail of Bits, v6.1 released with better calls and user experience. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ < Back to list +
+ +
+

SimpleX network: security review of protocols design by Trail of Bits, v6.1 released with better calls and user experience.

+

Published: Oct 14, 2024

+

This is the placeholder for the security review and release announcement.

+

Come back on Monday afternoon!

+
+
+ + +
+ +
+ + + + + diff --git a/blog/index.html b/blog/index.html index 9ad82a02d8..c98d22a095 100644 --- a/blog/index.html +++ b/blog/index.html @@ -409,6 +409,8 @@ window.addEventListener('scroll',changeHeaderBg); + +
diff --git a/docs/protocol/simplex-chat.html b/docs/protocol/simplex-chat.html index 296914eed7..38275405df 100644 --- a/docs/protocol/simplex-chat.html +++ b/docs/protocol/simplex-chat.html @@ -882,7 +882,7 @@ eventWord = 1* ALPHA

While introduced members establish connection inside group, inviting member forwards messages between them by sending x.grp.msg.forward messages. When introduced members finalize connection, they notify inviting member to stop forwarding via x.grp.mem.con message.

Adding member to the group

Member roles

-

Currently members can have one of three roles - owner, admin, member and observer. The user that created the group is self-assigned owner role, the new members are assigned role by the member who adds them - only owner and admin members can add new members; only owner members can add members with owner role. Observer members only receive messages and aren't allowed to send messages.

+

Currently members can have one of four roles - owner, admin, member and observer. The user that created the group is self-assigned owner role, the new members are assigned role by the member who adds them - only owner and admin members can add new members; only owner members can add members with owner role. Observer members only receive messages and aren't allowed to send messages.

Messages to manage groups and add members

x.grp.inv message is sent to invite contact to the group via contact's direct connection and includes group member connection address. This message MUST only be sent by members with admin or owner role. Optional groupLinkId is included when this message is sent to contacts connected via the user's group link. This identifier is a random byte sequence, with no global or even local uniqueness - it is only used for the user's invitations to a given group to provide confirmation to the contact that the group invitation is for the same group the contact was connecting to via the group link, so that the invitation can be automatically accepted by the contact - the contact compares it with the group link id contained in the group link uri's data field.

x.grp.acpt message is sent as part of group member connection handshake, only to the inviting user.

diff --git a/docs/server.html b/docs/server.html index dcb92bb92f..404f226394 100644 --- a/docs/server.html +++ b/docs/server.html @@ -858,10 +858,12 @@ window.addEventListener('scroll',changeHeaderBg);
-

| Updated 28.05.2024 | Languages: EN, FR, CZ, PL |

+

Hosting your own SMP Server

+

| Updated 12.10.2024 | Languages: EN, FR, CZ, PL |

Table of Contents

-

Hosting your own SMP Server

-

Overview

+

Quick start

+

To create SMP server, you'll need:

+
    +
  • VPS or any other server.
  • +
  • Your server domain, with A and AAAA records specifying server IPv4 and IPv6 addresses (smp1.example.com)
  • +
  • A basic Linux knowledge.
  • +
+

Please note: while you can run an SMP server without a domain name, in the near future client applications will start using server domain name in the invitation links (instead of simplex.chat domain they use now). In case a server does not have domain name and server pages (see below), the clients will be generaing the links with simplex: scheme that cannot be opened in the browsers.

+
    +
  1. +

    Install server with Installation script.

    +
  2. +
  3. +

    Adjust firewall:

    +
    ufw allow 80/tcp &&\
    +ufw allow 443/tcp &&\
    +ufw allow 5223/tcp
    +
    +
  4. +
  5. +

    Init server:

    +

    Replace smp1.example.com with your actual server domain.

    +
    su smp -c 'smp-server init --yes \
    +                        --store-log \
    +                        --no-password \
    +                        --control-port \
    +                        --socks-proxy \
    +                        --source-code \
    +                        --fqdn=smp1.example.com
    +
    +
  6. +
  7. +

    Install tor:

    +
    CODENAME="$(lsb_release -c | awk '{print $2}')"
    +
    +echo "deb [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org ${CODENAME} main
    +deb-src [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org ${CODENAME} main" > /etc/apt/sources.list.d/tor.list &&\
    +curl --proto '=https' --tlsv1.2 -sSf https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | tee /usr/share/keyrings/tor-archive-keyring.gpg >/dev/null &&\
    +apt update && apt install -y tor deb.torproject.org-keyring
    +
    +
  8. +
  9. +

    Configure tor:

    +
    tor-instance-create tor2 &&\
    +mkdir /var/lib/tor/simplex-smp/ &&\
    +chown debian-tor:debian-tor /var/lib/tor/simplex-smp/ &&\
    +chmod 700 /var/lib/tor/simplex-smp/
    +
    +
    vim /etc/tor/torrc
    +
    +

    Paste the following:

    +
    # Enable log (otherwise, tor doesn't seem to deploy onion address)
    +Log notice file /var/log/tor/notices.log
    +# Enable single hop routing (2 options below are dependencies of the third) - It will reduce the latency at the cost of lower anonimity of the server - as SMP-server onion address is used in the clients together with public address, this is ok. If you deploy SMP-server with onion-only address, keep standard configuration.
    +SOCKSPort 0
    +HiddenServiceNonAnonymousMode 1
    +HiddenServiceSingleHopMode 1
    +# smp-server hidden service host directory and port mappings
    +HiddenServiceDir /var/lib/tor/simplex-smp/
    +HiddenServicePort 5223 localhost:5223
    +HiddenServicePort 443 localhost:443
    +
    +
    vim /etc/tor/instances/tor2/torrc
    +
    +

    Paste the following:

    +
    # Log tor to systemd daemon
    +Log notice syslog
    +# Listen to local 9050 port for socks proxy
    +SocksPort 9050
    +
    +
  10. +
  11. +

    Start tor:

    +
    systemctl enable tor &&\
    +systemctl start tor &&\
    +systemctl restart tor &&\
    +systemctl enable --now tor@tor2
    +
    +
  12. +
  13. +

    Install Caddy:

    +
    sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl &&\
    +curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg &&\
    +curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list &&\
    +sudo apt update && sudo apt install caddy
    +
    +
  14. +
  15. +

    Configure Caddy:

    +
    vim /etc/caddy/Caddyfile
    +
    +

    Replace smp1.example.com with your actual server domain. Paste the following:

    +
    http://smp1.example.com {
    +   redir https://smp1.example.com{uri} permanent
    +}
    +
    +smp1.example.com:8443 {
    +   tls {
    +      key_type rsa4096
    +   }
    +}
    +
    +
    vim /usr/local/bin/simplex-servers-certs
    +
    +

    Replace smp1.example.com with your actual server domain. Paste the following:

    +
    #!/usr/bin/env sh
    +set -eu
    +
    +user='smp'
    +group="$user"
    +
    +domain='smp1.example.com'
    +folder_in="/var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/${domain}"
    +folder_out='/etc/opt/simplex'
    +key_name='web.key'
    +cert_name='web.crt'
    +
    +# Copy certifiacte from Caddy directory to smp-server directory
    +cp "${folder_in}/${domain}.crt" "${folder_out}/${cert_name}"
    +# Assign correct permissions
    +chown "$user":"$group" "${folder_out}/${cert_name}"
    +
    +# Copy certifiacte key from Caddy directory to smp-server directory
    +cp "${folder_in}/${domain}.key" "${folder_out}/${key_name}"
    +# Assign correct permissions
    +chown "$user":"$group" "${folder_out}/${key_name}"
    +
    +
    chmod +x /usr/local/bin/simplex-servers-certs
    +
    +
    sudo crontab -e
    +
    +

    Paste the following:

    +
    # Every week on 00:20 sunday
    +20 0 * * 0 /usr/local/bin/simplex-servers-certs
    +
    +
  16. +
  17. +

    Enable and start Caddy service:

    +

    Wait until "good to go" has been printed.

    +
    systemctl enable --now caddy &&\
    +sleep 10 &&\
    +/usr/local/bin/simplex-servers-certs &&\
    +echo 'good to go'
    +
    +
  18. +
  19. +

    Enable and start smp-server:

    +
    systemctl enable --now smp-server.service
    +
    +
  20. +
  21. +

    Print your address:

    +
    smp="$(journalctl --output cat -q _SYSTEMD_INVOCATION_ID="$(systemctl show -p InvocationID --value smp-server)" | grep -m1 'Server address:' | awk '{print $NF}' | sed 's/:443.*//')"
    +tor="$(cat /var/lib/tor/simplex-smp/hostname)"
    +
    +echo "$smp,$tor"
    +
    +
  22. +
+

Detailed guide

+

Overview

SMP server is the relay server used to pass messages in SimpleX network. SimpleX Chat apps have preset servers (for mobile apps these are smp11, smp12 and smp14.simplex.im), but you can easily change app configuration to use other servers.

SimpleX clients only determine which server is used to receive the messages, separately for each contact (or group connection with a group member), and these servers are only temporary, as the delivery address can change.

+

To create SMP server, you'll need:

+
    +
  1. VPS or any other server.
  2. +
  3. Your own domain, pointed at the server (smp.example.com)
  4. +
  5. A basic Linux knowledge.
  6. +

Please note: when you change the servers in the app configuration, it only affects which servers will be used for the new contacts, the existing contacts will not automatically move to the new servers, but you can move them manually using "Change receiving address" button in contact/member information pages – it will be automated in the future.

-

Installation

+

Installation

  1. First, install smp-server:

    @@ -953,8 +1120,10 @@ sudo chown smp:smp /var/opt/simplex /etc/opt/simplex

    Allow smp-server port in firewall:

    # For Ubuntu
     sudo ufw allow 5223/tcp
    +sudo ufw allow 443/tcp
    +sudo ufw allow 80/tcp
     # For Fedora
    -sudo firewall-cmd --permanent --add-port=5223/tcp && \
    +sudo firewall-cmd --permanent --add-port=5223/tcp --add-port=443/tcp --add-port=80/tcp && \
     sudo firewall-cmd --reload
     
  2. @@ -972,6 +1141,7 @@ ExecStopPost=/usr/bin/env sh -c '[ -e "/var/opt/simplex/smp-server-store.lo LimitNOFILE=65535 KillSignal=SIGINT TimeoutStopSec=infinity +AmbientCapabilities=CAP_NET_BIND_SERVICE [Install] WantedBy=multi-user.target @@ -979,7 +1149,7 @@ WantedBy=multi-user.target

    And execute sudo systemctl daemon-reload.

-

Configuration

+

Configuration

To see which options are available, execute smp-server without flags:

sudo su smp -c smp-server
 
@@ -993,7 +1163,7 @@ Available commands:
 

You can get further help by executing sudo su smp -c "smp-server <command> -h"

After that, we need to configure smp-server:

-

Interactively

+

Interactively

Execute the following command:

sudo su smp -c "smp-server init"
 
@@ -1020,7 +1190,7 @@ Available commands:

Enter your domain or ip address that your smp-server is running on - it will be included in server certificates and also printed as part of server address.

-

Via command line options

+

Via command line options

Execute the following command:

sudo su smp -c "smp-server init -h"
 
@@ -1069,7 +1239,7 @@ Fingerprint: d5fcsc7hhtPpexYUbI2XPxDbyU2d3WsVmROimcL90ss=
 Server address: smp://d5fcsc7hhtPpexYUbI2XPxDbyU2d3WsVmROimcL90ss=:V8ONoJ6ICwnrZnTC_QuSHfCEYq53uLaJKQ_oIC6-ve8=@<hostnames>
 

The server address above should be used in your client configuration, and if you added server password it should only be shared with the other people who you want to allow using your server to receive the messages (all your contacts will be able to send messages - it does not require a password). If you passed IP address or hostnames during the initialisation, they will be printed as part of server address, otherwise replace <hostnames> with the actual server hostnames.

-

Further configuration

+

Further configuration

All generated configuration, along with a description for each parameter, is available inside configuration file in /etc/opt/simplex/smp-server.ini for further customization. Depending on the smp-server version, the configuration file looks something like this:

[INFORMATION]
 # AGPLv3 license requires that you make any source code modifications
@@ -1088,26 +1258,26 @@ source_code: https://github.com/simplex-chat/simplexmq
 # condition_amendments: link
 
 # Server location and operator.
-server_country: <YOUR_SERVER_LOCATION>
-operator: <YOUR_NAME>
-operator_country: <YOUR_LOCATION>
-website: <WEBSITE_IF_AVAILABLE>
+# server_country: ISO-3166 2-letter code
+# operator: entity (organization or person name)
+# operator_country: ISO-3166 2-letter code
+# website:
 
 # Administrative contacts.
-#admin_simplex: SimpleX address
-admin_email: <EMAIL>
+# admin_simplex: SimpleX address
+# admin_email:
 # admin_pgp:
 # admin_pgp_fingerprint:
 
 # Contacts for complaints and feedback.
 # complaints_simplex: SimpleX address
-complaints_email: <COMPLAINTS_EMAIL>
+# complaints_email:
 # complaints_pgp:
 # complaints_pgp_fingerprint:
 
 # Hosting provider.
-hosting: <HOSTING_PROVIDER_NAME>
-hosting_country: <HOSTING_PROVIDER_LOCATION>
+# hosting: entity (organization or person name)
+# hosting_country: ISO-3166 2-letter code
 
 [STORE_LOG]
 # The server uses STM memory for persistence,
@@ -1121,6 +1291,7 @@ enable: on
 # they are preserved in the .bak file until the next restart.
 restore_messages: on
 expire_messages_days: 21
+expire_ntfs_hours: 24
 
 # Log daily server statistics to CSV file
 log_stats: on
@@ -1137,11 +1308,17 @@ new_queues: on
 # with the users who you want to allow creating messaging queues on your server.
 # create_password: password to create new queues (any printable ASCII characters without whitespace, '@', ':' and '/')
 
+# control_port_admin_password:
+# control_port_user_password:
+
 [TRANSPORT]
-# host is only used to print server address on start
-host: <your server domain/ip>
-port: 5223
+# Host is only used to print server address on start.
+# You can specify multiple server ports.
+host: <domain/ip>
+port: 5223,443
 log_tls_errors: off
+
+# Use `websockets: 443` to run websockets server in addition to plain TLS.
 websockets: off
 # control_port: 5224
 
@@ -1153,7 +1330,7 @@ websockets: off
 # required_host_mode: off
 
 # The domain suffixes of the relays you operate (space-separated) to count as separate proxy statistics.
-# own_server_domains: <your domain suffixes>
+# own_server_domains: 
 
 # SOCKS proxy port for forwarding messages to destination servers.
 # You may need a separate instance of SOCKS proxy for incoming single-hop requests.
@@ -1169,7 +1346,7 @@ websockets: off
 [INACTIVE_CLIENTS]
 # TTL and interval to check inactive clients
 disconnect: off
-# ttl: 43200
+# ttl: 21600
 # check_interval: 3600
 
 [WEB]
@@ -1179,16 +1356,16 @@ static_path: /var/opt/simplex/www
 # Run an embedded server on this port
 # Onion sites can use any port and register it in the hidden service config.
 # Running on a port 80 may require setting process capabilities.
-# http: 8000
+#http: 8000
 
 # You can run an embedded TLS web server too if you provide port and cert and key files.
 # Not required for running relay on onion address.
-# https: 443
-# cert: /etc/opt/simplex/web.cert
-# key: /etc/opt/simplex/web.key
+https: 443
+cert: /etc/opt/simplex/web.crt
+key: /etc/opt/simplex/web.key
 
-

Server security

-

Initialization

+

Server security

+

Initialization

Although it's convenient to initialize smp-server configuration directly on the server, operators ARE ADVISED to initialize smp-server fully offline to protect your SMP server CA private key.

Follow the steps to quickly initialize the server offline:

    @@ -1210,7 +1387,7 @@ static_path: /var/opt/simplex/www
-

Private keys

+

Private keys

Connection to the smp server occurs via a TLS connection. During the TLS handshake, the client verifies smp-server CA and server certificates by comparing its fingerprint with the one included in server address. If server TLS credential is compromised, this key can be used to sign a new one, keeping the same server identity and established connections. In order to protect your smp-server from bad actors, operators ARE ADVISED to move CA private key to a safe place. That could be:

  • Tails live usb drive with persistent and encrypted storage.
  • @@ -1234,7 +1411,7 @@ static_path: /var/opt/simplex/www -

    Online certificate rotation

    +

    Online certificate rotation

    Operators of smp servers ARE ADVISED to rotate online certificate regularly (e.g., every 3 months). In order to do this, follow the steps:

    1. @@ -1300,8 +1477,8 @@ $HOME/simplex/smp/config/ca.key

      Done!

    -

    Tor: installation and configuration

    -

    Installation for onion address

    +

    Tor: installation and configuration

    +

    Installation for onion address

    SMP-server can also be deployed to be available via Tor network. Run the following commands as root user.

    1. @@ -1350,6 +1527,7 @@ HiddenServiceSingleHopMode 1 # smp-server hidden service host directory and port mappings HiddenServiceDir /var/lib/tor/simplex-smp/ HiddenServicePort 5223 localhost:5223 +HiddenServicePort 443 localhost:443
    2. @@ -1372,7 +1550,7 @@ HiddenServicePort 5223 localhost:5223
    -

    SOCKS port for SMP PROXY

    +

    SOCKS port for SMP PROXY

    SMP-server versions starting from v5.8.0-beta.0 can be configured to PROXY smp servers available exclusively through Tor network to be accessible to the clients that do not use Tor. Run the following commands as root user.

    1. @@ -1411,15 +1589,27 @@ own_server_domains: <your domain suffixes if using `log_stats: on`>
    -

    Server information page

    -

    SMP-server versions starting from v5.8.0 can be configured to serve Web page with server information that can include admin info, server info, provider info, etc. Run the following commands as root user.

    +

    Server information page

    +

    SMP server SHOULD be configured to serve Web page with server information that can include admin info, server info, provider info, etc. It will also serve connection links, generated using the mobile/desktop apps. Run the following commands as root user.

    +

    Please note: this configuration is supported since v6.1.0-beta.2.

    1. Add the following to your smp-server configuration (please modify fields in [INFORMATION] section to include relevant information):

      vim /etc/opt/simplex/smp-server.ini
       
      -
      [WEB]
      +
      [TRANSPORT]
      +# host is only used to print server address on start
      +host: <domain/ip>
      +port: 443,5223
      +websockets: off
      +log_tls_errors: off
      +control_port: 5224
      +
      +[WEB]
      +https: 443
       static_path: /var/opt/simplex/www
      +cert: /etc/opt/simplex/web.crt
      +key: /etc/opt/simplex/web.key
       
       [INFORMATION]
       # AGPLv3 license requires that you make any source code modifications
      @@ -1487,12 +1677,18 @@ hosting_country: <HOSTING_PROVIDER_LOCATION>
       

      Full Caddy instllation instructions

    2. -

      Replace Caddy configuration with the following (don't forget to replace <YOUR_DOMAIN>):

      +

      Replace Caddy configuration with the following:

      +

      Please replace YOUR_DOMAIN with your actual domain (smp.example.com).

      vim /etc/caddy/Caddyfile
       
      -
      <YOUR_DOMAIN> {
      -  root * /var/opt/simplex/www
      -  file_server
      +
      http://YOUR_DOMAIN {
      +   redir https://YOUR_DOMAIN{uri} permanent
      +}
      +
      +YOUR_DOMAIN:8443 {
      +   tls {
      +      key_type rsa4096
      +   }
       }
       
    3. @@ -1502,16 +1698,66 @@ hosting_country: <HOSTING_PROVIDER_LOCATION>
    4. -

      Upgrade your smp-server to latest version - Updating your smp server

      +

      Create script to copy certificates to your smp directory:

      +

      Please replace YOUR_DOMAIN with your actual domain (smp.example.com).

      +
      vim /usr/local/bin/simplex-servers-certs
      +
      +
      #!/usr/bin/env sh
      +set -eu
      +
      +user='smp'
      +group="$user"
      +
      +domain='HOST'
      +folder_in="/var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/${domain}"
      +folder_out='/etc/opt/simplex'
      +key_name='web.key'
      +cert_name='web.crt'
      +
      +# Copy certifiacte from Caddy directory to smp-server directory
      +cp "${folder_in}/${domain}.crt" "${folder_out}/${cert_name}"
      +# Assign correct permissions
      +chown "$user":"$group" "${folder_out}/${cert_name}"
      +
      +# Copy certifiacte key from Caddy directory to smp-server directory
      +cp "${folder_in}/${domain}.key" "${folder_out}/${key_name}"
      +# Assign correct permissions
      +chown "$user":"$group" "${folder_out}/${key_name}"
      +
    5. -

      Access the webpage you've deployed from your browser. You should see the smp-server information that you've provided in your ini file.

      +

      Make the script executable and execute it:

      +
      chmod +x /usr/local/bin/simplex-servers-certs && /usr/local/bin/simplex-servers-certs
      +
      +
    6. +
    7. +

      Check if certificates were copied:

      +
      ls -haltr /etc/opt/simplex/web*
      +
      +
    8. +
    9. +

      Create cronjob to copy certificates to smp directory in timely manner:

      +
      sudo crontab -e
      +
      +
      # Every week on 00:20 sunday
      +20 0 * * 0 /usr/local/bin/simplex-servers-certs
      +
      +
    10. +
    11. +

      Then:

      + +
    12. +
    13. +

      Access the webpage you've deployed from your browser (https://smp.example.org). You should see the smp-server information that you've provided in your ini file.

    -

    Documentation

    +

    Documentation

    All necessary files for smp-server are located in /etc/opt/simplex/ folder.

    Stored messages, connections, statistics and server log are located in /var/opt/simplex/ folder.

    -

    SMP server address

    +

    SMP server address

    SMP server address has the following format:

    smp://<fingerprint>[:<password>]@<public_hostname>[,<onion_hostname>]
     
    @@ -1529,7 +1775,7 @@ hosting_country: <HOSTING_PROVIDER_LOCATION>

    Your configured hostname(s) of smp-server. You can check your configured hosts in /etc/opt/simplex/smp-server.ini, under [TRANSPORT] section in host: field.

-

Systemd commands

+

Systemd commands

To start smp-server on host boot, run:

sudo systemctl enable smp-server.service
 
@@ -1572,11 +1818,12 @@ Nov 23 19:23:21 5588ab759e80 smp-server[30878]: Listening on port 5223 (TLS)...
 Nov 23 19:23:21 5588ab759e80 smp-server[30878]: not expiring inactive clients
 Nov 23 19:23:21 5588ab759e80 smp-server[30878]: creating new queues requires password
 
-

Monitoring

+

Monitoring

You can enable smp-server statistics for Grafana dashboard by setting value on in /etc/opt/simplex/smp-server.ini, under [STORE_LOG] section in log_stats: field.

Logs will be stored as csv file in /var/opt/simplex/smp-server-stats.daily.log. Fields for the csv file are:

-
fromTime,qCreated,qSecured,qDeleted,msgSent,msgRecv,dayMsgQueues,weekMsgQueues,monthMsgQueues,msgSentNtf,msgRecvNtf,dayCountNtf,weekCountNtf,monthCountNtf,qCount,msgCount,msgExpired,qDeletedNew,qDeletedSecured,pRelays_pRequests,pRelays_pSuccesses,pRelays_pErrorsConnect,pRelays_pErrorsCompat,pRelays_pErrorsOther,pRelaysOwn_pRequests,pRelaysOwn_pSuccesses,pRelaysOwn_pErrorsConnect,pRelaysOwn_pErrorsCompat,pRelaysOwn_pErrorsOther,pMsgFwds_pRequests,pMsgFwds_pSuccesses,pMsgFwds_pErrorsConnect,pMsgFwds_pErrorsCompat,pMsgFwds_pErrorsOther,pMsgFwdsOwn_pRequests,pMsgFwdsOwn_pSuccesses,pMsgFwdsOwn_pErrorsConnect,pMsgFwdsOwn_pErrorsCompat,pMsgFwdsOwn_pErrorsOther,pMsgFwdsRecv,qSub,qSubAuth,qSubDuplicate,qSubProhibited,msgSentAuth,msgSentQuota,msgSentLarge
+
fromTime,qCreated,qSecured,qDeleted,msgSent,msgRecv,dayMsgQueues,weekMsgQueues,monthMsgQueues,msgSentNtf,msgRecvNtf,dayCountNtf,weekCountNtf,monthCountNtf,qCount,msgCount,msgExpired,qDeletedNew,qDeletedSecured,pRelays_pRequests,pRelays_pSuccesses,pRelays_pErrorsConnect,pRelays_pErrorsCompat,pRelays_pErrorsOther,pRelaysOwn_pRequests,pRelaysOwn_pSuccesses,pRelaysOwn_pErrorsConnect,pRelaysOwn_pErrorsCompat,pRelaysOwn_pErrorsOther,pMsgFwds_pRequests,pMsgFwds_pSuccesses,pMsgFwds_pErrorsConnect,pMsgFwds_pErrorsCompat,pMsgFwds_pErrorsOther,pMsgFwdsOwn_pRequests,pMsgFwdsOwn_pSuccesses,pMsgFwdsOwn_pErrorsConnect,pMsgFwdsOwn_pErrorsCompat,pMsgFwdsOwn_pErrorsOther,pMsgFwdsRecv,qSub,qSubAuth,qSubDuplicate,qSubProhibited,msgSentAuth,msgSentQuota,msgSentLarge,msgNtfs,msgNtfNoSub,msgNtfLost,qSubNoMsg,msgRecvGet,msgGet,msgGetNoMsg,msgGetAuth,msgGetDuplicate,msgGetProhibited,psSubDaily,psSubWeekly,psSubMonthly,qCount2,ntfCreated,ntfDeleted,ntfSub,ntfSubAuth,ntfSubDuplicate,ntfCount,qDeletedAllB,qSubAllB,qSubEnd,qSubEndB,ntfDeletedB,ntfSubB,msgNtfsB,msgNtfExpired
 
+

Fields description

@@ -1876,6 +2123,146 @@ Nov 23 19:23:21 5588ab759e80 smp-server[30878]: creating new queues requires pas + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
msgSentLarge Large message errors
48msgNtfsXXXXXXXXXXXXXXXXXXXX
49msgNtfNoSubXXXXXXXXXXXXXXXXXXXX
50msgNtfLostXXXXXXXXXXXXXXXXXXXX
51qSubNoMsgRemoved, always 0
52msgRecvGetXXXXXXXXXXXXXXXXX
53msgGetXXXXXXXXXXXXXXXXX
54msgGetNoMsgXXXXXXXXXXXXXXXXX
55msgGetAuthXXXXXXXXXXXXXXXXX
56msgGetDuplicateXXXXXXXXXXXXXXXXX
57msgGetProhibitedXXXXXXXXXXXXXXXXX
58psSub_dayCountRemoved, always 0
59psSub_weekCountRemoved, always 0
60psSub_monthCountRemoved, always 0
61qCountXXXXXXXXXXXXXXXXX
62ntfCreatedXXXXXXXXXXXXXXXXX
63ntfDeletedXXXXXXXXXXXXXXXXX
64ntfSubXXXXXXXXXXXXXXXXX
65ntfSubAuthXXXXXXXXXXXXXXXXX
66ntfSubDuplicateXXXXXXXXXXXXXXXXX
67ntfCountXXXXXXXXXXXXXXXXX
68qDeletedAllBXXXXXXXXXXXXXXXXX
69qSubAllBXXXXXXXXXXXXXXXXX
70qSubEndXXXXXXXXXXXXXXXXX
71qSubEndBXXXXXXXXXXXXXXXXX
72ntfDeletedBXXXXXXXXXXXXXXXXX
73ntfSubBXXXXXXXXXXXXXXXXX
74msgNtfsBXXXXXXXXXXXXXXXXX
75msgNtfExpiredXXXXXXXXXXXXXXXXX

To import csv to Grafana one should:

@@ -1885,15 +2272,13 @@ Nov 23 19:23:21 5588ab759e80 smp-server[30878]: creating new queues requires pas
  • Allow local mode by appending following:

    -
  • -
    [plugin.marcusolsson-csv-datasource]
     allow_local_mode = true
     

    ... to /etc/grafana/grafana.ini

    -
      -
    1. Add a CSV data source:
    2. -
    + +
  • +

    Add a CSV data source:

    • In the side menu, click the Configuration tab (cog icon)
    • Click Add data source in the top-right corner of the Data Sources tab
    • @@ -1901,23 +2286,31 @@ allow_local_mode = true
    • Click the search result that says "CSV"
    • In URL, enter a file that points to CSV content
    -
      -
    1. You're done! You should be able to create your own dashboard with statistics.
    2. + +
    3. +

      You're done! You should be able to create your own dashboard with statistics.

      +

    For further documentation, see: CSV Data Source for Grafana - Documentation

    -

    Updating your SMP server

    +

    Updating your SMP server

    To update your smp-server to latest version, choose your installation method and follow the steps:

    • Manual deployment

        -
      1. Stop the server:
        sudo systemctl stop smp-server
        +
      2. +

        Stop the server:

        +
        sudo systemctl stop smp-server
         
      3. -
      4. Update the binary:
         curl -L https://github.com/simplex-chat/simplexmq/releases/latest/download/smp-server-ubuntu-20_04-x86-64 -o /usr/local/bin/smp-server && chmod +x /usr/local/bin/smp-server
        +
      5. +

        Update the binary:

        +
         curl -L https://github.com/simplex-chat/simplexmq/releases/latest/download/smp-server-ubuntu-20_04-x86-64 -o /usr/local/bin/smp-server && chmod +x /usr/local/bin/smp-server
         
      6. -
      7. Start the server:
        sudo systemctl start smp-server
        +
      8. +

        Start the server:

        +
        sudo systemctl start smp-server
         
      @@ -1925,23 +2318,38 @@ allow_local_mode = true
    • Offical installation script

        -
      1. Execute the followin command:
        sudo simplex-servers-update
        +
      2. +

        Execute the followin command:

        +
        sudo simplex-servers-update
        +
        +

        To install specific version, run:

        +
        export VER=<version_from_github_releases> &&\
        +sudo -E simplex-servers-update
         
      3. -
      4. Done!
      5. +
      6. +

        Done!

        +
    • Docker container

        -
      1. Stop and remove the container:
        docker rm $(docker stop $(docker ps -a -q --filter ancestor=simplexchat/smp-server --format="\{\{.ID\}\}"))
        +
      2. +

        Stop and remove the container:

        +
        docker rm $(docker stop $(docker ps -a -q --filter ancestor=simplexchat/smp-server --format="\{\{.ID\}\}"))
         
      3. -
      4. Pull latest image:
        docker pull simplexchat/smp-server:latest
        +
      5. +

        Pull latest image:

        +
        docker pull simplexchat/smp-server:latest
         
      6. -
      7. Start new container:
        docker run -d \
        +
      8. +

        Start new container:

        +
        docker run -d \
           -p 5223:5223 \
        +  -p 443:443 \
           -v $HOME/simplex/smp/config:/etc/opt/simplex:z \
           -v $HOME/simplex/smp/logs:/var/opt/simplex:z \
           simplexchat/smp-server:latest
        @@ -1952,19 +2360,25 @@ allow_local_mode = true
         
      9. Linode Marketplace

          -
        1. Pull latest images:
          docker-compose --project-directory /etc/docker/compose/simplex pull
          +
        2. +

          Pull latest images:

          +
          docker-compose --project-directory /etc/docker/compose/simplex pull
           
        3. -
        4. Restart the containers:
          docker-compose --project-directory /etc/docker/compose/simplex up -d --remove-orphans
          +
        5. +

          Restart the containers:

          +
          docker-compose --project-directory /etc/docker/compose/simplex up -d --remove-orphans
           
        6. -
        7. Remove obsolete images:
          docker image prune
          +
        8. +

          Remove obsolete images:

          +
          docker image prune
           
    -

    Configuring the app to use the server

    +

    Configuring the app to use the server

    To configure the app to use your messaging server copy it's full address, including password, and add it to the app. You have an option to use your server together with preset servers or without them - you can remove or disable them.

    It is also possible to share the address of your server with your friends by letting them scan QR code from server settings - it will include server password, so they will be able to receive messages via your server as well.

    Please note: you need SMP server version 4.0 to have password support. If you already have a deployed server, you can add password by adding it to server INI file.

    diff --git a/feed.atom b/feed.atom index d7d5edfdba..014e4210ca 100644 --- a/feed.atom +++ b/feed.atom @@ -5,7 +5,7 @@ SimpleX Chat Blog It allows you to stay up to date with the latest Blogs from SimpleX Chat. - 2024-08-14T00:00:00Z + 2024-10-14T00:00:00Z SimpleX Chat chat@simplex.chat