##// END OF EJS Templates
configurable clone url...
marcink -
r1652:8384eaab beta
parent child Browse files
Show More
@@ -1,243 +1,252 b''
1 1 ################################################################################
2 2 ################################################################################
3 3 # RhodeCode - Pylons environment configuration #
4 4 # #
5 5 # The %(here)s variable will be replaced with the parent directory of this file#
6 6 ################################################################################
7 7
8 8 [DEFAULT]
9 9 debug = true
10 10 pdebug = false
11 11 ################################################################################
12 12 ## Uncomment and replace with the address which should receive ##
13 13 ## any error reports after application crash ##
14 14 ## Additionally those settings will be used by RhodeCode mailing system ##
15 15 ################################################################################
16 16 #email_to = admin@localhost
17 17 #error_email_from = paste_error@localhost
18 18 #app_email_from = rhodecode-noreply@localhost
19 19 #error_message =
20 20
21 21 #smtp_server = mail.server.com
22 22 #smtp_username =
23 23 #smtp_password =
24 24 #smtp_port =
25 25 #smtp_use_tls = false
26 26 #smtp_use_ssl = true
27 27 # Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
28 28 #smtp_auth =
29 29
30 30 [server:main]
31 31 ##nr of threads to spawn
32 32 threadpool_workers = 5
33 33
34 34 ##max request before thread respawn
35 35 threadpool_max_requests = 6
36 36
37 37 ##option to use threads of process
38 38 use_threadpool = true
39 39
40 40 use = egg:Paste#http
41 41 host = 0.0.0.0
42 42 port = 5000
43 43
44 44 [app:main]
45 45 use = egg:rhodecode
46 46 full_stack = true
47 47 static_files = true
48 48 lang=en
49 49 cache_dir = %(here)s/data
50 50 index_dir = %(here)s/data/index
51 51 app_instance_uuid = develop
52 52 cut_off_limit = 256000
53 53 force_https = false
54 54 commit_parse_limit = 25
55 55 use_gravatar = true
56 56 container_auth_enabled = false
57 57 proxypass_auth_enabled = false
58 58
59 ## overwrite schema of clone url
60 # available vars:
61 # scheme - http/https
62 # user - current user
63 # pass - password
64 # netloc - network location
65 # path - usually repo_name
66 # clone_uri = {scheme}://{user}{pass}{netloc}{path}
67
59 68 ####################################
60 69 ### CELERY CONFIG ####
61 70 ####################################
62 71 use_celery = false
63 72 broker.host = localhost
64 73 broker.vhost = rabbitmqhost
65 74 broker.port = 5672
66 75 broker.user = rabbitmq
67 76 broker.password = qweqwe
68 77
69 78 celery.imports = rhodecode.lib.celerylib.tasks
70 79
71 80 celery.result.backend = amqp
72 81 celery.result.dburi = amqp://
73 82 celery.result.serialier = json
74 83
75 84 #celery.send.task.error.emails = true
76 85 #celery.amqp.task.result.expires = 18000
77 86
78 87 celeryd.concurrency = 2
79 88 #celeryd.log.file = celeryd.log
80 89 celeryd.log.level = debug
81 90 celeryd.max.tasks.per.child = 1
82 91
83 92 #tasks will never be sent to the queue, but executed locally instead.
84 93 celery.always.eager = false
85 94
86 95 ####################################
87 96 ### BEAKER CACHE ####
88 97 ####################################
89 98 beaker.cache.data_dir=%(here)s/data/cache/data
90 99 beaker.cache.lock_dir=%(here)s/data/cache/lock
91 100
92 101 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
93 102
94 103 beaker.cache.super_short_term.type=memory
95 104 beaker.cache.super_short_term.expire=10
96 105 beaker.cache.super_short_term.key_length = 256
97 106
98 107 beaker.cache.short_term.type=memory
99 108 beaker.cache.short_term.expire=60
100 109 beaker.cache.short_term.key_length = 256
101 110
102 111 beaker.cache.long_term.type=memory
103 112 beaker.cache.long_term.expire=36000
104 113 beaker.cache.long_term.key_length = 256
105 114
106 115 beaker.cache.sql_cache_short.type=memory
107 116 beaker.cache.sql_cache_short.expire=10
108 117 beaker.cache.sql_cache_short.key_length = 256
109 118
110 119 beaker.cache.sql_cache_med.type=memory
111 120 beaker.cache.sql_cache_med.expire=360
112 121 beaker.cache.sql_cache_med.key_length = 256
113 122
114 123 beaker.cache.sql_cache_long.type=file
115 124 beaker.cache.sql_cache_long.expire=3600
116 125 beaker.cache.sql_cache_long.key_length = 256
117 126
118 127 ####################################
119 128 ### BEAKER SESSION ####
120 129 ####################################
121 130 ## Type of storage used for the session, current types are
122 131 ## dbm, file, memcached, database, and memory.
123 132 ## The storage uses the Container API
124 133 ##that is also used by the cache system.
125 134 beaker.session.type = file
126 135
127 136 beaker.session.key = rhodecode
128 137 beaker.session.secret = g654dcno0-9873jhgfreyu
129 138 beaker.session.timeout = 36000
130 139
131 140 ##auto save the session to not to use .save()
132 141 beaker.session.auto = False
133 142
134 143 ##true exire at browser close
135 144 #beaker.session.cookie_expires = 3600
136 145
137 146
138 147 ################################################################################
139 148 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
140 149 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
141 150 ## execute malicious code after an exception is raised. ##
142 151 ################################################################################
143 152 #set debug = false
144 153
145 154 ##################################
146 155 ### LOGVIEW CONFIG ###
147 156 ##################################
148 157 logview.sqlalchemy = #faa
149 158 logview.pylons.templating = #bfb
150 159 logview.pylons.util = #eee
151 160
152 161 #########################################################
153 162 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
154 163 #########################################################
155 164 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
156 165 sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
157 166 sqlalchemy.db1.echo = false
158 167 sqlalchemy.db1.pool_recycle = 3600
159 168 sqlalchemy.convert_unicode = true
160 169
161 170 ################################
162 171 ### LOGGING CONFIGURATION ####
163 172 ################################
164 173 [loggers]
165 174 keys = root, routes, rhodecode, sqlalchemy, beaker, templates
166 175
167 176 [handlers]
168 177 keys = console, console_sql
169 178
170 179 [formatters]
171 180 keys = generic, color_formatter, color_formatter_sql
172 181
173 182 #############
174 183 ## LOGGERS ##
175 184 #############
176 185 [logger_root]
177 186 level = NOTSET
178 187 handlers = console
179 188
180 189 [logger_routes]
181 190 level = DEBUG
182 191 handlers =
183 192 qualname = routes.middleware
184 193 # "level = DEBUG" logs the route matched and routing variables.
185 194 propagate = 1
186 195
187 196 [logger_beaker]
188 197 level = DEBUG
189 198 handlers =
190 199 qualname = beaker.container
191 200 propagate = 1
192 201
193 202 [logger_templates]
194 203 level = INFO
195 204 handlers =
196 205 qualname = pylons.templating
197 206 propagate = 1
198 207
199 208 [logger_rhodecode]
200 209 level = DEBUG
201 210 handlers =
202 211 qualname = rhodecode
203 212 propagate = 1
204 213
205 214 [logger_sqlalchemy]
206 215 level = INFO
207 216 handlers = console_sql
208 217 qualname = sqlalchemy.engine
209 218 propagate = 0
210 219
211 220 ##############
212 221 ## HANDLERS ##
213 222 ##############
214 223
215 224 [handler_console]
216 225 class = StreamHandler
217 226 args = (sys.stderr,)
218 227 level = DEBUG
219 228 formatter = color_formatter
220 229
221 230 [handler_console_sql]
222 231 class = StreamHandler
223 232 args = (sys.stderr,)
224 233 level = DEBUG
225 234 formatter = color_formatter_sql
226 235
227 236 ################
228 237 ## FORMATTERS ##
229 238 ################
230 239
231 240 [formatter_generic]
232 241 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
233 242 datefmt = %Y-%m-%d %H:%M:%S
234 243
235 244 [formatter_color_formatter]
236 245 class=rhodecode.lib.colored_formatter.ColorFormatter
237 246 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
238 247 datefmt = %Y-%m-%d %H:%M:%S
239 248
240 249 [formatter_color_formatter_sql]
241 250 class=rhodecode.lib.colored_formatter.ColorFormatterSql
242 251 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
243 252 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,415 +1,417 b''
1 1 .. _changelog:
2 2
3 3 Changelog
4 4 =========
5 5
6 6
7 7 1.3.0 (**XXXX-XX-XX**)
8 8 ======================
9 9
10 10 :status: in-progress
11 11 :branch: beta
12 12
13 13 news
14 14 ----
15 15
16 16 - #215 rst and markdown README files support
17 17 - #252 pass-through user identity
18 18 - hover top menu
19
19 - configurable clone url posibility to specify ssh:// manually as
20 alternative clone url.
21
20 22 fixes
21 23 -----
22 24
23 25 1.2.3 (**2011-11-02**)
24 26 ======================
25 27
26 28 news
27 29 ----
28 30
29 31 - added option to manage repos group for non admin users
30 32 - added following API methods for get_users, create_user, get_users_groups,
31 33 get_users_group, create_users_group, add_user_to_users_groups, get_repos,
32 34 get_repo, create_repo, add_user_to_repo
33 35 - implements #237 added password confirmation for my account
34 36 and admin edit user.
35 37 - implements #291 email notification for global events are now sent to all
36 38 administrator users, and global config email.
37 39
38 40 fixes
39 41 -----
40 42
41 43 - added option for passing auth method for smtp mailer
42 44 - #276 issue with adding a single user with id>10 to usergroups
43 45 - #277 fixes windows LDAP settings in which missing values breaks the ldap auth
44 46 - #288 fixes managing of repos in a group for non admin user
45 47
46 48 1.2.2 (**2011-10-17**)
47 49 ======================
48 50
49 51 news
50 52 ----
51 53
52 54 - #226 repo groups are available by path instead of numerical id
53 55
54 56 fixes
55 57 -----
56 58
57 59 - #259 Groups with the same name but with different parent group
58 60 - #260 Put repo in group, then move group to another group -> repo becomes unavailable
59 61 - #258 RhodeCode 1.2 assumes egg folder is writable (lockfiles problems)
60 62 - #265 ldap save fails sometimes on converting attributes to booleans,
61 63 added getter and setter into model that will prevent from this on db model level
62 64 - fixed problems with timestamps issues #251 and #213
63 65 - fixes #266 RhodeCode allows to create repo with the same name and in
64 66 the same parent as group
65 67 - fixes #245 Rescan of the repositories on Windows
66 68 - fixes #248 cannot edit repos inside a group on windows
67 69 - fixes #219 forking problems on windows
68 70
69 71 1.2.1 (**2011-10-08**)
70 72 ======================
71 73
72 74 news
73 75 ----
74 76
75 77
76 78 fixes
77 79 -----
78 80
79 81 - fixed problems with basic auth and push problems
80 82 - gui fixes
81 83 - fixed logger
82 84
83 85 1.2.0 (**2011-10-07**)
84 86 ======================
85 87
86 88 news
87 89 ----
88 90
89 91 - implemented #47 repository groups
90 92 - implemented #89 Can setup google analytics code from settings menu
91 93 - implemented #91 added nicer looking archive urls with more download options
92 94 like tags, branches
93 95 - implemented #44 into file browsing, and added follow branch option
94 96 - implemented #84 downloads can be enabled/disabled for each repository
95 97 - anonymous repository can be cloned without having to pass default:default
96 98 into clone url
97 99 - fixed #90 whoosh indexer can index chooses repositories passed in command
98 100 line
99 101 - extended journal with day aggregates and paging
100 102 - implemented #107 source code lines highlight ranges
101 103 - implemented #93 customizable changelog on combined revision ranges -
102 104 equivalent of githubs compare view
103 105 - implemented #108 extended and more powerful LDAP configuration
104 106 - implemented #56 users groups
105 107 - major code rewrites optimized codes for speed and memory usage
106 108 - raw and diff downloads are now in git format
107 109 - setup command checks for write access to given path
108 110 - fixed many issues with international characters and unicode. It uses utf8
109 111 decode with replace to provide less errors even with non utf8 encoded strings
110 112 - #125 added API KEY access to feeds
111 113 - #109 Repository can be created from external Mercurial link (aka. remote
112 114 repository, and manually updated (via pull) from admin panel
113 115 - beta git support - push/pull server + basic view for git repos
114 116 - added followers page and forks page
115 117 - server side file creation (with binary file upload interface)
116 118 and edition with commits powered by codemirror
117 119 - #111 file browser file finder, quick lookup files on whole file tree
118 120 - added quick login sliding menu into main page
119 121 - changelog uses lazy loading of affected files details, in some scenarios
120 122 this can improve speed of changelog page dramatically especially for
121 123 larger repositories.
122 124 - implements #214 added support for downloading subrepos in download menu.
123 125 - Added basic API for direct operations on rhodecode via JSON
124 126 - Implemented advanced hook management
125 127
126 128 fixes
127 129 -----
128 130
129 131 - fixed file browser bug, when switching into given form revision the url was
130 132 not changing
131 133 - fixed propagation to error controller on simplehg and simplegit middlewares
132 134 - fixed error when trying to make a download on empty repository
133 135 - fixed problem with '[' chars in commit messages in journal
134 136 - fixed #99 Unicode errors, on file node paths with non utf-8 characters
135 137 - journal fork fixes
136 138 - removed issue with space inside renamed repository after deletion
137 139 - fixed strange issue on formencode imports
138 140 - fixed #126 Deleting repository on Windows, rename used incompatible chars.
139 141 - #150 fixes for errors on repositories mapped in db but corrupted in
140 142 filesystem
141 143 - fixed problem with ascendant characters in realm #181
142 144 - fixed problem with sqlite file based database connection pool
143 145 - whoosh indexer and code stats share the same dynamic extensions map
144 146 - fixes #188 - relationship delete of repo_to_perm entry on user removal
145 147 - fixes issue #189 Trending source files shows "show more" when no more exist
146 148 - fixes issue #197 Relative paths for pidlocks
147 149 - fixes issue #198 password will require only 3 chars now for login form
148 150 - fixes issue #199 wrong redirection for non admin users after creating a repository
149 151 - fixes issues #202, bad db constraint made impossible to attach same group
150 152 more than one time. Affects only mysql/postgres
151 153 - fixes #218 os.kill patch for windows was missing sig param
152 154 - improved rendering of dag (they are not trimmed anymore when number of
153 155 heads exceeds 5)
154 156
155 157 1.1.8 (**2011-04-12**)
156 158 ======================
157 159
158 160 news
159 161 ----
160 162
161 163 - improved windows support
162 164
163 165 fixes
164 166 -----
165 167
166 168 - fixed #140 freeze of python dateutil library, since new version is python2.x
167 169 incompatible
168 170 - setup-app will check for write permission in given path
169 171 - cleaned up license info issue #149
170 172 - fixes for issues #137,#116 and problems with unicode and accented characters.
171 173 - fixes crashes on gravatar, when passed in email as unicode
172 174 - fixed tooltip flickering problems
173 175 - fixed came_from redirection on windows
174 176 - fixed logging modules, and sql formatters
175 177 - windows fixes for os.kill issue #133
176 178 - fixes path splitting for windows issues #148
177 179 - fixed issue #143 wrong import on migration to 1.1.X
178 180 - fixed problems with displaying binary files, thanks to Thomas Waldmann
179 181 - removed name from archive files since it's breaking ui for long repo names
180 182 - fixed issue with archive headers sent to browser, thanks to Thomas Waldmann
181 183 - fixed compatibility for 1024px displays, and larger dpi settings, thanks to
182 184 Thomas Waldmann
183 185 - fixed issue #166 summary pager was skipping 10 revisions on second page
184 186
185 187
186 188 1.1.7 (**2011-03-23**)
187 189 ======================
188 190
189 191 news
190 192 ----
191 193
192 194 fixes
193 195 -----
194 196
195 197 - fixed (again) #136 installation support for FreeBSD
196 198
197 199
198 200 1.1.6 (**2011-03-21**)
199 201 ======================
200 202
201 203 news
202 204 ----
203 205
204 206 fixes
205 207 -----
206 208
207 209 - fixed #136 installation support for FreeBSD
208 210 - RhodeCode will check for python version during installation
209 211
210 212 1.1.5 (**2011-03-17**)
211 213 ======================
212 214
213 215 news
214 216 ----
215 217
216 218 - basic windows support, by exchanging pybcrypt into sha256 for windows only
217 219 highly inspired by idea of mantis406
218 220
219 221 fixes
220 222 -----
221 223
222 224 - fixed sorting by author in main page
223 225 - fixed crashes with diffs on binary files
224 226 - fixed #131 problem with boolean values for LDAP
225 227 - fixed #122 mysql problems thanks to striker69
226 228 - fixed problem with errors on calling raw/raw_files/annotate functions
227 229 with unknown revisions
228 230 - fixed returned rawfiles attachment names with international character
229 231 - cleaned out docs, big thanks to Jason Harris
230 232
231 233 1.1.4 (**2011-02-19**)
232 234 ======================
233 235
234 236 news
235 237 ----
236 238
237 239 fixes
238 240 -----
239 241
240 242 - fixed formencode import problem on settings page, that caused server crash
241 243 when that page was accessed as first after server start
242 244 - journal fixes
243 245 - fixed option to access repository just by entering http://server/<repo_name>
244 246
245 247 1.1.3 (**2011-02-16**)
246 248 ======================
247 249
248 250 news
249 251 ----
250 252
251 253 - implemented #102 allowing the '.' character in username
252 254 - added option to access repository just by entering http://server/<repo_name>
253 255 - celery task ignores result for better performance
254 256
255 257 fixes
256 258 -----
257 259
258 260 - fixed ehlo command and non auth mail servers on smtp_lib. Thanks to
259 261 apollo13 and Johan Walles
260 262 - small fixes in journal
261 263 - fixed problems with getting setting for celery from .ini files
262 264 - registration, password reset and login boxes share the same title as main
263 265 application now
264 266 - fixed #113: to high permissions to fork repository
265 267 - fixed problem with '[' chars in commit messages in journal
266 268 - removed issue with space inside renamed repository after deletion
267 269 - db transaction fixes when filesystem repository creation failed
268 270 - fixed #106 relation issues on databases different than sqlite
269 271 - fixed static files paths links to use of url() method
270 272
271 273 1.1.2 (**2011-01-12**)
272 274 ======================
273 275
274 276 news
275 277 ----
276 278
277 279
278 280 fixes
279 281 -----
280 282
281 283 - fixes #98 protection against float division of percentage stats
282 284 - fixed graph bug
283 285 - forced webhelpers version since it was making troubles during installation
284 286
285 287 1.1.1 (**2011-01-06**)
286 288 ======================
287 289
288 290 news
289 291 ----
290 292
291 293 - added force https option into ini files for easier https usage (no need to
292 294 set server headers with this options)
293 295 - small css updates
294 296
295 297 fixes
296 298 -----
297 299
298 300 - fixed #96 redirect loop on files view on repositories without changesets
299 301 - fixed #97 unicode string passed into server header in special cases (mod_wsgi)
300 302 and server crashed with errors
301 303 - fixed large tooltips problems on main page
302 304 - fixed #92 whoosh indexer is more error proof
303 305
304 306 1.1.0 (**2010-12-18**)
305 307 ======================
306 308
307 309 news
308 310 ----
309 311
310 312 - rewrite of internals for vcs >=0.1.10
311 313 - uses mercurial 1.7 with dotencode disabled for maintaining compatibility
312 314 with older clients
313 315 - anonymous access, authentication via ldap
314 316 - performance upgrade for cached repos list - each repository has it's own
315 317 cache that's invalidated when needed.
316 318 - performance upgrades on repositories with large amount of commits (20K+)
317 319 - main page quick filter for filtering repositories
318 320 - user dashboards with ability to follow chosen repositories actions
319 321 - sends email to admin on new user registration
320 322 - added cache/statistics reset options into repository settings
321 323 - more detailed action logger (based on hooks) with pushed changesets lists
322 324 and options to disable those hooks from admin panel
323 325 - introduced new enhanced changelog for merges that shows more accurate results
324 326 - new improved and faster code stats (based on pygments lexers mapping tables,
325 327 showing up to 10 trending sources for each repository. Additionally stats
326 328 can be disabled in repository settings.
327 329 - gui optimizations, fixed application width to 1024px
328 330 - added cut off (for large files/changesets) limit into config files
329 331 - whoosh, celeryd, upgrade moved to paster command
330 332 - other than sqlite database backends can be used
331 333
332 334 fixes
333 335 -----
334 336
335 337 - fixes #61 forked repo was showing only after cache expired
336 338 - fixes #76 no confirmation on user deletes
337 339 - fixes #66 Name field misspelled
338 340 - fixes #72 block user removal when he owns repositories
339 341 - fixes #69 added password confirmation fields
340 342 - fixes #87 RhodeCode crashes occasionally on updating repository owner
341 343 - fixes #82 broken annotations on files with more than 1 blank line at the end
342 344 - a lot of fixes and tweaks for file browser
343 345 - fixed detached session issues
344 346 - fixed when user had no repos he would see all repos listed in my account
345 347 - fixed ui() instance bug when global hgrc settings was loaded for server
346 348 instance and all hgrc options were merged with our db ui() object
347 349 - numerous small bugfixes
348 350
349 351 (special thanks for TkSoh for detailed feedback)
350 352
351 353
352 354 1.0.2 (**2010-11-12**)
353 355 ======================
354 356
355 357 news
356 358 ----
357 359
358 360 - tested under python2.7
359 361 - bumped sqlalchemy and celery versions
360 362
361 363 fixes
362 364 -----
363 365
364 366 - fixed #59 missing graph.js
365 367 - fixed repo_size crash when repository had broken symlinks
366 368 - fixed python2.5 crashes.
367 369
368 370
369 371 1.0.1 (**2010-11-10**)
370 372 ======================
371 373
372 374 news
373 375 ----
374 376
375 377 - small css updated
376 378
377 379 fixes
378 380 -----
379 381
380 382 - fixed #53 python2.5 incompatible enumerate calls
381 383 - fixed #52 disable mercurial extension for web
382 384 - fixed #51 deleting repositories don't delete it's dependent objects
383 385
384 386
385 387 1.0.0 (**2010-11-02**)
386 388 ======================
387 389
388 390 - security bugfix simplehg wasn't checking for permissions on commands
389 391 other than pull or push.
390 392 - fixed doubled messages after push or pull in admin journal
391 393 - templating and css corrections, fixed repo switcher on chrome, updated titles
392 394 - admin menu accessible from options menu on repository view
393 395 - permissions cached queries
394 396
395 397 1.0.0rc4 (**2010-10-12**)
396 398 ==========================
397 399
398 400 - fixed python2.5 missing simplejson imports (thanks to Jens BΓ€ckman)
399 401 - removed cache_manager settings from sqlalchemy meta
400 402 - added sqlalchemy cache settings to ini files
401 403 - validated password length and added second try of failure on paster setup-app
402 404 - fixed setup database destroy prompt even when there was no db
403 405
404 406
405 407 1.0.0rc3 (**2010-10-11**)
406 408 =========================
407 409
408 410 - fixed i18n during installation.
409 411
410 412 1.0.0rc2 (**2010-10-11**)
411 413 =========================
412 414
413 415 - Disabled dirsize in file browser, it's causing nasty bug when dir renames
414 416 occure. After vcs is fixed it'll be put back again.
415 417 - templating/css rewrites, optimized css. No newline at end of file
@@ -1,243 +1,251 b''
1 1 ################################################################################
2 2 ################################################################################
3 3 # RhodeCode - Pylons environment configuration #
4 4 # #
5 5 # The %(here)s variable will be replaced with the parent directory of this file#
6 6 ################################################################################
7 7
8 8 [DEFAULT]
9 9 debug = true
10 10 pdebug = false
11 11 ################################################################################
12 12 ## Uncomment and replace with the address which should receive ##
13 13 ## any error reports after application crash ##
14 14 ## Additionally those settings will be used by RhodeCode mailing system ##
15 15 ################################################################################
16 16 #email_to = admin@localhost
17 17 #error_email_from = paste_error@localhost
18 18 #app_email_from = rhodecode-noreply@localhost
19 19 #error_message =
20 20
21 21 #smtp_server = mail.server.com
22 22 #smtp_username =
23 23 #smtp_password =
24 24 #smtp_port =
25 25 #smtp_use_tls = false
26 26 #smtp_use_ssl = true
27 27 # Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
28 28 #smtp_auth =
29 29
30 30 [server:main]
31 31 ##nr of threads to spawn
32 32 threadpool_workers = 5
33 33
34 34 ##max request before thread respawn
35 35 threadpool_max_requests = 10
36 36
37 37 ##option to use threads of process
38 38 use_threadpool = true
39 39
40 40 use = egg:Paste#http
41 41 host = 127.0.0.1
42 42 port = 8001
43 43
44 44 [app:main]
45 45 use = egg:rhodecode
46 46 full_stack = true
47 47 static_files = true
48 48 lang=en
49 49 cache_dir = %(here)s/data
50 50 index_dir = %(here)s/data/index
51 51 app_instance_uuid = prod1234
52 52 cut_off_limit = 256000
53 53 force_https = false
54 54 commit_parse_limit = 50
55 55 use_gravatar = true
56 56 container_auth_enabled = false
57 57 proxypass_auth_enabled = false
58 58
59 ## available vars
60 ## scheme - http/https
61 ## user - current user
62 ## pass - password
63 ## netloc - network location
64 ## path - usually repo_name
65 clone_uri = {scheme}://{user}{pass}{netloc}{path}
66
59 67 ####################################
60 68 ### CELERY CONFIG ####
61 69 ####################################
62 70 use_celery = false
63 71 broker.host = localhost
64 72 broker.vhost = rabbitmqhost
65 73 broker.port = 5672
66 74 broker.user = rabbitmq
67 75 broker.password = qweqwe
68 76
69 77 celery.imports = rhodecode.lib.celerylib.tasks
70 78
71 79 celery.result.backend = amqp
72 80 celery.result.dburi = amqp://
73 81 celery.result.serialier = json
74 82
75 83 #celery.send.task.error.emails = true
76 84 #celery.amqp.task.result.expires = 18000
77 85
78 86 celeryd.concurrency = 2
79 87 #celeryd.log.file = celeryd.log
80 88 celeryd.log.level = debug
81 89 celeryd.max.tasks.per.child = 1
82 90
83 91 #tasks will never be sent to the queue, but executed locally instead.
84 92 celery.always.eager = false
85 93
86 94 ####################################
87 95 ### BEAKER CACHE ####
88 96 ####################################
89 97 beaker.cache.data_dir=%(here)s/data/cache/data
90 98 beaker.cache.lock_dir=%(here)s/data/cache/lock
91 99
92 100 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
93 101
94 102 beaker.cache.super_short_term.type=memory
95 103 beaker.cache.super_short_term.expire=10
96 104 beaker.cache.super_short_term.key_length = 256
97 105
98 106 beaker.cache.short_term.type=memory
99 107 beaker.cache.short_term.expire=60
100 108 beaker.cache.short_term.key_length = 256
101 109
102 110 beaker.cache.long_term.type=memory
103 111 beaker.cache.long_term.expire=36000
104 112 beaker.cache.long_term.key_length = 256
105 113
106 114 beaker.cache.sql_cache_short.type=memory
107 115 beaker.cache.sql_cache_short.expire=10
108 116 beaker.cache.sql_cache_short.key_length = 256
109 117
110 118 beaker.cache.sql_cache_med.type=memory
111 119 beaker.cache.sql_cache_med.expire=360
112 120 beaker.cache.sql_cache_med.key_length = 256
113 121
114 122 beaker.cache.sql_cache_long.type=file
115 123 beaker.cache.sql_cache_long.expire=3600
116 124 beaker.cache.sql_cache_long.key_length = 256
117 125
118 126 ####################################
119 127 ### BEAKER SESSION ####
120 128 ####################################
121 129 ## Type of storage used for the session, current types are
122 130 ## dbm, file, memcached, database, and memory.
123 131 ## The storage uses the Container API
124 132 ##that is also used by the cache system.
125 133 beaker.session.type = file
126 134
127 135 beaker.session.key = rhodecode
128 136 beaker.session.secret = g654dcno0-9873jhgfreyu
129 137 beaker.session.timeout = 36000
130 138
131 139 ##auto save the session to not to use .save()
132 140 beaker.session.auto = False
133 141
134 142 ##true exire at browser close
135 143 #beaker.session.cookie_expires = 3600
136 144
137 145
138 146 ################################################################################
139 147 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
140 148 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
141 149 ## execute malicious code after an exception is raised. ##
142 150 ################################################################################
143 151 set debug = false
144 152
145 153 ##################################
146 154 ### LOGVIEW CONFIG ###
147 155 ##################################
148 156 logview.sqlalchemy = #faa
149 157 logview.pylons.templating = #bfb
150 158 logview.pylons.util = #eee
151 159
152 160 #########################################################
153 161 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
154 162 #########################################################
155 163 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
156 164 sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
157 165 sqlalchemy.db1.echo = false
158 166 sqlalchemy.db1.pool_recycle = 3600
159 167 sqlalchemy.convert_unicode = true
160 168
161 169 ################################
162 170 ### LOGGING CONFIGURATION ####
163 171 ################################
164 172 [loggers]
165 173 keys = root, routes, rhodecode, sqlalchemy, beaker, templates
166 174
167 175 [handlers]
168 176 keys = console, console_sql
169 177
170 178 [formatters]
171 179 keys = generic, color_formatter, color_formatter_sql
172 180
173 181 #############
174 182 ## LOGGERS ##
175 183 #############
176 184 [logger_root]
177 185 level = NOTSET
178 186 handlers = console
179 187
180 188 [logger_routes]
181 189 level = DEBUG
182 190 handlers =
183 191 qualname = routes.middleware
184 192 # "level = DEBUG" logs the route matched and routing variables.
185 193 propagate = 1
186 194
187 195 [logger_beaker]
188 196 level = DEBUG
189 197 handlers =
190 198 qualname = beaker.container
191 199 propagate = 1
192 200
193 201 [logger_templates]
194 202 level = INFO
195 203 handlers =
196 204 qualname = pylons.templating
197 205 propagate = 1
198 206
199 207 [logger_rhodecode]
200 208 level = DEBUG
201 209 handlers =
202 210 qualname = rhodecode
203 211 propagate = 1
204 212
205 213 [logger_sqlalchemy]
206 214 level = INFO
207 215 handlers = console_sql
208 216 qualname = sqlalchemy.engine
209 217 propagate = 0
210 218
211 219 ##############
212 220 ## HANDLERS ##
213 221 ##############
214 222
215 223 [handler_console]
216 224 class = StreamHandler
217 225 args = (sys.stderr,)
218 226 level = INFO
219 227 formatter = generic
220 228
221 229 [handler_console_sql]
222 230 class = StreamHandler
223 231 args = (sys.stderr,)
224 232 level = WARN
225 233 formatter = generic
226 234
227 235 ################
228 236 ## FORMATTERS ##
229 237 ################
230 238
231 239 [formatter_generic]
232 240 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
233 241 datefmt = %Y-%m-%d %H:%M:%S
234 242
235 243 [formatter_color_formatter]
236 244 class=rhodecode.lib.colored_formatter.ColorFormatter
237 245 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
238 246 datefmt = %Y-%m-%d %H:%M:%S
239 247
240 248 [formatter_color_formatter_sql]
241 249 class=rhodecode.lib.colored_formatter.ColorFormatterSql
242 250 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
243 251 datefmt = %Y-%m-%d %H:%M:%S No newline at end of file
@@ -1,253 +1,262 b''
1 1 ################################################################################
2 2 ################################################################################
3 3 # RhodeCode - Pylons environment configuration #
4 4 # #
5 5 # The %(here)s variable will be replaced with the parent directory of this file#
6 6 ################################################################################
7 7
8 8 [DEFAULT]
9 9 debug = true
10 10 pdebug = false
11 11 ################################################################################
12 12 ## Uncomment and replace with the address which should receive ##
13 13 ## any error reports after application crash ##
14 14 ## Additionally those settings will be used by RhodeCode mailing system ##
15 15 ################################################################################
16 16 #email_to = admin@localhost
17 17 #error_email_from = paste_error@localhost
18 18 #app_email_from = rhodecode-noreply@localhost
19 19 #error_message =
20 20
21 21 #smtp_server = mail.server.com
22 22 #smtp_username =
23 23 #smtp_password =
24 24 #smtp_port =
25 25 #smtp_use_tls = false
26 26 #smtp_use_ssl = true
27 27 # Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
28 28 #smtp_auth =
29 29
30 30 [server:main]
31 31 ##nr of threads to spawn
32 32 threadpool_workers = 5
33 33
34 34 ##max request before thread respawn
35 35 threadpool_max_requests = 10
36 36
37 37 ##option to use threads of process
38 38 use_threadpool = true
39 39
40 40 use = egg:Paste#http
41 41 host = 127.0.0.1
42 42 port = 5000
43 43
44 44 [app:main]
45 45 use = egg:rhodecode
46 46 full_stack = true
47 47 static_files = true
48 48 lang=en
49 49 cache_dir = %(here)s/data
50 50 index_dir = %(here)s/data/index
51 51 app_instance_uuid = ${app_instance_uuid}
52 52 cut_off_limit = 256000
53 53 force_https = false
54 54 commit_parse_limit = 50
55 55 use_gravatar = true
56 56 container_auth_enabled = false
57 57 proxypass_auth_enabled = false
58 58
59 ## overwrite schema of clone url
60 # available vars:
61 # scheme - http/https
62 # user - current user
63 # pass - password
64 # netloc - network location
65 # path - usually repo_name
66 # clone_uri = {scheme}://{user}{pass}{netloc}{path}
67
59 68 ####################################
60 69 ### CELERY CONFIG ####
61 70 ####################################
62 71 use_celery = false
63 72 broker.host = localhost
64 73 broker.vhost = rabbitmqhost
65 74 broker.port = 5672
66 75 broker.user = rabbitmq
67 76 broker.password = qweqwe
68 77
69 78 celery.imports = rhodecode.lib.celerylib.tasks
70 79
71 80 celery.result.backend = amqp
72 81 celery.result.dburi = amqp://
73 82 celery.result.serialier = json
74 83
75 84 #celery.send.task.error.emails = true
76 85 #celery.amqp.task.result.expires = 18000
77 86
78 87 celeryd.concurrency = 2
79 88 #celeryd.log.file = celeryd.log
80 89 celeryd.log.level = debug
81 90 celeryd.max.tasks.per.child = 1
82 91
83 92 #tasks will never be sent to the queue, but executed locally instead.
84 93 celery.always.eager = false
85 94
86 95 ####################################
87 96 ### BEAKER CACHE ####
88 97 ####################################
89 98 beaker.cache.data_dir=%(here)s/data/cache/data
90 99 beaker.cache.lock_dir=%(here)s/data/cache/lock
91 100
92 101 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
93 102
94 103 beaker.cache.super_short_term.type=memory
95 104 beaker.cache.super_short_term.expire=10
96 105 beaker.cache.super_short_term.key_length = 256
97 106
98 107 beaker.cache.short_term.type=memory
99 108 beaker.cache.short_term.expire=60
100 109 beaker.cache.short_term.key_length = 256
101 110
102 111 beaker.cache.long_term.type=memory
103 112 beaker.cache.long_term.expire=36000
104 113 beaker.cache.long_term.key_length = 256
105 114
106 115 beaker.cache.sql_cache_short.type=memory
107 116 beaker.cache.sql_cache_short.expire=10
108 117 beaker.cache.sql_cache_short.key_length = 256
109 118
110 119 beaker.cache.sql_cache_med.type=memory
111 120 beaker.cache.sql_cache_med.expire=360
112 121 beaker.cache.sql_cache_med.key_length = 256
113 122
114 123 beaker.cache.sql_cache_long.type=file
115 124 beaker.cache.sql_cache_long.expire=3600
116 125 beaker.cache.sql_cache_long.key_length = 256
117 126
118 127 ####################################
119 128 ### BEAKER SESSION ####
120 129 ####################################
121 130 ## Type of storage used for the session, current types are
122 131 ## dbm, file, memcached, database, and memory.
123 132 ## The storage uses the Container API
124 133 ##that is also used by the cache system.
125 134 beaker.session.type = file
126 135
127 136 beaker.session.key = rhodecode
128 137 beaker.session.secret = ${app_instance_secret}
129 138 beaker.session.timeout = 36000
130 139
131 140 ##auto save the session to not to use .save()
132 141 beaker.session.auto = False
133 142
134 143 ##true exire at browser close
135 144 #beaker.session.cookie_expires = 3600
136 145
137 146
138 147 ################################################################################
139 148 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
140 149 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
141 150 ## execute malicious code after an exception is raised. ##
142 151 ################################################################################
143 152 set debug = false
144 153
145 154 ##################################
146 155 ### LOGVIEW CONFIG ###
147 156 ##################################
148 157 logview.sqlalchemy = #faa
149 158 logview.pylons.templating = #bfb
150 159 logview.pylons.util = #eee
151 160
152 161 #########################################################
153 162 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
154 163 #########################################################
155 164
156 165 # SQLITE [default]
157 166 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
158 167
159 168 # POSTGRESQL
160 169 # sqlalchemy.db1.url = postgresql://user:pass@localhost/rhodecode
161 170
162 171 # MySQL
163 172 # sqlalchemy.db1.url = mysql://user:pass@localhost/rhodecode
164 173
165 174 # see sqlalchemy docs for others
166 175
167 176 sqlalchemy.db1.echo = false
168 177 sqlalchemy.db1.pool_recycle = 3600
169 178 sqlalchemy.convert_unicode = true
170 179
171 180 ################################
172 181 ### LOGGING CONFIGURATION ####
173 182 ################################
174 183 [loggers]
175 184 keys = root, routes, rhodecode, sqlalchemy, beaker, templates
176 185
177 186 [handlers]
178 187 keys = console, console_sql
179 188
180 189 [formatters]
181 190 keys = generic, color_formatter, color_formatter_sql
182 191
183 192 #############
184 193 ## LOGGERS ##
185 194 #############
186 195 [logger_root]
187 196 level = NOTSET
188 197 handlers = console
189 198
190 199 [logger_routes]
191 200 level = DEBUG
192 201 handlers =
193 202 qualname = routes.middleware
194 203 # "level = DEBUG" logs the route matched and routing variables.
195 204 propagate = 1
196 205
197 206 [logger_beaker]
198 207 level = DEBUG
199 208 handlers =
200 209 qualname = beaker.container
201 210 propagate = 1
202 211
203 212 [logger_templates]
204 213 level = INFO
205 214 handlers =
206 215 qualname = pylons.templating
207 216 propagate = 1
208 217
209 218 [logger_rhodecode]
210 219 level = DEBUG
211 220 handlers =
212 221 qualname = rhodecode
213 222 propagate = 1
214 223
215 224 [logger_sqlalchemy]
216 225 level = INFO
217 226 handlers = console_sql
218 227 qualname = sqlalchemy.engine
219 228 propagate = 0
220 229
221 230 ##############
222 231 ## HANDLERS ##
223 232 ##############
224 233
225 234 [handler_console]
226 235 class = StreamHandler
227 236 args = (sys.stderr,)
228 237 level = INFO
229 238 formatter = color_formatter
230 239
231 240 [handler_console_sql]
232 241 class = StreamHandler
233 242 args = (sys.stderr,)
234 243 level = WARN
235 244 formatter = color_formatter_sql
236 245
237 246 ################
238 247 ## FORMATTERS ##
239 248 ################
240 249
241 250 [formatter_generic]
242 251 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
243 252 datefmt = %Y-%m-%d %H:%M:%S
244 253
245 254 [formatter_color_formatter]
246 255 class=rhodecode.lib.colored_formatter.ColorFormatter
247 256 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
248 257 datefmt = %Y-%m-%d %H:%M:%S
249 258
250 259 [formatter_color_formatter_sql]
251 260 class=rhodecode.lib.colored_formatter.ColorFormatterSql
252 261 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
253 262 datefmt = %Y-%m-%d %H:%M:%S No newline at end of file
@@ -1,227 +1,229 b''
1 1 # -*- coding: utf-8 -*-
2 2 """
3 3 rhodecode.controllers.summary
4 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 5
6 6 Summary controller for Rhodecode
7 7
8 8 :created_on: Apr 18, 2010
9 9 :author: marcink
10 10 :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com>
11 11 :license: GPLv3, see COPYING for more details.
12 12 """
13 13 # This program is free software: you can redistribute it and/or modify
14 14 # it under the terms of the GNU General Public License as published by
15 15 # the Free Software Foundation, either version 3 of the License, or
16 16 # (at your option) any later version.
17 17 #
18 18 # This program is distributed in the hope that it will be useful,
19 19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 21 # GNU General Public License for more details.
22 22 #
23 23 # You should have received a copy of the GNU General Public License
24 24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25 25
26 26 import traceback
27 27 import calendar
28 28 import logging
29 29 from time import mktime
30 30 from datetime import timedelta, date
31 31 from itertools import product
32 from urlparse import urlparse
32 33
33 34 from vcs.exceptions import ChangesetError, EmptyRepositoryError, \
34 35 NodeDoesNotExistError
35 36
36 from pylons import tmpl_context as c, request, url
37 from pylons import tmpl_context as c, request, url, config
37 38 from pylons.i18n.translation import _
38 39
39 40 from beaker.cache import cache_region, region_invalidate
40 41
41 42 from rhodecode.model.db import Statistics, CacheInvalidation
42 43 from rhodecode.lib import ALL_READMES, ALL_EXTS
43 44 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
44 45 from rhodecode.lib.base import BaseRepoController, render
45 46 from rhodecode.lib.utils import EmptyChangeset
46 47 from rhodecode.lib.markup_renderer import MarkupRenderer
47 48 from rhodecode.lib.celerylib import run_task
48 49 from rhodecode.lib.celerylib.tasks import get_commits_stats, \
49 50 LANGUAGES_EXTENSIONS_MAP
50 51 from rhodecode.lib.helpers import RepoPage
51 52 from rhodecode.lib.compat import json, OrderedDict
52 53
53 54 log = logging.getLogger(__name__)
54 55
55 56 README_FILES = [''.join([x[0][0], x[1][0]]) for x in
56 57 sorted(list(product(ALL_READMES, ALL_EXTS)),
57 58 key=lambda y:y[0][1] + y[1][1])]
58 59
59 60 class SummaryController(BaseRepoController):
60 61
61 62 @LoginRequired()
62 63 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
63 64 'repository.admin')
64 65 def __before__(self):
65 66 super(SummaryController, self).__before__()
66 67
67 68 def index(self, repo_name):
68 69
69 70 e = request.environ
70 71 c.dbrepo = dbrepo = c.rhodecode_db_repo
71 72
72 73 c.following = self.scm_model.is_following_repo(repo_name,
73 74 self.rhodecode_user.user_id)
74 75
75 76 def url_generator(**kw):
76 77 return url('shortlog_home', repo_name=repo_name, size=10, **kw)
77 78
78 79 c.repo_changesets = RepoPage(c.rhodecode_repo, page=1,
79 80 items_per_page=10, url=url_generator)
80 81
81 82 if self.rhodecode_user.username == 'default':
82 #for default(anonymous) user we don't need to pass credentials
83 # for default(anonymous) user we don't need to pass credentials
83 84 username = ''
84 85 password = ''
85 86 else:
86 87 username = str(self.rhodecode_user.username)
87 88 password = '@'
88 89
89 if e.get('wsgi.url_scheme') == 'https':
90 split_s = 'https://'
91 else:
92 split_s = 'http://'
93
94 qualified_uri = [split_s] + [url.current(qualified=True)\
95 .split(split_s)[-1]]
96 uri = u'%(proto)s%(user)s%(pass)s%(rest)s' \
97 % {'user': username,
98 'pass': password,
99 'proto': qualified_uri[0],
100 'rest': qualified_uri[1]}
90 parsed_url = urlparse(url.current(qualified=True))
91
92 default_clone_uri = '{scheme}://{user}{pass}{netloc}{path}'
93
94 uri_tmpl = config.get('clone_uri',default_clone_uri)
95 uri_tmpl = uri_tmpl.replace('{','%(').replace('}',')s')
96
97 uri = uri_tmpl % {'user': username,
98 'pass': password,
99 'scheme': parsed_url.scheme,
100 'netloc':parsed_url.netloc,
101 'path':parsed_url.path}
102
101 103 c.clone_repo_url = uri
102 104 c.repo_tags = OrderedDict()
103 105 for name, hash in c.rhodecode_repo.tags.items()[:10]:
104 106 try:
105 107 c.repo_tags[name] = c.rhodecode_repo.get_changeset(hash)
106 108 except ChangesetError:
107 109 c.repo_tags[name] = EmptyChangeset(hash)
108 110
109 111 c.repo_branches = OrderedDict()
110 112 for name, hash in c.rhodecode_repo.branches.items()[:10]:
111 113 try:
112 114 c.repo_branches[name] = c.rhodecode_repo.get_changeset(hash)
113 115 except ChangesetError:
114 116 c.repo_branches[name] = EmptyChangeset(hash)
115 117
116 118 td = date.today() + timedelta(days=1)
117 119 td_1m = td - timedelta(days=calendar.mdays[td.month])
118 120 td_1y = td - timedelta(days=365)
119 121
120 122 ts_min_m = mktime(td_1m.timetuple())
121 123 ts_min_y = mktime(td_1y.timetuple())
122 124 ts_max_y = mktime(td.timetuple())
123 125
124 126 if dbrepo.enable_statistics:
125 127 c.no_data_msg = _('No data loaded yet')
126 128 run_task(get_commits_stats, c.dbrepo.repo_name, ts_min_y, ts_max_y)
127 129 else:
128 130 c.no_data_msg = _('Statistics are disabled for this repository')
129 131 c.ts_min = ts_min_m
130 132 c.ts_max = ts_max_y
131 133
132 134 stats = self.sa.query(Statistics)\
133 135 .filter(Statistics.repository == dbrepo)\
134 136 .scalar()
135 137
136 138 c.stats_percentage = 0
137 139
138 140 if stats and stats.languages:
139 141 c.no_data = False is dbrepo.enable_statistics
140 142 lang_stats_d = json.loads(stats.languages)
141 143 c.commit_data = stats.commit_activity
142 144 c.overview_data = stats.commit_activity_combined
143 145
144 146 lang_stats = ((x, {"count": y,
145 147 "desc": LANGUAGES_EXTENSIONS_MAP.get(x)})
146 148 for x, y in lang_stats_d.items())
147 149
148 150 c.trending_languages = json.dumps(OrderedDict(
149 151 sorted(lang_stats, reverse=True,
150 152 key=lambda k: k[1])[:10]
151 153 )
152 154 )
153 155 last_rev = stats.stat_on_revision
154 156 c.repo_last_rev = c.rhodecode_repo.count() - 1 \
155 157 if c.rhodecode_repo.revisions else 0
156 158 if last_rev == 0 or c.repo_last_rev == 0:
157 159 pass
158 160 else:
159 161 c.stats_percentage = '%.2f' % ((float((last_rev)) /
160 162 c.repo_last_rev) * 100)
161 163 else:
162 164 c.commit_data = json.dumps({})
163 165 c.overview_data = json.dumps([[ts_min_y, 0], [ts_max_y, 10]])
164 166 c.trending_languages = json.dumps({})
165 167 c.no_data = True
166 168
167 169 c.enable_downloads = dbrepo.enable_downloads
168 170 if c.enable_downloads:
169 171 c.download_options = self._get_download_links(c.rhodecode_repo)
170 172
171 173 c.readme_data, c.readme_file = self.__get_readme_data(c.rhodecode_repo)
172 174 return render('summary/summary.html')
173 175
174 176 def __get_readme_data(self, repo):
175 177
176 178 @cache_region('long_term')
177 179 def _get_readme_from_cache(key):
178 180 readme_data = None
179 181 readme_file = None
180 182 log.debug('Fetching readme file')
181 183 try:
182 184 cs = repo.get_changeset('tip')
183 185 renderer = MarkupRenderer()
184 186 for f in README_FILES:
185 187 try:
186 188 readme = cs.get_node(f)
187 189 readme_file = f
188 190 readme_data = renderer.render(readme.content, f)
189 191 log.debug('Found readme %s' % readme_file)
190 192 break
191 193 except NodeDoesNotExistError:
192 194 continue
193 195 except ChangesetError:
194 196 pass
195 197 except EmptyRepositoryError:
196 198 pass
197 199 except Exception:
198 200 log.error(traceback.format_exc())
199 201
200 202 return readme_data, readme_file
201 203
202 204 key = repo.name + '_README'
203 205 inv = CacheInvalidation.invalidate(key)
204 206 if inv is not None:
205 207 region_invalidate(_get_readme_from_cache, None, key)
206 208 CacheInvalidation.set_valid(inv.cache_key)
207 209 return _get_readme_from_cache(key)
208 210
209 211 def _get_download_links(self, repo):
210 212
211 213 download_l = []
212 214
213 215 branches_group = ([], _("Branches"))
214 216 tags_group = ([], _("Tags"))
215 217
216 218 for name, chs in c.rhodecode_repo.branches.items():
217 219 #chs = chs.split(':')[-1]
218 220 branches_group[0].append((chs, name),)
219 221 download_l.append(branches_group)
220 222
221 223 for name, chs in c.rhodecode_repo.tags.items():
222 224 #chs = chs.split(':')[-1]
223 225 tags_group[0].append((chs, name),)
224 226 download_l.append(tags_group)
225 227
226 228 return download_l
227 229
General Comments 0
You need to be logged in to leave comments. Login now