From 373fa12bc51c3c579f5520981414a6e28863299f Mon Sep 17 00:00:00 2001 From: epoberezkin Date: Mon, 3 Jun 2024 19:38:47 +0000 Subject: [PATCH] deploy: 4000fe383d6563509555d5d51a0b5f116e0fb363 --- docs/lang/cs/server.html | 6 + docs/lang/fr/server.html | 6 + docs/server.html | 490 ++++++++++++++++++++++++++++++++++++--- 3 files changed, 471 insertions(+), 31 deletions(-) diff --git a/docs/lang/cs/server.html b/docs/lang/cs/server.html index 8cb1c11ad5..c32e64a2d8 100644 --- a/docs/lang/cs/server.html +++ b/docs/lang/cs/server.html @@ -795,6 +795,12 @@ window.addEventListener('scroll',changeHeaderBg);
+
+
+ V angličtině je novější verze této stránky. Klikněte pro zobrazení +
+
+
diff --git a/docs/lang/fr/server.html b/docs/lang/fr/server.html index 9581abd769..b6f300ccfd 100644 --- a/docs/lang/fr/server.html +++ b/docs/lang/fr/server.html @@ -795,6 +795,12 @@ window.addEventListener('scroll',changeHeaderBg);
+
+
+ Il existe une version plus récente de cette page en anglais. Cliquez pour voir +
+
+
diff --git a/docs/server.html b/docs/server.html index 23e028052a..8823c2e76f 100644 --- a/docs/server.html +++ b/docs/server.html @@ -885,6 +885,7 @@ window.addEventListener('scroll',changeHeaderBg);
  • SOCKS port for SMP PROXY
  • +
  • Server information page
  • Documentation
    • SMP server address
    • @@ -1070,7 +1071,45 @@ Server address: smp://d5fcsc7hhtPpexYUbI2XPxDbyU2d3WsVmROimcL90ss=:V8ONoJ6ICwnrZ

      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

      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:

      -
      [STORE_LOG]
      +
      [INFORMATION]
      +# AGPLv3 license requires that you make any source code modifications
      +# available to the end users of the server.
      +# LICENSE: https://github.com/simplex-chat/simplexmq/blob/stable/LICENSE
      +# Include correct source code URI in case the server source code is modified in any way.
      +# If any other information fields are present, source code property also MUST be present.
      +
      +source_code: https://github.com/simplex-chat/simplexmq
      +
      +# Declaring all below information is optional, any of these fields can be omitted.
      +
      +# Server usage conditions and amendments.
      +# It is recommended to use standard conditions with any amendments in a separate document.
      +# usage_conditions: https://github.com/simplex-chat/simplex-chat/blob/stable/PRIVACY.md
      +# condition_amendments: link
      +
      +# Server location and operator.
      +server_country: <YOUR_SERVER_LOCATION>
      +operator: <YOUR_NAME>
      +operator_country: <YOUR_LOCATION>
      +website: <WEBSITE_IF_AVAILABLE>
      +
      +# Administrative contacts.
      +#admin_simplex: SimpleX address
      +admin_email: <EMAIL>
      +# admin_pgp:
      +# admin_pgp_fingerprint:
      +
      +# Contacts for complaints and feedback.
      +# complaints_simplex: SimpleX address
      +complaints_email: <COMPLAINTS_EMAIL>
      +# complaints_pgp:
      +# complaints_pgp_fingerprint:
      +
      +# Hosting provider.
      +hosting: <HOSTING_PROVIDER_NAME>
      +hosting_country: <HOSTING_PROVIDER_LOCATION>
      +
      +[STORE_LOG]
       # The server uses STM memory for persistence,
       # that will be lost on restart (e.g., as with redis).
       # This option enables saving memory to append only log,
      @@ -1132,6 +1171,21 @@ websockets: off
       disconnect: off
       # ttl: 43200
       # check_interval: 3600
      +
      +[WEB]
      +# Set path to generate static mini-site for server information and qr codes/links
      +static_path: <WRITABLE_PATH_TO_STORE_WEBSITE>
      +
      +# 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
      +
      +# 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
       

      Server security

      Initialization

      @@ -1357,6 +1411,108 @@ 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.

      +
        +
      1. +

        Create folder to store webserver static files and assign correct permissions:

        +
        mkdir -p /var/www/smp-server-web && chown smp:smp /var/www/smp-server-web
        +
        +
      2. +
      3. +

        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]
        +static_path: /var/www/smp-server-web
        +
        +[INFORMATION]
        +# AGPLv3 license requires that you make any source code modifications
        +# available to the end users of the server.
        +# LICENSE: https://github.com/simplex-chat/simplexmq/blob/stable/LICENSE
        +# Include correct source code URI in case the server source code is modified in any way.
        +# If any other information fields are present, source code property also MUST be present.
        +
        +source_code: https://github.com/simplex-chat/simplexmq
        +
        +# Declaring all below information is optional, any of these fields can be omitted.
        +
        +# Server usage conditions and amendments.
        +# It is recommended to use standard conditions with any amendments in a separate document.
        +# usage_conditions: https://github.com/simplex-chat/simplex-chat/blob/stable/PRIVACY.md
        +# condition_amendments: link
        +
        +# Server location and operator.
        +server_country: <YOUR_SERVER_LOCATION>
        +operator: <YOUR_NAME>
        +operator_country: <YOUR_LOCATION>
        +website: <WEBSITE_IF_AVAILABLE>
        +
        +# Administrative contacts.
        +#admin_simplex: SimpleX address
        +admin_email: <EMAIL>
        +# admin_pgp:
        +# admin_pgp_fingerprint:
        +
        +# Contacts for complaints and feedback.
        +# complaints_simplex: SimpleX address
        +complaints_email: <COMPLAINTS_EMAIL>
        +# complaints_pgp:
        +# complaints_pgp_fingerprint:
        +
        +# Hosting provider.
        +hosting: <HOSTING_PROVIDER_NAME>
        +hosting_country: <HOSTING_PROVIDER_LOCATION> 
        +
        +
      4. +
      5. +

        Install the webserver. For easy deployment we'll describe the installtion process of Caddy webserver on Ubuntu server:

        +
          +
        1. +

          Install the packages:

          +
          sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
          +
          +
        2. +
        3. +

          Install caddy gpg key for repository:

          +
          curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
          +
          +
        4. +
        5. +

          Install Caddy repository:

          +
          curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
          +
          +
        6. +
        7. +

          Install Caddy:

          +
          sudo apt update && sudo apt install caddy
          +
          +
        8. +
        +

        Full Caddy instllation instructions

        +
      6. +
      7. +

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

        +
        vim /etc/caddy/Caddyfile
        +
        +
        <YOUR_DOMAIN> {
        +  root * /var/www/simplex
        +  file_server
        +}
        +
        +
      8. +
      9. +

        Enable and start Caddy service:

        +
        systemctl enable --now caddy
        +
        +
      10. +
      11. +

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

        +
      12. +
      13. +

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

        +
      14. +

      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.

      @@ -1424,37 +1580,309 @@ Nov 23 19:23:21 5588ab759e80 smp-server[30878]: creating new queues requires pas

      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
      +
      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 - timestamp; date and time of event

        -
      • -
      • -

        qCreated - int; created queues

        -
      • -
      • -

        qSecured - int; established queues

        -
      • -
      • -

        qDeleted - int; deleted queues

        -
      • -
      • -

        msgSent - int; sent messages

        -
      • -
      • -

        msgRecv - int; received messages

        -
      • -
      • -

        dayMsgQueues - int; active queues in a day

        -
      • -
      • -

        weekMsgQueues - int; active queues in a week

        -
      • -
      • -

        monthMsgQueues - int; active queues in a month

        -
      • -
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Field numberField nameField Description
      1fromTimeDate of statistics
      Messaging queue:
      2qCreatedCreated
      3qSecuredEstablished
      4qDeletedDeleted
      Messages:
      5msgSentSent
      6msgRecvReceived
      7dayMsgQueuesActive queues in a day
      8weekMsgQueuesActive queues in a week
      9monthMsgQueuesActive queues in a month
      Messages with "notification" flag
      10msgSentNtfSent
      11msgRecvNtfReceived
      12dayCountNtfActive queues in a day
      13weekCountNtfActive queues in a week
      14monthCountNtfActive queues in a month
      Additional statistics:
      15qCountStored queues
      16msgCountStored messages
      17msgExpiredExpired messages
      18qDeletedNewNew deleted queues
      19qDeletedSecuredSecured deleted queues
      Requested sessions with all relays:
      20pRelays_pRequests- requests
      21pRelays_pSuccesses- successes
      22pRelays_pErrorsConnect- connection errors
      23pRelays_pErrorsCompat- compatability errors
      24pRelays_pErrorsOther- other errors
      Requested sessions with own relays:
      25pRelaysOwn_pRequests- requests
      26pRelaysOwn_pSuccesses- successes
      27pRelaysOwn_pErrorsConnect- connection errors
      28pRelaysOwn_pErrorsCompat- compatability errors
      29pRelaysOwn_pErrorsOther- other errors
      Message forwards to all relays:
      30pMsgFwds_pRequests- requests
      31pMsgFwds_pSuccesses- successes
      32pMsgFwds_pErrorsConnect- connection errors
      33pMsgFwds_pErrorsCompat- compatability errors
      34pMsgFwds_pErrorsOther- other errors
      Message forward to own relays:
      35pMsgFwdsOwn_pRequests- requests
      36pMsgFwdsOwn_pSuccesses- successes
      37pMsgFwdsOwn_pErrorsConnect- connection errors
      38pMsgFwdsOwn_pErrorsCompat- compatability errors
      39pMsgFwdsOwn_pErrorsOther- other errors
      Received message forwards:
      40pMsgFwdsRecv
      Message queue subscribtion errors:
      41qSubAll
      42qSubAuthAuthentication erorrs
      43qSubDuplicateDuplicate SUB errors
      44qSubProhibitedProhibited SUB errors
      Message errors:
      45msgSentAuthAuthentication errors
      46msgSentQuotaQuota errors
      47msgSentLargeLarge message errors

      To import csv to Grafana one should: