Changeset - 8384eaabeb19
[Not reviewed]
beta
0 5 0
Marcin Kuzminski - 14 years ago 2011-11-03 02:00:53
marcin@python-works.com
configurable clone url
- posibility to specify ssh:// manually as alternative clone url.
5 files changed with 45 insertions and 15 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -53,12 +53,21 @@ cut_off_limit = 256000
 
force_https = false
 
commit_parse_limit = 25
 
use_gravatar = true
 
container_auth_enabled = false
 
proxypass_auth_enabled = false
 

	
 
## overwrite schema of clone url
 
# available vars:
 
# scheme - http/https
 
# user - current user
 
# pass - password 
 
# netloc - network location
 
# path - usually repo_name
 
# clone_uri = {scheme}://{user}{pass}{netloc}{path}
 

	
 
####################################
 
###        CELERY CONFIG        ####
 
####################################
 
use_celery = false
 
broker.host = localhost
 
broker.vhost = rabbitmqhost
docs/changelog.rst
Show inline comments
 
@@ -13,13 +13,15 @@ Changelog
 
news
 
----
 

	
 
- #215 rst and markdown README files support
 
- #252 pass-through user identity
 
- hover top menu
 
 
 
- configurable clone url posibility to specify ssh:// manually as 
 
  alternative clone url.
 
   
 
fixes
 
-----
 

	
 
1.2.3 (**2011-11-02**)
 
======================
 

	
production.ini
Show inline comments
 
@@ -53,12 +53,20 @@ cut_off_limit = 256000
 
force_https = false 
 
commit_parse_limit = 50
 
use_gravatar = true
 
container_auth_enabled = false
 
proxypass_auth_enabled = false
 

	
 
## available vars
 
## scheme - http/https
 
## user - current user
 
## pass - password 
 
## netloc - network location
 
## path - usually repo_name
 
clone_uri = {scheme}://{user}{pass}{netloc}{path}
 

	
 
####################################
 
###        CELERY CONFIG        ####
 
####################################
 
use_celery = false
 
broker.host = localhost
 
broker.vhost = rabbitmqhost
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -53,12 +53,21 @@ cut_off_limit = 256000
 
force_https = false 
 
commit_parse_limit = 50
 
use_gravatar = true
 
container_auth_enabled = false
 
proxypass_auth_enabled = false
 

	
 
## overwrite schema of clone url
 
# available vars:
 
# scheme - http/https
 
# user - current user
 
# pass - password 
 
# netloc - network location
 
# path - usually repo_name
 
# clone_uri = {scheme}://{user}{pass}{netloc}{path}
 

	
 
####################################
 
###        CELERY CONFIG        ####
 
####################################
 
use_celery = false
 
broker.host = localhost
 
broker.vhost = rabbitmqhost
rhodecode/controllers/summary.py
Show inline comments
 
@@ -26,17 +26,18 @@
 
import traceback
 
import calendar
 
import logging
 
from time import mktime
 
from datetime import timedelta, date
 
from itertools import product
 
from urlparse import urlparse
 

	
 
from vcs.exceptions import ChangesetError, EmptyRepositoryError, \
 
    NodeDoesNotExistError
 

	
 
from pylons import tmpl_context as c, request, url
 
from pylons import tmpl_context as c, request, url, config
 
from pylons.i18n.translation import _
 

	
 
from beaker.cache import cache_region, region_invalidate
 

	
 
from rhodecode.model.db import Statistics, CacheInvalidation
 
from rhodecode.lib import ALL_READMES, ALL_EXTS
 
@@ -76,31 +77,32 @@ class SummaryController(BaseRepoControll
 
            return url('shortlog_home', repo_name=repo_name, size=10, **kw)
 

	
 
        c.repo_changesets = RepoPage(c.rhodecode_repo, page=1,
 
                                     items_per_page=10, url=url_generator)
 

	
 
        if self.rhodecode_user.username == 'default':
 
            #for default(anonymous) user we don't need to pass credentials
 
            # for default(anonymous) user we don't need to pass credentials
 
            username = ''
 
            password = ''
 
        else:
 
            username = str(self.rhodecode_user.username)
 
            password = '@'
 

	
 
        if e.get('wsgi.url_scheme') == 'https':
 
            split_s = 'https://'
 
        else:
 
            split_s = 'http://'
 

	
 
        qualified_uri = [split_s] + [url.current(qualified=True)\
 
                                     .split(split_s)[-1]]
 
        uri = u'%(proto)s%(user)s%(pass)s%(rest)s' \
 
                % {'user': username,
 
                     'pass': password,
 
                     'proto': qualified_uri[0],
 
                     'rest': qualified_uri[1]}
 
        parsed_url = urlparse(url.current(qualified=True))
 
        
 
        default_clone_uri = '{scheme}://{user}{pass}{netloc}{path}'
 
        
 
        uri_tmpl = config.get('clone_uri',default_clone_uri)
 
        uri_tmpl = uri_tmpl.replace('{','%(').replace('}',')s')
 
        
 
        uri =  uri_tmpl % {'user': username,
 
                           'pass': password,
 
                           'scheme': parsed_url.scheme,
 
                           'netloc':parsed_url.netloc,
 
                           'path':parsed_url.path}
 
        
 
        c.clone_repo_url = uri
 
        c.repo_tags = OrderedDict()
 
        for name, hash in c.rhodecode_repo.tags.items()[:10]:
 
            try:
 
                c.repo_tags[name] = c.rhodecode_repo.get_changeset(hash)
 
            except ChangesetError:
0 comments (0 inline, 0 general)