forked from openshift/origin-server
/
development.rb
128 lines (104 loc) · 6.1 KB
/
development.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
Broker::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
config.cache_classes = ENV['BROKER_SOURCE'] ? false : true
config.reload_plugins = ENV['BROKER_SOURCE'] ? true : false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
config.log_level = :debug
# Show full error reports and enable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = true
# Raise exceptions instead of rendering exception templates
config.action_dispatch.show_exceptions = true
# Disable request forgery protection
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Use SQL instead of Active Record's schema dumper when creating the test database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
config.assets.logger = false
############################################
# OpenShift Configuration Below this point #
############################################
conf = OpenShift::Config.new(File.join(OpenShift::Config::CONF_DIR, 'broker-dev.conf'))
config.send(:cache_store=, eval("[#{conf.get("CACHE_STORE")}]")) if conf.get("CACHE_STORE")
config.datastore = {
:host_port => conf.get("MONGO_HOST_PORT", "localhost:27017"),
:user => conf.get("MONGO_USER", "openshift"),
:password => conf.get("MONGO_PASSWORD", "mooo"),
:db => conf.get("MONGO_DB", "openshift_broker_dev"),
:ssl => conf.get_bool("MONGO_SSL", "false"),
:write_replicas => conf.get("MONGO_WRITE_REPLICAS", 1).to_i
}
config.usage_tracking = {
:datastore_enabled => conf.get_bool("ENABLE_USAGE_TRACKING_DATASTORE", "true"),
:audit_log_enabled => conf.get_bool("ENABLE_USAGE_TRACKING_AUDIT_LOG", "true"),
:audit_log_filepath => conf.get("USAGE_TRACKING_AUDIT_LOG_FILE", "/var/log/openshift/broker/usage.log")
}
config.analytics = {
:enabled => conf.get_bool("ENABLE_ANALYTICS", "false"), # global flag for whether any analytics should be enabled
}
config.user_action_logging = {
:logging_enabled => conf.get_bool("ENABLE_USER_ACTION_LOG", "true"),
:log_filepath => conf.get("USER_ACTION_LOG_FILE", "/var/log/openshift/broker/user_action.log")
}
config.maintenance = {
:enabled => conf.get_bool("ENABLE_MAINTENANCE_MODE", "false"),
:outage_msg_filepath => conf.get("MAINTENANCE_NOTIFICATION_FILE", "/etc/openshift/outage_notification.txt")
}
config.openshift = {
:domain_suffix => conf.get("CLOUD_DOMAIN", "example.com"),
:allow_alias_in_domain => conf.get_bool("ALLOW_ALIAS_IN_DOMAIN", "false"),
:default_max_domains => (conf.get("DEFAULT_MAX_DOMAINS", "10")).to_i,
:default_max_gears => (conf.get("DEFAULT_MAX_GEARS", "100")).to_i,
:default_gear_size => conf.get("DEFAULT_GEAR_SIZE", "small"),
:gear_sizes => conf.get("VALID_GEAR_SIZES", "small").split(","),
:default_gear_capabilities => conf.get("DEFAULT_GEAR_CAPABILITIES", "small").split(","),
:default_allow_ha => conf.get('DEFAULT_ALLOW_HA', "false"),
:community_quickstarts_url => conf.get('COMMUNITY_QUICKSTARTS_URL'),
:scopes => ['Scope::Session', 'Scope::Read', 'Scope::Domain', 'Scope::Application', 'Scope::Userinfo'],
:default_scope => 'userinfo',
:scope_expirations => OpenShift::Controller::Configuration.parse_expiration(conf.get('AUTH_SCOPE_TIMEOUTS'), 1.day),
:download_cartridges_enabled => conf.get_bool("DOWNLOAD_CARTRIDGES_ENABLED", "true"),
:ssl_endpoint => conf.get("SSL_ENDPOINT", "allow"),
:max_members_per_resource => conf.get('MAX_MEMBERS_PER_RESOURCE', '100').to_i,
:allow_ha_applications => conf.get_bool('ALLOW_HA_APPLICATIONS', "false"),
:default_ha_multiplier => (conf.get("DEFAULT_HA_MULTIPLIER", "0")).to_i,
:router_hostname => conf.get('ROUTER_HOSTNAME', "www.example.com"),
:ha_dns_prefix => conf.get('HA_DNS_PREFIX', "ha-"),
:ha_dns_suffix => conf.get('HA_DNS_SUFFIX', ""),
:valid_ssh_key_types => OpenShift::Controller::Configuration.parse_list(conf.get('VALID_SSH_KEY_TYPES', nil)),
:allow_obsolete_cartridges => conf.get_bool('ALLOW_OBSOLETE_CARTRIDGES', "false"),
:allow_multiple_haproxy_on_node => conf.get_bool('ALLOW_MULTIPLE_HAPROXY_ON_NODE', "true"),
:syslog_enabled => conf.get_bool('SYSLOG_ENABLED', 'false'),
:app_template_for => OpenShift::Controller::Configuration.parse_url_hash(conf.get('DEFAULT_APP_TEMPLATES', nil)),
:default_max_teams => (conf.get("DEFAULT_MAX_TEAMS", "0")).to_i,
:node_platforms => OpenShift::Controller::Configuration.parse_list(conf.get('NODE_PLATFORMS', 'linux')).map { |platform| platform.downcase }
}
config.auth = {
:salt => conf.get("AUTH_SALT", ""),
:privkeyfile => conf.get("AUTH_PRIV_KEY_FILE", "/var/www/openshift/broker/config/server_priv.pem"),
:privkeypass => conf.get("AUTH_PRIV_KEY_PASS", ""),
:pubkeyfile => conf.get("AUTH_PUB_KEY_FILE", "/var/www/openshift/broker/config/server_pub.pem"),
:rsync_keyfile => conf.get("AUTH_RSYNC_KEY_FILE", "/etc/openshift/rsync_id_rsa")
}
config.downloaded_cartridges = {
:max_downloaded_carts_per_app => conf.get("MAX_DOWNLOADED_CARTS_PER_APP", "5").to_i,
:max_download_redirects => conf.get("MAX_DOWNLOAD_REDIRECTS", "2").to_i,
:max_cart_size => conf.get("MAX_CART_SIZE", "20480").to_i,
:max_download_time => conf.get("MAX_DOWNLOAD_TIME", "10").to_i,
:connection_timeout => conf.get("CART_DOWNLOAD_CONN_TIMEOUT", "2").to_i,
:http_proxy => conf.get('HTTP_PROXY', '')
}
config.logger = OpenShift::Syslog.logger_for('openshift-broker', 'app') if config.openshift[:syslog_enabled]
end