Skip to content
This repository has been archived by the owner on Jun 5, 2021. It is now read-only.
zekro edited this page Sep 18, 2019 · 3 revisions

Setup

Before you start, you need to know that SLMS currently only supports MySQL as database. So you need to have access to a MySQL database server.

First of all, you need to install SLMS on your server. There are 3 options how you can do this:

Then, you need to configure SLMS. A YML config file is automatically generated at the given config location (defaultly ./config.yml if not set).

Because we don't want to save the access password in clear text in the config, the password is saved as blowfish hash. This can be generated from your password using this web page or using the SLMS inegrated hash generator:

The parameter -hash defines the clear text password string and the -rounds parameter defines the blowfish hashing rounds. Attention: Increasing the rounds value also exponentially increases the load on each authentication process!

$ ./slms -hash my5tr0ng_P455w0rd! -rounds 12

Or if you are using docker:

$ docker exec -it slms ./slms -hash my5tr0ng_P455w0rd! -rounds 12
# Database credentials and connection information
database:
  # Name of the database, recommendet 'slms'
  database: slms
  # The host address of the database server,
  # optionally an additional port if alters
  host:     127.0.0.1
  # Name of the user to be used
  username: slms
  # Password of the defined user
  password: '&gwj%w!JJV"yA9_2'

web_server:
  # The password needet to be entered to access management interface or API.
  # This is set here as a blowfish hash, which can be generated using the server
  # binary.
  api_token_hash: "$2a$12$/5bTF.yG/jEw4tUfNEreaOgwEIODGqxk9Opb4UTTSSk7giM99S3Ne"
  # Only accept HTTPS links as entered root links
  only_https_rootlink: true
  # The serevr replies with a 308 Permanent Redirect on requesting short
  # link instead of using 307 Temporary Redirect.
  # This may cause that changes of the root URL of a short link may not be
  # imediatly valid for users because of brwoser caching.
  # If this is enabled, accesses after the first access may also not be 
  # counted because the redirect is read from cache instead of requesting
  # the SLMS server, which also may decrease load.
  permanent_redirect: true
  # Redirect when root URL of SLMS is used.
  root_redirect: 'https://zekro.de'
  # The private key used to encrypt the login session key.
  # This is defaultly generated on start up from SLMS on config generation.
  session_store_key: 'rYLeUjZSo0UqsL8G_GzQ5pvZw313bW7BWaxJRBBFPADczwEOL1O_MRzwHKRAef6R'
  # TLS configuration
  tls:
    # Location of the cert file
    cert_file: /var/cert/example.com.cer
    # Location of the key file
    key_file: /var/cert/example.com.key
    # Whether or not to enable TLS (HTTPS)
    use: true
Clone this wiki locally