diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/alert-tracks-debian.ugly | 17 | ||||
-rw-r--r-- | config/crontab.ugly | 2 | ||||
-rw-r--r-- | config/deploy.rb | 3 | ||||
-rw-r--r-- | config/environment.rb | 24 | ||||
-rw-r--r-- | config/general.yml-example | 17 | ||||
-rw-r--r-- | config/httpd.conf | 2 | ||||
-rw-r--r-- | config/initializers/session_store.rb | 2 | ||||
-rw-r--r-- | config/initializers/theme_loader.rb | 3 | ||||
-rw-r--r-- | config/memcached.yml-test | 2 | ||||
-rw-r--r-- | config/purge-varnish-debian.ugly | 17 | ||||
-rw-r--r-- | config/routes.rb | 2 | ||||
-rw-r--r-- | config/test.yml | 4 |
12 files changed, 57 insertions, 38 deletions
diff --git a/config/alert-tracks-debian.ugly b/config/alert-tracks-debian.ugly index 5bd146061..2b52ad840 100644 --- a/config/alert-tracks-debian.ugly +++ b/config/alert-tracks-debian.ugly @@ -4,7 +4,7 @@ # Provides: alert-tracks # Required-Start: $local_fs $syslog # Required-Stop: $local_fs $syslog -# Default-Start: 2 3 4 5 +# Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: alert-tracks is a daemon running the Alaveteli email alerts # Description: alert-tracks send Alaveteli email alerts as required @@ -13,11 +13,14 @@ # !!(*= $daemon_name *)!! Start the Alaveteli email alert daemon NAME=!!(*= $daemon_name *)!! -DAEMON=/data/vhost/!!(*= $vhost *)!!/alaveteli/script/runner +DAEMON=!!(*= $vhost_dir *)!!/alaveteli/script/runner DAEMON_ARGS="--daemon TrackMailer.alert_tracks_loop" -PIDFILE=/data/vhost/!!(*= $vhost *)!!/alert-tracks.pid -LOGFILE=/data/vhost/!!(*= $vhost *)!!/logs/alert-tracks.log +PIDFILE=!!(*= $vhost_dir *)!!/alert-tracks.pid +LOGFILE=!!(*= $vhost_dir *)!!/logs/alert-tracks.log DUSER=!!(*= $user *)!! +# Set RAILS_ENV - not needed if using config/rails_env.rb +# RAILS_ENV=your_rails_env +# export RAILS_ENV trap "" 1 @@ -48,17 +51,17 @@ case "$1" in exit 0 fi ;; - + start) echo -n "Starting Alaveteli alert daemon: $NAME" start_daemon ;; - + stop) echo -n "Stopping Alaveteli alert daemon: $NAME" stop_daemon ;; - + restart) echo -n "Restarting Alaveteli alert daemon: $NAME" stop_daemon diff --git a/config/crontab.ugly b/config/crontab.ugly index dc660e18f..3e44f6153 100644 --- a/config/crontab.ugly +++ b/config/crontab.ugly @@ -3,8 +3,6 @@ # # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org. WWW: http://www.mysociety.org/ -# -# $Id: crontab.ugly,v 1.36 2009-09-20 10:29:36 francis Exp $ PATH=/usr/local/bin:/usr/bin:/bin MAILTO=cron-!!(*= $site *)!!@mysociety.org diff --git a/config/deploy.rb b/config/deploy.rb index e0507be2c..5e1c3aa0d 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -48,7 +48,10 @@ namespace :deploy do links = { "#{release_path}/config/database.yml" => "#{shared_path}/database.yml", "#{release_path}/config/general.yml" => "#{shared_path}/general.yml", + "#{release_path}/config/memcached.yml" => "#{shared_path}/memcached.yml", "#{release_path}/config/rails_env.rb" => "#{shared_path}/rails_env.rb", + "#{release_path}/public/foi-live-creation.png" => "#{shared_path}/foi-live-creation.png", + "#{release_path}/public/foi-user-use.png" => "#{shared_path}/foi-user-use.png", "#{release_path}/files" => "#{shared_path}/files", "#{release_path}/cache" => "#{shared_path}/cache", "#{release_path}/vendor/plugins/acts_as_xapian/xapiandbs" => "#{shared_path}/xapiandbs", diff --git a/config/environment.rb b/config/environment.rb index 250d3eed0..db537c14e 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -29,10 +29,10 @@ load "util.rb" # without effecting method behaviour # and adds fallback gem call removed in https://github.com/rails/rails/commit/4c3725723f15fab0a424cb1318b82b460714b72f require File.join(File.dirname(__FILE__), '../lib/old_rubygems_patch') - +require 'configuration' # Application version -ALAVETELI_VERSION = '0.6.6' +ALAVETELI_VERSION = '0.6.7' Rails::Initializer.run do |config| # Load intial mySociety config @@ -78,8 +78,8 @@ Rails::Initializer.run do |config| end # See Rails::Configuration for more options - ENV['RECAPTCHA_PUBLIC_KEY'] = MySociety::Config::get("RECAPTCHA_PUBLIC_KEY", 'x'); - ENV['RECAPTCHA_PRIVATE_KEY'] = MySociety::Config::get("RECAPTCHA_PRIVATE_KEY", 'x'); + ENV['RECAPTCHA_PUBLIC_KEY'] = Configuration::recaptcha_public_key + ENV['RECAPTCHA_PRIVATE_KEY'] = Configuration::recaptcha_private_key end # Add new inflection rules using the following format @@ -98,22 +98,22 @@ end # The Rails cache is set up by the Interlock plugin to use memcached # Domain for URLs (so can work for scripts, not just web pages) -ActionMailer::Base.default_url_options[:host] = MySociety::Config.get("DOMAIN", 'localhost:3000') +ActionMailer::Base.default_url_options[:host] = Configuration::domain # So that javascript assets use full URL, so proxied admin URLs read javascript OK -if (MySociety::Config.get("DOMAIN", "") != "") +if (Configuration::domain != "") ActionController::Base.asset_host = Proc.new { |source, request| if ENV["RAILS_ENV"] != "test" && request.fullpath.match(/^\/admin\//) - MySociety::Config.get("ADMIN_PUBLIC_URL", "") + Configuration::admin_public_url else - MySociety::Config.get("DOMAIN", 'localhost:3000') + Configuration::domain end } end # fallback locale and available locales -available_locales = MySociety::Config.get('AVAILABLE_LOCALES', '').split(/ /) -default_locale = MySociety::Config.get('DEFAULT_LOCALE', '') +available_locales = Configuration::available_locales.split(/ /) +default_locale = Configuration::default_locale FastGettext.default_available_locales = available_locales I18n.locale = default_locale @@ -140,5 +140,5 @@ require 'world_foi_websites.rb' require 'alaveteli_external_command.rb' require 'quiet_opener.rb' -ExceptionNotification::Notifier.sender_address = MySociety::Config::get('EXCEPTION_NOTIFICATIONS_FROM') -ExceptionNotification::Notifier.exception_recipients = MySociety::Config::get('EXCEPTION_NOTIFICATIONS_TO') +ExceptionNotification::Notifier.sender_address = Configuration::exception_notifications_from +ExceptionNotification::Notifier.exception_recipients = Configuration::exception_notifications_to diff --git a/config/general.yml-example b/config/general.yml-example index a6f657d96..b457b5ed6 100644 --- a/config/general.yml-example +++ b/config/general.yml-example @@ -30,8 +30,12 @@ REPLY_LATE_AFTER_DAYS: 20 REPLY_VERY_LATE_AFTER_DAYS: 40 # We give some types of authority like schools a bit longer than everyone else SPECIAL_REPLY_VERY_LATE_AFTER_DAYS: 60 +# Whether the days above are given in working or calendar days. Value can be "working" or "calendar". +# Default is "working". +WORKING_OR_CALENDAR_DAYS: working # example public bodies for the home page, semicolon delimited - short_names +# Comment out if you want this to be auto-generated. WARNING: this is slow & don't use production! FRONTPAGE_PUBLICBODY_EXAMPLES: 'tgq' # URLs of themes to download and use (when running rails-post-deploy @@ -79,7 +83,8 @@ TRACK_SENDER_NAME: 'Alaveteli Webmaster' # this up! RAW_EMAILS_LOCATION: 'files/raw_emails' -# The base URL for admin pages. +# The base URL for admin pages, must always end with a '/' +# e.g. https://www.example.com/secure/alaveteli-admin/ # If not specified, it will default to the path to the admin controller, # which is usually what you want. It is useful in situations where admin # requests are proxied via a secure server, for example. @@ -157,3 +162,13 @@ VARNISH_HOST: localhost # Adding a value here will enable Google Analytics on all non-admin pages. GA_CODE: '' + +# If you want to override *all* the public body request emails with your own +# email so that request emails that would normally go to the public body +# go to you, then uncomment below and fill in your email. +# Useful for a staging server to play with the whole process of sending requests +# without inadvertently sending an email to a real authority +#OVERRIDE_ALL_PUBLIC_BODY_REQUEST_EMAILS: test-email@foo.com + +# Search path for external commandline utilities (such as pdftohtml, pdftk, unrtf) +UTILITY_SEARCH_PATH: ["/usr/bin", "/usr/local/bin"] diff --git a/config/httpd.conf b/config/httpd.conf index 129b1577b..440da0d87 100644 --- a/config/httpd.conf +++ b/config/httpd.conf @@ -5,8 +5,6 @@ # # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org -# -# $Id: httpd.conf,v 1.31 2009-09-02 13:05:48 matthew Exp $ # This is needed for the PHP spell checker <Location /fcgi> diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index a05d2c7d1..8cfa333f2 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -7,7 +7,7 @@ ActionController::Base.session = { :key => '_wdtk_cookie_session', - :secret => MySociety::Config.get("COOKIE_STORE_SESSION_SECRET", 'this default is insecure as code is open source, please override for live sites in config/general; this will do for local development') + :secret => Configuration::cookie_store_session_secret } ActionController::Base.session_store = :cookie_store diff --git a/config/initializers/theme_loader.rb b/config/initializers/theme_loader.rb index 8908dc07e..877149e9d 100644 --- a/config/initializers/theme_loader.rb +++ b/config/initializers/theme_loader.rb @@ -2,9 +2,8 @@ # It is used by our config/routes.rb to decide which route extension files to load. $alaveteli_route_extensions = [] -theme_urls = MySociety::Config.get("THEME_URLS", []) if ENV["RAILS_ENV"] != "test" # Don't let the themes interfere with Alaveteli specs - for url in theme_urls.reverse + for url in Configuration::theme_urls.reverse theme_name = url.sub(/.*\/(.*).git/, "\\1") theme_main_include = File.expand_path "../../../vendor/plugins/#{theme_name}/lib/alavetelitheme.rb", __FILE__ if File.exists? theme_main_include diff --git a/config/memcached.yml-test b/config/memcached.yml-test new file mode 100644 index 000000000..18d959876 --- /dev/null +++ b/config/memcached.yml-test @@ -0,0 +1,2 @@ +test: + disabled: true
\ No newline at end of file diff --git a/config/purge-varnish-debian.ugly b/config/purge-varnish-debian.ugly index 1a9259da8..af32650a8 100644 --- a/config/purge-varnish-debian.ugly +++ b/config/purge-varnish-debian.ugly @@ -4,7 +4,7 @@ # Provides: purge-varnish # Required-Start: $local_fs $syslog # Required-Stop: $local_fs $syslog -# Default-Start: 2 3 4 5 +# Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: purge-varnish is a daemon purging the Alaveteli varnish cache # Description: purge-varnish purge the Alaveteli varnish cache @@ -13,11 +13,14 @@ # !!(*= $daemon_name *)!! Start the Alaveteli email purge-varnish daemon NAME=!!(*= $daemon_name *)!! -DAEMON=/data/vhost/!!(*= $vhost *)!!/alaveteli/script/runner +DAEMON=!!(*= $vhost_dir *)!!/alaveteli/script/runner DAEMON_ARGS="--daemon PurgeRequest.purge_all_loop" -PIDFILE=/data/vhost/!!(*= $vhost *)!!/purge-varnish.pid -LOGFILE=/data/vhost/!!(*= $vhost *)!!/logs/purge-varnish.log +PIDFILE=!!(*= $vhost_dir *)!!/purge-varnish.pid +LOGFILE=!!(*= $vhost_dir *)!!/logs/purge-varnish.log DUSER=!!(*= $user *)!! +# Set RAILS_ENV - not needed if using config/rails_env.rb +# RAILS_ENV=your_rails_env +# export RAILS_ENV trap "" 1 @@ -48,17 +51,17 @@ case "$1" in exit 0 fi ;; - + start) echo -n "Starting Alaveteli purge-varnish daemon: $NAME" start_daemon ;; - + stop) echo -n "Stopping Alaveteli purge-varnish daemon: $NAME" stop_daemon ;; - + restart) echo -n "Restarting Alaveteli purge-varnish daemon: $NAME" stop_daemon diff --git a/config/routes.rb b/config/routes.rb index 34232b55b..5fc0075a4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,8 +3,6 @@ # # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ -# -# $Id: routes.rb,v 1.92 2009-10-14 22:01:27 francis Exp $ # Allow easy extension from themes. Note these will have the highest priority. $alaveteli_route_extensions.each do |f| diff --git a/config/test.yml b/config/test.yml index 5811b1785..ef270dcf2 100644 --- a/config/test.yml +++ b/config/test.yml @@ -72,7 +72,7 @@ CONTACT_NAME: 'Alaveteli Webmaster' RAW_EMAILS_LOCATION: 'files/raw_emails' # The base URL for admin pages. You probably don't want to change this. -ADMIN_BASE_URL: '/admin/' +ADMIN_BASE_URL: '' # Where /stylesheets sits under for admin pages. See asset_host in # config/environment.rb. Can be full domain or relative path (not an @@ -125,4 +125,4 @@ EXCEPTION_NOTIFICATIONS_TO: MAX_REQUESTS_PER_USER_PER_DAY: 2 VARNISH_HOST: varnish.localdomain -SKIP_ADMIN_AUTH: true
\ No newline at end of file +SKIP_ADMIN_AUTH: true |