mirror of
https://github.com/journeyman-cc/smeagol.git
synced 2026-04-12 18:05:06 +00:00
No results
1
Environment Variables
Simon Brooke edited this page 2017-09-12 17:22:24 +01:00
Table of Contents
Smeagol-specific environment variables
Smeagol can be configured entirely with environment variables. The variables are:
SMEAGOL_CONFIG(optional but advised) should be the full or relative pathname of a Smeagol Configuration file;SMEAGOL_CONTENT_DIRshould be the full or relative pathname of the directory from which Smeagol should serve content (which may initially be empty, but must be writable by the process which runs Smeagol);SMEAGOL_DEFAULT_LOCALEwhich should be a locale specification in the form "en-GB", "fr-FR", or whatever to suit your users;SMEAGOL_FORMATTERSshould be an edn-formatted map of formatter directives (this would be pretty hard to do from an environment variable);SMEAGOL_LOG_LEVELwhich should be one ofTRACE DEBUG INFO WARN ERROR FATALSMEAGOL_PASSWDshould be the full or relative pathname of a Smeagol Passwd file - see Security and authentication. This file must contain an entry for at least your initial user, and, if you want to administer users through the user interface, must be writable by the process which runs Smeagol.SMEAGOL_SITE_TITLEwhich should be the title you want shown on the header of all pages.
You can have both a configuration file and environment variables; if you do, the values of the environment variables take precedence over the values in the config file.
Other environment variables
If Smeagol is compiled as an executable jar file, the actual web server component is Ring server. This recognises the PORT environment variable, and, if this is present and its value is a positive integer, will listen on the specified port (otherwise its default is 3000, which is... unusual).
Smeagol uses the Timbre logging library. This recognises the following environment variables:
TIMBRE_DEFAULT_STACKTRACE_FONTSTimbre by default colourises stacktrace dumps using ANSI terminal codes. This can be quite useful in a console, but is a real pain in a log file. To turn colourised stacktraces off, set the value of this to an empty string;TIMBRE_LEVELSets the minimum logging level; but there are two problems with this. The first is that the environment variable is only read at compile time not at run time, and the second is that the syntax is a bit odd, which is why I've implementedSMEAGOL_LOG_LEVEL(above);TIMBRE_NS_WHITELISTSets a list of Clojure namespaces from which messages should be logged; however this is only read at compile time so isn't much use in practice;TIMBRE_NS_BLACKLISTAs above, but sets a list of namespaces from which messages should not be logged.