From 94b9ecf1e5388c4073fca7f1324714720346f8fc Mon Sep 17 00:00:00 2001 From: epoberezkin Date: Fri, 31 Jan 2025 12:56:40 +0000 Subject: [PATCH] deploy: 68e63c7eb6361e5d90901b24acab5e0651361557 --- docs/server.html | 264 +++++++++++++++++++++++++++++++++--------- docs/xftp-server.html | 120 ++++++++++++++++--- 2 files changed, 312 insertions(+), 72 deletions(-) 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);

Hosting your own SMP Server

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

-

Table of Contents

-

Hosting your own XFTP Server

+

Table of Contents

+

Overview

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:

    @@ -756,27 +779,37 @@ window.addEventListener('scroll',changeHeaderBg);
  • no identifiers or ciphertext in common between sent and received relay traffic, same as for messages delivered by SMP relays.
  • protection of sender IP address from the recipients.
-

Installation

-
    -
  1. -

    First, install xftp-server:

    +

    Installation options

    +

    You can install XFTP server in one of the following ways:

    -
  2. -
-

Manual installation requires some preliminary actions:

-
    +

    systemd service

    +

    Installation script

    +

    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 deployment

    +

    Manual installation is the most advanced deployment that provides the most flexibility. Generally recommended only for advanced users.

    +
    1. Install binary:

        @@ -833,6 +866,55 @@ WantedBy=multi-user.target

        And execute sudo systemctl daemon-reload.

    +

    Docker сontainer

    +

    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.

    +
      +
    1. Create xftp-server directory and switch to it:
    2. +
    +
    mkdir xftp-server && cd xftp-server
    +
    +
      +
    1. Create docker-compose.yml file with the following content:
    2. +
    +

    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
    +
    +
      +
    1. In the same directory, create .env file with the following content:
    2. +
    +

    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'
    +
    +
      +
    1. Start your containers:
    2. +
    +
    docker compose up
    +
    +

    Linode marketplace

    +

    You can deploy xftp-server upon creating new Linode VM. Please refer to: Linode Marketplace

    Tor installation

    xftp-server can also be deployed to serve from tor network. Run the following commands as root user.

      @@ -1059,7 +1141,7 @@ Feb 27 19:21:11 localhost xftp-server[2350]: Listening on port 443... Feb 27 19:21:11 localhost xftp-server[2350]: [INFO 2023-02-27 19:21:11 +0000 src/Simplex/FileTransfer/Server/Env.hs:85] Total / available storage: 64424509440 / 64424509440

      Control port

      -

      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.

      1. Generate two passwords for each user:

        @@ -1199,7 +1281,7 @@ allow_local_mode = true

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

      -

      Updating your XFTP server

      +

      Updating your XFTP server

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

      • @@ -1259,7 +1341,7 @@ allow_local_mode = true
    -

    Configuring the app to use the server

    +

    Configuring the app to use the server

    Please see: SMP Server: Configuring the app to use the server.