Configuration file
Eventyay reads its configuration from a configuration file. It tries to find this file at the following locations. It will try to read the file from the specified paths in the following order. The file that is found last will override the settings from the files found before.
PRETIX_CONFIG_FILEenvironment variable/etc/eventyay/eventyay.cfg~/.Eventyay.cfgeventyay.cfgin the current working directory
The file is expected to be in the INI format as specified in the Python documentation.
The config file may contain the following sections (all settings are optional and have default values). We suggest that you start from the examples given in one of the installation tutorials.
Note
The configuration file is the recommended way to configure eventyay. However, you can
also set them through environment variables. In this case, the syntax is
PRETIX_SECTION_CONFIG. For example, to configure the setting password_reset
from the [Eventyay] section, set PRETIX_PRETIX_PASSWORD_RESET=off in your
environment.
Eventyay settings
Example:
[Eventyay]
instance_name=eventyay
url=http://localhost
currency=EUR
datadir=/data
plugins_default=eventyay.plugins.sendmail,eventyay.plugins.statistics
cookie_domain=.eventyay
instance_nameThe name of this installation. Default:
eventyayurlThe installation’s full URL, without a trailing slash.
currencyThe default currency as a three-letter code. Defaults to
EUR.datadirThe local path to a data directory that will be used for storing user uploads and similar data. Defaults to the value of the environment variable
DATA_DIRordata.plugins_defaultA comma-separated list of plugins that are enabled by default for all new events. Defaults to
eventyay.plugins.sendmail,eventyay.plugins.statistics.plugins_excludeA comma-separated list of plugins that are not available even though they are installed. Defaults to an empty string.
auth_backendsA comma-separated list of available auth backends. Defaults to
eventyay.base.auth.NativeAuthBackend.cookie_domainThe cookie domain to be set. Defaults to
None.registrationEnables or disables the registration of new admin users. Defaults to
on.password_resetEnables or disables password reset. Defaults to
on.long_sessionsEnables or disables the “keep me logged in” button. Defaults to
on.ecb_ratesBy default, eventyay periodically downloads a XML file from the European Central Bank to retrieve exchange rates that are used to print tax amounts in the customer currency on invoices for some currencies. Set to
offto disable this feature. Defaults toon.audit_commentsEnables or disables nagging staff users for leaving comments on their sessions for auditability. Defaults to
off.obligatory_2faEnables or disables obligatory usage of Two-Factor Authentication for users of the eventyay backend. Defaults to
Falsetrust_x_forwarded_forSpecifies whether the
X-Forwarded-Forheader can be trusted. Only set toonif you have a reverse proxy that actively removes and re-adds the header to make sure the correct client IP is the first value. Defaults tooff.trust_x_forwarded_protoSpecifies whether the
X-Forwarded-Protoheader can be trusted. Only set toonif you have a reverse proxy that actively removes and re-adds the header to make sure the correct value is set. Defaults tooff.csp_logLog violations of the Content Security Policy (CSP). Defaults to
on.csp_additional_headerSpecifies a CSP header that will be merged with eventyay’s default header. For example, if you set this to
script-src https://mycdn.com, eventyay will addhttps://mycdn.comas an additional allowed source to all CSP headers. Empty by default.loglevelSet console and file log level (
DEBUG,INFO,WARNING,ERRORorCRITICAL). Defaults toINFO.
Locale settings
Example:
[locale]
default=de
timezone=Europe/Berlin
defaultThe system’s default locale. Default:
entimezoneThe system’s default timezone as a
pytzname. Default:UTC
Database settings
Example:
[database]
backend=postgresql
name=eventyay
user=eventyay
password=abcd
host=localhost
port=3306
backendOne of
sqlite3andpostgresql. Default:sqlite3.nameThe database’s name. Default:
db.sqlite3.user,password,host,portConnection details for the database connection. Empty by default.
Database replica settings
If you use a replicated database setup, eventyay expects that the default database connection always points to the primary database node. Routing read queries to a replica on database layer is strongly discouraged since this can lead to inaccurate such as more tickets being sold than are actually available.
However, eventyay can still make use of a database replica to keep some expensive queries with that can tolerate some latency from your
primary database, such as backend search queries. The replica configuration section can have the same settings as the database
section (except for the backend setting) and will default back to the database settings for all values that are not given. This
way, you just need to specify the settings that are different for the replica.
Example:
[replica]
host=192.168.0.2
URLs
Example:
[urls]
media=/media/
static=/media/
mediaThe URL to be used to serve user-uploaded content. You should not need to modify this. Default:
/media/staticThe URL to be used to serve static files. You should not need to modify this. Default:
/static/
Email
Example:
[mail]
from=hello@localhost
host=127.0.0.71
user=eventyay
password=foobar
port=1025
tls=on
ssl=off
host,portThe SMTP Host to connect to. Defaults to
localhostand25.user,passwordThe SMTP user data to use for the connection. Empty by default.
fromThe email address to set as
Fromheader in outgoing emails by the system. Default:eventyay@localhosttls,sslUse STARTTLS or SSL for the SMTP connection. Off by default.
adminsComma-separated list of email addresses that should receive a report about every error code 500 thrown by eventyay.
Django settings
Example:
[django]
secret=j1kjps5a5&4ilpn912s7a1!e2h!duz^i3&idu@_907s$wrz@x-
debug=off
secretThe secret to be used by Django for signing and verification purposes. If this setting is not provided, eventyay will generate a random secret on the first start and will store it in the filesystem for later usage.
debugWhether or not to run in debug mode. Default is
False.Warning
Never set this to
Truein production!profileEnable code profiling for a random subset of requests. Disabled by default, see Performance monitoring for details.
Metrics
If you want to fetch internally collected prometheus-style metrics you need to configure the credentials for the metrics endpoint and enable it:
[metrics]
enabled=true
user=your_user
passphrase=mysupersecretpassphrase
Currently, metrics-collection requires a redis server to be available.
Memcached
You can use an existing memcached server as eventyay’s caching backend:
[memcached]
location=127.0.0.1:11211
locationThe location of memcached, either a host:port combination or a socket file.
If no memcached is configured, eventyay will use Django’s built-in local-memory caching method.
Note
If you use memcached and you deploy eventyay across multiple servers, you should use one shared memcached instance, not multiple ones, because cache invalidations would not be propagated otherwise.
Redis
If a redis server is configured, eventyay can use it for locking, caching and session storage to speed up various operations:
[redis]
location=redis://127.0.0.1:6379/1
sessions=false
locationThe location of redis, as a URL of the form
redis://[:password]@localhost:6379/0orunix://[:password]@/path/to/socket.sock?db=0sessionWhen this is set to
True, redis will be used as the session storage.
If redis is not configured, eventyay will store sessions and locks in the database. If memcached is configured, memcached will be used for caching instead of redis.
Translations
Eventyay comes with a number of translations. Some of them are marked as “incubating”, which means they can usually only be selected in development mode. If you want to use them nevertheless, you can activate them like this:
[languages]
allow_incubating=pt-br,da
You can also tell eventyay about additional paths where it will search for translations:
[languages]
path=/path/to/my/translations
For a given language (e.g. pt-br), eventyay will then look in the
specific sub-folder, e.g. /path/to/my/translations/pt_BR/LC_MESSAGES/django.po.
Celery task queue
For processing long-running tasks asynchronously, eventyay requires the celery task queue. For communication between the web server and the task workers in both direction, a messaging queue and a result backend is needed. You can use a redis database for both directions, or an AMQP server (e.g. RabbitMQ) as a broker and redis or your database as a result backend:
[celery]
broker=amqp://guest:guest@localhost:5672//
backend=redis://localhost/0
RabbitMQ might be the better choice if you have a complex, multi-server, high-performance setup, but as you already should have a redis instance ready for session and lock storage, we recommend redis for convenience. See the Celery documentation for more details.
Sentry
Eventyay has native support for sentry, a tool that you can use to track errors in the application. If you want to use sentry, you need to set a DSN in the configuration file:
[sentry]
dsn=https://<key>:<secret>@sentry.io/<project>
dsnYou will be given this value by your sentry installation.
Caching
You can adjust some caching settings to control how much storage eventyay uses:
[cache]
tickets=48 ; Number of hours tickets (PDF, passbook, …) are cached
Secret length
If you are really paranoid, you can increase the length of random strings eventyay uses in various places like order codes, secrets in the ticket QR codes, etc. Example:
[entropy]
; Order code needs to be < 16 characters, default is 5
order_code=5
; Ticket secret needs to be < 64 characters, default is 32
ticket_secret=32
; Voucher code needs to be < 255 characters, default is 16
voucher_code=16
External tools
Eventyay can make use of some external tools if they are installed. Currently, they are all optional. Example:
[tools]
pdftk=/usr/bin/pdftk