##// END OF EJS Templates
added simple profiling middleware controlled by .ini file flag
marcink -
r1355:bfc52937 beta
parent child Browse files
Show More
@@ -1,232 +1,233 b''
1 ################################################################################
1 ################################################################################
2 ################################################################################
2 ################################################################################
3 # RhodeCode - Pylons environment configuration #
3 # RhodeCode - Pylons environment configuration #
4 # #
4 # #
5 # The %(here)s variable will be replaced with the parent directory of this file#
5 # The %(here)s variable will be replaced with the parent directory of this file#
6 ################################################################################
6 ################################################################################
7
7
8 [DEFAULT]
8 [DEFAULT]
9 debug = true
9 debug = true
10 pdebug = false
10 ################################################################################
11 ################################################################################
11 ## Uncomment and replace with the address which should receive ##
12 ## Uncomment and replace with the address which should receive ##
12 ## any error reports after application crash ##
13 ## any error reports after application crash ##
13 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ################################################################################
15 ################################################################################
15 #email_to = admin@localhost
16 #email_to = admin@localhost
16 #error_email_from = paste_error@localhost
17 #error_email_from = paste_error@localhost
17 #app_email_from = rhodecode-noreply@localhost
18 #app_email_from = rhodecode-noreply@localhost
18 #error_message =
19 #error_message =
19
20
20 #smtp_server = mail.server.com
21 #smtp_server = mail.server.com
21 #smtp_username =
22 #smtp_username =
22 #smtp_password =
23 #smtp_password =
23 #smtp_port =
24 #smtp_port =
24 #smtp_use_tls = false
25 #smtp_use_tls = false
25 #smtp_use_ssl = true
26 #smtp_use_ssl = true
26
27
27 [server:main]
28 [server:main]
28 ##nr of threads to spawn
29 ##nr of threads to spawn
29 threadpool_workers = 5
30 threadpool_workers = 5
30
31
31 ##max request before thread respawn
32 ##max request before thread respawn
32 threadpool_max_requests = 6
33 threadpool_max_requests = 6
33
34
34 ##option to use threads of process
35 ##option to use threads of process
35 use_threadpool = true
36 use_threadpool = true
36
37
37 use = egg:Paste#http
38 use = egg:Paste#http
38 host = 0.0.0.0
39 host = 0.0.0.0
39 port = 5000
40 port = 5000
40
41
41 [app:main]
42 [app:main]
42 use = egg:rhodecode
43 use = egg:rhodecode
43 full_stack = true
44 full_stack = true
44 static_files = true
45 static_files = true
45 lang=en
46 lang=en
46 cache_dir = %(here)s/data
47 cache_dir = %(here)s/data
47 index_dir = %(here)s/data/index
48 index_dir = %(here)s/data/index
48 app_instance_uuid = develop
49 app_instance_uuid = develop
49 cut_off_limit = 256000
50 cut_off_limit = 256000
50 force_https = false
51 force_https = false
51 commit_parse_limit = 25
52 commit_parse_limit = 25
52 use_gravatar = true
53 use_gravatar = true
53
54
54 ####################################
55 ####################################
55 ### CELERY CONFIG ####
56 ### CELERY CONFIG ####
56 ####################################
57 ####################################
57 use_celery = false
58 use_celery = false
58 broker.host = localhost
59 broker.host = localhost
59 broker.vhost = rabbitmqhost
60 broker.vhost = rabbitmqhost
60 broker.port = 5672
61 broker.port = 5672
61 broker.user = rabbitmq
62 broker.user = rabbitmq
62 broker.password = qweqwe
63 broker.password = qweqwe
63
64
64 celery.imports = rhodecode.lib.celerylib.tasks
65 celery.imports = rhodecode.lib.celerylib.tasks
65
66
66 celery.result.backend = amqp
67 celery.result.backend = amqp
67 celery.result.dburi = amqp://
68 celery.result.dburi = amqp://
68 celery.result.serialier = json
69 celery.result.serialier = json
69
70
70 #celery.send.task.error.emails = true
71 #celery.send.task.error.emails = true
71 #celery.amqp.task.result.expires = 18000
72 #celery.amqp.task.result.expires = 18000
72
73
73 celeryd.concurrency = 2
74 celeryd.concurrency = 2
74 #celeryd.log.file = celeryd.log
75 #celeryd.log.file = celeryd.log
75 celeryd.log.level = debug
76 celeryd.log.level = debug
76 celeryd.max.tasks.per.child = 1
77 celeryd.max.tasks.per.child = 1
77
78
78 #tasks will never be sent to the queue, but executed locally instead.
79 #tasks will never be sent to the queue, but executed locally instead.
79 celery.always.eager = false
80 celery.always.eager = false
80
81
81 ####################################
82 ####################################
82 ### BEAKER CACHE ####
83 ### BEAKER CACHE ####
83 ####################################
84 ####################################
84 beaker.cache.data_dir=%(here)s/data/cache/data
85 beaker.cache.data_dir=%(here)s/data/cache/data
85 beaker.cache.lock_dir=%(here)s/data/cache/lock
86 beaker.cache.lock_dir=%(here)s/data/cache/lock
86
87
87 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
88 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
88
89
89 beaker.cache.super_short_term.type=memory
90 beaker.cache.super_short_term.type=memory
90 beaker.cache.super_short_term.expire=10
91 beaker.cache.super_short_term.expire=10
91
92
92 beaker.cache.short_term.type=memory
93 beaker.cache.short_term.type=memory
93 beaker.cache.short_term.expire=60
94 beaker.cache.short_term.expire=60
94
95
95 beaker.cache.long_term.type=memory
96 beaker.cache.long_term.type=memory
96 beaker.cache.long_term.expire=36000
97 beaker.cache.long_term.expire=36000
97
98
98 beaker.cache.sql_cache_short.type=memory
99 beaker.cache.sql_cache_short.type=memory
99 beaker.cache.sql_cache_short.expire=10
100 beaker.cache.sql_cache_short.expire=10
100
101
101 beaker.cache.sql_cache_med.type=memory
102 beaker.cache.sql_cache_med.type=memory
102 beaker.cache.sql_cache_med.expire=360
103 beaker.cache.sql_cache_med.expire=360
103
104
104 beaker.cache.sql_cache_long.type=file
105 beaker.cache.sql_cache_long.type=file
105 beaker.cache.sql_cache_long.expire=3600
106 beaker.cache.sql_cache_long.expire=3600
106
107
107 ####################################
108 ####################################
108 ### BEAKER SESSION ####
109 ### BEAKER SESSION ####
109 ####################################
110 ####################################
110 ## Type of storage used for the session, current types are
111 ## Type of storage used for the session, current types are
111 ## dbm, file, memcached, database, and memory.
112 ## dbm, file, memcached, database, and memory.
112 ## The storage uses the Container API
113 ## The storage uses the Container API
113 ##that is also used by the cache system.
114 ##that is also used by the cache system.
114 beaker.session.type = file
115 beaker.session.type = file
115
116
116 beaker.session.key = rhodecode
117 beaker.session.key = rhodecode
117 beaker.session.secret = g654dcno0-9873jhgfreyu
118 beaker.session.secret = g654dcno0-9873jhgfreyu
118 beaker.session.timeout = 36000
119 beaker.session.timeout = 36000
119
120
120 ##auto save the session to not to use .save()
121 ##auto save the session to not to use .save()
121 beaker.session.auto = False
122 beaker.session.auto = False
122
123
123 ##true exire at browser close
124 ##true exire at browser close
124 #beaker.session.cookie_expires = 3600
125 #beaker.session.cookie_expires = 3600
125
126
126
127
127 ################################################################################
128 ################################################################################
128 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
129 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
129 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
130 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
130 ## execute malicious code after an exception is raised. ##
131 ## execute malicious code after an exception is raised. ##
131 ################################################################################
132 ################################################################################
132 #set debug = false
133 #set debug = false
133
134
134 ##################################
135 ##################################
135 ### LOGVIEW CONFIG ###
136 ### LOGVIEW CONFIG ###
136 ##################################
137 ##################################
137 logview.sqlalchemy = #faa
138 logview.sqlalchemy = #faa
138 logview.pylons.templating = #bfb
139 logview.pylons.templating = #bfb
139 logview.pylons.util = #eee
140 logview.pylons.util = #eee
140
141
141 #########################################################
142 #########################################################
142 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
143 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
143 #########################################################
144 #########################################################
144 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
145 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
145 #sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
146 #sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
146 sqlalchemy.db1.echo = True
147 sqlalchemy.db1.echo = True
147 sqlalchemy.db1.pool_recycle = 3600
148 sqlalchemy.db1.pool_recycle = 3600
148 sqlalchemy.convert_unicode = true
149 sqlalchemy.convert_unicode = true
149
150
150 ################################
151 ################################
151 ### LOGGING CONFIGURATION ####
152 ### LOGGING CONFIGURATION ####
152 ################################
153 ################################
153 [loggers]
154 [loggers]
154 keys = root, routes, rhodecode, sqlalchemy, beaker, templates
155 keys = root, routes, rhodecode, sqlalchemy, beaker, templates
155
156
156 [handlers]
157 [handlers]
157 keys = console, console_sql
158 keys = console, console_sql
158
159
159 [formatters]
160 [formatters]
160 keys = generic, color_formatter, color_formatter_sql
161 keys = generic, color_formatter, color_formatter_sql
161
162
162 #############
163 #############
163 ## LOGGERS ##
164 ## LOGGERS ##
164 #############
165 #############
165 [logger_root]
166 [logger_root]
166 level = NOTSET
167 level = NOTSET
167 handlers = console
168 handlers = console
168
169
169 [logger_routes]
170 [logger_routes]
170 level = DEBUG
171 level = DEBUG
171 handlers =
172 handlers =
172 qualname = routes.middleware
173 qualname = routes.middleware
173 # "level = DEBUG" logs the route matched and routing variables.
174 # "level = DEBUG" logs the route matched and routing variables.
174 propagate = 1
175 propagate = 1
175
176
176 [logger_beaker]
177 [logger_beaker]
177 level = DEBUG
178 level = DEBUG
178 handlers =
179 handlers =
179 qualname = beaker.container
180 qualname = beaker.container
180 propagate = 1
181 propagate = 1
181
182
182 [logger_templates]
183 [logger_templates]
183 level = INFO
184 level = INFO
184 handlers =
185 handlers =
185 qualname = pylons.templating
186 qualname = pylons.templating
186 propagate = 1
187 propagate = 1
187
188
188 [logger_rhodecode]
189 [logger_rhodecode]
189 level = DEBUG
190 level = DEBUG
190 handlers =
191 handlers =
191 qualname = rhodecode
192 qualname = rhodecode
192 propagate = 1
193 propagate = 1
193
194
194 [logger_sqlalchemy]
195 [logger_sqlalchemy]
195 level = INFO
196 level = INFO
196 handlers = console_sql
197 handlers = console_sql
197 qualname = sqlalchemy.engine
198 qualname = sqlalchemy.engine
198 propagate = 0
199 propagate = 0
199
200
200 ##############
201 ##############
201 ## HANDLERS ##
202 ## HANDLERS ##
202 ##############
203 ##############
203
204
204 [handler_console]
205 [handler_console]
205 class = StreamHandler
206 class = StreamHandler
206 args = (sys.stderr,)
207 args = (sys.stderr,)
207 level = NOTSET
208 level = NOTSET
208 formatter = color_formatter
209 formatter = color_formatter
209
210
210 [handler_console_sql]
211 [handler_console_sql]
211 class = StreamHandler
212 class = StreamHandler
212 args = (sys.stderr,)
213 args = (sys.stderr,)
213 level = NOTSET
214 level = NOTSET
214 formatter = color_formatter_sql
215 formatter = color_formatter_sql
215
216
216 ################
217 ################
217 ## FORMATTERS ##
218 ## FORMATTERS ##
218 ################
219 ################
219
220
220 [formatter_generic]
221 [formatter_generic]
221 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
222 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
222 datefmt = %Y-%m-%d %H:%M:%S
223 datefmt = %Y-%m-%d %H:%M:%S
223
224
224 [formatter_color_formatter]
225 [formatter_color_formatter]
225 class=rhodecode.lib.colored_formatter.ColorFormatter
226 class=rhodecode.lib.colored_formatter.ColorFormatter
226 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
227 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
227 datefmt = %Y-%m-%d %H:%M:%S
228 datefmt = %Y-%m-%d %H:%M:%S
228
229
229 [formatter_color_formatter_sql]
230 [formatter_color_formatter_sql]
230 class=rhodecode.lib.colored_formatter.ColorFormatterSql
231 class=rhodecode.lib.colored_formatter.ColorFormatterSql
231 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
232 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
232 datefmt = %Y-%m-%d %H:%M:%S
233 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,232 +1,233 b''
1 ################################################################################
1 ################################################################################
2 ################################################################################
2 ################################################################################
3 # RhodeCode - Pylons environment configuration #
3 # RhodeCode - Pylons environment configuration #
4 # #
4 # #
5 # The %(here)s variable will be replaced with the parent directory of this file#
5 # The %(here)s variable will be replaced with the parent directory of this file#
6 ################################################################################
6 ################################################################################
7
7
8 [DEFAULT]
8 [DEFAULT]
9 debug = true
9 debug = true
10 pdebug = false
10 ################################################################################
11 ################################################################################
11 ## Uncomment and replace with the address which should receive ##
12 ## Uncomment and replace with the address which should receive ##
12 ## any error reports after application crash ##
13 ## any error reports after application crash ##
13 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ################################################################################
15 ################################################################################
15 #email_to = admin@localhost
16 #email_to = admin@localhost
16 #error_email_from = paste_error@localhost
17 #error_email_from = paste_error@localhost
17 #app_email_from = rhodecode-noreply@localhost
18 #app_email_from = rhodecode-noreply@localhost
18 #error_message =
19 #error_message =
19
20
20 #smtp_server = mail.server.com
21 #smtp_server = mail.server.com
21 #smtp_username =
22 #smtp_username =
22 #smtp_password =
23 #smtp_password =
23 #smtp_port =
24 #smtp_port =
24 #smtp_use_tls = false
25 #smtp_use_tls = false
25 #smtp_use_ssl = true
26 #smtp_use_ssl = true
26
27
27 [server:main]
28 [server:main]
28 ##nr of threads to spawn
29 ##nr of threads to spawn
29 threadpool_workers = 5
30 threadpool_workers = 5
30
31
31 ##max request before thread respawn
32 ##max request before thread respawn
32 threadpool_max_requests = 10
33 threadpool_max_requests = 10
33
34
34 ##option to use threads of process
35 ##option to use threads of process
35 use_threadpool = true
36 use_threadpool = true
36
37
37 use = egg:Paste#http
38 use = egg:Paste#http
38 host = 127.0.0.1
39 host = 127.0.0.1
39 port = 8001
40 port = 8001
40
41
41 [app:main]
42 [app:main]
42 use = egg:rhodecode
43 use = egg:rhodecode
43 full_stack = true
44 full_stack = true
44 static_files = true
45 static_files = true
45 lang=en
46 lang=en
46 cache_dir = %(here)s/data
47 cache_dir = %(here)s/data
47 index_dir = %(here)s/data/index
48 index_dir = %(here)s/data/index
48 app_instance_uuid = prod1234
49 app_instance_uuid = prod1234
49 cut_off_limit = 256000
50 cut_off_limit = 256000
50 force_https = false
51 force_https = false
51 commit_parse_limit = 50
52 commit_parse_limit = 50
52 use_gravatar = true
53 use_gravatar = true
53
54
54 ####################################
55 ####################################
55 ### CELERY CONFIG ####
56 ### CELERY CONFIG ####
56 ####################################
57 ####################################
57 use_celery = false
58 use_celery = false
58 broker.host = localhost
59 broker.host = localhost
59 broker.vhost = rabbitmqhost
60 broker.vhost = rabbitmqhost
60 broker.port = 5672
61 broker.port = 5672
61 broker.user = rabbitmq
62 broker.user = rabbitmq
62 broker.password = qweqwe
63 broker.password = qweqwe
63
64
64 celery.imports = rhodecode.lib.celerylib.tasks
65 celery.imports = rhodecode.lib.celerylib.tasks
65
66
66 celery.result.backend = amqp
67 celery.result.backend = amqp
67 celery.result.dburi = amqp://
68 celery.result.dburi = amqp://
68 celery.result.serialier = json
69 celery.result.serialier = json
69
70
70 #celery.send.task.error.emails = true
71 #celery.send.task.error.emails = true
71 #celery.amqp.task.result.expires = 18000
72 #celery.amqp.task.result.expires = 18000
72
73
73 celeryd.concurrency = 2
74 celeryd.concurrency = 2
74 #celeryd.log.file = celeryd.log
75 #celeryd.log.file = celeryd.log
75 celeryd.log.level = debug
76 celeryd.log.level = debug
76 celeryd.max.tasks.per.child = 1
77 celeryd.max.tasks.per.child = 1
77
78
78 #tasks will never be sent to the queue, but executed locally instead.
79 #tasks will never be sent to the queue, but executed locally instead.
79 celery.always.eager = false
80 celery.always.eager = false
80
81
81 ####################################
82 ####################################
82 ### BEAKER CACHE ####
83 ### BEAKER CACHE ####
83 ####################################
84 ####################################
84 beaker.cache.data_dir=%(here)s/data/cache/data
85 beaker.cache.data_dir=%(here)s/data/cache/data
85 beaker.cache.lock_dir=%(here)s/data/cache/lock
86 beaker.cache.lock_dir=%(here)s/data/cache/lock
86
87
87 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
88 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
88
89
89 beaker.cache.super_short_term.type=memory
90 beaker.cache.super_short_term.type=memory
90 beaker.cache.super_short_term.expire=10
91 beaker.cache.super_short_term.expire=10
91
92
92 beaker.cache.short_term.type=memory
93 beaker.cache.short_term.type=memory
93 beaker.cache.short_term.expire=60
94 beaker.cache.short_term.expire=60
94
95
95 beaker.cache.long_term.type=memory
96 beaker.cache.long_term.type=memory
96 beaker.cache.long_term.expire=36000
97 beaker.cache.long_term.expire=36000
97
98
98 beaker.cache.sql_cache_short.type=memory
99 beaker.cache.sql_cache_short.type=memory
99 beaker.cache.sql_cache_short.expire=10
100 beaker.cache.sql_cache_short.expire=10
100
101
101 beaker.cache.sql_cache_med.type=memory
102 beaker.cache.sql_cache_med.type=memory
102 beaker.cache.sql_cache_med.expire=360
103 beaker.cache.sql_cache_med.expire=360
103
104
104 beaker.cache.sql_cache_long.type=file
105 beaker.cache.sql_cache_long.type=file
105 beaker.cache.sql_cache_long.expire=3600
106 beaker.cache.sql_cache_long.expire=3600
106
107
107 ####################################
108 ####################################
108 ### BEAKER SESSION ####
109 ### BEAKER SESSION ####
109 ####################################
110 ####################################
110 ## Type of storage used for the session, current types are
111 ## Type of storage used for the session, current types are
111 ## dbm, file, memcached, database, and memory.
112 ## dbm, file, memcached, database, and memory.
112 ## The storage uses the Container API
113 ## The storage uses the Container API
113 ##that is also used by the cache system.
114 ##that is also used by the cache system.
114 beaker.session.type = file
115 beaker.session.type = file
115
116
116 beaker.session.key = rhodecode
117 beaker.session.key = rhodecode
117 beaker.session.secret = g654dcno0-9873jhgfreyu
118 beaker.session.secret = g654dcno0-9873jhgfreyu
118 beaker.session.timeout = 36000
119 beaker.session.timeout = 36000
119
120
120 ##auto save the session to not to use .save()
121 ##auto save the session to not to use .save()
121 beaker.session.auto = False
122 beaker.session.auto = False
122
123
123 ##true exire at browser close
124 ##true exire at browser close
124 #beaker.session.cookie_expires = 3600
125 #beaker.session.cookie_expires = 3600
125
126
126
127
127 ################################################################################
128 ################################################################################
128 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
129 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
129 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
130 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
130 ## execute malicious code after an exception is raised. ##
131 ## execute malicious code after an exception is raised. ##
131 ################################################################################
132 ################################################################################
132 set debug = false
133 set debug = false
133
134
134 ##################################
135 ##################################
135 ### LOGVIEW CONFIG ###
136 ### LOGVIEW CONFIG ###
136 ##################################
137 ##################################
137 logview.sqlalchemy = #faa
138 logview.sqlalchemy = #faa
138 logview.pylons.templating = #bfb
139 logview.pylons.templating = #bfb
139 logview.pylons.util = #eee
140 logview.pylons.util = #eee
140
141
141 #########################################################
142 #########################################################
142 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
143 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
143 #########################################################
144 #########################################################
144 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
145 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
145 sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
146 sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
146 sqlalchemy.db1.echo = True
147 sqlalchemy.db1.echo = True
147 sqlalchemy.db1.pool_recycle = 3600
148 sqlalchemy.db1.pool_recycle = 3600
148 sqlalchemy.convert_unicode = true
149 sqlalchemy.convert_unicode = true
149
150
150 ################################
151 ################################
151 ### LOGGING CONFIGURATION ####
152 ### LOGGING CONFIGURATION ####
152 ################################
153 ################################
153 [loggers]
154 [loggers]
154 keys = root, routes, rhodecode, sqlalchemy, beaker, templates
155 keys = root, routes, rhodecode, sqlalchemy, beaker, templates
155
156
156 [handlers]
157 [handlers]
157 keys = console, console_sql
158 keys = console, console_sql
158
159
159 [formatters]
160 [formatters]
160 keys = generic, color_formatter, color_formatter_sql
161 keys = generic, color_formatter, color_formatter_sql
161
162
162 #############
163 #############
163 ## LOGGERS ##
164 ## LOGGERS ##
164 #############
165 #############
165 [logger_root]
166 [logger_root]
166 level = NOTSET
167 level = NOTSET
167 handlers = console
168 handlers = console
168
169
169 [logger_routes]
170 [logger_routes]
170 level = DEBUG
171 level = DEBUG
171 handlers =
172 handlers =
172 qualname = routes.middleware
173 qualname = routes.middleware
173 # "level = DEBUG" logs the route matched and routing variables.
174 # "level = DEBUG" logs the route matched and routing variables.
174 propagate = 1
175 propagate = 1
175
176
176 [logger_beaker]
177 [logger_beaker]
177 level = DEBUG
178 level = DEBUG
178 handlers =
179 handlers =
179 qualname = beaker.container
180 qualname = beaker.container
180 propagate = 1
181 propagate = 1
181
182
182 [logger_templates]
183 [logger_templates]
183 level = INFO
184 level = INFO
184 handlers =
185 handlers =
185 qualname = pylons.templating
186 qualname = pylons.templating
186 propagate = 1
187 propagate = 1
187
188
188 [logger_rhodecode]
189 [logger_rhodecode]
189 level = DEBUG
190 level = DEBUG
190 handlers =
191 handlers =
191 qualname = rhodecode
192 qualname = rhodecode
192 propagate = 1
193 propagate = 1
193
194
194 [logger_sqlalchemy]
195 [logger_sqlalchemy]
195 level = INFO
196 level = INFO
196 handlers = console_sql
197 handlers = console_sql
197 qualname = sqlalchemy.engine
198 qualname = sqlalchemy.engine
198 propagate = 0
199 propagate = 0
199
200
200 ##############
201 ##############
201 ## HANDLERS ##
202 ## HANDLERS ##
202 ##############
203 ##############
203
204
204 [handler_console]
205 [handler_console]
205 class = StreamHandler
206 class = StreamHandler
206 args = (sys.stderr,)
207 args = (sys.stderr,)
207 level = INFO
208 level = INFO
208 formatter = color_formatter
209 formatter = color_formatter
209
210
210 [handler_console_sql]
211 [handler_console_sql]
211 class = StreamHandler
212 class = StreamHandler
212 args = (sys.stderr,)
213 args = (sys.stderr,)
213 level = WARN
214 level = WARN
214 formatter = color_formatter_sql
215 formatter = color_formatter_sql
215
216
216 ################
217 ################
217 ## FORMATTERS ##
218 ## FORMATTERS ##
218 ################
219 ################
219
220
220 [formatter_generic]
221 [formatter_generic]
221 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
222 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
222 datefmt = %Y-%m-%d %H:%M:%S
223 datefmt = %Y-%m-%d %H:%M:%S
223
224
224 [formatter_color_formatter]
225 [formatter_color_formatter]
225 class=rhodecode.lib.colored_formatter.ColorFormatter
226 class=rhodecode.lib.colored_formatter.ColorFormatter
226 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
227 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
227 datefmt = %Y-%m-%d %H:%M:%S
228 datefmt = %Y-%m-%d %H:%M:%S
228
229
229 [formatter_color_formatter_sql]
230 [formatter_color_formatter_sql]
230 class=rhodecode.lib.colored_formatter.ColorFormatterSql
231 class=rhodecode.lib.colored_formatter.ColorFormatterSql
231 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
232 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
232 datefmt = %Y-%m-%d %H:%M:%S No newline at end of file
233 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,231 +1,232 b''
1 ################################################################################
1 ################################################################################
2 ################################################################################
2 ################################################################################
3 # RhodeCode - Pylons environment configuration #
3 # RhodeCode - Pylons environment configuration #
4 # #
4 # #
5 # The %(here)s variable will be replaced with the parent directory of this file#
5 # The %(here)s variable will be replaced with the parent directory of this file#
6 ################################################################################
6 ################################################################################
7
7
8 [DEFAULT]
8 [DEFAULT]
9 debug = true
9 debug = true
10 pdebug = false
10 ################################################################################
11 ################################################################################
11 ## Uncomment and replace with the address which should receive ##
12 ## Uncomment and replace with the address which should receive ##
12 ## any error reports after application crash ##
13 ## any error reports after application crash ##
13 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ################################################################################
15 ################################################################################
15 #email_to = admin@localhost
16 #email_to = admin@localhost
16 #error_email_from = paste_error@localhost
17 #error_email_from = paste_error@localhost
17 #app_email_from = rhodecode-noreply@localhost
18 #app_email_from = rhodecode-noreply@localhost
18 #error_message =
19 #error_message =
19
20
20 #smtp_server = mail.server.com
21 #smtp_server = mail.server.com
21 #smtp_username =
22 #smtp_username =
22 #smtp_password =
23 #smtp_password =
23 #smtp_port =
24 #smtp_port =
24 #smtp_use_tls = false
25 #smtp_use_tls = false
25 #smtp_use_ssl = true
26 #smtp_use_ssl = true
26
27
27 [server:main]
28 [server:main]
28 ##nr of threads to spawn
29 ##nr of threads to spawn
29 threadpool_workers = 5
30 threadpool_workers = 5
30
31
31 ##max request before thread respawn
32 ##max request before thread respawn
32 threadpool_max_requests = 10
33 threadpool_max_requests = 10
33
34
34 ##option to use threads of process
35 ##option to use threads of process
35 use_threadpool = true
36 use_threadpool = true
36
37
37 use = egg:Paste#http
38 use = egg:Paste#http
38 host = 127.0.0.1
39 host = 127.0.0.1
39 port = 5000
40 port = 5000
40
41
41 [app:main]
42 [app:main]
42 use = egg:rhodecode
43 use = egg:rhodecode
43 full_stack = true
44 full_stack = true
44 static_files = true
45 static_files = true
45 lang=en
46 lang=en
46 cache_dir = %(here)s/data
47 cache_dir = %(here)s/data
47 index_dir = %(here)s/data/index
48 index_dir = %(here)s/data/index
48 app_instance_uuid = ${app_instance_uuid}
49 app_instance_uuid = ${app_instance_uuid}
49 cut_off_limit = 256000
50 cut_off_limit = 256000
50 force_https = false
51 force_https = false
51 commit_parse_limit = 50
52 commit_parse_limit = 50
52 use_gravatar = true
53 use_gravatar = true
53
54
54 ####################################
55 ####################################
55 ### CELERY CONFIG ####
56 ### CELERY CONFIG ####
56 ####################################
57 ####################################
57 use_celery = false
58 use_celery = false
58 broker.host = localhost
59 broker.host = localhost
59 broker.vhost = rabbitmqhost
60 broker.vhost = rabbitmqhost
60 broker.port = 5672
61 broker.port = 5672
61 broker.user = rabbitmq
62 broker.user = rabbitmq
62 broker.password = qweqwe
63 broker.password = qweqwe
63
64
64 celery.imports = rhodecode.lib.celerylib.tasks
65 celery.imports = rhodecode.lib.celerylib.tasks
65
66
66 celery.result.backend = amqp
67 celery.result.backend = amqp
67 celery.result.dburi = amqp://
68 celery.result.dburi = amqp://
68 celery.result.serialier = json
69 celery.result.serialier = json
69
70
70 #celery.send.task.error.emails = true
71 #celery.send.task.error.emails = true
71 #celery.amqp.task.result.expires = 18000
72 #celery.amqp.task.result.expires = 18000
72
73
73 celeryd.concurrency = 2
74 celeryd.concurrency = 2
74 #celeryd.log.file = celeryd.log
75 #celeryd.log.file = celeryd.log
75 celeryd.log.level = debug
76 celeryd.log.level = debug
76 celeryd.max.tasks.per.child = 1
77 celeryd.max.tasks.per.child = 1
77
78
78 #tasks will never be sent to the queue, but executed locally instead.
79 #tasks will never be sent to the queue, but executed locally instead.
79 celery.always.eager = false
80 celery.always.eager = false
80
81
81 ####################################
82 ####################################
82 ### BEAKER CACHE ####
83 ### BEAKER CACHE ####
83 ####################################
84 ####################################
84 beaker.cache.data_dir=%(here)s/data/cache/data
85 beaker.cache.data_dir=%(here)s/data/cache/data
85 beaker.cache.lock_dir=%(here)s/data/cache/lock
86 beaker.cache.lock_dir=%(here)s/data/cache/lock
86
87
87 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
88 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
88
89
89 beaker.cache.super_short_term.type=memory
90 beaker.cache.super_short_term.type=memory
90 beaker.cache.super_short_term.expire=10
91 beaker.cache.super_short_term.expire=10
91
92
92 beaker.cache.short_term.type=memory
93 beaker.cache.short_term.type=memory
93 beaker.cache.short_term.expire=60
94 beaker.cache.short_term.expire=60
94
95
95 beaker.cache.long_term.type=memory
96 beaker.cache.long_term.type=memory
96 beaker.cache.long_term.expire=36000
97 beaker.cache.long_term.expire=36000
97
98
98 beaker.cache.sql_cache_short.type=memory
99 beaker.cache.sql_cache_short.type=memory
99 beaker.cache.sql_cache_short.expire=10
100 beaker.cache.sql_cache_short.expire=10
100
101
101 beaker.cache.sql_cache_med.type=memory
102 beaker.cache.sql_cache_med.type=memory
102 beaker.cache.sql_cache_med.expire=360
103 beaker.cache.sql_cache_med.expire=360
103
104
104 beaker.cache.sql_cache_long.type=file
105 beaker.cache.sql_cache_long.type=file
105 beaker.cache.sql_cache_long.expire=3600
106 beaker.cache.sql_cache_long.expire=3600
106
107
107 ####################################
108 ####################################
108 ### BEAKER SESSION ####
109 ### BEAKER SESSION ####
109 ####################################
110 ####################################
110 ## Type of storage used for the session, current types are
111 ## Type of storage used for the session, current types are
111 ## dbm, file, memcached, database, and memory.
112 ## dbm, file, memcached, database, and memory.
112 ## The storage uses the Container API
113 ## The storage uses the Container API
113 ##that is also used by the cache system.
114 ##that is also used by the cache system.
114 beaker.session.type = file
115 beaker.session.type = file
115
116
116 beaker.session.key = rhodecode
117 beaker.session.key = rhodecode
117 beaker.session.secret = ${app_instance_secret}
118 beaker.session.secret = ${app_instance_secret}
118 beaker.session.timeout = 36000
119 beaker.session.timeout = 36000
119
120
120 ##auto save the session to not to use .save()
121 ##auto save the session to not to use .save()
121 beaker.session.auto = False
122 beaker.session.auto = False
122
123
123 ##true exire at browser close
124 ##true exire at browser close
124 #beaker.session.cookie_expires = 3600
125 #beaker.session.cookie_expires = 3600
125
126
126
127
127 ################################################################################
128 ################################################################################
128 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
129 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
129 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
130 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
130 ## execute malicious code after an exception is raised. ##
131 ## execute malicious code after an exception is raised. ##
131 ################################################################################
132 ################################################################################
132 set debug = false
133 set debug = false
133
134
134 ##################################
135 ##################################
135 ### LOGVIEW CONFIG ###
136 ### LOGVIEW CONFIG ###
136 ##################################
137 ##################################
137 logview.sqlalchemy = #faa
138 logview.sqlalchemy = #faa
138 logview.pylons.templating = #bfb
139 logview.pylons.templating = #bfb
139 logview.pylons.util = #eee
140 logview.pylons.util = #eee
140
141
141 #########################################################
142 #########################################################
142 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
143 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
143 #########################################################
144 #########################################################
144 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
145 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
145 sqlalchemy.db1.echo = True
146 sqlalchemy.db1.echo = True
146 sqlalchemy.db1.pool_recycle = 3600
147 sqlalchemy.db1.pool_recycle = 3600
147 sqlalchemy.convert_unicode = true
148 sqlalchemy.convert_unicode = true
148
149
149 ################################
150 ################################
150 ### LOGGING CONFIGURATION ####
151 ### LOGGING CONFIGURATION ####
151 ################################
152 ################################
152 [loggers]
153 [loggers]
153 keys = root, routes, rhodecode, sqlalchemy, beaker, templates
154 keys = root, routes, rhodecode, sqlalchemy, beaker, templates
154
155
155 [handlers]
156 [handlers]
156 keys = console, console_sql
157 keys = console, console_sql
157
158
158 [formatters]
159 [formatters]
159 keys = generic, color_formatter, color_formatter_sql
160 keys = generic, color_formatter, color_formatter_sql
160
161
161 #############
162 #############
162 ## LOGGERS ##
163 ## LOGGERS ##
163 #############
164 #############
164 [logger_root]
165 [logger_root]
165 level = NOTSET
166 level = NOTSET
166 handlers = console
167 handlers = console
167
168
168 [logger_routes]
169 [logger_routes]
169 level = DEBUG
170 level = DEBUG
170 handlers =
171 handlers =
171 qualname = routes.middleware
172 qualname = routes.middleware
172 # "level = DEBUG" logs the route matched and routing variables.
173 # "level = DEBUG" logs the route matched and routing variables.
173 propagate = 1
174 propagate = 1
174
175
175 [logger_beaker]
176 [logger_beaker]
176 level = DEBUG
177 level = DEBUG
177 handlers =
178 handlers =
178 qualname = beaker.container
179 qualname = beaker.container
179 propagate = 1
180 propagate = 1
180
181
181 [logger_templates]
182 [logger_templates]
182 level = INFO
183 level = INFO
183 handlers =
184 handlers =
184 qualname = pylons.templating
185 qualname = pylons.templating
185 propagate = 1
186 propagate = 1
186
187
187 [logger_rhodecode]
188 [logger_rhodecode]
188 level = DEBUG
189 level = DEBUG
189 handlers =
190 handlers =
190 qualname = rhodecode
191 qualname = rhodecode
191 propagate = 1
192 propagate = 1
192
193
193 [logger_sqlalchemy]
194 [logger_sqlalchemy]
194 level = INFO
195 level = INFO
195 handlers = console_sql
196 handlers = console_sql
196 qualname = sqlalchemy.engine
197 qualname = sqlalchemy.engine
197 propagate = 0
198 propagate = 0
198
199
199 ##############
200 ##############
200 ## HANDLERS ##
201 ## HANDLERS ##
201 ##############
202 ##############
202
203
203 [handler_console]
204 [handler_console]
204 class = StreamHandler
205 class = StreamHandler
205 args = (sys.stderr,)
206 args = (sys.stderr,)
206 level = INFO
207 level = INFO
207 formatter = color_formatter
208 formatter = color_formatter
208
209
209 [handler_console_sql]
210 [handler_console_sql]
210 class = StreamHandler
211 class = StreamHandler
211 args = (sys.stderr,)
212 args = (sys.stderr,)
212 level = WARN
213 level = WARN
213 formatter = color_formatter_sql
214 formatter = color_formatter_sql
214
215
215 ################
216 ################
216 ## FORMATTERS ##
217 ## FORMATTERS ##
217 ################
218 ################
218
219
219 [formatter_generic]
220 [formatter_generic]
220 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
221 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
221 datefmt = %Y-%m-%d %H:%M:%S
222 datefmt = %Y-%m-%d %H:%M:%S
222
223
223 [formatter_color_formatter]
224 [formatter_color_formatter]
224 class=rhodecode.lib.colored_formatter.ColorFormatter
225 class=rhodecode.lib.colored_formatter.ColorFormatter
225 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
226 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
226 datefmt = %Y-%m-%d %H:%M:%S
227 datefmt = %Y-%m-%d %H:%M:%S
227
228
228 [formatter_color_formatter_sql]
229 [formatter_color_formatter_sql]
229 class=rhodecode.lib.colored_formatter.ColorFormatterSql
230 class=rhodecode.lib.colored_formatter.ColorFormatterSql
230 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
231 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
231 datefmt = %Y-%m-%d %H:%M:%S No newline at end of file
232 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,79 +1,82 b''
1 """Pylons middleware initialization"""
1 """Pylons middleware initialization"""
2
2
3 from beaker.middleware import SessionMiddleware
3 from beaker.middleware import SessionMiddleware
4 from routes.middleware import RoutesMiddleware
4 from routes.middleware import RoutesMiddleware
5 from paste.cascade import Cascade
5 from paste.cascade import Cascade
6 from paste.registry import RegistryManager
6 from paste.registry import RegistryManager
7 from paste.urlparser import StaticURLParser
7 from paste.urlparser import StaticURLParser
8 from paste.deploy.converters import asbool
8 from paste.deploy.converters import asbool
9 from paste.gzipper import make_gzip_middleware
9 from paste.gzipper import make_gzip_middleware
10
10
11 from pylons.middleware import ErrorHandler, StatusCodeRedirect
11 from pylons.middleware import ErrorHandler, StatusCodeRedirect
12 from pylons.wsgiapp import PylonsApp
12 from pylons.wsgiapp import PylonsApp
13
13
14 from rhodecode.lib.middleware.simplehg import SimpleHg
14 from rhodecode.lib.middleware.simplehg import SimpleHg
15 from rhodecode.lib.middleware.simplegit import SimpleGit
15 from rhodecode.lib.middleware.simplegit import SimpleGit
16 from rhodecode.lib.middleware.https_fixup import HttpsFixup
16 from rhodecode.lib.middleware.https_fixup import HttpsFixup
17 from rhodecode.config.environment import load_environment
17 from rhodecode.config.environment import load_environment
18
18
19
19
20 def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
20 def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
21 """Create a Pylons WSGI application and return it
21 """Create a Pylons WSGI application and return it
22
22
23 ``global_conf``
23 ``global_conf``
24 The inherited configuration for this application. Normally from
24 The inherited configuration for this application. Normally from
25 the [DEFAULT] section of the Paste ini file.
25 the [DEFAULT] section of the Paste ini file.
26
26
27 ``full_stack``
27 ``full_stack``
28 Whether or not this application provides a full WSGI stack (by
28 Whether or not this application provides a full WSGI stack (by
29 default, meaning it handles its own exceptions and errors).
29 default, meaning it handles its own exceptions and errors).
30 Disable full_stack when this application is "managed" by
30 Disable full_stack when this application is "managed" by
31 another WSGI middleware.
31 another WSGI middleware.
32
32
33 ``app_conf``
33 ``app_conf``
34 The application's local configuration. Normally specified in
34 The application's local configuration. Normally specified in
35 the [app:<name>] section of the Paste ini file (where <name>
35 the [app:<name>] section of the Paste ini file (where <name>
36 defaults to main).
36 defaults to main).
37
37
38 """
38 """
39 # Configure the Pylons environment
39 # Configure the Pylons environment
40 config = load_environment(global_conf, app_conf)
40 config = load_environment(global_conf, app_conf)
41
41
42 # The Pylons WSGI app
42 # The Pylons WSGI app
43 app = PylonsApp(config=config)
43 app = PylonsApp(config=config)
44
44
45 # Routing/Session/Cache Middleware
45 # Routing/Session/Cache Middleware
46 app = RoutesMiddleware(app, config['routes.map'])
46 app = RoutesMiddleware(app, config['routes.map'])
47 app = SessionMiddleware(app, config)
47 app = SessionMiddleware(app, config)
48
48
49 # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
49 # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
50 if asbool(config['pdebug']):
51 from rhodecode.lib.profiler import ProfilingMiddleware
52 app = ProfilingMiddleware(app)
50
53
51 app = SimpleHg(app, config)
54 app = SimpleHg(app, config)
52 app = SimpleGit(app, config)
55 app = SimpleGit(app, config)
53
56
54 if asbool(full_stack):
57 if asbool(full_stack):
55 # Handle Python exceptions
58 # Handle Python exceptions
56 app = ErrorHandler(app, global_conf, **config['pylons.errorware'])
59 app = ErrorHandler(app, global_conf, **config['pylons.errorware'])
57
60
58 # Display error documents for 401, 403, 404 status codes (and
61 # Display error documents for 401, 403, 404 status codes (and
59 # 500 when debug is disabled)
62 # 500 when debug is disabled)
60 if asbool(config['debug']):
63 if asbool(config['debug']):
61 app = StatusCodeRedirect(app)
64 app = StatusCodeRedirect(app)
62 else:
65 else:
63 app = StatusCodeRedirect(app, [400, 401, 403, 404, 500])
66 app = StatusCodeRedirect(app, [400, 401, 403, 404, 500])
64
67
65 #enable https redirets based on HTTP_X_URL_SCHEME set by proxy
68 #enable https redirets based on HTTP_X_URL_SCHEME set by proxy
66 app = HttpsFixup(app, config)
69 app = HttpsFixup(app, config)
67
70
68 # Establish the Registry for this application
71 # Establish the Registry for this application
69 app = RegistryManager(app)
72 app = RegistryManager(app)
70
73
71 if asbool(static_files):
74 if asbool(static_files):
72 # Serve static files
75 # Serve static files
73 static_app = StaticURLParser(config['pylons.paths']['static_files'])
76 static_app = StaticURLParser(config['pylons.paths']['static_files'])
74 app = Cascade([static_app, app])
77 app = Cascade([static_app, app])
75 app = make_gzip_middleware(app, global_conf, compress_level=1)
78 app = make_gzip_middleware(app, global_conf, compress_level=1)
76
79
77 app.config = config
80 app.config = config
78
81
79 return app
82 return app
General Comments 0
You need to be logged in to leave comments. Login now