##// END OF EJS Templates
fixes #79 cut off limit was added into .ini config files
marcink -
r812:30ad41c7 beta
parent child Browse files
Show More
@@ -1,214 +1,215 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 ################################################################################
10 ################################################################################
11 ## Uncomment and replace with the address which should receive ##
11 ## Uncomment and replace with the address which should receive ##
12 ## any error reports after application crash ##
12 ## any error reports after application crash ##
13 ## Additionally those settings will be used by RhodeCode mailing system ##
13 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ################################################################################
14 ################################################################################
15 #email_to = admin@localhost
15 #email_to = admin@localhost
16 #error_email_from = paste_error@localhost
16 #error_email_from = paste_error@localhost
17 #app_email_from = rhodecode-noreply@localhost
17 #app_email_from = rhodecode-noreply@localhost
18 #error_message =
18 #error_message =
19
19
20 #smtp_server = mail.server.com
20 #smtp_server = mail.server.com
21 #smtp_username =
21 #smtp_username =
22 #smtp_password =
22 #smtp_password =
23 #smtp_port =
23 #smtp_port =
24 #smtp_use_tls = false
24 #smtp_use_tls = false
25 #smtp_use_ssl = true
25 #smtp_use_ssl = true
26
26
27 [server:main]
27 [server:main]
28 ##nr of threads to spawn
28 ##nr of threads to spawn
29 threadpool_workers = 5
29 threadpool_workers = 5
30
30
31 ##max request before thread respawn
31 ##max request before thread respawn
32 threadpool_max_requests = 6
32 threadpool_max_requests = 6
33
33
34 ##option to use threads of process
34 ##option to use threads of process
35 use_threadpool = false
35 use_threadpool = false
36
36
37 use = egg:Paste#http
37 use = egg:Paste#http
38 host = 0.0.0.0
38 host = 0.0.0.0
39 port = 5000
39 port = 5000
40
40
41 [app:main]
41 [app:main]
42 use = egg:rhodecode
42 use = egg:rhodecode
43 full_stack = true
43 full_stack = true
44 static_files = true
44 static_files = true
45 lang=en
45 lang=en
46 cache_dir = %(here)s/data
46 cache_dir = %(here)s/data
47 index_dir = %(here)s/data/index
47 index_dir = %(here)s/data/index
48 cut_off_limit = 256000
48
49
49 ####################################
50 ####################################
50 ### CELERY CONFIG ####
51 ### CELERY CONFIG ####
51 ####################################
52 ####################################
52 use_celery = false
53 use_celery = false
53 broker.host = localhost
54 broker.host = localhost
54 broker.vhost = rabbitmqhost
55 broker.vhost = rabbitmqhost
55 broker.port = 5672
56 broker.port = 5672
56 broker.user = rabbitmq
57 broker.user = rabbitmq
57 broker.password = qweqwe
58 broker.password = qweqwe
58
59
59 celery.imports = rhodecode.lib.celerylib.tasks
60 celery.imports = rhodecode.lib.celerylib.tasks
60
61
61 celery.result.backend = amqp
62 celery.result.backend = amqp
62 celery.result.dburi = amqp://
63 celery.result.dburi = amqp://
63 celery.result.serialier = json
64 celery.result.serialier = json
64
65
65 #celery.send.task.error.emails = true
66 #celery.send.task.error.emails = true
66 #celery.amqp.task.result.expires = 18000
67 #celery.amqp.task.result.expires = 18000
67
68
68 celeryd.concurrency = 2
69 celeryd.concurrency = 2
69 #celeryd.log.file = celeryd.log
70 #celeryd.log.file = celeryd.log
70 celeryd.log.level = debug
71 celeryd.log.level = debug
71 celeryd.max.tasks.per.child = 3
72 celeryd.max.tasks.per.child = 3
72
73
73 #tasks will never be sent to the queue, but executed locally instead.
74 #tasks will never be sent to the queue, but executed locally instead.
74 celery.always.eager = false
75 celery.always.eager = false
75
76
76 ####################################
77 ####################################
77 ### BEAKER CACHE ####
78 ### BEAKER CACHE ####
78 ####################################
79 ####################################
79 beaker.cache.data_dir=/%(here)s/data/cache/data
80 beaker.cache.data_dir=/%(here)s/data/cache/data
80 beaker.cache.lock_dir=/%(here)s/data/cache/lock
81 beaker.cache.lock_dir=/%(here)s/data/cache/lock
81 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
82 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
82
83
83 beaker.cache.super_short_term.type=memory
84 beaker.cache.super_short_term.type=memory
84 beaker.cache.super_short_term.expire=10
85 beaker.cache.super_short_term.expire=10
85
86
86 beaker.cache.short_term.type=memory
87 beaker.cache.short_term.type=memory
87 beaker.cache.short_term.expire=60
88 beaker.cache.short_term.expire=60
88
89
89 beaker.cache.long_term.type=memory
90 beaker.cache.long_term.type=memory
90 beaker.cache.long_term.expire=36000
91 beaker.cache.long_term.expire=36000
91
92
92 beaker.cache.sql_cache_short.type=memory
93 beaker.cache.sql_cache_short.type=memory
93 beaker.cache.sql_cache_short.expire=10
94 beaker.cache.sql_cache_short.expire=10
94
95
95 beaker.cache.sql_cache_med.type=memory
96 beaker.cache.sql_cache_med.type=memory
96 beaker.cache.sql_cache_med.expire=360
97 beaker.cache.sql_cache_med.expire=360
97
98
98 beaker.cache.sql_cache_long.type=file
99 beaker.cache.sql_cache_long.type=file
99 beaker.cache.sql_cache_long.expire=3600
100 beaker.cache.sql_cache_long.expire=3600
100
101
101 ####################################
102 ####################################
102 ### BEAKER SESSION ####
103 ### BEAKER SESSION ####
103 ####################################
104 ####################################
104 ## Type of storage used for the session, current types are
105 ## Type of storage used for the session, current types are
105 ## dbm, file, memcached, database, and memory.
106 ## dbm, file, memcached, database, and memory.
106 ## The storage uses the Container API
107 ## The storage uses the Container API
107 ##that is also used by the cache system.
108 ##that is also used by the cache system.
108 beaker.session.type = file
109 beaker.session.type = file
109
110
110 beaker.session.key = rhodecode
111 beaker.session.key = rhodecode
111 beaker.session.secret = g654dcno0-9873jhgfreyu
112 beaker.session.secret = g654dcno0-9873jhgfreyu
112 beaker.session.timeout = 36000
113 beaker.session.timeout = 36000
113
114
114 ##auto save the session to not to use .save()
115 ##auto save the session to not to use .save()
115 beaker.session.auto = False
116 beaker.session.auto = False
116
117
117 ##true exire at browser close
118 ##true exire at browser close
118 #beaker.session.cookie_expires = 3600
119 #beaker.session.cookie_expires = 3600
119
120
120
121
121 ################################################################################
122 ################################################################################
122 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
123 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
123 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
124 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
124 ## execute malicious code after an exception is raised. ##
125 ## execute malicious code after an exception is raised. ##
125 ################################################################################
126 ################################################################################
126 #set debug = false
127 #set debug = false
127
128
128 ##################################
129 ##################################
129 ### LOGVIEW CONFIG ###
130 ### LOGVIEW CONFIG ###
130 ##################################
131 ##################################
131 logview.sqlalchemy = #faa
132 logview.sqlalchemy = #faa
132 logview.pylons.templating = #bfb
133 logview.pylons.templating = #bfb
133 logview.pylons.util = #eee
134 logview.pylons.util = #eee
134
135
135 #########################################################
136 #########################################################
136 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
137 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
137 #########################################################
138 #########################################################
138 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
139 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
139 #sqlalchemy.db1.echo = False
140 #sqlalchemy.db1.echo = False
140 #sqlalchemy.db1.pool_recycle = 3600
141 #sqlalchemy.db1.pool_recycle = 3600
141 sqlalchemy.convert_unicode = true
142 sqlalchemy.convert_unicode = true
142
143
143 ################################
144 ################################
144 ### LOGGING CONFIGURATION ####
145 ### LOGGING CONFIGURATION ####
145 ################################
146 ################################
146 [loggers]
147 [loggers]
147 keys = root, routes, rhodecode, sqlalchemy,beaker,templates
148 keys = root, routes, rhodecode, sqlalchemy,beaker,templates
148
149
149 [handlers]
150 [handlers]
150 keys = console
151 keys = console
151
152
152 [formatters]
153 [formatters]
153 keys = generic,color_formatter
154 keys = generic,color_formatter
154
155
155 #############
156 #############
156 ## LOGGERS ##
157 ## LOGGERS ##
157 #############
158 #############
158 [logger_root]
159 [logger_root]
159 level = NOTSET
160 level = NOTSET
160 handlers = console
161 handlers = console
161
162
162 [logger_routes]
163 [logger_routes]
163 level = DEBUG
164 level = DEBUG
164 handlers = console
165 handlers = console
165 qualname = routes.middleware
166 qualname = routes.middleware
166 # "level = DEBUG" logs the route matched and routing variables.
167 # "level = DEBUG" logs the route matched and routing variables.
167 propagate = 0
168 propagate = 0
168
169
169 [logger_beaker]
170 [logger_beaker]
170 level = ERROR
171 level = ERROR
171 handlers = console
172 handlers = console
172 qualname = beaker.container
173 qualname = beaker.container
173 propagate = 0
174 propagate = 0
174
175
175 [logger_templates]
176 [logger_templates]
176 level = INFO
177 level = INFO
177 handlers = console
178 handlers = console
178 qualname = pylons.templating
179 qualname = pylons.templating
179 propagate = 0
180 propagate = 0
180
181
181 [logger_rhodecode]
182 [logger_rhodecode]
182 level = DEBUG
183 level = DEBUG
183 handlers = console
184 handlers = console
184 qualname = rhodecode
185 qualname = rhodecode
185 propagate = 0
186 propagate = 0
186
187
187 [logger_sqlalchemy]
188 [logger_sqlalchemy]
188 level = ERROR
189 level = ERROR
189 handlers = console
190 handlers = console
190 qualname = sqlalchemy.engine
191 qualname = sqlalchemy.engine
191 propagate = 0
192 propagate = 0
192
193
193 ##############
194 ##############
194 ## HANDLERS ##
195 ## HANDLERS ##
195 ##############
196 ##############
196
197
197 [handler_console]
198 [handler_console]
198 class = StreamHandler
199 class = StreamHandler
199 args = (sys.stderr,)
200 args = (sys.stderr,)
200 level = NOTSET
201 level = NOTSET
201 formatter = color_formatter
202 formatter = color_formatter
202
203
203 ################
204 ################
204 ## FORMATTERS ##
205 ## FORMATTERS ##
205 ################
206 ################
206
207
207 [formatter_generic]
208 [formatter_generic]
208 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
209 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
209 datefmt = %Y-%m-%d %H:%M:%S
210 datefmt = %Y-%m-%d %H:%M:%S
210
211
211 [formatter_color_formatter]
212 [formatter_color_formatter]
212 class=rhodecode.lib.colored_formatter.ColorFormatter
213 class=rhodecode.lib.colored_formatter.ColorFormatter
213 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
214 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
214 datefmt = %Y-%m-%d %H:%M:%S No newline at end of file
215 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,203 +1,204 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 ################################################################################
10 ################################################################################
11 ## Uncomment and replace with the address which should receive ##
11 ## Uncomment and replace with the address which should receive ##
12 ## any error reports after application crash ##
12 ## any error reports after application crash ##
13 ## Additionally those settings will be used by rhodecode mailing system ##
13 ## Additionally those settings will be used by rhodecode mailing system ##
14 ################################################################################
14 ################################################################################
15 #email_to = admin@localhost
15 #email_to = admin@localhost
16 #error_email_from = paste_error@localhost
16 #error_email_from = paste_error@localhost
17 #app_email_from = rhodecode-noreply@localhost
17 #app_email_from = rhodecode-noreply@localhost
18 #error_message =
18 #error_message =
19
19
20 #smtp_server = mail.server.com
20 #smtp_server = mail.server.com
21 #smtp_username =
21 #smtp_username =
22 #smtp_password =
22 #smtp_password =
23 #smtp_port =
23 #smtp_port =
24 #smtp_use_tls = false
24 #smtp_use_tls = false
25 #smtp_use_ssl = true
25 #smtp_use_ssl = true
26
26
27 [server:main]
27 [server:main]
28 ##nr of threads to spawn
28 ##nr of threads to spawn
29 threadpool_workers = 5
29 threadpool_workers = 5
30
30
31 ##max request before thread respawn
31 ##max request before thread respawn
32 threadpool_max_requests = 2
32 threadpool_max_requests = 2
33
33
34 ##option to use threads of process
34 ##option to use threads of process
35 use_threadpool = true
35 use_threadpool = true
36
36
37 use = egg:Paste#http
37 use = egg:Paste#http
38 host = 127.0.0.1
38 host = 127.0.0.1
39 port = 8001
39 port = 8001
40
40
41 [app:main]
41 [app:main]
42 use = egg:rhodecode
42 use = egg:rhodecode
43 full_stack = true
43 full_stack = true
44 static_files = false
44 static_files = false
45 lang=en
45 lang=en
46 cache_dir = %(here)s/data
46 cache_dir = %(here)s/data
47 index_dir = %(here)s/data/index
47 index_dir = %(here)s/data/index
48 cut_off_limit = 256000
48
49
49 ####################################
50 ####################################
50 ### CELERY CONFIG ####
51 ### CELERY CONFIG ####
51 ####################################
52 ####################################
52 use_celery = false
53 use_celery = false
53 broker.host = localhost
54 broker.host = localhost
54 broker.vhost = rabbitmqhost
55 broker.vhost = rabbitmqhost
55 broker.port = 5672
56 broker.port = 5672
56 broker.user = rabbitmq
57 broker.user = rabbitmq
57 broker.password = qweqwe
58 broker.password = qweqwe
58
59
59 celery.imports = rhodecode.lib.celerylib.tasks
60 celery.imports = rhodecode.lib.celerylib.tasks
60
61
61 celery.result.backend = amqp
62 celery.result.backend = amqp
62 celery.result.dburi = amqp://
63 celery.result.dburi = amqp://
63 celery.result.serialier = json
64 celery.result.serialier = json
64
65
65 #celery.send.task.error.emails = true
66 #celery.send.task.error.emails = true
66 #celery.amqp.task.result.expires = 18000
67 #celery.amqp.task.result.expires = 18000
67
68
68 celeryd.concurrency = 2
69 celeryd.concurrency = 2
69 #celeryd.log.file = celeryd.log
70 #celeryd.log.file = celeryd.log
70 celeryd.log.level = debug
71 celeryd.log.level = debug
71 celeryd.max.tasks.per.child = 3
72 celeryd.max.tasks.per.child = 3
72
73
73 #tasks will never be sent to the queue, but executed locally instead.
74 #tasks will never be sent to the queue, but executed locally instead.
74 celery.always.eager = false
75 celery.always.eager = false
75
76
76 ####################################
77 ####################################
77 ### BEAKER CACHE ####
78 ### BEAKER CACHE ####
78 ####################################
79 ####################################
79 beaker.cache.data_dir=/%(here)s/data/cache/data
80 beaker.cache.data_dir=/%(here)s/data/cache/data
80 beaker.cache.lock_dir=/%(here)s/data/cache/lock
81 beaker.cache.lock_dir=/%(here)s/data/cache/lock
81 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
82 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
82
83
83 beaker.cache.super_short_term.type=memory
84 beaker.cache.super_short_term.type=memory
84 beaker.cache.super_short_term.expire=10
85 beaker.cache.super_short_term.expire=10
85
86
86 beaker.cache.short_term.type=memory
87 beaker.cache.short_term.type=memory
87 beaker.cache.short_term.expire=60
88 beaker.cache.short_term.expire=60
88
89
89 beaker.cache.long_term.type=memory
90 beaker.cache.long_term.type=memory
90 beaker.cache.long_term.expire=36000
91 beaker.cache.long_term.expire=36000
91
92
92
93
93 beaker.cache.sql_cache_short.type=memory
94 beaker.cache.sql_cache_short.type=memory
94 beaker.cache.sql_cache_short.expire=5
95 beaker.cache.sql_cache_short.expire=5
95
96
96 beaker.cache.sql_cache_med.type=memory
97 beaker.cache.sql_cache_med.type=memory
97 beaker.cache.sql_cache_med.expire=360
98 beaker.cache.sql_cache_med.expire=360
98
99
99 beaker.cache.sql_cache_long.type=file
100 beaker.cache.sql_cache_long.type=file
100 beaker.cache.sql_cache_long.expire=3600
101 beaker.cache.sql_cache_long.expire=3600
101
102
102 ####################################
103 ####################################
103 ### BEAKER SESSION ####
104 ### BEAKER SESSION ####
104 ####################################
105 ####################################
105 ## Type of storage used for the session, current types are
106 ## Type of storage used for the session, current types are
106 ## dbm, file, memcached, database, and memory.
107 ## dbm, file, memcached, database, and memory.
107 ## The storage uses the Container API
108 ## The storage uses the Container API
108 ##that is also used by the cache system.
109 ##that is also used by the cache system.
109 beaker.session.type = file
110 beaker.session.type = file
110
111
111 beaker.session.key = rhodecode
112 beaker.session.key = rhodecode
112 beaker.session.secret = g654dcno0-9873jhgfreyu
113 beaker.session.secret = g654dcno0-9873jhgfreyu
113 beaker.session.timeout = 36000
114 beaker.session.timeout = 36000
114
115
115 ##auto save the session to not to use .save()
116 ##auto save the session to not to use .save()
116 beaker.session.auto = False
117 beaker.session.auto = False
117
118
118 ##true exire at browser close
119 ##true exire at browser close
119 #beaker.session.cookie_expires = 3600
120 #beaker.session.cookie_expires = 3600
120
121
121
122
122 ################################################################################
123 ################################################################################
123 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
124 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
124 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
125 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
125 ## execute malicious code after an exception is raised. ##
126 ## execute malicious code after an exception is raised. ##
126 ################################################################################
127 ################################################################################
127 set debug = false
128 set debug = false
128
129
129 ##################################
130 ##################################
130 ### LOGVIEW CONFIG ###
131 ### LOGVIEW CONFIG ###
131 ##################################
132 ##################################
132 logview.sqlalchemy = #faa
133 logview.sqlalchemy = #faa
133 logview.pylons.templating = #bfb
134 logview.pylons.templating = #bfb
134 logview.pylons.util = #eee
135 logview.pylons.util = #eee
135
136
136 #########################################################
137 #########################################################
137 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
138 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
138 #########################################################
139 #########################################################
139 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
140 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
140 #sqlalchemy.db1.echo = False
141 #sqlalchemy.db1.echo = False
141 #sqlalchemy.db1.pool_recycle = 3600
142 #sqlalchemy.db1.pool_recycle = 3600
142 sqlalchemy.convert_unicode = true
143 sqlalchemy.convert_unicode = true
143
144
144 ################################
145 ################################
145 ### LOGGING CONFIGURATION ####
146 ### LOGGING CONFIGURATION ####
146 ################################
147 ################################
147 [loggers]
148 [loggers]
148 keys = root, routes, rhodecode, sqlalchemy
149 keys = root, routes, rhodecode, sqlalchemy
149
150
150 [handlers]
151 [handlers]
151 keys = console
152 keys = console
152
153
153 [formatters]
154 [formatters]
154 keys = generic,color_formatter
155 keys = generic,color_formatter
155
156
156 #############
157 #############
157 ## LOGGERS ##
158 ## LOGGERS ##
158 #############
159 #############
159 [logger_root]
160 [logger_root]
160 level = INFO
161 level = INFO
161 handlers = console
162 handlers = console
162
163
163 [logger_routes]
164 [logger_routes]
164 level = INFO
165 level = INFO
165 handlers = console
166 handlers = console
166 qualname = routes.middleware
167 qualname = routes.middleware
167 # "level = DEBUG" logs the route matched and routing variables.
168 # "level = DEBUG" logs the route matched and routing variables.
168 propagate = 0
169 propagate = 0
169
170
170 [logger_rhodecode]
171 [logger_rhodecode]
171 level = DEBUG
172 level = DEBUG
172 handlers = console
173 handlers = console
173 qualname = rhodecode
174 qualname = rhodecode
174 propagate = 0
175 propagate = 0
175
176
176 [logger_sqlalchemy]
177 [logger_sqlalchemy]
177 level = ERROR
178 level = ERROR
178 handlers = console
179 handlers = console
179 qualname = sqlalchemy.engine
180 qualname = sqlalchemy.engine
180 propagate = 0
181 propagate = 0
181
182
182 ##############
183 ##############
183 ## HANDLERS ##
184 ## HANDLERS ##
184 ##############
185 ##############
185
186
186 [handler_console]
187 [handler_console]
187 class = StreamHandler
188 class = StreamHandler
188 args = (sys.stderr,)
189 args = (sys.stderr,)
189 level = NOTSET
190 level = NOTSET
190 formatter = color_formatter
191 formatter = color_formatter
191
192
192 ################
193 ################
193 ## FORMATTERS ##
194 ## FORMATTERS ##
194 ################
195 ################
195
196
196 [formatter_generic]
197 [formatter_generic]
197 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
198 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
198 datefmt = %Y-%m-%d %H:%M:%S
199 datefmt = %Y-%m-%d %H:%M:%S
199
200
200 [formatter_color_formatter]
201 [formatter_color_formatter]
201 class=rhodecode.lib.colored_formatter.ColorFormatter
202 class=rhodecode.lib.colored_formatter.ColorFormatter
202 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
203 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
203 datefmt = %Y-%m-%d %H:%M:%S No newline at end of file
204 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,203 +1,204 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 ################################################################################
10 ################################################################################
11 ## Uncomment and replace with the address which should receive ##
11 ## Uncomment and replace with the address which should receive ##
12 ## any error reports after application crash ##
12 ## any error reports after application crash ##
13 ## Additionally those settings will be used by RhodeCode mailing system ##
13 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ################################################################################
14 ################################################################################
15 #email_to = admin@localhost
15 #email_to = admin@localhost
16 #error_email_from = paste_error@localhost
16 #error_email_from = paste_error@localhost
17 #app_email_from = rhodecode-noreply@localhost
17 #app_email_from = rhodecode-noreply@localhost
18 #error_message =
18 #error_message =
19
19
20 #smtp_server = mail.server.com
20 #smtp_server = mail.server.com
21 #smtp_username =
21 #smtp_username =
22 #smtp_password =
22 #smtp_password =
23 #smtp_port =
23 #smtp_port =
24 #smtp_use_tls = false
24 #smtp_use_tls = false
25 #smtp_use_ssl = true
25 #smtp_use_ssl = true
26
26
27 [server:main]
27 [server:main]
28 ##nr of threads to spawn
28 ##nr of threads to spawn
29 threadpool_workers = 5
29 threadpool_workers = 5
30
30
31 ##max request before thread respawn
31 ##max request before thread respawn
32 threadpool_max_requests = 10
32 threadpool_max_requests = 10
33
33
34 ##option to use threads of process
34 ##option to use threads of process
35 use_threadpool = true
35 use_threadpool = true
36
36
37 use = egg:Paste#http
37 use = egg:Paste#http
38 host = 127.0.0.1
38 host = 127.0.0.1
39 port = 5000
39 port = 5000
40
40
41 [app:main]
41 [app:main]
42 use = egg:rhodecode
42 use = egg:rhodecode
43 full_stack = true
43 full_stack = true
44 static_files = true
44 static_files = true
45 lang=en
45 lang=en
46 cache_dir = %(here)s/data
46 cache_dir = %(here)s/data
47 index_dir = %(here)s/data/index
47 index_dir = %(here)s/data/index
48 app_instance_uuid = ${app_instance_uuid}
48 app_instance_uuid = ${app_instance_uuid}
49 cut_off_limit = 256000
49
50
50 ####################################
51 ####################################
51 ### CELERY CONFIG ####
52 ### CELERY CONFIG ####
52 ####################################
53 ####################################
53 use_celery = false
54 use_celery = false
54 broker.host = localhost
55 broker.host = localhost
55 broker.vhost = rabbitmqhost
56 broker.vhost = rabbitmqhost
56 broker.port = 5672
57 broker.port = 5672
57 broker.user = rabbitmq
58 broker.user = rabbitmq
58 broker.password = qweqwe
59 broker.password = qweqwe
59
60
60 celery.imports = rhodecode.lib.celerylib.tasks
61 celery.imports = rhodecode.lib.celerylib.tasks
61
62
62 celery.result.backend = amqp
63 celery.result.backend = amqp
63 celery.result.dburi = amqp://
64 celery.result.dburi = amqp://
64 celery.result.serialier = json
65 celery.result.serialier = json
65
66
66 #celery.send.task.error.emails = true
67 #celery.send.task.error.emails = true
67 #celery.amqp.task.result.expires = 18000
68 #celery.amqp.task.result.expires = 18000
68
69
69 celeryd.concurrency = 2
70 celeryd.concurrency = 2
70 #celeryd.log.file = celeryd.log
71 #celeryd.log.file = celeryd.log
71 celeryd.log.level = debug
72 celeryd.log.level = debug
72 celeryd.max.tasks.per.child = 3
73 celeryd.max.tasks.per.child = 3
73
74
74 #tasks will never be sent to the queue, but executed locally instead.
75 #tasks will never be sent to the queue, but executed locally instead.
75 celery.always.eager = false
76 celery.always.eager = false
76
77
77 ####################################
78 ####################################
78 ### BEAKER CACHE ####
79 ### BEAKER CACHE ####
79 ####################################
80 ####################################
80 beaker.cache.data_dir=/%(here)s/data/cache/data
81 beaker.cache.data_dir=/%(here)s/data/cache/data
81 beaker.cache.lock_dir=/%(here)s/data/cache/lock
82 beaker.cache.lock_dir=/%(here)s/data/cache/lock
82 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
83 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
83
84
84 beaker.cache.super_short_term.type=memory
85 beaker.cache.super_short_term.type=memory
85 beaker.cache.super_short_term.expire=10
86 beaker.cache.super_short_term.expire=10
86
87
87 beaker.cache.short_term.type=memory
88 beaker.cache.short_term.type=memory
88 beaker.cache.short_term.expire=60
89 beaker.cache.short_term.expire=60
89
90
90 beaker.cache.long_term.type=memory
91 beaker.cache.long_term.type=memory
91 beaker.cache.long_term.expire=36000
92 beaker.cache.long_term.expire=36000
92
93
93 beaker.cache.sql_cache_short.type=memory
94 beaker.cache.sql_cache_short.type=memory
94 beaker.cache.sql_cache_short.expire=10
95 beaker.cache.sql_cache_short.expire=10
95
96
96 beaker.cache.sql_cache_med.type=memory
97 beaker.cache.sql_cache_med.type=memory
97 beaker.cache.sql_cache_med.expire=360
98 beaker.cache.sql_cache_med.expire=360
98
99
99 beaker.cache.sql_cache_long.type=file
100 beaker.cache.sql_cache_long.type=file
100 beaker.cache.sql_cache_long.expire=3600
101 beaker.cache.sql_cache_long.expire=3600
101
102
102 ####################################
103 ####################################
103 ### BEAKER SESSION ####
104 ### BEAKER SESSION ####
104 ####################################
105 ####################################
105 ## Type of storage used for the session, current types are
106 ## Type of storage used for the session, current types are
106 ## dbm, file, memcached, database, and memory.
107 ## dbm, file, memcached, database, and memory.
107 ## The storage uses the Container API
108 ## The storage uses the Container API
108 ##that is also used by the cache system.
109 ##that is also used by the cache system.
109 beaker.session.type = file
110 beaker.session.type = file
110
111
111 beaker.session.key = rhodecode
112 beaker.session.key = rhodecode
112 beaker.session.secret = ${app_instance_secret}
113 beaker.session.secret = ${app_instance_secret}
113 beaker.session.timeout = 36000
114 beaker.session.timeout = 36000
114
115
115 ##auto save the session to not to use .save()
116 ##auto save the session to not to use .save()
116 beaker.session.auto = False
117 beaker.session.auto = False
117
118
118 ##true exire at browser close
119 ##true exire at browser close
119 #beaker.session.cookie_expires = 3600
120 #beaker.session.cookie_expires = 3600
120
121
121
122
122 ################################################################################
123 ################################################################################
123 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
124 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
124 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
125 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
125 ## execute malicious code after an exception is raised. ##
126 ## execute malicious code after an exception is raised. ##
126 ################################################################################
127 ################################################################################
127 set debug = false
128 set debug = false
128
129
129 ##################################
130 ##################################
130 ### LOGVIEW CONFIG ###
131 ### LOGVIEW CONFIG ###
131 ##################################
132 ##################################
132 logview.sqlalchemy = #faa
133 logview.sqlalchemy = #faa
133 logview.pylons.templating = #bfb
134 logview.pylons.templating = #bfb
134 logview.pylons.util = #eee
135 logview.pylons.util = #eee
135
136
136 #########################################################
137 #########################################################
137 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
138 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
138 #########################################################
139 #########################################################
139 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
140 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
140 #sqlalchemy.db1.echo = False
141 #sqlalchemy.db1.echo = False
141 #sqlalchemy.db1.pool_recycle = 3600
142 #sqlalchemy.db1.pool_recycle = 3600
142 sqlalchemy.convert_unicode = true
143 sqlalchemy.convert_unicode = true
143
144
144 ################################
145 ################################
145 ### LOGGING CONFIGURATION ####
146 ### LOGGING CONFIGURATION ####
146 ################################
147 ################################
147 [loggers]
148 [loggers]
148 keys = root, routes, rhodecode, sqlalchemy
149 keys = root, routes, rhodecode, sqlalchemy
149
150
150 [handlers]
151 [handlers]
151 keys = console
152 keys = console
152
153
153 [formatters]
154 [formatters]
154 keys = generic,color_formatter
155 keys = generic,color_formatter
155
156
156 #############
157 #############
157 ## LOGGERS ##
158 ## LOGGERS ##
158 #############
159 #############
159 [logger_root]
160 [logger_root]
160 level = INFO
161 level = INFO
161 handlers = console
162 handlers = console
162
163
163 [logger_routes]
164 [logger_routes]
164 level = INFO
165 level = INFO
165 handlers = console
166 handlers = console
166 qualname = routes.middleware
167 qualname = routes.middleware
167 # "level = DEBUG" logs the route matched and routing variables.
168 # "level = DEBUG" logs the route matched and routing variables.
168 propagate = 0
169 propagate = 0
169
170
170 [logger_rhodecode]
171 [logger_rhodecode]
171 level = DEBUG
172 level = DEBUG
172 handlers = console
173 handlers = console
173 qualname = rhodecode
174 qualname = rhodecode
174 propagate = 0
175 propagate = 0
175
176
176 [logger_sqlalchemy]
177 [logger_sqlalchemy]
177 level = ERROR
178 level = ERROR
178 handlers = console
179 handlers = console
179 qualname = sqlalchemy.engine
180 qualname = sqlalchemy.engine
180 propagate = 0
181 propagate = 0
181
182
182 ##############
183 ##############
183 ## HANDLERS ##
184 ## HANDLERS ##
184 ##############
185 ##############
185
186
186 [handler_console]
187 [handler_console]
187 class = StreamHandler
188 class = StreamHandler
188 args = (sys.stderr,)
189 args = (sys.stderr,)
189 level = NOTSET
190 level = NOTSET
190 formatter = color_formatter
191 formatter = color_formatter
191
192
192 ################
193 ################
193 ## FORMATTERS ##
194 ## FORMATTERS ##
194 ################
195 ################
195
196
196 [formatter_generic]
197 [formatter_generic]
197 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
198 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
198 datefmt = %Y-%m-%d %H:%M:%S
199 datefmt = %Y-%m-%d %H:%M:%S
199
200
200 [formatter_color_formatter]
201 [formatter_color_formatter]
201 class=rhodecode.lib.colored_formatter.ColorFormatter
202 class=rhodecode.lib.colored_formatter.ColorFormatter
202 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
203 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
203 datefmt = %Y-%m-%d %H:%M:%S No newline at end of file
204 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,187 +1,192 b''
1 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2 # encoding: utf-8
2 """
3 # changeset controller for pylons
3 rhodecode.controllers.changeset
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
6 changeset controller for pylons
7
8 :created_on: Apr 25, 2010
9 :author: marcink
10 :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
11 :license: GPLv3, see COPYING for more details.
12 """
5 # This program is free software; you can redistribute it and/or
13 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
14 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; version 2
15 # as published by the Free Software Foundation; version 2
8 # of the License or (at your opinion) any later version of the license.
16 # of the License or (at your opinion) any later version of the license.
9 #
17 #
10 # This program is distributed in the hope that it will be useful,
18 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
21 # GNU General Public License for more details.
14 #
22 #
15 # You should have received a copy of the GNU General Public License
23 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
24 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 # MA 02110-1301, USA.
26 # MA 02110-1301, USA.
19 """
27 import logging
20 Created on April 25, 2010
28 import traceback
21 changeset controller for pylons
29
22 @author: marcink
23 """
24 from pylons import tmpl_context as c, url, request, response
30 from pylons import tmpl_context as c, url, request, response
25 from pylons.i18n.translation import _
31 from pylons.i18n.translation import _
26 from pylons.controllers.util import redirect
32 from pylons.controllers.util import redirect
33
34 import rhodecode.lib.helpers as h
27 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
35 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
28 from rhodecode.lib.base import BaseController, render
36 from rhodecode.lib.base import BaseController, render
29 from rhodecode.lib.utils import EmptyChangeset
37 from rhodecode.lib.utils import EmptyChangeset
30 import rhodecode.lib.helpers as h
31 from rhodecode.model.scm import ScmModel
38 from rhodecode.model.scm import ScmModel
39
32 from vcs.exceptions import RepositoryError, ChangesetError
40 from vcs.exceptions import RepositoryError, ChangesetError
33 from vcs.nodes import FileNode
41 from vcs.nodes import FileNode
34 from vcs.utils import diffs as differ
42 from vcs.utils import diffs as differ
35 import logging
36 import traceback
37
43
38 log = logging.getLogger(__name__)
44 log = logging.getLogger(__name__)
39
45
40 class ChangesetController(BaseController):
46 class ChangesetController(BaseController):
41
47
42 @LoginRequired()
48 @LoginRequired()
43 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
49 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
44 'repository.admin')
50 'repository.admin')
45 def __before__(self):
51 def __before__(self):
46 super(ChangesetController, self).__before__()
52 super(ChangesetController, self).__before__()
47
53
48 def index(self, revision):
54 def index(self, revision):
49 hg_model = ScmModel()
55 hg_model = ScmModel()
50 cut_off_limit = 1024 * 250
51
56
52 def wrap_to_table(str):
57 def wrap_to_table(str):
53
58
54 return '''<table class="code-difftable">
59 return '''<table class="code-difftable">
55 <tr class="line">
60 <tr class="line">
56 <td class="lineno new"></td>
61 <td class="lineno new"></td>
57 <td class="code"><pre>%s</pre></td>
62 <td class="code"><pre>%s</pre></td>
58 </tr>
63 </tr>
59 </table>''' % str
64 </table>''' % str
60
65
61 try:
66 try:
62 c.changeset = hg_model.get_repo(c.repo_name).get_changeset(revision)
67 c.changeset = hg_model.get_repo(c.repo_name).get_changeset(revision)
63 except RepositoryError, e:
68 except RepositoryError, e:
64 log.error(traceback.format_exc())
69 log.error(traceback.format_exc())
65 h.flash(str(e), category='warning')
70 h.flash(str(e), category='warning')
66 return redirect(url('home'))
71 return redirect(url('home'))
67 else:
72 else:
68 try:
73 try:
69 c.changeset_old = c.changeset.parents[0]
74 c.changeset_old = c.changeset.parents[0]
70 except IndexError:
75 except IndexError:
71 c.changeset_old = None
76 c.changeset_old = None
72 c.changes = []
77 c.changes = []
73
78
74 #===================================================================
79 #===================================================================
75 # ADDED FILES
80 # ADDED FILES
76 #===================================================================
81 #===================================================================
77 c.sum_added = 0
82 c.sum_added = 0
78 for node in c.changeset.added:
83 for node in c.changeset.added:
79
84
80 filenode_old = FileNode(node.path, '', EmptyChangeset())
85 filenode_old = FileNode(node.path, '', EmptyChangeset())
81 if filenode_old.is_binary or node.is_binary:
86 if filenode_old.is_binary or node.is_binary:
82 diff = wrap_to_table(_('binary file'))
87 diff = wrap_to_table(_('binary file'))
83 else:
88 else:
84 c.sum_added += node.size
89 c.sum_added += node.size
85 if c.sum_added < cut_off_limit:
90 if c.sum_added < self.cut_off_limit:
86 f_udiff = differ.get_udiff(filenode_old, node)
91 f_udiff = differ.get_udiff(filenode_old, node)
87 diff = differ.DiffProcessor(f_udiff).as_html()
92 diff = differ.DiffProcessor(f_udiff).as_html()
88
93
89 else:
94 else:
90 diff = wrap_to_table(_('Changeset is to big and was cut'
95 diff = wrap_to_table(_('Changeset is to big and was cut'
91 ' off, see raw changeset instead'))
96 ' off, see raw changeset instead'))
92
97
93 cs1 = None
98 cs1 = None
94 cs2 = node.last_changeset.raw_id
99 cs2 = node.last_changeset.raw_id
95 c.changes.append(('added', node, diff, cs1, cs2))
100 c.changes.append(('added', node, diff, cs1, cs2))
96
101
97 #===================================================================
102 #===================================================================
98 # CHANGED FILES
103 # CHANGED FILES
99 #===================================================================
104 #===================================================================
100 c.sum_removed = 0
105 c.sum_removed = 0
101 for node in c.changeset.changed:
106 for node in c.changeset.changed:
102 try:
107 try:
103 filenode_old = c.changeset_old.get_node(node.path)
108 filenode_old = c.changeset_old.get_node(node.path)
104 except ChangesetError:
109 except ChangesetError:
105 filenode_old = FileNode(node.path, '', EmptyChangeset())
110 filenode_old = FileNode(node.path, '', EmptyChangeset())
106
111
107 if filenode_old.is_binary or node.is_binary:
112 if filenode_old.is_binary or node.is_binary:
108 diff = wrap_to_table(_('binary file'))
113 diff = wrap_to_table(_('binary file'))
109 else:
114 else:
110
115
111 if c.sum_removed < cut_off_limit:
116 if c.sum_removed < self.cut_off_limit:
112 f_udiff = differ.get_udiff(filenode_old, node)
117 f_udiff = differ.get_udiff(filenode_old, node)
113 diff = differ.DiffProcessor(f_udiff).as_html()
118 diff = differ.DiffProcessor(f_udiff).as_html()
114 if diff:
119 if diff:
115 c.sum_removed += len(diff)
120 c.sum_removed += len(diff)
116 else:
121 else:
117 diff = wrap_to_table(_('Changeset is to big and was cut'
122 diff = wrap_to_table(_('Changeset is to big and was cut'
118 ' off, see raw changeset instead'))
123 ' off, see raw changeset instead'))
119
124
120
125
121 cs1 = filenode_old.last_changeset.raw_id
126 cs1 = filenode_old.last_changeset.raw_id
122 cs2 = node.last_changeset.raw_id
127 cs2 = node.last_changeset.raw_id
123 c.changes.append(('changed', node, diff, cs1, cs2))
128 c.changes.append(('changed', node, diff, cs1, cs2))
124
129
125 #===================================================================
130 #===================================================================
126 # REMOVED FILES
131 # REMOVED FILES
127 #===================================================================
132 #===================================================================
128 for node in c.changeset.removed:
133 for node in c.changeset.removed:
129 c.changes.append(('removed', node, None, None, None))
134 c.changes.append(('removed', node, None, None, None))
130
135
131 return render('changeset/changeset.html')
136 return render('changeset/changeset.html')
132
137
133 def raw_changeset(self, revision):
138 def raw_changeset(self, revision):
134
139
135 hg_model = ScmModel()
140 hg_model = ScmModel()
136 method = request.GET.get('diff', 'show')
141 method = request.GET.get('diff', 'show')
137 try:
142 try:
138 r = hg_model.get_repo(c.repo_name)
143 r = hg_model.get_repo(c.repo_name)
139 c.scm_type = r.alias
144 c.scm_type = r.alias
140 c.changeset = r.get_changeset(revision)
145 c.changeset = r.get_changeset(revision)
141 except RepositoryError:
146 except RepositoryError:
142 log.error(traceback.format_exc())
147 log.error(traceback.format_exc())
143 return redirect(url('home'))
148 return redirect(url('home'))
144 else:
149 else:
145 try:
150 try:
146 c.changeset_old = c.changeset.parents[0]
151 c.changeset_old = c.changeset.parents[0]
147 except IndexError:
152 except IndexError:
148 c.changeset_old = None
153 c.changeset_old = None
149 c.changes = []
154 c.changes = []
150
155
151 for node in c.changeset.added:
156 for node in c.changeset.added:
152 filenode_old = FileNode(node.path, '')
157 filenode_old = FileNode(node.path, '')
153 if filenode_old.is_binary or node.is_binary:
158 if filenode_old.is_binary or node.is_binary:
154 diff = _('binary file') +'\n'
159 diff = _('binary file') + '\n'
155 else:
160 else:
156 f_udiff = differ.get_udiff(filenode_old, node)
161 f_udiff = differ.get_udiff(filenode_old, node)
157 diff = differ.DiffProcessor(f_udiff).raw_diff()
162 diff = differ.DiffProcessor(f_udiff).raw_diff()
158
163
159 cs1 = None
164 cs1 = None
160 cs2 = node.last_changeset.raw_id
165 cs2 = node.last_changeset.raw_id
161 c.changes.append(('added', node, diff, cs1, cs2))
166 c.changes.append(('added', node, diff, cs1, cs2))
162
167
163 for node in c.changeset.changed:
168 for node in c.changeset.changed:
164 filenode_old = c.changeset_old.get_node(node.path)
169 filenode_old = c.changeset_old.get_node(node.path)
165 if filenode_old.is_binary or node.is_binary:
170 if filenode_old.is_binary or node.is_binary:
166 diff = _('binary file')
171 diff = _('binary file')
167 else:
172 else:
168 f_udiff = differ.get_udiff(filenode_old, node)
173 f_udiff = differ.get_udiff(filenode_old, node)
169 diff = differ.DiffProcessor(f_udiff).raw_diff()
174 diff = differ.DiffProcessor(f_udiff).raw_diff()
170
175
171 cs1 = filenode_old.last_changeset.raw_id
176 cs1 = filenode_old.last_changeset.raw_id
172 cs2 = node.last_changeset.raw_id
177 cs2 = node.last_changeset.raw_id
173 c.changes.append(('changed', node, diff, cs1, cs2))
178 c.changes.append(('changed', node, diff, cs1, cs2))
174
179
175 response.content_type = 'text/plain'
180 response.content_type = 'text/plain'
176
181
177 if method == 'download':
182 if method == 'download':
178 response.content_disposition = 'attachment; filename=%s.patch' % revision
183 response.content_disposition = 'attachment; filename=%s.patch' % revision
179
184
180 parent = True if len(c.changeset.parents) > 0 else False
185 parent = True if len(c.changeset.parents) > 0 else False
181 c.parent_tmpl = 'Parent %s' % c.changeset.parents[0].raw_id if parent else ''
186 c.parent_tmpl = 'Parent %s' % c.changeset.parents[0].raw_id if parent else ''
182
187
183 c.diffs = ''
188 c.diffs = ''
184 for x in c.changes:
189 for x in c.changes:
185 c.diffs += x[2]
190 c.diffs += x[2]
186
191
187 return render('changeset/raw_changeset.html')
192 return render('changeset/raw_changeset.html')
@@ -1,247 +1,252 b''
1 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2 # encoding: utf-8
2 """
3 # files controller for pylons
3 rhodecode.controllers.files
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
5
6 Files controller for RhodeCode
7
8 :created_on: Apr 21, 2010
9 :author: marcink
10 :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
11 :license: GPLv3, see COPYING for more details.
12 """
6 # This program is free software; you can redistribute it and/or
13 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
14 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
15 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
16 # of the License or (at your opinion) any later version of the license.
10 #
17 #
11 # This program is distributed in the hope that it will be useful,
18 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
21 # GNU General Public License for more details.
15 #
22 #
16 # You should have received a copy of the GNU General Public License
23 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
24 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
26 # MA 02110-1301, USA.
20 """
27 import tempfile
21 Created on April 21, 2010
28 import logging
22 files controller for pylons
29 import rhodecode.lib.helpers as h
23 @author: marcink
30
24 """
25 from mercurial import archival
31 from mercurial import archival
32
26 from pylons import request, response, session, tmpl_context as c, url
33 from pylons import request, response, session, tmpl_context as c, url
27 from pylons.i18n.translation import _
34 from pylons.i18n.translation import _
28 from pylons.controllers.util import redirect
35 from pylons.controllers.util import redirect
36
29 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
37 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
30 from rhodecode.lib.base import BaseController, render
38 from rhodecode.lib.base import BaseController, render
31 from rhodecode.lib.utils import EmptyChangeset
39 from rhodecode.lib.utils import EmptyChangeset
32 from rhodecode.model.scm import ScmModel
40 from rhodecode.model.scm import ScmModel
41
33 from vcs.exceptions import RepositoryError, ChangesetError
42 from vcs.exceptions import RepositoryError, ChangesetError
34 from vcs.nodes import FileNode
43 from vcs.nodes import FileNode
35 from vcs.utils import diffs as differ
44 from vcs.utils import diffs as differ
36 import logging
37 import rhodecode.lib.helpers as h
38 import tempfile
39
45
40 log = logging.getLogger(__name__)
46 log = logging.getLogger(__name__)
41
47
42 class FilesController(BaseController):
48 class FilesController(BaseController):
43
49
44 @LoginRequired()
50 @LoginRequired()
45 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
51 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
46 'repository.admin')
52 'repository.admin')
47 def __before__(self):
53 def __before__(self):
48 super(FilesController, self).__before__()
54 super(FilesController, self).__before__()
49 c.file_size_limit = 250 * 1024 #limit of file size to display
50
55
51 def index(self, repo_name, revision, f_path):
56 def index(self, repo_name, revision, f_path):
52 hg_model = ScmModel()
57 hg_model = ScmModel()
53 c.repo = hg_model.get_repo(c.repo_name)
58 c.repo = hg_model.get_repo(c.repo_name)
54 revision = request.POST.get('at_rev', None) or revision
59 revision = request.POST.get('at_rev', None) or revision
55
60
56 def get_next_rev(cur):
61 def get_next_rev(cur):
57 max_rev = len(c.repo.revisions) - 1
62 max_rev = len(c.repo.revisions) - 1
58 r = cur + 1
63 r = cur + 1
59 if r > max_rev:
64 if r > max_rev:
60 r = max_rev
65 r = max_rev
61 return r
66 return r
62
67
63 def get_prev_rev(cur):
68 def get_prev_rev(cur):
64 r = cur - 1
69 r = cur - 1
65 return r
70 return r
66
71
67 c.f_path = f_path
72 c.f_path = f_path
68
73
69
74
70 try:
75 try:
71 c.changeset = c.repo.get_changeset(revision)
76 c.changeset = c.repo.get_changeset(revision)
72 cur_rev = c.changeset.revision
77 cur_rev = c.changeset.revision
73 prev_rev = c.repo.get_changeset(get_prev_rev(cur_rev)).raw_id
78 prev_rev = c.repo.get_changeset(get_prev_rev(cur_rev)).raw_id
74 next_rev = c.repo.get_changeset(get_next_rev(cur_rev)).raw_id
79 next_rev = c.repo.get_changeset(get_next_rev(cur_rev)).raw_id
75
80
76 c.url_prev = url('files_home', repo_name=c.repo_name,
81 c.url_prev = url('files_home', repo_name=c.repo_name,
77 revision=prev_rev, f_path=f_path)
82 revision=prev_rev, f_path=f_path)
78 c.url_next = url('files_home', repo_name=c.repo_name,
83 c.url_next = url('files_home', repo_name=c.repo_name,
79 revision=next_rev, f_path=f_path)
84 revision=next_rev, f_path=f_path)
80
85
81 try:
86 try:
82 c.files_list = c.changeset.get_node(f_path)
87 c.files_list = c.changeset.get_node(f_path)
83 c.file_history = self._get_history(c.repo, c.files_list, f_path)
88 c.file_history = self._get_history(c.repo, c.files_list, f_path)
84 except RepositoryError, e:
89 except RepositoryError, e:
85 h.flash(str(e), category='warning')
90 h.flash(str(e), category='warning')
86 redirect(h.url('files_home', repo_name=repo_name, revision=revision))
91 redirect(h.url('files_home', repo_name=repo_name, revision=revision))
87
92
88 except RepositoryError, e:
93 except RepositoryError, e:
89 h.flash(str(e), category='warning')
94 h.flash(str(e), category='warning')
90 redirect(h.url('files_home', repo_name=repo_name, revision='tip'))
95 redirect(h.url('files_home', repo_name=repo_name, revision='tip'))
91
96
92
97
93
98
94 return render('files/files.html')
99 return render('files/files.html')
95
100
96 def rawfile(self, repo_name, revision, f_path):
101 def rawfile(self, repo_name, revision, f_path):
97 hg_model = ScmModel()
102 hg_model = ScmModel()
98 c.repo = hg_model.get_repo(c.repo_name)
103 c.repo = hg_model.get_repo(c.repo_name)
99 file_node = c.repo.get_changeset(revision).get_node(f_path)
104 file_node = c.repo.get_changeset(revision).get_node(f_path)
100 response.content_type = file_node.mimetype
105 response.content_type = file_node.mimetype
101 response.content_disposition = 'attachment; filename=%s' \
106 response.content_disposition = 'attachment; filename=%s' \
102 % f_path.split('/')[-1]
107 % f_path.split('/')[-1]
103 return file_node.content
108 return file_node.content
104
109
105 def raw(self, repo_name, revision, f_path):
110 def raw(self, repo_name, revision, f_path):
106 hg_model = ScmModel()
111 hg_model = ScmModel()
107 c.repo = hg_model.get_repo(c.repo_name)
112 c.repo = hg_model.get_repo(c.repo_name)
108 file_node = c.repo.get_changeset(revision).get_node(f_path)
113 file_node = c.repo.get_changeset(revision).get_node(f_path)
109 response.content_type = 'text/plain'
114 response.content_type = 'text/plain'
110
115
111 return file_node.content
116 return file_node.content
112
117
113 def annotate(self, repo_name, revision, f_path):
118 def annotate(self, repo_name, revision, f_path):
114 hg_model = ScmModel()
119 hg_model = ScmModel()
115 c.repo = hg_model.get_repo(c.repo_name)
120 c.repo = hg_model.get_repo(c.repo_name)
116
121
117 try:
122 try:
118 c.cs = c.repo.get_changeset(revision)
123 c.cs = c.repo.get_changeset(revision)
119 c.file = c.cs.get_node(f_path)
124 c.file = c.cs.get_node(f_path)
120 except RepositoryError, e:
125 except RepositoryError, e:
121 h.flash(str(e), category='warning')
126 h.flash(str(e), category='warning')
122 redirect(h.url('files_home', repo_name=repo_name, revision=revision))
127 redirect(h.url('files_home', repo_name=repo_name, revision=revision))
123
128
124 c.file_history = self._get_history(c.repo, c.file, f_path)
129 c.file_history = self._get_history(c.repo, c.file, f_path)
125
130
126 c.f_path = f_path
131 c.f_path = f_path
127
132
128 return render('files/files_annotate.html')
133 return render('files/files_annotate.html')
129
134
130 def archivefile(self, repo_name, revision, fileformat):
135 def archivefile(self, repo_name, revision, fileformat):
131 archive_specs = {
136 archive_specs = {
132 '.tar.bz2': ('application/x-tar', 'tbz2'),
137 '.tar.bz2': ('application/x-tar', 'tbz2'),
133 '.tar.gz': ('application/x-tar', 'tgz'),
138 '.tar.gz': ('application/x-tar', 'tgz'),
134 '.zip': ('application/zip', 'zip'),
139 '.zip': ('application/zip', 'zip'),
135 }
140 }
136 if not archive_specs.has_key(fileformat):
141 if not archive_specs.has_key(fileformat):
137 return 'Unknown archive type %s' % fileformat
142 return 'Unknown archive type %s' % fileformat
138
143
139 def read_in_chunks(file_object, chunk_size=1024 * 40):
144 def read_in_chunks(file_object, chunk_size=1024 * 40):
140 """Lazy function (generator) to read a file piece by piece.
145 """Lazy function (generator) to read a file piece by piece.
141 Default chunk size: 40k."""
146 Default chunk size: 40k."""
142 while True:
147 while True:
143 data = file_object.read(chunk_size)
148 data = file_object.read(chunk_size)
144 if not data:
149 if not data:
145 break
150 break
146 yield data
151 yield data
147
152
148 archive = tempfile.TemporaryFile()
153 archive = tempfile.TemporaryFile()
149 repo = ScmModel().get_repo(repo_name).repo
154 repo = ScmModel().get_repo(repo_name).repo
150 fname = '%s-%s%s' % (repo_name, revision, fileformat)
155 fname = '%s-%s%s' % (repo_name, revision, fileformat)
151 archival.archive(repo, archive, revision, archive_specs[fileformat][1],
156 archival.archive(repo, archive, revision, archive_specs[fileformat][1],
152 prefix='%s-%s' % (repo_name, revision))
157 prefix='%s-%s' % (repo_name, revision))
153 response.content_type = archive_specs[fileformat][0]
158 response.content_type = archive_specs[fileformat][0]
154 response.content_disposition = 'attachment; filename=%s' % fname
159 response.content_disposition = 'attachment; filename=%s' % fname
155 archive.seek(0)
160 archive.seek(0)
156 return read_in_chunks(archive)
161 return read_in_chunks(archive)
157
162
158 def diff(self, repo_name, f_path):
163 def diff(self, repo_name, f_path):
159 hg_model = ScmModel()
164 hg_model = ScmModel()
160 diff1 = request.GET.get('diff1')
165 diff1 = request.GET.get('diff1')
161 diff2 = request.GET.get('diff2')
166 diff2 = request.GET.get('diff2')
162 c.action = request.GET.get('diff')
167 c.action = request.GET.get('diff')
163 c.no_changes = diff1 == diff2
168 c.no_changes = diff1 == diff2
164 c.f_path = f_path
169 c.f_path = f_path
165 c.repo = hg_model.get_repo(c.repo_name)
170 c.repo = hg_model.get_repo(c.repo_name)
166
171
167 try:
172 try:
168 if diff1 not in ['', None, 'None', '0' * 12, '0' * 40]:
173 if diff1 not in ['', None, 'None', '0' * 12, '0' * 40]:
169 c.changeset_1 = c.repo.get_changeset(diff1)
174 c.changeset_1 = c.repo.get_changeset(diff1)
170 node1 = c.changeset_1.get_node(f_path)
175 node1 = c.changeset_1.get_node(f_path)
171 else:
176 else:
172 c.changeset_1 = EmptyChangeset()
177 c.changeset_1 = EmptyChangeset()
173 node1 = FileNode('.', '', changeset=c.changeset_1)
178 node1 = FileNode('.', '', changeset=c.changeset_1)
174
179
175 if diff2 not in ['', None, 'None', '0' * 12, '0' * 40]:
180 if diff2 not in ['', None, 'None', '0' * 12, '0' * 40]:
176 c.changeset_2 = c.repo.get_changeset(diff2)
181 c.changeset_2 = c.repo.get_changeset(diff2)
177 node2 = c.changeset_2.get_node(f_path)
182 node2 = c.changeset_2.get_node(f_path)
178 else:
183 else:
179 c.changeset_2 = EmptyChangeset()
184 c.changeset_2 = EmptyChangeset()
180 node2 = FileNode('.', '', changeset=c.changeset_2)
185 node2 = FileNode('.', '', changeset=c.changeset_2)
181 except RepositoryError:
186 except RepositoryError:
182 return redirect(url('files_home',
187 return redirect(url('files_home',
183 repo_name=c.repo_name, f_path=f_path))
188 repo_name=c.repo_name, f_path=f_path))
184
189
185 f_udiff = differ.get_udiff(node1, node2)
190 f_udiff = differ.get_udiff(node1, node2)
186 diff = differ.DiffProcessor(f_udiff)
191 diff = differ.DiffProcessor(f_udiff)
187
192
188 if c.action == 'download':
193 if c.action == 'download':
189 diff_name = '%s_vs_%s.diff' % (diff1, diff2)
194 diff_name = '%s_vs_%s.diff' % (diff1, diff2)
190 response.content_type = 'text/plain'
195 response.content_type = 'text/plain'
191 response.content_disposition = 'attachment; filename=%s' \
196 response.content_disposition = 'attachment; filename=%s' \
192 % diff_name
197 % diff_name
193 return diff.raw_diff()
198 return diff.raw_diff()
194
199
195 elif c.action == 'raw':
200 elif c.action == 'raw':
196 response.content_type = 'text/plain'
201 response.content_type = 'text/plain'
197 return diff.raw_diff()
202 return diff.raw_diff()
198
203
199 elif c.action == 'diff':
204 elif c.action == 'diff':
200 if node1.size > c.file_size_limit or node2.size > c.file_size_limit:
205 if node1.size > self.cut_off_limit or node2.size > self.cut_off_limit:
201 c.cur_diff = _('Diff is to big to display')
206 c.cur_diff = _('Diff is to big to display')
202 else:
207 else:
203 c.cur_diff = diff.as_html()
208 c.cur_diff = diff.as_html()
204 else:
209 else:
205 #default option
210 #default option
206 if node1.size > c.file_size_limit or node2.size > c.file_size_limit:
211 if node1.size > self.cut_off_limit or node2.size > self.cut_off_limit:
207 c.cur_diff = _('Diff is to big to display')
212 c.cur_diff = _('Diff is to big to display')
208 else:
213 else:
209 c.cur_diff = diff.as_html()
214 c.cur_diff = diff.as_html()
210
215
211 if not c.cur_diff: c.no_changes = True
216 if not c.cur_diff: c.no_changes = True
212 return render('files/file_diff.html')
217 return render('files/file_diff.html')
213
218
214 def _get_history(self, repo, node, f_path):
219 def _get_history(self, repo, node, f_path):
215 from vcs.nodes import NodeKind
220 from vcs.nodes import NodeKind
216 if not node.kind is NodeKind.FILE:
221 if not node.kind is NodeKind.FILE:
217 return []
222 return []
218 changesets = node.history
223 changesets = node.history
219 hist_l = []
224 hist_l = []
220
225
221 changesets_group = ([], _("Changesets"))
226 changesets_group = ([], _("Changesets"))
222 branches_group = ([], _("Branches"))
227 branches_group = ([], _("Branches"))
223 tags_group = ([], _("Tags"))
228 tags_group = ([], _("Tags"))
224
229
225 for chs in changesets:
230 for chs in changesets:
226 n_desc = 'r%s:%s' % (chs.revision, chs.short_id)
231 n_desc = 'r%s:%s' % (chs.revision, chs.short_id)
227 changesets_group[0].append((chs.raw_id, n_desc,))
232 changesets_group[0].append((chs.raw_id, n_desc,))
228
233
229 hist_l.append(changesets_group)
234 hist_l.append(changesets_group)
230
235
231 for name, chs in c.repository_branches.items():
236 for name, chs in c.repository_branches.items():
232 #chs = chs.split(':')[-1]
237 #chs = chs.split(':')[-1]
233 branches_group[0].append((chs, name),)
238 branches_group[0].append((chs, name),)
234 hist_l.append(branches_group)
239 hist_l.append(branches_group)
235
240
236 for name, chs in c.repository_tags.items():
241 for name, chs in c.repository_tags.items():
237 #chs = chs.split(':')[-1]
242 #chs = chs.split(':')[-1]
238 tags_group[0].append((chs, name),)
243 tags_group[0].append((chs, name),)
239 hist_l.append(tags_group)
244 hist_l.append(tags_group)
240
245
241 return hist_l
246 return hist_l
242
247
243 # [
248 # [
244 # ([("u1", "User1"), ("u2", "User2")], "Users"),
249 # ([("u1", "User1"), ("u2", "User2")], "Users"),
245 # ([("g1", "Group1"), ("g2", "Group2")], "Groups")
250 # ([("g1", "Group1"), ("g2", "Group2")], "Groups")
246 # ]
251 # ]
247
252
@@ -1,52 +1,52 b''
1 """The base Controller API
1 """The base Controller API
2
2
3 Provides the BaseController class for subclassing.
3 Provides the BaseController class for subclassing.
4 """
4 """
5 from pylons import config, tmpl_context as c, request, session
5 from pylons import config, tmpl_context as c, request, session
6 from pylons.controllers import WSGIController
6 from pylons.controllers import WSGIController
7 from pylons.templating import render_mako as render
7 from pylons.templating import render_mako as render
8 from rhodecode import __version__
8 from rhodecode import __version__
9 from rhodecode.lib import auth
9 from rhodecode.lib import auth
10 from rhodecode.lib.utils import get_repo_slug
10 from rhodecode.lib.utils import get_repo_slug
11 from rhodecode.model import meta
11 from rhodecode.model import meta
12 from rhodecode.model.scm import ScmModel
12 from rhodecode.model.scm import ScmModel
13 from rhodecode import BACKENDS
13 from rhodecode import BACKENDS
14
14
15 class BaseController(WSGIController):
15 class BaseController(WSGIController):
16
16
17 def __before__(self):
17 def __before__(self):
18 c.rhodecode_version = __version__
18 c.rhodecode_version = __version__
19 c.rhodecode_name = config['rhodecode_title']
19 c.rhodecode_name = config['rhodecode_title']
20 c.repo_name = get_repo_slug(request)
20 c.repo_name = get_repo_slug(request)
21 c.cached_repo_list = ScmModel().get_repos()
21 c.cached_repo_list = ScmModel().get_repos()
22 c.backends = BACKENDS.keys()
22 c.backends = BACKENDS.keys()
23
23 self.cut_off_limit = int(config['cut_off_limit'])
24 self.sa = meta.Session()
24 self.sa = meta.Session()
25 scm_model = ScmModel(self.sa)
25 scm_model = ScmModel(self.sa)
26 #c.unread_journal = scm_model.get_unread_journal()
26 #c.unread_journal = scm_model.get_unread_journal()
27
27
28 if c.repo_name:
28 if c.repo_name:
29 cached_repo = scm_model.get(c.repo_name)
29 cached_repo = scm_model.get(c.repo_name)
30 if cached_repo:
30 if cached_repo:
31 c.repository_tags = cached_repo.tags
31 c.repository_tags = cached_repo.tags
32 c.repository_branches = cached_repo.branches
32 c.repository_branches = cached_repo.branches
33 c.repository_followers = scm_model.get_followers(cached_repo.dbrepo.repo_id)
33 c.repository_followers = scm_model.get_followers(cached_repo.dbrepo.repo_id)
34 c.repository_forks = scm_model.get_forks(cached_repo.dbrepo.repo_id)
34 c.repository_forks = scm_model.get_forks(cached_repo.dbrepo.repo_id)
35 else:
35 else:
36 c.repository_tags = {}
36 c.repository_tags = {}
37 c.repository_branches = {}
37 c.repository_branches = {}
38 c.repository_followers = 0
38 c.repository_followers = 0
39 c.repository_forks = 0
39 c.repository_forks = 0
40
40
41
41
42 def __call__(self, environ, start_response):
42 def __call__(self, environ, start_response):
43 """Invoke the Controller"""
43 """Invoke the Controller"""
44 # WSGIController.__call__ dispatches to the Controller method
44 # WSGIController.__call__ dispatches to the Controller method
45 # the request is routed to. This routing information is
45 # the request is routed to. This routing information is
46 # available in environ['pylons.routes_dict']
46 # available in environ['pylons.routes_dict']
47 try:
47 try:
48 #putting this here makes sure that we update permissions every time
48 #putting this here makes sure that we update permissions every time
49 self.rhodecode_user = c.rhodecode_user = auth.get_user(session)
49 self.rhodecode_user = c.rhodecode_user = auth.get_user(session)
50 return WSGIController.__call__(self, environ, start_response)
50 return WSGIController.__call__(self, environ, start_response)
51 finally:
51 finally:
52 meta.Session.remove()
52 meta.Session.remove()
@@ -1,201 +1,202 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 ################################################################################
10 ################################################################################
11 ## Uncomment and replace with the address which should receive ##
11 ## Uncomment and replace with the address which should receive ##
12 ## any error reports after application crash ##
12 ## any error reports after application crash ##
13 ## Additionally those settings will be used by rhodecode mailing system ##
13 ## Additionally those settings will be used by rhodecode mailing system ##
14 ################################################################################
14 ################################################################################
15 #email_to = admin@localhost
15 #email_to = admin@localhost
16 #error_email_from = paste_error@localhost
16 #error_email_from = paste_error@localhost
17 #app_email_from = rhodecode-noreply@localhost
17 #app_email_from = rhodecode-noreply@localhost
18 #error_message =
18 #error_message =
19
19
20 #smtp_server = mail.server.com
20 #smtp_server = mail.server.com
21 #smtp_username =
21 #smtp_username =
22 #smtp_password =
22 #smtp_password =
23 #smtp_port =
23 #smtp_port =
24 #smtp_use_tls = false
24 #smtp_use_tls = false
25
25
26 [server:main]
26 [server:main]
27 ##nr of threads to spawn
27 ##nr of threads to spawn
28 threadpool_workers = 5
28 threadpool_workers = 5
29
29
30 ##max request before thread respawn
30 ##max request before thread respawn
31 threadpool_max_requests = 2
31 threadpool_max_requests = 2
32
32
33 ##option to use threads of process
33 ##option to use threads of process
34 use_threadpool = true
34 use_threadpool = true
35
35
36 use = egg:Paste#http
36 use = egg:Paste#http
37 host = 127.0.0.1
37 host = 127.0.0.1
38 port = 5000
38 port = 5000
39
39
40 [app:main]
40 [app:main]
41 use = egg:rhodecode
41 use = egg:rhodecode
42 full_stack = true
42 full_stack = true
43 static_files = true
43 static_files = true
44 lang=en
44 lang=en
45 cache_dir = %(here)s/data
45 cache_dir = %(here)s/data
46 index_dir = /tmp/index
46 index_dir = /tmp/index
47 cut_off_limit = 256000
47
48
48 ####################################
49 ####################################
49 ### CELERY CONFIG ####
50 ### CELERY CONFIG ####
50 ####################################
51 ####################################
51 use_celery = false
52 use_celery = false
52 broker.host = localhost
53 broker.host = localhost
53 broker.vhost = rabbitmqhost
54 broker.vhost = rabbitmqhost
54 broker.port = 5672
55 broker.port = 5672
55 broker.user = rabbitmq
56 broker.user = rabbitmq
56 broker.password = qweqwe
57 broker.password = qweqwe
57
58
58 celery.imports = rhodecode.lib.celerylib.tasks
59 celery.imports = rhodecode.lib.celerylib.tasks
59
60
60 celery.result.backend = amqp
61 celery.result.backend = amqp
61 celery.result.dburi = amqp://
62 celery.result.dburi = amqp://
62 celery.result.serialier = json
63 celery.result.serialier = json
63
64
64 #celery.send.task.error.emails = true
65 #celery.send.task.error.emails = true
65 #celery.amqp.task.result.expires = 18000
66 #celery.amqp.task.result.expires = 18000
66
67
67 celeryd.concurrency = 2
68 celeryd.concurrency = 2
68 #celeryd.log.file = celeryd.log
69 #celeryd.log.file = celeryd.log
69 celeryd.log.level = debug
70 celeryd.log.level = debug
70 celeryd.max.tasks.per.child = 3
71 celeryd.max.tasks.per.child = 3
71
72
72 #tasks will never be sent to the queue, but executed locally instead.
73 #tasks will never be sent to the queue, but executed locally instead.
73 celery.always.eager = false
74 celery.always.eager = false
74
75
75 ####################################
76 ####################################
76 ### BEAKER CACHE ####
77 ### BEAKER CACHE ####
77 ####################################
78 ####################################
78 beaker.cache.data_dir=/%(here)s/data/cache/data
79 beaker.cache.data_dir=/%(here)s/data/cache/data
79 beaker.cache.lock_dir=/%(here)s/data/cache/lock
80 beaker.cache.lock_dir=/%(here)s/data/cache/lock
80 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
81 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
81
82
82 beaker.cache.super_short_term.type=memory
83 beaker.cache.super_short_term.type=memory
83 beaker.cache.super_short_term.expire=10
84 beaker.cache.super_short_term.expire=10
84
85
85 beaker.cache.short_term.type=memory
86 beaker.cache.short_term.type=memory
86 beaker.cache.short_term.expire=60
87 beaker.cache.short_term.expire=60
87
88
88 beaker.cache.long_term.type=memory
89 beaker.cache.long_term.type=memory
89 beaker.cache.long_term.expire=36000
90 beaker.cache.long_term.expire=36000
90
91
91
92
92 beaker.cache.sql_cache_short.type=memory
93 beaker.cache.sql_cache_short.type=memory
93 beaker.cache.sql_cache_short.expire=5
94 beaker.cache.sql_cache_short.expire=5
94
95
95 beaker.cache.sql_cache_med.type=memory
96 beaker.cache.sql_cache_med.type=memory
96 beaker.cache.sql_cache_med.expire=360
97 beaker.cache.sql_cache_med.expire=360
97
98
98 beaker.cache.sql_cache_long.type=file
99 beaker.cache.sql_cache_long.type=file
99 beaker.cache.sql_cache_long.expire=3600
100 beaker.cache.sql_cache_long.expire=3600
100
101
101 ####################################
102 ####################################
102 ### BEAKER SESSION ####
103 ### BEAKER SESSION ####
103 ####################################
104 ####################################
104 ## Type of storage used for the session, current types are
105 ## Type of storage used for the session, current types are
105 ## dbm, file, memcached, database, and memory.
106 ## dbm, file, memcached, database, and memory.
106 ## The storage uses the Container API
107 ## The storage uses the Container API
107 ##that is also used by the cache system.
108 ##that is also used by the cache system.
108 beaker.session.type = file
109 beaker.session.type = file
109
110
110 beaker.session.key = rhodecode
111 beaker.session.key = rhodecode
111 beaker.session.secret = g654dcno0-9873jhgfreyu
112 beaker.session.secret = g654dcno0-9873jhgfreyu
112 beaker.session.timeout = 36000
113 beaker.session.timeout = 36000
113
114
114 ##auto save the session to not to use .save()
115 ##auto save the session to not to use .save()
115 beaker.session.auto = False
116 beaker.session.auto = False
116
117
117 ##true exire at browser close
118 ##true exire at browser close
118 #beaker.session.cookie_expires = 3600
119 #beaker.session.cookie_expires = 3600
119
120
120
121
121 ################################################################################
122 ################################################################################
122 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
123 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
123 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
124 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
124 ## execute malicious code after an exception is raised. ##
125 ## execute malicious code after an exception is raised. ##
125 ################################################################################
126 ################################################################################
126 #set debug = false
127 #set debug = false
127
128
128 ##################################
129 ##################################
129 ### LOGVIEW CONFIG ###
130 ### LOGVIEW CONFIG ###
130 ##################################
131 ##################################
131 logview.sqlalchemy = #faa
132 logview.sqlalchemy = #faa
132 logview.pylons.templating = #bfb
133 logview.pylons.templating = #bfb
133 logview.pylons.util = #eee
134 logview.pylons.util = #eee
134
135
135 #########################################################
136 #########################################################
136 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
137 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
137 #########################################################
138 #########################################################
138 sqlalchemy.db1.url = sqlite:///%(here)s/test.db
139 sqlalchemy.db1.url = sqlite:///%(here)s/test.db
139 #sqlalchemy.db1.echo = False
140 #sqlalchemy.db1.echo = False
140 #sqlalchemy.db1.pool_recycle = 3600
141 #sqlalchemy.db1.pool_recycle = 3600
141 sqlalchemy.convert_unicode = true
142 sqlalchemy.convert_unicode = true
142
143
143 ################################
144 ################################
144 ### LOGGING CONFIGURATION ####
145 ### LOGGING CONFIGURATION ####
145 ################################
146 ################################
146 [loggers]
147 [loggers]
147 keys = root, routes, rhodecode, sqlalchemy
148 keys = root, routes, rhodecode, sqlalchemy
148
149
149 [handlers]
150 [handlers]
150 keys = console
151 keys = console
151
152
152 [formatters]
153 [formatters]
153 keys = generic,color_formatter
154 keys = generic,color_formatter
154
155
155 #############
156 #############
156 ## LOGGERS ##
157 ## LOGGERS ##
157 #############
158 #############
158 [logger_root]
159 [logger_root]
159 level = ERROR
160 level = ERROR
160 handlers = console
161 handlers = console
161
162
162 [logger_routes]
163 [logger_routes]
163 level = ERROR
164 level = ERROR
164 handlers = console
165 handlers = console
165 qualname = routes.middleware
166 qualname = routes.middleware
166 # "level = DEBUG" logs the route matched and routing variables.
167 # "level = DEBUG" logs the route matched and routing variables.
167
168
168 [logger_rhodecode]
169 [logger_rhodecode]
169 level = ERROR
170 level = ERROR
170 handlers = console
171 handlers = console
171 qualname = rhodecode
172 qualname = rhodecode
172 propagate = 0
173 propagate = 0
173
174
174 [logger_sqlalchemy]
175 [logger_sqlalchemy]
175 level = ERROR
176 level = ERROR
176 handlers = console
177 handlers = console
177 qualname = sqlalchemy.engine
178 qualname = sqlalchemy.engine
178 propagate = 0
179 propagate = 0
179
180
180 ##############
181 ##############
181 ## HANDLERS ##
182 ## HANDLERS ##
182 ##############
183 ##############
183
184
184 [handler_console]
185 [handler_console]
185 class = StreamHandler
186 class = StreamHandler
186 args = (sys.stderr,)
187 args = (sys.stderr,)
187 level = NOTSET
188 level = NOTSET
188 formatter = color_formatter
189 formatter = color_formatter
189
190
190 ################
191 ################
191 ## FORMATTERS ##
192 ## FORMATTERS ##
192 ################
193 ################
193
194
194 [formatter_generic]
195 [formatter_generic]
195 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
196 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
196 datefmt = %Y-%m-%d %H:%M:%S
197 datefmt = %Y-%m-%d %H:%M:%S
197
198
198 [formatter_color_formatter]
199 [formatter_color_formatter]
199 class=rhodecode.lib.colored_formatter.ColorFormatter
200 class=rhodecode.lib.colored_formatter.ColorFormatter
200 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
201 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
201 datefmt = %Y-%m-%d %H:%M:%S No newline at end of file
202 datefmt = %Y-%m-%d %H:%M:%S
General Comments 0
You need to be logged in to leave comments. Login now