Changeset - d2319cb2ba9b
[Not reviewed]
Merge default
0 5 0
Mads Kiilerich (mads) - 6 years ago 2019-12-19 20:50:33
mads@kiilerich.com
Merge stable
5 files changed with 12 insertions and 7 deletions:
0 comments (0 inline, 0 general)
kallithea/bin/ldap_sync.py
Show inline comments
 
@@ -23,24 +23,25 @@ Original author and date, and relevant c
 
:author: marcink
 
:copyright: (c) 2013 RhodeCode GmbH, and others.
 
:license: GPLv3, see LICENSE.md for more details.
 
"""
 

	
 
from __future__ import print_function
 

	
 
import urllib2
 
import uuid
 
from ConfigParser import ConfigParser
 

	
 
import ldap
 

	
 
from kallithea.lib.compat import json
 

	
 

	
 
config = ConfigParser()
 
config.read('ldap_sync.conf')
 

	
 

	
 
class InvalidResponseIDError(Exception):
 
    """ Request and response don't have the same UUID. """
 

	
 

	
 
class ResponseError(Exception):
kallithea/i18n/ru/LC_MESSAGES/kallithea.po
Show inline comments
 
@@ -71,39 +71,39 @@ msgstr "Лента новостей %s %s"
 

	
 
msgid "Changes on %s repository"
 
msgstr "Изменения в репозитории %s"
 

	
 
msgid "Click here to add new file"
 
msgstr "Нажмите чтобы добавить новый файл"
 

	
 
msgid "%s at %s"
 
msgstr "%s (%s)"
 

	
 
msgid "You can only delete files with revision being a valid branch"
 
msgstr ""
 
"Вы можете удалять файлы только в ревизии, связанной с существующей веткой "
 
"Вы можете удалять файлы только в ревизии, являющейся корректной веткой"
 

	
 
msgid "Deleted file %s via Kallithea"
 
msgstr "Файл %s удалён с помощью Kallithea"
 

	
 
msgid "Successfully deleted file %s"
 
msgstr "Файл %s удалён"
 

	
 
msgid "Error occurred during commit"
 
msgstr "Во время коммита произошла ошибка"
 

	
 
msgid "You can only edit files with revision being a valid branch"
 
msgstr ""
 
"Вы можете редактировать файлы только в ревизии, связанной с существующей "
 
"веткой "
 
"веткой"
 

	
 
msgid "Edited file %s via Kallithea"
 
msgstr "Файл %s отредактирован с помощью Kallithea"
 

	
 
msgid "No changes"
 
msgstr "Без изменений"
 

	
 
msgid "Successfully committed to %s"
 
msgstr "Изменения применены в %s"
 

	
 
msgid "Added file via Kallithea"
 
msgstr "Файл добавлен с помощью Kallithea"
 
@@ -702,27 +702,27 @@ msgid_plural "%d hours"
 
msgstr[0] "%d час"
 
msgstr[1] "%d часов"
 
msgstr[2] "%d часа"
 

	
 
msgid "%d minute"
 
msgid_plural "%d minutes"
 
msgstr[0] "%d минута"
 
msgstr[1] "%d минут"
 
msgstr[2] "%d минуты"
 

	
 
msgid "%d second"
 
msgid_plural "%d seconds"
 
msgstr[0] "%d секунды"
 
msgstr[0] "%d секунда"
 
msgstr[1] "%d секунды"
 
msgstr[2] "%d секунды"
 
msgstr[2] "%d секунд"
 

	
 
msgid "in %s"
 
msgstr "в %s"
 

	
 
msgid "%s ago"
 
msgstr "%s назад"
 

	
 
msgid "in %s and %s"
 
msgstr "в %s и %s"
 

	
 
msgid "%s and %s ago"
 
msgstr "%s и %s назад"
 
@@ -828,25 +828,25 @@ msgid ""
 
"periods or dashes and must begin with alphanumeric character"
 
msgstr ""
 
"имя группы пользователей может содержать только буквы, цифры, символы "
 
"подчеркивания, точки и тире; а так же должно начинаться с буквы или цифры"
 

	
 
msgid "Cannot assign this group as parent"
 
msgstr "Невозможно использовать эту группу как родителя"
 

	
 
msgid "Group \"%(group_name)s\" already exists"
 
msgstr "Группа \"%(group_name)s\" уже существует"
 

	
 
msgid "Repository with name \"%(group_name)s\" already exists"
 
msgstr "Репозитарий с  именем \"%(group_name)s\" уже существует"
 
msgstr "Репозиторий с именем «%(group_name)s» уже существует"
 

	
 
msgid "Invalid characters (non-ascii) in password"
 
msgstr "Недопустимые символы (не ascii) в пароле"
 

	
 
msgid "Invalid old password"
 
msgstr "Неверно задан старый пароль"
 

	
 
msgid "Passwords do not match"
 
msgstr "Пароли не совпадают"
 

	
 
msgid "Repository named %(repo)s already exists"
 
msgstr "Репозитарий %(repo)s уже существует"
kallithea/lib/ssh.py
Show inline comments
 
@@ -57,45 +57,47 @@ def parse_pub_key(ssh_key):
 
    SshKeyParseError: Incorrect SSH key - failed to decode base64 part 'AAAAB3NzaC1yc2EAAAALVGhpcyBpcyBmYWtlIQ'
 
    >>> parse_pub_key('''ssh-rsa  AAAAB2NzaC1yc2EAAAALVGhpcyBpcyBmYWtlIQ==''')
 
    Traceback (most recent call last):
 
    ...
 
    SshKeyParseError: Incorrect SSH key - base64 part is not 'ssh-rsa' as claimed but 'csh-rsa'
 
    >>> parse_pub_key('''ssh-rsa  AAAAB3NzaC1yc2EAAAA'LVGhpcyBpcyBmYWtlIQ''')
 
    Traceback (most recent call last):
 
    ...
 
    SshKeyParseError: Incorrect SSH key - unexpected characters in base64 part "AAAAB3NzaC1yc2EAAAA'LVGhpcyBpcyBmYWtlIQ"
 
    >>> parse_pub_key(''' ssh-rsa  AAAAB3NzaC1yc2EAAAALVGhpcyBpcyBmYWtlIQ== and a comment
 
    ... ''')
 
    ('ssh-rsa', '\x00\x00\x00\x07ssh-rsa\x00\x00\x00\x0bThis is fake!', 'and a comment\n')
 
    >>> parse_pub_key('''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP1NA2kBQIKe74afUXmIWD9ByDYQJqUwW44Y4gJOBRuo''')
 
    ('ssh-ed25519', '\x00\x00\x00\x0bssh-ed25519\x00\x00\x00 \xfdM\x03i\x01@\x82\x9e\xef\x86\x9fQy\x88X?A\xc86\x10&\xa50[\x8e\x18\xe2\x02N\x05\x1b\xa8', '')
 
    """
 
    if not ssh_key:
 
        raise SshKeyParseError(_("SSH key is missing"))
 

	
 
    parts = ssh_key.split(None, 2)
 
    if len(parts) < 2:
 
        raise SshKeyParseError(_("Incorrect SSH key - it must have both a key type and a base64 part"))
 

	
 
    keytype, keyvalue, comment = (parts + [''])[:3]
 
    if keytype not in ('ssh-rsa', 'ssh-dss', 'ssh-ed25519'):
 
        raise SshKeyParseError(_("Incorrect SSH key - it must start with 'ssh-(rsa|dss|ed25519)'"))
 

	
 
    if re.search(r'[^a-zA-Z0-9+/=]', keyvalue):
 
        raise SshKeyParseError(_("Incorrect SSH key - unexpected characters in base64 part %r") % keyvalue)
 

	
 
    try:
 
        decoded = keyvalue.decode('base64')
 
    except binascii.Error:
 
        raise SshKeyParseError(_("Incorrect SSH key - failed to decode base64 part %r") % keyvalue)
 

	
 
    if not decoded.startswith('\x00\x00\x00\x07' + str(keytype) + '\x00'):
 
    if not decoded.startswith('\x00\x00\x00' + chr(len(keytype)) + str(keytype) + '\x00'):
 
        raise SshKeyParseError(_("Incorrect SSH key - base64 part is not %r as claimed but %r") % (str(keytype), str(decoded[4:].split('\0', 1)[0])))
 

	
 
    return keytype, decoded, comment
 

	
 

	
 
SSH_OPTIONS = 'no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding'
 

	
 

	
 
def authorized_keys_line(kallithea_cli_path, config_file, key):
 
    """
 
    Return a line as it would appear in .authorized_keys
 

	
kallithea/templates/admin/settings/settings_visual.html
Show inline comments
 
@@ -49,24 +49,26 @@ ${h.form(url('admin_settings_visual'), m
 
                                                    {repoid} ID of repository, can be used to construct clone-by-id,
 
                                                    {system_user}  name of the Kallithea system user,
 
                                                    {hostname}  server hostname
 
                                                    ''')}
 
                    </span>
 
                </div>
 
                %if c.ssh_enabled:
 
                <label class="control-label">${_('SSH Clone URL')}:</label>
 
                <div>
 
                    ${h.text('clone_ssh_tmpl', size=80, class_='form-control')}
 
                    <span class="help-block">${_('''Schema for constructing SSH clone URL, eg. 'ssh://{system_user}@{hostname}/{repo}'.''')}</span>
 
                </div>
 
                %else:
 
                ${h.hidden('clone_ssh_tmpl', size=80, class_='form-control')}
 
                %endif
 
            </div>
 

	
 
            <div class="form-group">
 
                <label class="control-label" for="dashboard_items">${_('Repository page size')}:</label>
 
                <div>
 
                    ${h.text('dashboard_items',size=5,class_='form-control')}
 
                    <span class="help-block">${_('Number of items displayed in the repository pages before pagination is shown.')}</span>
 
                </div>
 
            </div>
 

	
 
            <div class="form-group">
scripts/make-release
Show inline comments
 
@@ -10,25 +10,25 @@ cleanup()
 

	
 
echo "Checking that you are NOT inside a virtualenv"
 
[ -z "$VIRTUAL_ENV" ]
 

	
 
venv=$(mktemp -d --tmpdir kallithea-release-XXXXX)
 
trap cleanup EXIT
 

	
 
echo "Setting up a fresh virtualenv in $venv"
 
virtualenv -p python2 "$venv"
 
. "$venv/bin/activate"
 

	
 
echo "Install/verify tools needed for building and uploading stuff"
 
pip install --upgrade -e . -r dev_requirements.txt twine
 
pip install --upgrade -e . -r dev_requirements.txt twine python-ldap python-pam
 

	
 
echo "Cleanup and update copyrights ... and clean checkout"
 
scripts/run-all-cleanup
 
scripts/update-copyrights.py
 
hg up -cr .
 

	
 
echo "Make release build from clean checkout in build/"
 
rm -rf build dist
 
hg archive build
 
cd build
 

	
 
echo "Check that each entry in MANIFEST.in match something"
0 comments (0 inline, 0 general)