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.
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.
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.
# 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
+
+
+
+
Start tor:
+
systemctl enable tor &&\
+systemctl start tor &&\
+systemctl restart tor &&\
+systemctl enable --now tor@tor2
+
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:
+
+
VPS or any other server.
+
Your own domain, pointed at the server (smp.example.com)
+
A basic Linux knowledge.
+
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.
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:
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:
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.
@@ -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.
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>
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.
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:
docker-compose --project-directory /etc/docker/compose/simplex up -d --remove-orphans
+
+
Restart the containers:
+
docker-compose --project-directory /etc/docker/compose/simplex up -d --remove-orphans
-
Remove obsolete images:
docker image prune
+
+
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 BlogIt allows you to stay up to date with the latest Blogs from SimpleX Chat.
- 2024-08-14T00:00:00Z
+ 2024-10-14T00:00:00ZSimpleX Chatchat@simplex.chat