diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2017-03-01 22:20:40 +0100 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2017-03-01 22:20:40 +0100 |
commit | ee5056fb56ad0a00924d8ba87543106f518b4a11 (patch) | |
tree | e350674c6124faefeb26e2cced8f9e6cc4e0485d | |
parent | 2eee45f0a554a7c839f8a894b61aca4205714441 (diff) | |
download | ecs-ee5056fb56ad0a00924d8ba87543106f518b4a11.tar.gz ecs-ee5056fb56ad0a00924d8ba87543106f518b4a11.zip |
Initial config files.
-rw-r--r-- | config/database.yml | 44 | ||||
-rw-r--r-- | config/ecs_config.yml | 5 | ||||
-rw-r--r-- | config/initializers/ecs_00.rb | 40 |
3 files changed, 73 insertions, 16 deletions
diff --git a/config/database.yml b/config/database.yml index 1c1a37c..d462838 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,25 +1,37 @@ -# SQLite version 3.x -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' -# -default: &default - adapter: sqlite3 +base: &base + adapter: postgresql + encoding: unicode pool: 5 - timeout: 5000 - + username: mb7 + password: +# development: - <<: *default - database: db/development.sqlite3 + database: ecs_development + <<: *base + + # Connect on a TCP socket. Omitted by default since the client uses a + # domain socket that doesn't need configuration. Windows does not have + # domain sockets, so uncomment these lines. + #host: localhost + #port: 5432 + + # Schema search path. The server defaults to $user,public + #schema_search_path: myapp,sharedapp,public + + # Minimum log levels, in increasing order: + # debug5, debug4, debug3, debug2, debug1, + # log, notice, warning, error, fatal, and panic + # The server defaults to notice. + #min_messages: warning # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: - <<: *default - database: db/test.sqlite3 + database: ecs_test + <<: *base production: - <<: *default - database: db/production.sqlite3 + database: ecs_production + <<: *base + diff --git a/config/ecs_config.yml b/config/ecs_config.yml new file mode 100644 index 0000000..77cebb0 --- /dev/null +++ b/config/ecs_config.yml @@ -0,0 +1,5 @@ +participants: + allow_anonymous: false + allow_events: true # for database migration +admin: + confirm_actions: false diff --git a/config/initializers/ecs_00.rb b/config/initializers/ecs_00.rb new file mode 100644 index 0000000..c750fc5 --- /dev/null +++ b/config/initializers/ecs_00.rb @@ -0,0 +1,40 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +# Filter-Namespace +module EcsFilter +end + +class FilterApi + attr_accessor :params, :record +end + +FILTER_API=FilterApi.new + +# read configuration data +require 'yaml' + +begin + ECS_CONFIG = YAML::load_stream(File.open(Rails.root.join('config','ecs_config.yml')))[0] +rescue Exception + Rails.logger.fatal "Reading #{Rails.root.join('config','ecs_config.yml')}" +end + +ECS_CONFIG["participants"]["allow_anonymous"] = false unless defined? ECS_CONFIG["participants"]["allow_anonymous"] +ECS_CONFIG["participants"]["allow_events"] = true unless defined? ECS_CONFIG["participants"]["allow_events"] +ECS_CONFIG["admin"]["confirm_actions"] = true unless defined? ECS_CONFIG["admin"]["confirm_actions"] |