myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2148] trunk: moved all configuration from enviro


From: noreply
Subject: [myexperiment-hackers] [2148] trunk: moved all configuration from environment_private. pre to default_settings.yml
Date: Sun, 29 Mar 2009 15:26:53 -0400 (EDT)

Revision
2148
Author
dgc
Date
2009-03-29 15:26:53 -0400 (Sun, 29 Mar 2009)

Log Message

moved all configuration from environment_private.pre to default_settings.yml

Modified Paths

Removed Paths

Diff

Modified: trunk/app/controllers/blobs_controller.rb (2147 => 2148)


--- trunk/app/controllers/blobs_controller.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/controllers/blobs_controller.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -28,8 +28,8 @@
     @query = params[:query] || ''
     @query.strip!
     
-    @blobs = (SOLR_ENABLE && address@hidden) ? Blob.find_by_solr(@query, :limit => 100).results : []
-    @blobs_found_total_count = (SOLR_ENABLE && address@hidden) ? Blob.count_by_solr(@query) : 0
+    @blobs = (Conf.solr_enable && address@hidden) ? Blob.find_by_solr(@query, :limit => 100).results : []
+    @blobs_found_total_count = (Conf.solr_enable && address@hidden) ? Blob.count_by_solr(@query) : 0
     
     respond_to do |format|
       format.html # search.rhtml

Modified: trunk/app/controllers/networks_controller.rb (2147 => 2148)


--- trunk/app/controllers/networks_controller.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/controllers/networks_controller.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -21,8 +21,8 @@
     @query = params[:query] || ''
     @query.strip!
     
-    @networks = (SOLR_ENABLE && address@hidden) ? Network.find_by_solr(@query, :limit => 100).results : []
-    @networks_found_total_count = (SOLR_ENABLE && address@hidden) ? Network.count_by_solr(@query) : 0
+    @networks = (Conf.solr_enable && address@hidden) ? Network.find_by_solr(@query, :limit => 100).results : []
+    @networks_found_total_count = (Conf.solr_enable && address@hidden) ? Network.count_by_solr(@query) : 0
     
     respond_to do |format|
       format.html # search.rhtml
@@ -119,7 +119,7 @@
             existing_invitation_emails << email_addr
           else 
             if ActivityLimit.check_limit(current_user, "group_invite")[0]
-              token_code = Digest::SHA1.hexdigest( email_addr.reverse + SECRET_WORD )
+              token_code = Digest::SHA1.hexdigest( email_addr.reverse + Conf.secret_word )
               valid_addresses_tokens[email_addr] = token_code
               invitation = PendingInvitation.new(:email => email_addr, :request_type => "membership", :requested_by => current_user.id, :request_for => params[:id], :message => params[:invitations][:msg_text], :token => token_code)
               invitation.save

Modified: trunk/app/controllers/packs_controller.rb (2147 => 2148)


--- trunk/app/controllers/packs_controller.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/controllers/packs_controller.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -26,8 +26,8 @@
     @query = params[:query] || ''
     @query.strip!
     
-    @packs = (SOLR_ENABLE && address@hidden) ? Pack.find_by_solr(@query, :limit => 100).results : []
-    @packs_found_total_count = (SOLR_ENABLE && address@hidden) ? Pack.count_by_solr(@query) : 0
+    @packs = (Conf.solr_enable && address@hidden) ? Pack.find_by_solr(@query, :limit => 100).results : []
+    @packs_found_total_count = (Conf.solr_enable && address@hidden) ? Pack.count_by_solr(@query) : 0
     
     respond_to do |format|
       format.html # search.rhtml

Modified: trunk/app/controllers/search_controller.rb (2147 => 2148)


--- trunk/app/controllers/search_controller.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/controllers/search_controller.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -134,7 +134,7 @@
 
     @results = []
 
-    if SOLR_ENABLE && address@hidden
+    if Conf.solr_enable && address@hidden
 
       categories = (Conf.search_categories - ['all']).map do |category|
         if Conf.model_aliases.key?(category.camelize.singularize)

Modified: trunk/app/controllers/users_controller.rb (2147 => 2148)


--- trunk/app/controllers/users_controller.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/controllers/users_controller.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -22,11 +22,11 @@
     @query = params[:query] || ''
     @query.strip!
     
-    results = (SOLR_ENABLE && address@hidden) ? User.find_by_solr(@query, :limit => 100).results : []
+    results = (Conf.solr_enable && address@hidden) ? User.find_by_solr(@query, :limit => 100).results : []
     
     # Only show activated users!
     @users = results.select { |u| u.activated? }
-    @users_found_total_count = (SOLR_ENABLE && address@hidden) ? User.count_by_solr(@query) : 0
+    @users_found_total_count = (Conf.solr_enable && address@hidden) ? User.count_by_solr(@query) : 0
     
     respond_to do |format|
       format.html # search.rhtml
@@ -420,7 +420,7 @@
               existing_invitation_emails << email_addr
             else 
               if ActivityLimit.check_limit(current_user, "user_invite")[0]
-                token_code = Digest::SHA1.hexdigest( email_addr.reverse + SECRET_WORD )
+                token_code = Digest::SHA1.hexdigest( email_addr.reverse + Conf.secret_word )
                 valid_addresses_tokens[email_addr] = token_code
                 invitation = PendingInvitation.new(:email => email_addr, :request_type => "friendship", :requested_by => params[:invitations_user_id], :request_for => params[:invitations_user_id], :message => params[:invitations][:msg_text], :token => token_code)
                 invitation.save
@@ -599,7 +599,7 @@
   end
   
   def confirmation_hash(string)
-    Digest::SHA1.hexdigest(string + SECRET_WORD)
+    Digest::SHA1.hexdigest(string + Conf.secret_word)
   end
   
 end

Modified: trunk/app/controllers/workflows_controller.rb (2147 => 2148)


--- trunk/app/controllers/workflows_controller.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/controllers/workflows_controller.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -37,8 +37,8 @@
     @query = params[:query] || ''
     @query.strip!
     
-    @workflows = (SOLR_ENABLE && address@hidden) ? Workflow.find_by_solr(@query, :limit => 100).results : []
-    @workflows_found_total_count = (SOLR_ENABLE && address@hidden) ? Workflow.count_by_solr(@query) : 0
+    @workflows = (Conf.solr_enable && address@hidden) ? Workflow.find_by_solr(@query, :limit => 100).results : []
+    @workflows_found_total_count = (Conf.solr_enable && address@hidden) ? Workflow.count_by_solr(@query) : 0
     
     respond_to do |format|
       format.html # search.rhtml
@@ -726,9 +726,9 @@
       end
       return false
     # Check that the size of the workflow file doesn't exceed the max size
-    elsif params[:workflow][:file].size > WORKFLOW_UPLOAD_MAX_BYTES
+    elsif params[:workflow][:file].size > Conf.max_upload_size
       respond_to do |format|
-        flash.now[:error] = "The workflow file/script uploaded is too big. The maximum upload size for workflows is #{number_to_human_size(WORKFLOW_UPLOAD_MAX_BYTES)}."
+        flash.now[:error] = "The workflow file/script uploaded is too big. The maximum upload size for workflows is #{number_to_human_size(Conf.max_upload_size)}."
         format.html { render :action ="" view_to_render_on_fail }
       end
       return false

Modified: trunk/app/models/activity_limit.rb (2147 => 2148)


--- trunk/app/models/activity_limit.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/models/activity_limit.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -20,9 +20,9 @@
         # e.g. in the first month of membership on myExperiment one can send 10 messages daily,
         # but after that can send 15 (because the user becomes more "trusted")
         if (limit.promote_after && time_now > limit.promote_after)
-          absolute_max_limit_value = eval("#{limit_feature.upcase}_LIMIT_MAX_VALUE")
-          limit_increment_value = eval("#{limit_feature.upcase}_LIMIT_PROMOTE_INCREMENT")
-          promote_every = eval("#{limit_feature.upcase}_LIMIT_PROMOTE_EVERY")
+          absolute_max_limit_value = Conf.activity_limits[limit_feature]["max_value"]
+          limit_increment_value = Conf.activity_limits[limit_feature]["promote_increment"]
+          promote_every = Conf.activity_limits[limit_feature]["promote_every"]
           
           if limit_increment_value
             if absolute_max_limit_value
@@ -65,12 +65,12 @@
       
     else
       # limit doesn't exist yet - create it, then proceed to validation and saving
-      limit_frequency = eval("#{limit_feature.upcase}_LIMIT_FREQUENCY")
-      promote_every = eval("#{limit_feature.upcase}_LIMIT_PROMOTE_EVERY")
+      limit_frequency = Conf.activity_limits[limit_feature]["frequency"]
+      promote_every = Conf.activity_limits[limit_feature]["promote_every"]
       
       limit = ActivityLimit.new(:contributor_type => contributor.class.name, :contributor_id => contributor.id,
                                 :limit_feature => limit_feature, 
-                                :limit_max => eval("#{limit_feature.upcase}_LIMIT_START_VALUE"),
+                                :limit_max => Conf.activity_limits[limit_feature]["start_value"],
                                 :limit_frequency => limit_frequency,
                                 :reset_after => (limit_frequency ? (time_now + limit_frequency.hours) : nil),
                                 :promote_after => (promote_every ? (time_now + promote_every.days) : nil),

Modified: trunk/app/models/blob.rb (2147 => 2148)


--- trunk/app/models/blob.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/models/blob.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -26,7 +26,7 @@
   acts_as_attributable
   
   acts_as_solr(:fields => [:title, :local_name, :body, :content_type, :uploader],
-               :include => [ :comments ]) if SOLR_ENABLE
+               :include => [ :comments ]) if Conf.solr_enable
   belongs_to :content_blob
 
   # :dependent => :destroy is not supported in belongs_to in rails 1.2.6

Modified: trunk/app/models/comment.rb (2147 => 2148)


--- trunk/app/models/comment.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/models/comment.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -13,7 +13,7 @@
   # NOTE: Comments belong to a user
   belongs_to :user
   
-  acts_as_solr :fields => [ :comment ] if SOLR_ENABLE
+  acts_as_solr :fields => [ :comment ] if Conf.solr_enable
   
   acts_as_simile_timeline_event(
     :fields => {

Modified: trunk/app/models/network.rb (2147 => 2148)


--- trunk/app/models/network.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/models/network.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -21,7 +21,7 @@
   has_many :workflows, :as => :contributor
   
   acts_as_solr(:fields => [ :title, :unique_name, :owner_name, :description, :tag_list ],
-               :include => [ :comments ]) if SOLR_ENABLE
+               :include => [ :comments ]) if Conf.solr_enable
 
   format_attribute :description
   

Modified: trunk/app/models/pack.rb (2147 => 2148)


--- trunk/app/models/pack.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/models/pack.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -27,7 +27,7 @@
   format_attribute :description
   
   acts_as_solr(:fields => [ :title, :description, :contributor_name, :tag_list ],
-               :include => [ :comments ]) if SOLR_ENABLE
+               :include => [ :comments ]) if Conf.solr_enable
   
   has_many :contributable_entries,
            :class_name => "PackContributableEntry",

Modified: trunk/app/models/profile.rb (2147 => 2148)


--- trunk/app/models/profile.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/models/profile.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -48,7 +48,7 @@
                             :location_city,
                             :location_country,
                             :interests,
-                            :contact_details ] if SOLR_ENABLE
+                            :contact_details ] if Conf.solr_enable
   
   def avatar?
     not (picture_id.nil? or picture_id.zero?)

Modified: trunk/app/models/review.rb (2147 => 2148)


--- trunk/app/models/review.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/models/review.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -12,7 +12,7 @@
   
   before_create :check_multiple
   
-  acts_as_solr :fields => [ :title, :review ] if SOLR_ENABLE
+  acts_as_solr :fields => [ :title, :review ] if Conf.solr_enable
   
   # returns the 'last created' Reviews
   # the maximum number of results is set by #limit#

Modified: trunk/app/models/taverna_enactor.rb (2147 => 2148)


--- trunk/app/models/taverna_enactor.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/models/taverna_enactor.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -20,7 +20,7 @@
   validates_presence_of :url
   validates_presence_of :title
   
-  encrypts :password, :mode => :symmetric, :key => SYM_ENCRYPTION_KEY
+  encrypts :password, :mode => :symmetric, :key => Conf.sym_encryption_key
   
   def self.find_by_contributor(contributor_type, contributor_id)
     TavernaEnactor.find(:all, :conditions => ["contributor_type = ? AND contributor_id = ?", contributor_type, contributor_id])

Modified: trunk/app/models/user.rb (2147 => 2148)


--- trunk/app/models/user.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/models/user.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -284,7 +284,7 @@
   
   acts_as_creditor
 
-  acts_as_solr(:fields => [ :name, :tag_list ], :include => [ :profile ]) if SOLR_ENABLE
+  acts_as_solr(:fields => [ :name, :tag_list ], :include => [ :profile ]) if Conf.solr_enable
 
   validates_presence_of :name
   

Modified: trunk/app/models/workflow.rb (2147 => 2148)


--- trunk/app/models/workflow.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/models/workflow.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -81,7 +81,7 @@
 # acts_as_solr(:fields => [ :title, :body, :tag_list, :contributor_name, { :rating => :integer } ],
 
   acts_as_solr(:fields => [ :title, :body, :tag_list, :contributor_name, :type_display_name, :get_all_search_terms ],
-               :include => [ :comments ]) if SOLR_ENABLE
+               :include => [ :comments ]) if Conf.solr_enable
 
   acts_as_runnable
   

Modified: trunk/app/views/layouts/_bookmark_widget.rhtml (2147 => 2148)


--- trunk/app/views/layouts/_bookmark_widget.rhtml	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/views/layouts/_bookmark_widget.rhtml	2009-03-29 19:26:53 UTC (rev 2148)
@@ -2,6 +2,6 @@
 <script type="text/_javascript_">
   addthis_url    = location.href;   
   addthis_title  = document.title;  
-  addthis_pub    = "<%= ADDTHIS_WIDGET_USERNAME %>";     
+  addthis_pub    = "<%= Conf.bookmark_widget["addthis_username"] %>";     
 </script><script type="text/_javascript_" src="" ></script>
 <!-- AddThis Bookmark Button END -->

Modified: trunk/app/views/layouts/_breadcrumbs_bar.rhtml (2147 => 2148)


--- trunk/app/views/layouts/_breadcrumbs_bar.rhtml	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/views/layouts/_breadcrumbs_bar.rhtml	2009-03-29 19:26:53 UTC (rev 2148)
@@ -8,7 +8,7 @@
 			</ul>
 		</td>
 		<td style="text-align: right; padding-left: 1em;">
-			<%= render :partial => "layouts/bookmark_widget" if USE_BOOKMARK_WIDGET %>
+			<%= render :partial => "layouts/bookmark_widget" if Conf.bookmark_widget["enable"] %>
 		</td>
 	</tr>
 </table>

Modified: trunk/app/views/layouts/_web_analytics.rhtml (2147 => 2148)


--- trunk/app/views/layouts/_web_analytics.rhtml	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/views/layouts/_web_analytics.rhtml	2009-03-29 19:26:53 UTC (rev 2148)
@@ -3,7 +3,7 @@
 document.write(unescape("%3Cscript src='' type='text/_javascript_'%3E%3C/script%3E"));
 </script>
 <script type="text/_javascript_">
-var pageTracker = _gat._getTracker("<%= GOOGLEANALYTICS_TRACKER_CODE -%>");
+var pageTracker = _gat._getTracker("<%= Conf.google_web_analytics["tracker_code"] -%>");
 pageTracker._initData();
 pageTracker._trackPageview();
-</script>
\ No newline at end of file
+</script>

Modified: trunk/app/views/layouts/application.rhtml (2147 => 2148)


--- trunk/app/views/layouts/application.rhtml	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/app/views/layouts/application.rhtml	2009-03-29 19:26:53 UTC (rev 2148)
@@ -104,12 +104,12 @@
 				</div>
 			<% end -%>
 			
-			<%= render :partial => "layouts/debug" if SHOW_DEBUG %> 
+			<%= render :partial => "layouts/debug" if Conf.show_debug %> 
 		</div>
 		
 		<%= _javascript__include_tag "tabs.js" %>
 		<%= _javascript__include_tag "folds.js" %>
 		
-		<%= render :partial => "layouts/web_analytics" if USE_WEBANALYTICS %>
+		<%= render :partial => "layouts/web_analytics" if Conf.google_web_analytics["enable"] %>
 	</body>
 </html>

Modified: trunk/config/default_settings.yml (2147 => 2148)


--- trunk/config/default_settings.yml	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/config/default_settings.yml	2009-03-29 19:26:53 UTC (rev 2148)
@@ -4,9 +4,16 @@
 # See license.txt for details.
 
 # ------------------------------------------------------------------------------
-#   myExperiment server configuration
+# |  myExperiment server configuration                                         |
 # ------------------------------------------------------------------------------
-#
+# |                                                                            |
+# | NOTE: Don't make changes to this file.  Instead, copy it to                |
+# |       config/settings.yml and change that copy instead.  Both the          |
+# |       default_settings.yml and settings.yml configuration files are        |
+# |       loaded and configuration entries in settings.yml take precedence.    |
+# |                                                                            |
+# ------------------------------------------------------------------------------
+
 # site_name - Set "site_name" to the name of this myExperiment installation.
 #             This is used by the myExperiment codebase to refer to service by
 #             name.
@@ -199,3 +206,125 @@
   File:  Blob
   Group: Network
 
+# bot_ignore_list - Patterns in this list will be used to be checked against
+#                   "user-agent" in HTTP request headers to filter out bots
+#                   from usage statistics.
+
+bot_ignore_list:
+
+  - Googlebot
+  - Slurp
+  - msnbot
+  - crawler
+  - bot
+  - heritrix
+  - spider
+  - Nutch
+
+# max_upload_size - The maximum file size allowed for workflows, etc.
+
+max_upload_size: 20971520
+
+# solr_enable - Set solr_enable to true to enable the search facility - this
+#               requires a running solr server.
+
+solr_enable: false
+
+# smtp - Email configuration.  These details are used to connect to a SMTP
+#        server instead of sendmail.
+
+smtp:
+
+  :address:        "smtp.example.com"
+  :port:           25,
+  :domain:         ""
+  :authentication: :login
+  :user_name:      "username"
+  :password:       "password"
+
+# show_debug - Shows query statistics in the footer: "Queries in Controller",
+#              "Queries in View" and "Query Time".
+
+show_debug: false
+
+# sym_encryption_key - This is the encyption key used to encrypt the passwords
+#                      for the workflow runners.
+
+sym_encryption_key: your_symmetric_encryption_key
+
+# secret_word - This word is used as salt for email confirmation hashes.
+
+secret_word: our_secret_word_that_no_one_knows
+
+# google_web_analytics - Enable this to enable Google web analytics.
+
+google_web_analytics:
+
+  enable:       false
+  tracker_code: "enter_tracker_code_here"
+
+# bookmark_widget - Enable this to show the bookmark widget
+
+bookmark_widget:
+
+  enable:           false
+  addthis_username: "addthis.com username"
+
+# =========== Settings for Activity Limits ===========
+
+# Each limited feature will require a set of 5 settings; meanings of each
+# described below.  First part of every setting is the name of the feature
+# being limited.
+#
+# start_value - The initial maximum allowance for the feature (used when the
+#               new limit is created)  
+#
+# max_value - Absolute maximum allowance for the feature (this can't be
+#             exceeded after any promotions); 'nil' for always increasing
+#             allowance
+#
+# frequency (in hours) - The time period over which the allowance is given; for
+#                        example 5 messages (allowance) for 24 hours
+#                        (frequency) 'nil' for non-periodic limits (i.e. limits
+#                        which won't have their counters reset every
+#                        <frequency> hours)
+#
+# promote_every (in days) -  Every <X> days the user will be promoted to the
+#                            new level, where the allowance per frequency
+#                            period will be adjusted by promote_increment;
+#                            'nil' to indicate that promotion should never
+#                            happen
+#
+# promote_increment - Should be positive; 0 to indicate that promotion
+#                     shouldn't expand the allowance (why would this be
+#                     useful?) 'nil' to perform a one-time promotion by setting
+#                     the limit to whatever the value of max_value is; 'nil'
+#                     when the max_value is also 'nil' makes the feature
+#                     unlimited.
+
+activity_limits:
+
+  internal_message:
+  
+    start_value:       10
+    max_value:         200
+    frequency:         24 # hours
+    promote_every:     10 # days
+    promote_increment: 10
+
+  user_invite:
+
+    start_value:       20
+    max_value:         nil
+    frequency:         24 # hours
+    promote_every:     nil # days
+    promote_increment: nil
+
+  group_invite:
+
+    start_value:       10
+    max_value:         100
+    frequency:         24 # hours
+    promote_every:     20 # days
+    promote_increment: 10
+

Modified: trunk/config/environment.rb (2147 => 2148)


--- trunk/config/environment.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/config/environment.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -71,5 +71,7 @@
 require 'smtp_tls'
 require 'authorization'
 
+ActionMailer::Base.smtp_settings = Conf.smtp
+
 load 'config/environment_private.rb' if FileTest.exist?('config/environment_private.rb')
 

Deleted: trunk/config/environment_private.rb.pre (2147 => 2148)


--- trunk/config/environment_private.rb.pre	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/config/environment_private.rb.pre	2009-03-29 19:26:53 UTC (rev 2148)
@@ -1,109 +0,0 @@
-
-# Mailer configuration
-
-ActionMailer::Base.smtp_settings = {
-  :address  => "smtp.example.com",
-  :port  => 25, 
-  :domain  => "",
-  :user_name  => "username",
-  :password  => "password",
-  :authentication  => :login
-} 
-
-ActionMailer::Base.server_settings = {
-  :address => "smtp.example.com",
-  :port => "587",
-  :domain => "",
-  :authentication => :plain,
-  :user_name => "username",
-  :password  => "password"
-}
-
-SHOW_DEBUG = false
-
-# Key used for Symmetric Encryption
-SYM_ENCRYPTION_KEY = "your_symmetric_encryption_key"
-
-# Secret word used for email confirmation hashes (and possibly other things)
-SECRET_WORD = "our_secret_word_that_no_one_knows"
-
-# Set SOLR_ENABLE to true to enable the search facility - this requires a solr
-# server
-SOLR_ENABLE = false
-
-
-# ---
-# BEGIN web analytics settings
-
-# Switch web analytics on or off
-USE_WEBANALYTICS = false
-
-# Tracker code for Google Analytics
-GOOGLEANALYTICS_TRACKER_CODE = "enter_tracker_code_here"
-
-# END web analytics settings
-# ---
-
-
-# ---
-# BEGIN addthis.com bookmarking widget settings
-
-USE_BOOKMARK_WIDGET = false
-
-# addthis.com username
-ADDTHIS_WIDGET_USERNAME = "addthis.com username"
-
-# END addthis.com bookmarking widget settings
-# ---
-
-# The number of seconds for the cache timeout
-CACHE_TIMEOUT_SECS = 120
-
-# The maximum file size allowed for workflows
-WORKFLOW_UPLOAD_MAX_BYTES = 20971520
-
-
-# =========== Settings for Download and Viewing Logging ===========
-
-# Patterns in this list will be used to be checked against "user-agent" in http request headers
-# to filter out bots from usage statistics.
-#
-# It is essential to put patterns into the ignore list in a single quotes - this will enable the
-# patterns to be treated as regular expressions, not just strings
-BOT_IGNORE_LIST = ['Googlebot', 'Slurp', 'msnbot', 'crawler', 'bot', 'heritrix', 'spider', 'Nutch']
-
-
-# =========== Settings for Activity Limits ===========
-
-# Each limited feature will require a set of 5 settings; meanings of each described below.
-# First part of every setting is the name of the feature being limited.
-# <feature_name>_LIMIT_START_VALUE - the initial maximum allowance for the feature (used when the new limit is created)  
-# <feature_name>_LIMIT_MAX_VALUE - absolute maximum allowance for the feature (this can't be exceeded after any promotions);
-#                                  NULL for always increasing allowance
-# <feature_name>_LIMIT_FREQUENCY -- in hours -- the time period over which the allowance is given; for example 5 messages (allowance) for 24 hours (frequency)
-#                                               NULL for non-periodic limits (i.e. limits which won't have their counters reset every <frequency> hours)
-# <feature_name>_LIMIT_PROMOTE_EVERY -- in days -- every <X> days the user will be promoted to the new level, 
-#                                                  where the allowance per frequency period will be adjusted by <feature_name>_LIMIT_PROMOTE_INCREMENT;
-#                                                  NULL to indicate that promotion should never happen
-# <feature_name>_LIMIT_PROMOTE_INCREMENT - should be positive; 
-#                                          0 to indicate that promotion shouldn't expand the allowance (why would this be useful?)
-#                                          NULL to perform a one-time promotion by setting the limit to whatever the value of <feature_name>_LIMIT_MAX_VALUE is;
-#                                          NULL when the <feature_name>_LIMIT_MAX_VALUE is also NULL makes the feature unlimited.
-
-INTERNAL_MESSAGE_LIMIT_START_VALUE = 10
-INTERNAL_MESSAGE_LIMIT_MAX_VALUE = 200
-INTERNAL_MESSAGE_LIMIT_FREQUENCY = 24 # hours
-INTERNAL_MESSAGE_LIMIT_PROMOTE_EVERY = 10 # days
-INTERNAL_MESSAGE_LIMIT_PROMOTE_INCREMENT = 10
-
-USER_INVITE_LIMIT_START_VALUE = 20
-USER_INVITE_LIMIT_MAX_VALUE = nil
-USER_INVITE_LIMIT_FREQUENCY = 24 # hours
-USER_INVITE_LIMIT_PROMOTE_EVERY = nil # days
-USER_INVITE_LIMIT_PROMOTE_INCREMENT = nil
-
-GROUP_INVITE_LIMIT_START_VALUE = 10
-GROUP_INVITE_LIMIT_MAX_VALUE = 100
-GROUP_INVITE_LIMIT_FREQUENCY = 24 # hours
-GROUP_INVITE_LIMIT_PROMOTE_EVERY = 20 # days
-GROUP_INVITE_LIMIT_PROMOTE_INCREMENT = 10

Modified: trunk/lib/conf.rb (2147 => 2148)


--- trunk/lib/conf.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/lib/conf.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -57,6 +57,46 @@
     self.fetch_entry('model_aliases')
   end
 
+  def self.bot_ignore_list
+    self.fetch_entry('bot_ignore_list')
+  end
+
+  def self.max_upload_size
+    self.fetch_entry('max_upload_size')
+  end
+
+  def self.solr_enable
+    self.fetch_entry('solr_enable')
+  end
+
+  def self.smtp
+    self.fetch_entry('smtp')
+  end
+
+  def self.show_debug
+    self.fetch_entry('show_debug')
+  end
+
+  def self.sym_encryption_key
+    self.fetch_entry('sym_encryption_key')
+  end
+
+  def self.secret_word
+    self.fetch_entry('secret_word')
+  end
+
+  def self.google_web_analytics
+    self.fetch_entry('google_web_analytics')
+  end
+
+  def self.bookmark_widget
+    self.fetch_entry('bookmark_widget')
+  end
+
+  def self.activity_limits
+    self.fetch_entry('activity_limits')
+  end
+
   # This method is required to create an administrator in the test fixtures
 
   def self.admins=(value)

Modified: trunk/lib/rest.rb (2147 => 2148)


--- trunk/lib/rest.rb	2009-03-29 14:11:51 UTC (rev 2147)
+++ trunk/lib/rest.rb	2009-03-29 19:26:53 UTC (rev 2148)
@@ -802,7 +802,7 @@
 
   results = []
 
-  if SOLR_ENABLE and not search_query.nil? and search_query != ""
+  if Conf.solr_enable and not search_query.nil? and search_query != ""
     results = models[0].multi_solr_search(search_query, :limit => 100,
         :models => models).results
   end

reply via email to

[Prev in Thread] Current Thread [Next in Thread]