--- layout: page title: Configuration --- # Configuring Alaveteli
You can control much of how Alaveteli looks and behaves just by changing the config settings.
## The general configuration file The alaveteli code ships with an example configuration file: `config/general.yml-example`. As part of the [installation process]({{ page.baseurl }}/docs/installing/ ), the example file gets copied to `config/general.yml`. You **must** edit this file to suit your needs. Note that the default settings for frontpage examples are designed to work with the dummy data shipped with Alaveteli. Once you have real data, you should certainly edit these. Note that there are [other configuration files](#other-config) too, for specific aspects of Alaveteli. ## Config settings by topic The following are all the configuration settings that you can change in `config/general.yml`. When you edit this file, remember it must be in the YAML syntax. It's not complicated but — especially if you're editing a list — be careful to get the indentation correct. If in doubt, look at the examples already in the file, and don't use tabs. ### Appearance and overall behaviour of the site:SITE_NAME
DOMAIN
FORCE_SSL
FORCE_REGISTRATION_ON_NEW_REQUEST
THEME_URLS
THEME_BRANCH
FRONTPAGE_PUBLICBODY_EXAMPLES
PUBLIC_BODY_STATISTICS_PAGE
MINIMUM_REQUESTS_FOR_STATISTICS
RESPONSIVE_STYLING
### Site status:
READ_ONLY
STAGING_SITE
### Locale and internationalisation:
ISO_COUNTRY_CODE
TIME_ZONE
AVAILABLE_LOCALES
DEFAULT_LOCALE
USE_DEFAULT_BROWSER_LANGUAGE
INCLUDE_DEFAULT_LOCALE_IN_URLS
### Definition of "late":
REPLY_LATE_AFTER_DAYS
REPLY_VERY_LATE_AFTER_DAYS
SPECIAL_REPLY_VERY_LATE_AFTER_DAYS
WORKING_OR_CALENDAR_DAYS
### Admin access:
ADMIN_USERNAME
ADMIN_PASSWORD
DISABLE_EMERGENCY_USER
SKIP_ADMIN_AUTH
### Email management:
INCOMING_EMAIL_DOMAIN
INCOMING_EMAIL_PREFIX
INCOMING_EMAIL_SECRET
BLACKHOLE_PREFIX
CONTACT_EMAIL
CONTACT_NAME
TRACK_SENDER_EMAIL
TRACK_SENDER_NAME
RAW_EMAILS_LOCATION
EXCEPTION_NOTIFICATIONS_FROM
EXCEPTION_NOTIFICATIONS_TO
FORWARD_NONBOUNCE_RESPONSES_TO
MTA_LOG_PATH
MTA_LOG_TYPE
### General admin (keys, paths, back-end services):
COOKIE_STORE_SESSION_SECRET
RECAPTCHA_PUBLIC_KEY
RECAPTCHA_PRIVATE_KEY
GAZE_URL
GA_CODE
(GA=Google Analytics)
UTILITY_SEARCH_PATH
SHARED_FILES_PATH
SHARED_FILES
SHARED_DIRECTORIES
### Behaviour settings and switches:
NEW_RESPONSE_REMINDER_AFTER_DAYS
AUTHORITY_MUST_RESPOND
MAX_REQUESTS_PER_USER_PER_DAY
OVERRIDE_ALL_PUBLIC_BODY_REQUEST_EMAILS
ALLOW_BATCH_REQUESTS
PUBLIC_BODY_LIST_FALLBACK_TO_DEFAULT_LOCALE
### External public services:
BLOG_FEED
TWITTER_USERNAME
TWITTER_WIDGET_ID
DONATION_URL
### Development work or special cases:
DEBUG_RECORD_MEMORY
VARNISH_HOST
USE_MAILCATCHER_IN_DEVELOPMENT
USE_GHOSTSCRIPT_COMPRESSION
HTML_TO_PDF_COMMAND
CACHE_FRAGMENTS
---
## All the general settings
SITE_NAME
Examples:
SITE_NAME: 'Alaveteli'
SITE_NAME: 'WhatDoTheyKnow'
DOMAIN
Examples:
DOMAIN: '127.0.0.1:3000'
DOMAIN: 'www.example.com'
FORCE_SSL
Example:
FORCE_SSL: true
FORCE_REGISTRATION_ON_NEW_REQUEST
Example:
FORCE_REGISTRATION_ON_NEW_REQUEST: false
THEME_URLS
rails-post-deploy
script). The earlier in the list means
the templates have a higher priority.
Example:
THEME_URLS: - 'git://github.com/mysociety/alavetelitheme.git'
THEME_BRANCH
rails-post-deploy
installs the themes,
it will try the theme branch first, but only if you've set THEME_BRANCH
to be true. If the branch doesn't exist it will fall back to using a tagged version
specific to your installed alaveteli version, and if that doesn't exist it will
back to master
.
The default theme is the "Alaveteli" theme. This gets installed automatically when
rails-post-deploy
runs.
Example:
THEME_BRANCH: false
FRONTPAGE_PUBLICBODY_EXAMPLES
short_names
.
If you want more than one, separate them with semicolons.
Comment this out if you want this to be auto-generated.
Warning: this is slow — don't use in production!
Examples:
FRONTPAGE_PUBLICBODY_EXAMPLES: 'tgq'
FRONTPAGE_PUBLICBODY_EXAMPLES: 'tgq;foo;bar'
# FRONTPAGE_PUBLICBODY_EXAMPLES:
PUBLIC_BODY_STATISTICS_PAGE
&
MINIMUM_REQUESTS_FOR_STATISTICS
/body_statistics
).
The page will only consider public bodies that have had at least the number of requests
set by MINIMUM_REQUESTS_FOR_STATISTICS.
Example:
PUBLIC_BODY_STATISTICS_PAGE: false
MINIMUM_REQUESTS_FOR_STATISTICS: 50
RESPONSIVE_STYLING
Example:
RESPONSIVE_STYLING: true
READ_ONLY
Examples:
READ_ONLY: ''
READ_ONLY: 'The site is not currently accepting requests while we move the server.'
STAGING_SITE
rails-post-deploy
script will create the file config/rails_env.rb
file to force
Rails into production environment.
Examples:
STAGING_SITE: 1
STAGING_SITE: 0
ISO_COUNTRY_CODE
Example:
ISO_COUNTRY_CODE: GB
TIME_ZONE
Example:
TIME_ZONE: Australia/Sydney
AVAILABLE_LOCALES
&
DEFAULT_LOCALE
Examples:
AVAILABLE_LOCALES: 'en es'
DEFAULT_LOCALE: 'en'
USE_DEFAULT_BROWSER_LANGUAGE
Example:
USE_DEFAULT_BROWSER_LANGUAGE: true
INCLUDE_DEFAULT_LOCALE_IN_URLS
www.example.com/en/body/list/all
. If you don't want this
behaviour whenever the locale is the default one, set
INCLUDE_DEFAULT_LOCALE_IN_URLS to false.
Example:
INCLUDE_DEFAULT_LOCALE_IN_URLS: true
REPLY_LATE_AFTER_DAYS
REPLY_VERY_LATE_AFTER_DAYS
SPECIAL_REPLY_VERY_LATE_AFTER_DAYS
WORKING_OR_CALENDAR_DAYS
Examples:
REPLY_LATE_AFTER_DAYS: 20
REPLY_VERY_LATE_AFTER_DAYS: 40
SPECIAL_REPLY_VERY_LATE_AFTER_DAYS: 60
WORKING_OR_CALENDAR_DAYS: working
ADMIN_USERNAME
&
ADMIN_PASSWORD
DISABLE_EMERGENCY_USER
This is useful for creating the initial admin users for your site:
For details of this process, see creating a superuser account.
Examples:
ADMIN_USERNAME: 'adminxxxx'
ADMIN_PASSWORD: 'passwordx'
DISABLE_EMERGENCY_USER: false
SKIP_ADMIN_AUTH
Example:
SKIP_ADMIN_AUTH: false
INCOMING_EMAIL_DOMAIN
Example:
INCOMING_EMAIL_DOMAIN: 'localhost'
INCOMING_EMAIL_DOMAIN: 'foifa.com'
INCOMING_EMAIL_PREFIX
Example:
INCOMING_EMAIL_PREFIX: ''
INCOMING_EMAIL_PREFIX: 'foi+'
INCOMING_EMAIL_SECRET
Example:
INCOMING_EMAIL_SECRET: '11ae 4e3b 70ff c001 3682 4a51 e86d ef5f'
BLACKHOLE_PREFIX
Example:
BLACKHOLE_PREFIX: 'do-not-reply-to-this-address'
CONTACT_EMAIL
&
CONTACT_NAME
Examples:
CONTACT_EMAIL: 'team@example.com'
CONTACT_NAME: 'Alaveteli Webmaster'
TRACK_SENDER_EMAIL
&
TRACK_SENDER_NAME
Examples:
TRACK_SENDER_EMAIL: 'alaveteli@example.com'
TRACK_SENDER_NAME: 'Alaveteli Webmaster'
RAW_EMAILS_LOCATION
Example:
RAW_EMAILS_LOCATION: 'files/raw_emails'
EXCEPTION_NOTIFICATIONS_FROM
&
EXCEPTION_NOTIFICATIONS_TO
Examples:
EXCEPTION_NOTIFICATIONS_FROM: do-not-reply-to-this-address@example.com EXCEPTION_NOTIFICATIONS_TO: - robin@example.com - seb@example.com
FORWARD_NONBOUNCE_RESPONSES_TO
Example:
FORWARD_NONBOUNCE_RESPONSES_TO: user-support@example.com
MTA_LOG_PATH
script/load-mail-server-logs
.
Example:
MTA_LOG_PATH: '/var/log/exim4/exim-mainlog-*'
MTA_LOG_TYPE
Example:
MTA_LOG_TYPE: "exim"
COOKIE_STORE_SESSION_SECRET
Example:
COOKIE_STORE_SESSION_SECRET: 'uIngVC238Jn9NsaQizMNf89pliYmDBFugPjHS2JJmzOp8'
RECAPTCHA_PUBLIC_KEY
&
RECAPTCHA_PRIVATE_KEY
Examples:
RECAPTCHA_PUBLIC_KEY: '7HoPjGBBBBBBBBBkmj78HF9PjjaisQ893'
RECAPTCHA_PRIVATE_KEY: '7HjPjGBBBBBCBBBpuTy8a33sgnGG7A'
GAZE_URL
Example:
GAZE_URL: http://gaze.mysociety.org
GA_CODE
(GA=Google Analytics)
Examples:
GA_CODE: ''
GA_CODE: 'AB-8222142-14'
UTILITY_SEARCH_PATH
Example:
UTILITY_SEARCH_PATH: ["/usr/bin", "/usr/local/bin"]
SHARED_FILES_PATH
files
directory, the cache
directory and the
generated graphs such as public/foi-live-creation.png
. If you're
installing Alaveteli in such a setup then set SHARED_FILES_PATH to
the directory you're keeping these files under. Otherwise, leave it blank.
Example:
SHARED_FILES_PATH: ''
SHARED_FILES
&
SHARED_DIRECTORIES
Examples:
SHARED_FILES: - config/database.yml - config/general.yml - config/rails_env.rb - config/newrelic.yml - config/httpd.conf - public/foi-live-creation.png - public/foi-user-use.png - config/aliases
SHARED_DIRECTORIES: - files/ - cache/ - lib/acts_as_xapian/xapiandbs/ - vendor/bundle - public/assets
NEW_RESPONSE_REMINDER_AFTER_DAYS
Example:
NEW_RESPONSE_REMINDER_AFTER_DAYS: [3, 10, 24]
AUTHORITY_MUST_RESPOND
true
if authorities must respond by law. Set to false
otherwise. It defaults to true
. At the moment this just controls the display of some UI text telling users that the authority must respond to them by law.
Example:
AUTHORITY_MUST_RESPOND: true
MAX_REQUESTS_PER_USER_PER_DAY
Example:
MAX_REQUESTS_PER_USER_PER_DAY: 6
OVERRIDE_ALL_PUBLIC_BODY_REQUEST_EMAILS
Examples:
OVERRIDE_ALL_PUBLIC_BODY_REQUEST_EMAILS: test-email@foo.com
# OVERRIDE_ALL_PUBLIC_BODY_REQUEST_EMAILS:
ALLOW_BATCH_REQUESTS
Example:
ALLOW_BATCH_REQUESTS: false
PUBLIC_BODY_LIST_FALLBACK_TO_DEFAULT_LOCALE
Example:
PUBLIC_BODY_LIST_FALLBACK_TO_DEFAULT_LOCALE: false
BLOG_FEED
Example:
BLOG_FEED: 'https://www.mysociety.org/category/projects/whatdotheyknow/feed/'
TWITTER_USERNAME
TWITTER_WIDGET_ID
Examples:
TWITTER_USERNAME: WhatDoTheyKnow
TWITTER_WIDGET_ID: '833549204689320031'
DONATION_URL
Example:
DONATION_URL: "https://www.mysociety.org/donate/"
DEBUG_RECORD_MEMORY
Example:
DEBUG_RECORD_MEMORY: false
VARNISH_HOST
Examples:
VARNISH_HOST: null
VARNISH_HOST: localhost
USE_MAILCATCHER_IN_DEVELOPMENT
Example:
USE_MAILCATCHER_IN_DEVELOPMENT: true
USE_GHOSTSCRIPT_COMPRESSION
Example:
USE_GHOSTSCRIPT_COMPRESSION: true
HTML_TO_PDF_COMMAND
Example:
HTML_TO_PDF_COMMAND: /usr/local/bin/wkhtmltopdf-amd64
CACHE_FRAGMENTS
config.action_controller.perform_caching
is set to true
Example:
CACHE_FRAGMENTS: true