diff --git a/docs/server.html b/docs/server.html index ab335fc11e..e2e5c36832 100644 --- a/docs/server.html +++ b/docs/server.html @@ -870,13 +870,17 @@ window.addEventListener('scroll',changeHeaderBg);
| Updated 12.10.2024 | Languages: EN, FR, CZ, PL |
-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:
+smp.example.com)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 create SMP server as a systemd service, you'll need:
smp1.example.com)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:
-smp.example.com)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.
-First, install smp-server:
You can install SMP server in one of the following ways:
Manual deployment (see below)
-Semi-automatic deployment:
+Manual installation requires some preliminary actions:
+This installation script will automatically install binaries, systemd services and additional scripts that will manage backups, updates and uninstallation. This is the recommended option due to its flexibility, easy updating, and being battle tested on our servers.
+Please note that currently only Ubuntu distribution is supported.
+Run the following script on the server:
+curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/simplex-chat/simplexmq/stable/install.sh -o simplex-server-install.sh &&\
+if echo '53fcdb4ceab324316e2c4cda7e84dbbb344f32550a65975a7895425e5a1be757 simplex-server-install.sh' | sha256sum -c; then
+ chmod +x ./simplex-server-install.sh
+ ./simplex-server-install.sh
+ rm ./simplex-server-install.sh
+else
+ echo "SHA-256 checksum is incorrect!"
+ rm ./simplex-server-install.sh
+fi
+
+Type 1 and hit enter to install smp-server.
Manual installation is the most advanced deployment that provides the most flexibility. Generally recommended only for advanced users.
Install binary:
@@ -1160,7 +1171,154 @@ WantedBy=multi-user.targetAnd execute sudo systemctl daemon-reload.
You can deploy smp-server using Docker Compose. This is second recommended option due to its popularity and relatively easy deployment.
+This deployment provides two Docker Compose files: the automatic one and manual. If you're not sure, choose automatic.
+This will download images from Docker Hub.
+This configuration provides quick and easy way to setup your SMP server: Caddy will automatically manage Let's Encrypt certificates and redirect HTTP to HTTPS, while smp-server will serve both server information page and SMP Protocol by 443 port. 5223 port is used as fallback.
+Please note that you must have 80 and 443 ports unallocated by other servers.
smp-server directory and switch to it:mkdir smp-server && cd smp-server
+
+docker-compose.yml file with the following content:You can also grab it from here - docker-compose-smp-complete.yml. Don't forget to rename it to docker-compose.yml.
name: SimpleX Chat - smp-server
+
+services:
+ oneshot:
+ image: ubuntu:latest
+ environment:
+ CADDYCONF: |
+ ${CADDY_OPTS:-}
+
+ http://{$$ADDR} {
+ redir https://{$$ADDR}{uri} permanent
+ }
+
+ {$$ADDR}:8443 {
+ tls {
+ key_type rsa4096
+ }
+ }
+ command: sh -c 'if [ ! -f /etc/caddy/Caddyfile ]; then printf "$${CADDYCONF}" > /etc/caddy/Caddyfile; fi'
+ volumes:
+ - ./caddy_conf:/etc/caddy
+
+ caddy:
+ image: caddy:latest
+ depends_on:
+ oneshot:
+ condition: service_completed_successfully
+ cap_add:
+ - NET_ADMIN
+ environment:
+ ADDR: ${ADDR?"Please specify the domain."}
+ volumes:
+ - ./caddy_conf:/etc/caddy
+ - caddy_data:/data
+ - caddy_config:/config
+ ports:
+ - 80:80
+ restart: unless-stopped
+ healthcheck:
+ test: "test -d /data/caddy/certificates/${CERT_PATH:-acme-v02.api.letsencrypt.org-directory}/${ADDR} || exit 1"
+ interval: 1s
+ retries: 60
+
+ smp-server:
+ image: ${SIMPLEX_IMAGE:-simplexchat/smp-server:latest}
+ depends_on:
+ caddy:
+ condition: service_healthy
+ environment:
+ ADDR: ${ADDR?"Please specify the domain."}
+ PASS: ${PASS:-}
+ volumes:
+ - ./smp_configs:/etc/opt/simplex
+ - ./smp_state:/var/opt/simplex
+ - type: volume
+ source: caddy_data
+ target: /certificates
+ volume:
+ subpath: "caddy/certificates/${CERT_PATH:-acme-v02.api.letsencrypt.org-directory}/${ADDR}"
+ ports:
+ - 443:443
+ - 5223:5223
+ restart: unless-stopped
+
+volumes:
+ caddy_data:
+ caddy_config:
+
+.env file with the following content:You can also grab it from here - docker-compose-smp-complete.env. Don't forget to rename it to .env.
Change variables according to your preferences.
+# Mandatory
+ADDR=your_ip_or_addr
+
+# Optional
+#PASS='123123'
+
+docker compose up
+
+If you know what you are doing, this configuration provides bare SMP server setup without automatically managed Let's Encrypt certificates by Caddy to serve server information page with 5223 port set as primary.
+This configuration allows you to retain the ability to manage 80 and 443 ports yourself. As a downside, SMP server *can not be served to 443 port.
+smp-server directory and switch to it:mkdir smp-server && cd smp-server
+
+docker-compose.yml file with the following content:You can also grab it from here - docker-compose-smp-manual.yml. Don't forget to rename it to docker-compose.yml.
name: SimpleX Chat - smp-server
+
+services:
+ smp-server:
+ image: ${SIMPLEX_IMAGE:-simplexchat/smp-server:latest}
+ environment:
+ WEB_MANUAL: ${WEB_MANUAL:-1}
+ ADDR: ${ADDR?"Please specify the domain."}
+ PASS: ${PASS:-}
+ volumes:
+ - ./smp_configs:/etc/opt/simplex
+ - ./smp_state:/var/opt/simplex
+ ports:
+ - 5223:5223
+ restart: unless-stopped
+
+.env file with the following content:You can also grab it from here - docker-compose-smp-manual.env. Don't forget to rename it to .env.
Change variables according to your preferences.
+# Mandatory
+ADDR=your_ip_or_addr
+
+# Optional
+#PASS='123123'
+WEB_MANUAL=1
+
+docker compose up
+
+You can deploy smp-server upon creating new Linode VM. Please refer to: Linode Marketplace
+To see which options are available, execute smp-server without flags:
sudo su smp -c smp-server
@@ -1174,7 +1332,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:
Execute the following command:
sudo su smp -c "smp-server init"
@@ -1201,7 +1359,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.
-Execute the following command:
sudo su smp -c "smp-server init -h"
@@ -1250,7 +1408,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.
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
@@ -1375,8 +1533,8 @@ https: 443
cert: /etc/opt/simplex/web.crt
key: /etc/opt/simplex/web.key
-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:
Operators of smp servers ARE ADVISED to rotate online certificate regularly (e.g., every 3 months). In order to do this, follow the steps:
Done!
SMP-server can also be deployed to be available via Tor network. Run the following commands as root user.
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.
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.
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.
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 has the following format:
smp://<fingerprint>[:<password>]@<public_hostname>[,<onion_hostname>]
@@ -1786,7 +1944,7 @@ chown "$user":"$group" "${folder_out}/${key_name}"
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.
To start smp-server on host boot, run:
sudo systemctl enable smp-server.service
@@ -1829,7 +1987,7 @@ 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
-Enabling control port in the configuration allows administrator to see information about the smp-server in real-time. Additionally, it allows to delete queues for content moderation and see the debug info about the clients, sockets, etc. Enabling the control port requires setting the admin and user passwords.
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,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
@@ -2412,7 +2570,7 @@ allow_local_mode = true
For further documentation, see: CSV Data Source for Grafana - Documentation
-To update your smp-server to latest version, choose your installation method and follow the steps:
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/docs/xftp-server.html b/docs/xftp-server.html index 1b310bf139..77512c3cac 100644 --- a/docs/xftp-server.html +++ b/docs/xftp-server.html @@ -746,6 +746,29 @@ window.addEventListener('scroll',changeHeaderBg);XFTP is a new file transfer protocol focussed on meta-data protection - it is based on the same principles as SimpleX Messaging Protocol used in SimpleX Chat messenger:
First, install xftp-server:
You can install XFTP server in one of the following ways:
Manual deployment (see below)
-Semi-automatic deployment:
+Manual installation requires some preliminary actions:
-This installation script will automatically install binaries, systemd services and additional scripts that will manage backups, updates and uninstallation. This is the recommended option due to its flexibility, easy updating, and being battle tested on our servers.
+Please note that currently only Ubuntu distribution is supported.
+Run the following script on the server:
+curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/simplex-chat/simplexmq/stable/install.sh -o simplex-server-install.sh &&\
+if echo '53fcdb4ceab324316e2c4cda7e84dbbb344f32550a65975a7895425e5a1be757 simplex-server-install.sh' | sha256sum -c; then
+ chmod +x ./simplex-server-install.sh
+ ./simplex-server-install.sh
+ rm ./simplex-server-install.sh
+else
+ echo "SHA-256 checksum is incorrect!"
+ rm ./simplex-server-install.sh
+fi
+
+Type 2 and hit enter to install xftp-server.
Manual installation is the most advanced deployment that provides the most flexibility. Generally recommended only for advanced users.
+Install binary:
And execute sudo systemctl daemon-reload.
You can deploy smp-server using Docker Compose. This is second recommended option due to its popularity and relatively easy deployment.
+This deployment provides two Docker Compose files: the automatic one and manual. If you're not sure, choose automatic.
+This will download images from Docker Hub.
+xftp-server directory and switch to it:mkdir xftp-server && cd xftp-server
+
+docker-compose.yml file with the following content:You can also grab it from here - docker-compose-xftp.yml. Don't forget to rename it to docker-compose.yml.
name: SimpleX Chat - xftp-server
+
+services:
+ xftp-server:
+ image: ${SIMPLEX_XFTP_IMAGE:-simplexchat/xftp-server:latest}
+ environment:
+ ADDR: ${ADDR?"Please specify the domain."}
+ QUOTA: ${QUOTA?"Please specify disk quota."}
+ PASS: ${PASS:-}
+ volumes:
+ - ./xftp_configs:/etc/opt/simplex-xftp
+ - ./xftp_state:/var/opt/simplex-xftp
+ - ./xftp_files:/srv/xftp
+ ports:
+ - 443:443
+ restart: unless-stopped
+
+.env file with the following content:You can also grab it from here - docker-compose-xftp.env. Don't forget to rename it to .env.
Change variables according to your preferences.
+# Mandatory
+ADDR=your_ip_or_addr
+QUOTA=120gb
+
+# Optional
+#PASS='123123'
+
+docker compose up
+
+You can deploy xftp-server upon creating new Linode VM. Please refer to: Linode Marketplace
xftp-server can also be deployed to serve from tor network. Run the following commands as root user.
Enabling control port in the configuration allows administrator to see information about the smp-server in real-time. Additionally, it allows to delete file chunks for content moderation and see the debug info about the clients, sockets, etc. Enabling the control port requires setting the admin and user passwords.
Enabling control port in the configuration allows administrator to see information about the xftp-server in real-time. Additionally, it allows to delete file chunks for content moderation and see the debug info about the clients, sockets, etc. Enabling the control port requires setting the admin and user passwords.
Generate two passwords for each user:
@@ -1199,7 +1281,7 @@ allow_local_mode = trueFor further documentation, see: CSV Data Source for Grafana - Documentation
-To update your XFTP server to latest version, choose your installation method and follow the steps:
Please see: SMP Server: Configuring the app to use the server.