mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Merge pull request #1229 from internetee/update-rails-settings-cached-gem
Update `rails-settings-cached` gem
This commit is contained in:
commit
703aa13b02
5 changed files with 86 additions and 78 deletions
5
Gemfile
5
Gemfile
|
@ -21,7 +21,10 @@ gem 'pg', '0.19.0'
|
|||
gem 'ransack', '1.5.1' # for searching
|
||||
gem 'validates_email_format_of', '1.6.3' # validates email against RFC 2822 and RFC 3696
|
||||
gem 'paper_trail', '~> 4.0'
|
||||
gem 'rails-settings-cached', '0.4.1' # for settings
|
||||
|
||||
# 0.7.3 is the latest for Rails 4.2, however, it is absent on Rubygems server
|
||||
# https://github.com/huacnlee/rails-settings-cached/issues/165
|
||||
gem 'rails-settings-cached', '0.7.2'
|
||||
|
||||
# html-xml
|
||||
gem 'haml-rails', '0.9.0' # haml for views
|
||||
|
|
|
@ -313,8 +313,8 @@ GEM
|
|||
rails-deprecated_sanitizer (>= 1.0.1)
|
||||
rails-html-sanitizer (1.0.4)
|
||||
loofah (~> 2.2, >= 2.2.2)
|
||||
rails-settings-cached (0.4.1)
|
||||
rails (>= 4.0.0)
|
||||
rails-settings-cached (0.7.2)
|
||||
rails (>= 4.2.0)
|
||||
railties (4.2.11.1)
|
||||
actionpack (= 4.2.11.1)
|
||||
activesupport (= 4.2.11.1)
|
||||
|
@ -493,7 +493,7 @@ DEPENDENCIES
|
|||
que-web (= 0.4.0)
|
||||
railroady (= 1.3.0)
|
||||
rails (= 4.2.11.1)
|
||||
rails-settings-cached (= 0.4.1)
|
||||
rails-settings-cached (= 0.7.2)
|
||||
ransack (= 1.5.1)
|
||||
rest-client
|
||||
rspec-rails (~> 3.6)
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
class Setting < RailsSettings::CachedSettings
|
||||
class Setting < RailsSettings::Base
|
||||
include Versions # version/setting_version.rb
|
||||
source Rails.root.join('config', 'app.yml')
|
||||
|
||||
# When config/app.yml has changed, you need change this prefix to v2, v3 ... to expires caches
|
||||
# cache_prefix { "v1" }
|
||||
|
||||
def self.reload_settings!
|
||||
STDOUT << "#{Time.zone.now.utc} - Clearing settings cache\n"
|
||||
|
|
74
config/app.yml
Normal file
74
config/app.yml
Normal file
|
@ -0,0 +1,74 @@
|
|||
# config/app.yml for rails-settings-cached
|
||||
defaults: &defaults
|
||||
admin_contacts_min_count: 1
|
||||
admin_contacts_max_count: 10
|
||||
tech_contacts_min_count: 1
|
||||
tech_contacts_max_count: 10
|
||||
orphans_contacts_in_months: 6
|
||||
expire_pending_confirmation: 48
|
||||
|
||||
ds_digest_type: 2
|
||||
ds_data_allowed: false
|
||||
key_data_allowed: true
|
||||
|
||||
dnskeys_min_count: 0
|
||||
dnskeys_max_count: 9
|
||||
ns_min_count: 2
|
||||
ns_max_count: 11
|
||||
|
||||
transfer_wait_time: 0
|
||||
request_confrimation_on_registrant_change_enabled: true
|
||||
request_confirmation_on_domain_deletion_enabled: true
|
||||
address_processing: true
|
||||
default_language: en
|
||||
nameserver_required: false
|
||||
|
||||
client_side_status_editing_enabled: false
|
||||
|
||||
invoice_number_min: 131050
|
||||
invoice_number_max: 149999
|
||||
directo_monthly_number_min: 309901
|
||||
directo_monthly_number_max: 309999
|
||||
directo_monthly_number_last: 309901
|
||||
days_to_keep_invoices_active: 30
|
||||
minimum_deposit: 0.0
|
||||
directo_receipt_payment_term: R
|
||||
directo_receipt_product_name: ETTEM06
|
||||
directo_sales_agent: JAANA
|
||||
|
||||
days_to_renew_domain_before_expire: 90
|
||||
expire_warning_period: 15
|
||||
redemption_grace_period: 30
|
||||
expiration_reminder_mail: 2
|
||||
|
||||
registrar_ip_whitelist_enabled: false
|
||||
api_ip_whitelist_enabled: false
|
||||
|
||||
registry_juridical_name: "Eesti Interneti SA"
|
||||
registry_reg_no: "90010019"
|
||||
registry_email: "info@internet.ee"
|
||||
registry_billing_email: "info@internet.ee"
|
||||
registry_phone: "+372 727 1000"
|
||||
registry_country_code: "EE"
|
||||
registry_state: "Harjumaa"
|
||||
registry_street: "Paldiski mnt 80"
|
||||
registry_city: "Tallinn"
|
||||
registry_zip: "10617"
|
||||
registry_vat_no: "EE101286464"
|
||||
registry_url: "www.internet.ee"
|
||||
registry_vat_prc: 0.2
|
||||
registry_iban: "EE557700771000598731"
|
||||
registry_bank: "LHV Pank"
|
||||
registry_bank_code: "689"
|
||||
registry_swift: "LHVBEE22"
|
||||
registry_invoice_contact: "Martti Õigus"
|
||||
registry_whois_disclaimer: "Search results may not be used for commercial, advertising, recompilation, repackaging, redistribution, reuse, obscuring or other similar activities."
|
||||
|
||||
development:
|
||||
<<: *defaults
|
||||
|
||||
test:
|
||||
<<: *defaults
|
||||
|
||||
production:
|
||||
<<: *defaults
|
|
@ -1,73 +0,0 @@
|
|||
# encoding: UTF-8
|
||||
# otherwise rake not working 100%
|
||||
begin
|
||||
con = ActiveRecord::Base.connection
|
||||
rescue ActiveRecord::NoDatabaseError => e
|
||||
Rails.logger.info "Init settings didn't find database: #{e}"
|
||||
end
|
||||
|
||||
if con.present? && con.table_exists?('settings')
|
||||
Setting.save_default(:admin_contacts_min_count, 1)
|
||||
Setting.save_default(:admin_contacts_max_count, 10)
|
||||
Setting.save_default(:tech_contacts_min_count, 1)
|
||||
Setting.save_default(:tech_contacts_max_count, 10)
|
||||
Setting.save_default(:orphans_contacts_in_months, 6)
|
||||
Setting.save_default(:expire_pending_confirmation, 48)
|
||||
|
||||
Setting.save_default(:ds_digest_type, 2)
|
||||
Setting.save_default(:ds_data_allowed, false)
|
||||
Setting.save_default(:key_data_allowed, true)
|
||||
|
||||
Setting.save_default(:dnskeys_min_count, 0)
|
||||
Setting.save_default(:dnskeys_max_count, 9)
|
||||
Setting.save_default(:ns_min_count, 2)
|
||||
Setting.save_default(:ns_max_count, 11)
|
||||
|
||||
Setting.save_default(:transfer_wait_time, 0)
|
||||
Setting.save_default(:request_confrimation_on_registrant_change_enabled, true)
|
||||
Setting.save_default(:request_confirmation_on_domain_deletion_enabled, true)
|
||||
Setting.save_default(:address_processing, true)
|
||||
Setting.save_default(:default_language, 'en')
|
||||
Setting.save_default(:nameserver_required, false)
|
||||
|
||||
Setting.save_default(:client_side_status_editing_enabled, false)
|
||||
|
||||
Setting.save_default(:invoice_number_min, 131050)
|
||||
Setting.save_default(:invoice_number_max, 149999)
|
||||
Setting.save_default(:directo_monthly_number_min, 309901)
|
||||
Setting.save_default(:directo_monthly_number_max, 309999)
|
||||
Setting.save_default(:directo_monthly_number_last, 309901)
|
||||
Setting.save_default(:days_to_keep_invoices_active, 30)
|
||||
Setting.save_default(:minimum_deposit, 0.0)
|
||||
Setting.save_default(:directo_receipt_payment_term, "R")
|
||||
Setting.save_default(:directo_receipt_product_name, "ETTEM06")
|
||||
Setting.save_default(:directo_sales_agent, "JAANA")
|
||||
|
||||
Setting.save_default(:days_to_renew_domain_before_expire, 90)
|
||||
Setting.save_default(:expire_warning_period, 15)
|
||||
Setting.save_default(:redemption_grace_period, 30)
|
||||
Setting.save_default(:expiration_reminder_mail, 2)
|
||||
|
||||
Setting.save_default(:registrar_ip_whitelist_enabled, false)
|
||||
Setting.save_default(:api_ip_whitelist_enabled, false)
|
||||
|
||||
Setting.save_default(:registry_juridical_name, 'Eesti Interneti SA')
|
||||
Setting.save_default(:registry_reg_no, '90010019')
|
||||
Setting.save_default(:registry_email, 'info@internet.ee')
|
||||
Setting.save_default(:registry_billing_email, 'info@internet.ee')
|
||||
Setting.save_default(:registry_phone, '+372 727 1000')
|
||||
Setting.save_default(:registry_country_code, 'EE')
|
||||
Setting.save_default(:registry_state, 'Harjumaa')
|
||||
Setting.save_default(:registry_street, 'Paldiski mnt 80')
|
||||
Setting.save_default(:registry_city, 'Tallinn')
|
||||
Setting.save_default(:registry_zip, '10617')
|
||||
Setting.save_default(:registry_vat_no, 'EE101286464')
|
||||
Setting.save_default(:registry_url, 'www.internet.ee')
|
||||
Setting.save_default(:registry_vat_prc, 0.2)
|
||||
Setting.save_default(:registry_iban, 'EE557700771000598731')
|
||||
Setting.save_default(:registry_bank, 'LHV Pank')
|
||||
Setting.save_default(:registry_bank_code, '689')
|
||||
Setting.save_default(:registry_swift, 'LHVBEE22')
|
||||
Setting.save_default(:registry_invoice_contact, 'Martti Õigus')
|
||||
Setting.save_default(:registry_whois_disclaimer, 'Search results may not be used for commercial, advertising, recompilation, repackaging, redistribution, reuse, obscuring or other similar activities.')
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue