aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/configuration.rb2
-rw-r--r--lib/tasks/config_files.rake32
-rw-r--r--lib/tasks/stats.rake4
-rw-r--r--lib/world_foi_websites.rb17
4 files changed, 37 insertions, 18 deletions
diff --git a/lib/configuration.rb b/lib/configuration.rb
index d525bf712..bd2d31ac2 100644
--- a/lib/configuration.rb
+++ b/lib/configuration.rb
@@ -58,7 +58,7 @@ module AlaveteliConfiguration
:RECAPTCHA_PUBLIC_KEY => 'x',
:REPLY_LATE_AFTER_DAYS => 20,
:REPLY_VERY_LATE_AFTER_DAYS => 40,
- :RESPONSIVE_STYLING => false,
+ :RESPONSIVE_STYLING => true,
:SITE_NAME => 'Alaveteli',
:SKIP_ADMIN_AUTH => false,
:SPECIAL_REPLY_VERY_LATE_AFTER_DAYS => 60,
diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake
index 60814cb27..5dda64a04 100644
--- a/lib/tasks/config_files.rake
+++ b/lib/tasks/config_files.rake
@@ -23,26 +23,34 @@ namespace :config_files do
desc 'Convert Debian .ugly init script in config to a form suitable for installing in /etc/init.d'
task :convert_init_script => :environment do
- example = 'rake config_files:convert_init_script DEPLOY_USER=deploy VHOST_DIR=/dir/above/alaveteli SCRIPT_FILE=config/alert-tracks-debian.ugly '
- check_for_env_vars(['DEPLOY_USER', 'VHOST_DIR', 'SCRIPT_FILE'], example)
+ example = 'rake config_files:convert_init_script DEPLOY_USER=deploy VHOST_DIR=/dir/above/alaveteli VCSPATH=alaveteli SITE=alaveteli SCRIPT_FILE=config/alert-tracks-debian.ugly'
+ check_for_env_vars(['DEPLOY_USER',
+ 'VHOST_DIR',
+ 'SCRIPT_FILE'], example)
+
+ replacements = {
+ :user => ENV['DEPLOY_USER'],
+ :vhost_dir => ENV['VHOST_DIR'],
+ :vcspath => ENV.fetch('VCSPATH') { 'alaveteli' },
+ :site => ENV.fetch('SITE') { 'foi' }
+ }
- deploy_user = ENV['DEPLOY_USER']
- vhost_dir = ENV['VHOST_DIR']
- script_file = ENV['SCRIPT_FILE']
+ # Use the filename for the $daemon_name ugly variable
+ daemon_name = File.basename(ENV['SCRIPT_FILE'], '-debian.ugly')
+ replacements.update(:daemon_name => "#{ replacements[:site] }-#{ daemon_name }")
- replacements = { :user => deploy_user,
- :vhost_dir => vhost_dir }
+ # Generate the template for potential further processing
+ converted = convert_ugly(ENV['SCRIPT_FILE'], replacements)
- daemon_name = File.basename(script_file, '-debian.ugly')
- replacements.update(:daemon_name => "foi-#{daemon_name}")
- converted = convert_ugly(script_file, replacements)
- rails_env_file = File.expand_path(File.join(Rails.root, 'config', 'rails_env.rb'))
- if !File.exists?(rails_env_file)
+ # gsub the RAILS_ENV in to the generated template if its not set by the
+ # hard coded config file
+ unless File.exists?("#{ Rails.root }/config/rails_env.rb")
converted.each do |line|
line.gsub!(/^#\s*RAILS_ENV=your_rails_env/, "RAILS_ENV=#{Rails.env}")
line.gsub!(/^#\s*export RAILS_ENV/, "export RAILS_ENV")
end
end
+
converted.each do |line|
puts line
end
diff --git a/lib/tasks/stats.rake b/lib/tasks/stats.rake
index f09594529..46a645b4d 100644
--- a/lib/tasks/stats.rake
+++ b/lib/tasks/stats.rake
@@ -119,7 +119,7 @@ DESC
count ? count : 0
end
- row = [body.name] + stats
+ row = [%Q("#{ body.name }")] + stats
puts row.join(",")
end
end
@@ -147,7 +147,7 @@ DESC
count ? count : 0
end
- row = [body.name] + stats
+ row = [%Q("#{ body.name }")] + stats
puts row.join(",")
end
end
diff --git a/lib/world_foi_websites.rb b/lib/world_foi_websites.rb
index eb707a103..fc2395986 100644
--- a/lib/world_foi_websites.rb
+++ b/lib/world_foi_websites.rb
@@ -62,11 +62,22 @@ class WorldFOIWebsites
:country_name => "România",
:country_iso_code => "RO",
:url => "http://nuvasuparati.info/"},
- {:name => "Marsoum41",
+ {:name => "Marsoum41",
:country_name => "تونس",
:country_iso_code => "TN",
- :url => "http://www.marsoum41.org"}
-
+ :url => "http://www.marsoum41.org"},
+ {:name => "Доступ до правди",
+ :country_name => "Україна",
+ :country_iso_code => "UA",
+ :url => "https://dostup.pravda.com.ua/"},
+ {:name => "Ask Data",
+ :country_name => "מְדִינַת יִשְׂרָאֵל",
+ :country_iso_code => "IL",
+ :url => "http://askdata.org.il/"},
+ {:name => "Слободен пристап",
+ :country_name => "Република Македонија",
+ :country_iso_code => "MK",
+ :url => "http://www.slobodenpristap.mk/"}
]
return world_foi_websites
end