Skip to content

Updating config.lisp

Arnold Noronha edited this page May 18, 2024 · 15 revisions

Screenshotbot's webservice loads a file called config.lisp at start-up. You may use this file to configure additional plugins that are necessary, in particular for integrations with other external tools such as Slack or Jira.

You can reload config.lisp at any time without restarting the server and without downtime.

Basic configuration

Your config.lisp should typically look something like this:

(setf (installation) 
      (make-instance 'installation
                     :domain "https://screenshotbot.example.com"
                     :plugins (list ...)
                     :auth-providers (list ...)
                            

The advantage of this structure is that if there is some error in the config file it will not change any global state.

A Quick overview of Lisp

In order to understand the above configuration it might be helpful to understand how Lisp translates to other non-Lisp languages. Roughly speaking:

  • (foo ...) in Lisp is similar to foo(...) in most of other languages.
  • (setf x y) translates roughly to x = y.
  • (make-instance 'xyz ...) translates to new Xyz(...).
  • Named arguments to functions and constructors are passed as :arg-name arg-value, similar to how you might do foo(arg-name=arg-value) in Python.

For Lisp experts

All the code in the config.lisp file is loaded in the screenshotbot/config package that is defined here: https://github.com/screenshotbot/screenshotbot-oss/blob/main/src/screenshotbot/config.lisp#L7. Use this as guide for which symbols are available by default in the config file.

You can also pass the --start-slynk flag when launching Screenshotbot to start a Slynk (The SLY version of Swank) session if you need to debug the config.