-
Notifications
You must be signed in to change notification settings - Fork 13
Updating config.lisp
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.
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.
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 tofoo(...)
in most of other languages. -
(setf x y)
translates roughly tox = y
. -
(make-instance 'xyz ...)
translates tonew Xyz(...)
. - Named arguments to functions and constructors are passed as
:arg-name arg-value
, similar to how you might dofoo(arg-name=arg-value)
in Python.
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.