aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/.cvsignore3
-rwxr-xr-xconfig/alert-tracks-debian.example (renamed from config/alert-tracks-debian.ugly)2
-rw-r--r--config/application.rb4
-rw-r--r--config/crontab-example4
-rw-r--r--config/deploy.rb2
-rw-r--r--config/environments/development.rb8
-rw-r--r--config/environments/production.rb15
-rw-r--r--config/general.yml-example43
-rw-r--r--config/initializers/alaveteli.rb3
-rw-r--r--config/packages.debian-wheezy1
-rwxr-xr-xconfig/purge-varnish-debian.example (renamed from config/purge-varnish-debian.ugly)2
-rw-r--r--config/routes.rb2
-rwxr-xr-xconfig/sysvinit-passenger.example (renamed from config/sysvinit-passenger.ugly)0
-rwxr-xr-xconfig/sysvinit-thin.example (renamed from config/sysvinit-thin.ugly)0
-rw-r--r--config/varnish-alaveteli.vcl16
15 files changed, 85 insertions, 20 deletions
diff --git a/config/.cvsignore b/config/.cvsignore
deleted file mode 100644
index 2539dd3cd..000000000
--- a/config/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-general
-database.yml
-rails_env.rb
diff --git a/config/alert-tracks-debian.ugly b/config/alert-tracks-debian.example
index f1ca68b03..a098bc332 100755
--- a/config/alert-tracks-debian.ugly
+++ b/config/alert-tracks-debian.example
@@ -41,7 +41,7 @@ start_daemon() {
}
stop_daemon() {
- /sbin/start-stop-daemon --stop --oknodo --pidfile "$PIDFILE"
+ /sbin/start-stop-daemon --stop --oknodo --retry 5 --pidfile "$PIDFILE"
}
restart() { stop; start; }
diff --git a/config/application.rb b/config/application.rb
index 3c01e26c4..46c4eb93b 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -60,7 +60,8 @@ module Alaveteli
config.time_zone = ::AlaveteliConfiguration::time_zone
# Set the cache to use a memcached backend
- config.cache_store = :mem_cache_store, { :namespace => AlaveteliConfiguration::domain }
+ config.cache_store = :mem_cache_store,
+ { :namespace => "#{AlaveteliConfiguration::domain}_#{RUBY_VERSION}" }
config.action_dispatch.rack_cache = nil
config.after_initialize do |app|
@@ -116,6 +117,7 @@ module Alaveteli
'ie6.css',
'ie7.css',
'bootstrap-dropdown.js',
+ 'widget.css',
'responsive/print.css',
'responsive/application-lte-ie7.css',
'responsive/application-ie8.css']
diff --git a/config/crontab-example b/config/crontab-example
index f65555b11..bfcba0568 100644
--- a/config/crontab-example
+++ b/config/crontab-example
@@ -16,9 +16,7 @@ MAILTO=!!(*= $mailto *)!!
# Once an hour
09 * * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/alert-comment-on-request.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/alert-comment-on-request || echo "stalled?"
-
-# Only root can read the log files
-31 * * * * root !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/load-mail-server-logs.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/load-mail-server-logs || echo "stalled?"
+31 * * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/load-mail-server-logs.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/load-mail-server-logs || echo "stalled?"
# Once a day, early morning
31 1 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/change-xapian-database.lock "!!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/compact-xapian-database production !!(*= $site *)!!" || echo "stalled?"
diff --git a/config/deploy.rb b/config/deploy.rb
index f4a0b536a..d02488bfa 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -58,6 +58,7 @@ namespace :deploy do
"#{release_path}/log" => "#{shared_path}/log",
"#{release_path}/tmp/pids" => "#{shared_path}/tmp/pids",
"#{release_path}/lib/acts_as_xapian/xapiandbs" => "#{shared_path}/xapiandbs",
+ "#{release_path}/lib/themes" => "#{shared_path}/themes",
}
# "ln -sf <a> <b>" creates a symbolic link but deletes <b> if it already exists
@@ -70,6 +71,7 @@ namespace :deploy do
run "mkdir -p #{shared_path}/log"
run "mkdir -p #{shared_path}/tmp/pids"
run "mkdir -p #{shared_path}/xapiandbs"
+ run "mkdir -p #{shared_path}/themes"
end
end
diff --git a/config/environments/development.rb b/config/environments/development.rb
index dbf8d7b2a..b334a1e19 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -46,4 +46,12 @@ Alaveteli::Application.configure do
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5
+ if AlaveteliConfiguration.use_bullet_in_development
+ config.after_initialize do
+ Bullet.enable = true
+ Bullet.bullet_logger = true
+ Bullet.console = true
+ Bullet.add_footer = true
+ end
+ end
end
diff --git a/config/environments/production.rb b/config/environments/production.rb
index a3e3cebd2..af2ca15b9 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -17,7 +17,20 @@ Alaveteli::Application.configure do
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
- config.action_mailer.delivery_method = :sendmail # so is queued, rather than giving immediate errors
+
+ config.action_mailer.delivery_method = AlaveteliConfiguration::production_mailer_delivery_method.to_sym
+
+ if AlaveteliConfiguration::production_mailer_delivery_method.to_sym == :smtp
+ config.action_mailer.smtp_settings = {
+ :address => AlaveteliConfiguration::smtp_mailer_address,
+ :port => AlaveteliConfiguration.smtp_mailer_port,
+ :domain => AlaveteliConfiguration.smtp_mailer_domain,
+ :user_name => AlaveteliConfiguration.smtp_mailer_user_name,
+ :password => AlaveteliConfiguration.smtp_mailer_password,
+ :authentication => AlaveteliConfiguration.smtp_mailer_authentication,
+ :enable_starttls_auto => AlaveteliConfiguration.smtp_mailer_enable_starttls_auto
+ }
+ end
config.active_support.deprecation = :notify
diff --git a/config/general.yml-example b/config/general.yml-example
index 8acea374b..a6980b71c 100644
--- a/config/general.yml-example
+++ b/config/general.yml-example
@@ -673,6 +673,14 @@ PUBLIC_BODY_LIST_FALLBACK_TO_DEFAULT_LOCALE: false
# ---
USE_MAILCATCHER_IN_DEVELOPMENT: true
+# Bullet is a tool to help to kill N+1 queries and unused eager loading
+# https://github.com/flyerhzm/bullet
+#
+# USE_BULLET_IN_DEVELOPMENT - Boolean (default: false)
+#
+# ---
+USE_BULLET_IN_DEVELOPMENT: false
+
# Use memcached to cache HTML fragments for better performance. This will
# only have an effect in environments where
# config.action_controller.perform_caching is set to true
@@ -775,3 +783,38 @@ ALLOW_BATCH_REQUESTS: false
#
# ---
RESPONSIVE_STYLING: true
+
+# Define the mailer delivery method to be used only in the production environment.
+# By default, use sendmail.
+#
+# The list of accepted options are available in the Rails ActionMailer configuration
+# documentation: http://guides.rubyonrails.org/action_mailer_basics.html#example-action-mailer-configuration
+#
+# The most common alternative is to use 'smtp'
+# If you choose to use an external SMTP service then you will need to also include the SMTP configuration settings.
+#
+# As a string this is coerced into a symbol in config/environments/production.rb
+#
+# PRODUCTION_MAILER_DELIVERY_METHOD - String (default: sendmail)
+#
+# Examples:
+#
+# PRODUCTION_MAILER_DELIVERY_METHOD: smtp
+# SMTP_MAILER_ADDRESS: smtp.gmail.com
+# SMTP_MAILER_PORT: 587
+# SMTP_MAILER_DOMAIN: example.com
+# SMTP_MAILER_USER_NAME: jane322
+# SMTP_MAILER_PASSWORD: supersecretpassword
+# SMTP_MAILER_AUTHENTICATION: 'plain'
+# SMTP_MAILER_ENABLE_STARTTLS_AUTO: true
+# ---
+PRODUCTION_MAILER_DELIVERY_METHOD: sendmail
+
+# If ENABLE_WIDGETS is set to true, Alaveteli will allow the embedding of a
+# 'widget' linking to a request on other sites. This widget will record
+# how many people click on an 'I also want to know' button.
+#
+# ENABLE_WIDGETS - Boolean (default: false)
+#
+# ---
+ENABLE_WIDGETS: false
diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb
index b0bc55318..71169b684 100644
--- a/config/initializers/alaveteli.rb
+++ b/config/initializers/alaveteli.rb
@@ -10,7 +10,7 @@ load "debug_helpers.rb"
load "util.rb"
# Application version
-ALAVETELI_VERSION = '0.21.0.26'
+ALAVETELI_VERSION = '0.21.0.30'
# Add new inflection rules using the following format
# (all these examples are active by default):
@@ -35,7 +35,6 @@ end
# Load monkey patches and other things from lib/
-require 'ruby19.rb'
require 'activesupport_cache_extensions.rb'
require 'use_spans_for_errors.rb'
require 'activerecord_errors_extensions.rb'
diff --git a/config/packages.debian-wheezy b/config/packages.debian-wheezy
index 4129aa930..ff1a55d84 100644
--- a/config/packages.debian-wheezy
+++ b/config/packages.debian-wheezy
@@ -35,3 +35,4 @@ wkhtmltopdf-static
wv
xapian-tools
xlhtml
+ttf-bitstream-vera
diff --git a/config/purge-varnish-debian.ugly b/config/purge-varnish-debian.example
index dc3f74ff6..457a77ed8 100755
--- a/config/purge-varnish-debian.ugly
+++ b/config/purge-varnish-debian.example
@@ -43,7 +43,7 @@ start_daemon() {
}
stop_daemon() {
- /sbin/start-stop-daemon --stop --oknodo --pidfile "$PIDFILE"
+ /sbin/start-stop-daemon --stop --oknodo --retry 5 --pidfile "$PIDFILE"
}
restart() { stop; start; }
diff --git a/config/routes.rb b/config/routes.rb
index c975d6007..7319f92fc 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -65,6 +65,7 @@ Alaveteli::Application.routes.draw do
resources :request, :only => [] do
resource :report, :only => [:new, :create]
+ resource :widget, :only => [:new, :show, :update]
end
resources :info_request_batch, :only => :show
@@ -142,6 +143,7 @@ Alaveteli::Application.routes.draw do
match '/track/update/:track_id' => 'track#update', :as => :update
match '/track/delete_all_type' => 'track#delete_all_type', :as => :delete_all_type
match '/track/feed/:track_id' => 'track#atom_feed', :as => :atom_feed
+ match '/track/widget_vote/:info_request_id' => 'track#widget_vote', :as => :widget_vote
####
#### Help controller
diff --git a/config/sysvinit-passenger.ugly b/config/sysvinit-passenger.example
index 0940a4d63..0940a4d63 100755
--- a/config/sysvinit-passenger.ugly
+++ b/config/sysvinit-passenger.example
diff --git a/config/sysvinit-thin.ugly b/config/sysvinit-thin.example
index 0155ff8c3..0155ff8c3 100755
--- a/config/sysvinit-thin.ugly
+++ b/config/sysvinit-thin.example
diff --git a/config/varnish-alaveteli.vcl b/config/varnish-alaveteli.vcl
index d3726682c..59d76b0d1 100644
--- a/config/varnish-alaveteli.vcl
+++ b/config/varnish-alaveteli.vcl
@@ -2,10 +2,10 @@
# of Alaveteli. See the vcl(7) man page for details on VCL syntax and
# semantics.
-#
+#
# Default backend definition. Set this to point to your content
# server. In this case, apache + Passenger running on port 80
-#
+#
backend default {
.host = "127.0.0.1";
@@ -32,7 +32,7 @@ sub vcl_recv {
# Sanitise X-Forwarded-For...
remove req.http.X-Forwarded-For;
set req.http.X-Forwarded-For = client.ip;
-
+
# Remove Google Analytics, has_js, and last-seen cookies
set req.http.Cookie = regsuball(req.http.Cookie, "(^|;\s*)(__[a-z]+|has_js|has_seen_country_message|seen_foi2)=[^;]*", "");
@@ -50,14 +50,14 @@ sub vcl_recv {
remove req.http.Accept-Encoding;
}
}
-
+
# Ignore empty cookies
if (req.http.Cookie ~ "^\s*$") {
remove req.http.Cookie;
}
-
+
if (req.request != "GET" &&
- req.request != "HEAD" &&
+ req.request != "HEAD" &&
req.request != "POST" &&
req.request != "PUT" &&
req.request != "PURGE" &&
@@ -70,9 +70,9 @@ sub vcl_recv {
/* We only deal with GET and HEAD by default, the rest get passed direct to backend */
return (pass);
}
-
+
# Ignore Cookies on images...
- if (req.url ~ "\.(png|gif|jpg|jpeg|swf|css|js|rdf|ico|txt)(\?.*|)$") {
+ if (req.url ~ "\.(png|gif|jpg|jpeg|swf|css|js|rdf|ico)(\?.*|)$") {
remove req.http.Cookie;
return (lookup);
}