# HG changeset patch # User Mads Kiilerich # Date 1578193792 -3600 # Node ID 1516f0fd9fd4d34fc0f2c04369818eadf32bb1fc # Parent 0cb9aae7fe42f9e0fbcf5f394503cb3e0a13f165# Parent 01dbd21d206c724952cba54063bc5835981b356f Merge stable diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 .hgtags --- a/.hgtags Sun Jan 05 04:07:51 2020 +0100 +++ b/.hgtags Sun Jan 05 04:09:52 2020 +0100 @@ -73,3 +73,4 @@ 60f726162fd6c515bd819feb423be73cad01d7d3 0.4.0rc2 19086c5de05f4984d7a90cd31624c45dd893f6bb 0.4.0 da65398a62fff50f3d241796cbf17acdea2092ef 0.4.1 +bfa0b0a814644f0af3f492d17a9ed169cc3b89fe 0.5.0 diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 CONTRIBUTORS --- a/CONTRIBUTORS Sun Jan 05 04:07:51 2020 +0100 +++ b/CONTRIBUTORS Sun Jan 05 04:09:52 2020 +0100 @@ -8,8 +8,16 @@ ssantos 2018-2019 Danni Randeris 2019 Edmund Wong 2019 + Elizabeth Sherrock 2019 + Hüseyin Tunç 2019 + leela <53352@protonmail.com> 2019 Manuel Jacob 2019 + Mateusz Mendel 2019 + Nathan 2019 + Oleksandr Shtalinberg 2019 + THANOS SIOURDAKIS 2019 Wolfgang Scherer 2019 + Христо Станев 2019 Dominik Ruf 2012 2014-2018 Michal Čihař 2014-2015 2018 Branko Majic 2015 2018 diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 MANIFEST.in --- a/MANIFEST.in Sun Jan 05 04:07:51 2020 +0100 +++ b/MANIFEST.in Sun Jan 05 04:09:52 2020 +0100 @@ -7,6 +7,7 @@ include LICENSE.md include MIT-Permissive-License.txt include README.rst +include conftest.py include dev_requirements.txt include development.ini include pytest.ini diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 docs/usage/performance.rst --- a/docs/usage/performance.rst Sun Jan 05 04:07:51 2020 +0100 +++ b/docs/usage/performance.rst Sun Jan 05 04:09:52 2020 +0100 @@ -23,6 +23,15 @@ Tweak beaker cache settings in the ini file. The actual effect of that is questionable. +.. note:: + + Beaker has no upper bound on cache size and will never drop any caches. For + memory cache, the only option is to regularly restart the worker process. + For file cache, it must be cleaned manually, as described in the `Beaker + documentation `_:: + + find data/cache -type f -mtime +30 -print -exec rm {} \; + Database -------- diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 kallithea/__init__.py --- a/kallithea/__init__.py Sun Jan 05 04:07:51 2020 +0100 +++ b/kallithea/__init__.py Sun Jan 05 04:09:52 2020 +0100 @@ -31,7 +31,7 @@ import sys -VERSION = (0, 4, 99) +VERSION = (0, 5, 0) BACKENDS = { 'hg': 'Mercurial repository', 'git': 'Git repository', diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 kallithea/alembic/versions/151b4a4e8c48_db_migration_step_after_93834966ae01_.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kallithea/alembic/versions/151b4a4e8c48_db_migration_step_after_93834966ae01_.py Sun Jan 05 04:09:52 2020 +0100 @@ -0,0 +1,51 @@ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +"""db: migration step after 93834966ae01 dropped non-nullable inherit_default_permissions + +Revision ID: 151b4a4e8c48 +Revises: b74907136bc1 +Create Date: 2019-11-23 01:37:42.963119 + +""" + +# The following opaque hexadecimal identifiers ("revisions") are used +# by Alembic to track this migration script and its relations to others. +revision = '151b4a4e8c48' +down_revision = 'b74907136bc1' +branch_labels = None +depends_on = None + +import sqlalchemy as sa +from alembic import op + + +def upgrade(): + meta = sa.MetaData() + meta.reflect(bind=op.get_bind()) + + if 'inherit_default_permissions' in meta.tables['users'].columns: + with op.batch_alter_table('users', schema=None) as batch_op: + batch_op.drop_column('inherit_default_permissions') + + if 'users_group_inherit_default_permissions' in meta.tables['users_groups'].columns: + with op.batch_alter_table('users_groups', schema=None) as batch_op: + batch_op.drop_column('users_group_inherit_default_permissions') + + +def downgrade(): + with op.batch_alter_table('users_groups', schema=None) as batch_op: + batch_op.add_column(sa.Column('users_group_inherit_default_permissions', sa.BOOLEAN(), nullable=False, default=True)) + + with op.batch_alter_table('users', schema=None) as batch_op: + batch_op.add_column(sa.Column('inherit_default_permissions', sa.BOOLEAN(), nullable=False, default=True)) diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 kallithea/alembic/versions/4851d15bc437_db_migration_step_after_95c01895c006_.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kallithea/alembic/versions/4851d15bc437_db_migration_step_after_95c01895c006_.py Sun Jan 05 04:09:52 2020 +0100 @@ -0,0 +1,44 @@ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +"""db: migration step after 95c01895c006 failed to add usk_public_key_idx in alembic step b74907136bc1 + +Revision ID: 4851d15bc437 +Revises: 151b4a4e8c48 +Create Date: 2019-11-24 02:51:14.029583 + +""" + +# The following opaque hexadecimal identifiers ("revisions") are used +# by Alembic to track this migration script and its relations to others. +revision = '4851d15bc437' +down_revision = '151b4a4e8c48' +branch_labels = None +depends_on = None + +import sqlalchemy as sa +from alembic import op + + +def upgrade(): + meta = sa.MetaData() + meta.reflect(bind=op.get_bind()) + + if not any(i.name == 'usk_public_key_idx' for i in meta.tables['user_ssh_keys'].indexes): + with op.batch_alter_table('user_ssh_keys', schema=None) as batch_op: + batch_op.create_index('usk_public_key_idx', ['public_key'], unique=False) + + +def downgrade(): + with op.batch_alter_table('user_ssh_keys', schema=None) as batch_op: + batch_op.drop_index('usk_public_key_idx') diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 kallithea/bin/ldap_sync.py diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 kallithea/i18n/be/LC_MESSAGES/kallithea.po --- a/kallithea/i18n/be/LC_MESSAGES/kallithea.po Sun Jan 05 04:07:51 2020 +0100 +++ b/kallithea/i18n/be/LC_MESSAGES/kallithea.po Sun Jan 05 04:09:52 2020 +0100 @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Kallithea 0.3\n" "Report-Msgid-Bugs-To: translations@kallithea-scm.org\n" -"POT-Creation-Date: 2019-11-14 23:33+0100\n" +"POT-Creation-Date: 2020-01-05 04:10+0100\n" "PO-Revision-Date: 2017-08-20 10:44+0000\n" "Last-Translator: Viktar Vauchkevich \n" "Language-Team: Belarusian \n" "Language-Team: Czech \n" "Language-Team: Danish \n" "Language-Team: German \n" "Language-Team: Greek \n" "Language-Team: Spanish \n" "Language-Team: French \n" "Language-Team: Hungarian \n" "Language-Team: Japanese , 2019. +# FIRST AUTHOR , 2020. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Kallithea 0.4.99\n" +"Project-Id-Version: Kallithea 0.5.0\n" "Report-Msgid-Bugs-To: translations@kallithea-scm.org\n" -"POT-Creation-Date: 2019-11-14 23:33+0100\n" +"POT-Creation-Date: 2020-01-05 04:10+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1227,29 +1227,29 @@ "repositories" msgstr "" -#: kallithea/lib/ssh.py:71 +#: kallithea/lib/ssh.py:73 msgid "SSH key is missing" msgstr "" -#: kallithea/lib/ssh.py:75 +#: kallithea/lib/ssh.py:77 msgid "Incorrect SSH key - it must have both a key type and a base64 part" msgstr "" -#: kallithea/lib/ssh.py:79 +#: kallithea/lib/ssh.py:81 msgid "Incorrect SSH key - it must start with 'ssh-(rsa|dss|ed25519)'" msgstr "" -#: kallithea/lib/ssh.py:82 +#: kallithea/lib/ssh.py:84 #, python-format msgid "Incorrect SSH key - unexpected characters in base64 part %r" msgstr "" -#: kallithea/lib/ssh.py:87 +#: kallithea/lib/ssh.py:89 #, python-format msgid "Incorrect SSH key - failed to decode base64 part %r" msgstr "" -#: kallithea/lib/ssh.py:90 +#: kallithea/lib/ssh.py:92 #, python-format msgid "Incorrect SSH key - base64 part is not %r as claimed but %r" msgstr "" @@ -2299,7 +2299,7 @@ #: kallithea/templates/admin/repos/repo_edit_settings.html:100 #: kallithea/templates/admin/settings/settings_global.html:50 #: kallithea/templates/admin/settings/settings_vcs.html:66 -#: kallithea/templates/admin/settings/settings_visual.html:127 +#: kallithea/templates/admin/settings/settings_visual.html:129 #: kallithea/templates/admin/user_groups/user_group_edit_perms.html:89 #: kallithea/templates/admin/users/user_edit_api_keys.html:14 #: kallithea/templates/admin/users/user_edit_api_keys.html:73 @@ -3337,7 +3337,7 @@ #: kallithea/templates/admin/settings/settings_global.html:49 #: kallithea/templates/admin/settings/settings_vcs.html:65 -#: kallithea/templates/admin/settings/settings_visual.html:126 +#: kallithea/templates/admin/settings/settings_visual.html:128 msgid "Save Settings" msgstr "" @@ -3576,53 +3576,53 @@ "'ssh://{system_user}@{hostname}/{repo}'." msgstr "" -#: kallithea/templates/admin/settings/settings_visual.html:65 +#: kallithea/templates/admin/settings/settings_visual.html:67 msgid "Repository page size" msgstr "" -#: kallithea/templates/admin/settings/settings_visual.html:68 +#: kallithea/templates/admin/settings/settings_visual.html:70 msgid "" "Number of items displayed in the repository pages before pagination is " "shown." msgstr "" -#: kallithea/templates/admin/settings/settings_visual.html:73 +#: kallithea/templates/admin/settings/settings_visual.html:75 msgid "Admin page size" msgstr "" -#: kallithea/templates/admin/settings/settings_visual.html:76 +#: kallithea/templates/admin/settings/settings_visual.html:78 msgid "" "Number of items displayed in the admin pages grids before pagination is " "shown." msgstr "" -#: kallithea/templates/admin/settings/settings_visual.html:81 +#: kallithea/templates/admin/settings/settings_visual.html:83 msgid "Icons" msgstr "" -#: kallithea/templates/admin/settings/settings_visual.html:86 +#: kallithea/templates/admin/settings/settings_visual.html:88 msgid "Show public repository icon on repositories" msgstr "" -#: kallithea/templates/admin/settings/settings_visual.html:92 +#: kallithea/templates/admin/settings/settings_visual.html:94 msgid "Show private repository icon on repositories" msgstr "" -#: kallithea/templates/admin/settings/settings_visual.html:95 +#: kallithea/templates/admin/settings/settings_visual.html:97 msgid "Show public/private icons next to repository names." msgstr "" -#: kallithea/templates/admin/settings/settings_visual.html:100 +#: kallithea/templates/admin/settings/settings_visual.html:102 msgid "Meta Tagging" msgstr "" -#: kallithea/templates/admin/settings/settings_visual.html:105 +#: kallithea/templates/admin/settings/settings_visual.html:107 msgid "" "Parses meta tags from the repository description field and turns them " "into colored tags." msgstr "" -#: kallithea/templates/admin/settings/settings_visual.html:109 +#: kallithea/templates/admin/settings/settings_visual.html:111 msgid "Stylify recognised meta tags:" msgstr "" diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 kallithea/i18n/nb_NO/LC_MESSAGES/kallithea.po --- a/kallithea/i18n/nb_NO/LC_MESSAGES/kallithea.po Sun Jan 05 04:07:51 2020 +0100 +++ b/kallithea/i18n/nb_NO/LC_MESSAGES/kallithea.po Sun Jan 05 04:09:52 2020 +0100 @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: Kallithea 0.3.99\n" "Report-Msgid-Bugs-To: translations@kallithea-scm.org\n" -"POT-Creation-Date: 2019-11-14 23:33+0100\n" +"POT-Creation-Date: 2020-01-05 04:10+0100\n" "PO-Revision-Date: 2019-04-30 22:25+0000\n" "Last-Translator: Allan Nordhøy \n" "Language-Team: Norwegian Bokmål \n" "Language-Team: Flemish \n" "Language-Team: Polish \n" "Language-Team: Portuguese (Brazil) \n" "Language-Team: Russian \n" "Language-Team: Slovak \n" "Language-Team: Turkish \n" "Language-Team: Ukrainian \n" "Language-Team: Chinese (Simplified) \n" "Language-Team: Chinese (Traditional) >> 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")) @@ -86,7 +88,7 @@ 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 diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 kallithea/public/js/base.js --- a/kallithea/public/js/base.js Sun Jan 05 04:07:51 2020 +0100 +++ b/kallithea/public/js/base.js Sun Jan 05 04:09:52 2020 +0100 @@ -697,7 +697,7 @@ if (!confirm('Confirm to delete this pull request')) { return false; } - var comments = $('.comment').size(); + var comments = $('.comment').length; if (comments > 0 && !confirm('Confirm again to delete this pull request with {0} comments'.format(comments))) { return false; diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 kallithea/templates/about.html --- a/kallithea/templates/about.html Sun Jan 05 04:07:51 2020 +0100 +++ b/kallithea/templates/about.html Sun Jan 05 04:09:52 2020 +0100 @@ -32,8 +32,16 @@
  • Copyright © 2018–2019, ssantos
  • Copyright © 2019, Danni Randeris
  • Copyright © 2019, Edmund Wong
  • +
  • Copyright © 2019, Elizabeth Sherrock
  • +
  • Copyright © 2019, Hüseyin Tunç
  • +
  • Copyright © 2019, leela
  • Copyright © 2019, Manuel Jacob
  • +
  • Copyright © 2019, Mateusz Mendel
  • +
  • Copyright © 2019, Nathan
  • +
  • Copyright © 2019, Oleksandr Shtalinberg
  • +
  • Copyright © 2019, THANOS SIOURDAKIS
  • Copyright © 2019, Wolfgang Scherer
  • +
  • Copyright © 2019, Христо Станев
  • Copyright © 2012, 2014–2018, Dominik Ruf
  • Copyright © 2014–2015, 2018, Michal Čihař
  • Copyright © 2015, 2018, Branko Majic
  • diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 kallithea/templates/admin/settings/settings_visual.html --- a/kallithea/templates/admin/settings/settings_visual.html Sun Jan 05 04:07:51 2020 +0100 +++ b/kallithea/templates/admin/settings/settings_visual.html Sun Jan 05 04:09:52 2020 +0100 @@ -58,6 +58,8 @@ ${h.text('clone_ssh_tmpl', size=80, class_='form-control')} ${_('''Schema for constructing SSH clone URL, eg. 'ssh://{system_user}@{hostname}/{repo}'.''')} + %else: + ${h.hidden('clone_ssh_tmpl', size=80, class_='form-control')} %endif diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 kallithea/templates/changeset/changeset_file_comment.html --- a/kallithea/templates/changeset/changeset_file_comment.html Sun Jan 05 04:07:51 2020 +0100 +++ b/kallithea/templates/changeset/changeset_file_comment.html Sun Jan 05 04:09:52 2020 +0100 @@ -198,7 +198,7 @@ $(window).on('beforeunload', function(){ var $textareas = $('.comment-inline-form textarea[name=text]'); - if($textareas.size() > 1 || + if($textareas.length > 1 || $textareas.val()) { // this message will not be displayed on all browsers // (e.g. some versions of Firefox), but the user will still be warned diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 kallithea/templates/files/diff_2way.html --- a/kallithea/templates/files/diff_2way.html Sun Jan 05 04:07:51 2020 +0100 +++ b/kallithea/templates/files/diff_2way.html Sun Jan 05 04:09:52 2020 +0100 @@ -67,7 +67,11 @@ $(document).ready(function () { $('#compare').mergely({ width: 'auto', - height: $(window).height() - $('#compare').offset().top - $('#footer').height() - 35, + /* let the 2 compare panes use all the window space currently available + below footer (i.e. on an empty page with just header and footer): */ + height: $(window).height() + - $('.footer').offset().top + - $('.footer').height(), fgcolor: {a:'#ddffdd',c:'#cccccc',d:'#ffdddd'}, bgcolor: '#fff', viewport: true, diff -r 0cb9aae7fe42 -r 1516f0fd9fd4 scripts/make-release --- a/scripts/make-release Sun Jan 05 04:07:51 2020 +0100 +++ b/scripts/make-release Sun Jan 05 04:09:52 2020 +0100 @@ -19,7 +19,7 @@ . "$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