Smos Logo Smos

A comprehensive self-management system

The Smos Server

Documentation for the Smos Server, for hosting your own Smos API

You can set up your own Smos server to host your own syncing.

A community sync-server has been set up at api.smos.online in case do not want to do that

Installation

stack install autoexporter
stack install smos-server

Running

To run the server, run the following command:

$ smos-server serve

Reference

Arguments

Usage: smos-server COMMAND [--config-file FILEPATH]
  
  Smos API Server version: 0.3.0
  
  Server API version: 0.2.0

Available options:
  -h,--help                Show this help text
  --config-file FILEPATH   The config file to use

Available commands:
  serve                    Serve as the sync server

Environment

Available environment variables:

  SMOS_SERVER_ADMIN
                         The user that will have admin
                         rights
  SMOS_SERVER_AUTO_BACKUP_ENABLED
                         Whether to enable this looper
  SMOS_SERVER_AUTO_BACKUP_PERIOD
                         The amount of time to wait between
                         runs of the looper, in seconds
  SMOS_SERVER_AUTO_BACKUP_PHASE
                         The amount of time to wait before
                         starting the looper the first
                         time, in seconds
  SMOS_SERVER_BACKUP_GARBAGE_COLLECTOR_ENABLED
                         Whether to enable this looper
  SMOS_SERVER_BACKUP_GARBAGE_COLLECTOR_PERIOD
                         The amount of time to wait between
                         runs of the looper, in seconds
  SMOS_SERVER_BACKUP_GARBAGE_COLLECTOR_PHASE
                         The amount of time to wait before
                         starting the looper the first
                         time, in seconds
  SMOS_SERVER_BACKUP_INTERVAL
                         The interval between automatic
                         backups (seconds)
  SMOS_SERVER_CONFIG_FILE
                         Config file
  SMOS_SERVER_DATABASE_FILE
                         The file to store the server
                         database in
  SMOS_SERVER_FILE_MIGRATOR_ENABLED
                         Whether to enable this looper
  SMOS_SERVER_FILE_MIGRATOR_PERIOD
                         The amount of time to wait between
                         runs of the looper, in seconds
  SMOS_SERVER_FILE_MIGRATOR_PHASE
                         The amount of time to wait before
                         starting the looper the first
                         time, in seconds
  SMOS_SERVER_FREELOADERS
                         The usernames of users that will
                         not have to pay, comma separated
  SMOS_SERVER_LOG_LEVEL
                         The minimal severity of log
                         messages
  SMOS_SERVER_MAX_BACKUPS_PER_USER
                         The maximum number of backups per
                         user
  SMOS_SERVER_MAX_BACKUP_SIZE_PER_USER
                         The maximum number of bytes that
                         backups can take up per user
  SMOS_SERVER_PORT
                         The port to serve web requests on
  SMOS_SERVER_SIGNING_KEY_FILE
                         The file to store the JWT signing
                         key in
  SMOS_SERVER_STRIPE_PRICE
                         The stripe price id
  SMOS_SERVER_STRIPE_PUBLISHABLE_KEY
                         The stripe api publishable key
  SMOS_SERVER_STRIPE_SECRET_KEY
                         The stripe api secret key
  SMOS_SERVER_UUID_FILE
                         The file to store the server uuid in

Configuration

# Configuration
log-level: # optional
  # The minimal severity for log messages
  <string>
uuid-file: # optional
  # The file in which to store the server uuid
  <string>
database-file: # optional
  # The file in which to store the database
  <string>
signing-key-file: # optional
  # The file in which to store signing key for JWT tokens
  <string>
port: # optional
  # The port on which to serve api requests
  <number>
max-backups-per-user: # optional
  # The maximum number of backups per user
  <number>
max-backup-size-per-user: # optional
  # The maximum number of bytes that backups can take up per user
  <number>
backup-interval: # optional
  # The interval between automatic backups (seconds)
  <number>
auto-backup: # optional
  # The configuration for the automatic backup looper
  # LooperConfiguration
  enabled: # optional
    # Enable this looper
    <boolean>
  phase: # optional
    # The amount of time to wait before starting the looper the first time, in seconds
    <number>
  period: # optional
    # The amount of time to wait between runs of the looper, in seconds
    <number>
backup-garbage-collector: # optional
  # The configuration for the automatic backup garbage collection looper
  # LooperConfiguration
  enabled: # optional
    # Enable this looper
    <boolean>
  phase: # optional
    # The amount of time to wait before starting the looper the first time, in seconds
    <number>
  period: # optional
    # The amount of time to wait between runs of the looper, in seconds
    <number>
file-migrator: # optional
  # The configuration for the automatic file format migrator looper
  # LooperConfiguration
  enabled: # optional
    # Enable this looper
    <boolean>
  phase: # optional
    # The amount of time to wait before starting the looper the first time, in seconds
    <number>
  period: # optional
    # The amount of time to wait between runs of the looper, in seconds
    <number>
admin: # optional
  # The username of the user who will have admin rights
  <string>
monetisation: # optional
  # Monetisation configuration. If this is not configured then the server is run entirely for free.
  # MonetisationConfiguration
  stripe-secret-key: # optional
    # The secret key for calling the stripe api
    <string>
  stripe-publishable-key: # optional
    # The publishable key for calling the stripe api
    <string>
  stripe-price: # optional
    # The stripe identifier of the stripe price used to checkout a subscription
    <string>
  freeloaders: # optional , default: fromList []
    - # The usernames of users that will not have to pay
      <string>