Skip to content

Commit

Permalink
Merge pull request #26 from okfn/release-v2.0.1
Browse files Browse the repository at this point in the history
merge Release v2.0.1
  • Loading branch information
wardi committed Jun 12, 2013
2 parents fd7d55f + 416535c commit 43f6b8f
Show file tree
Hide file tree
Showing 24 changed files with 194 additions and 36 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.txt
@@ -1,6 +1,22 @@
CKAN CHANGELOG
++++++++++++++

v2.0.1 2013-06-11
=================

Bug fixes:
* Use IDatasetForm schema for resource_update (#897)
* Fixes for CKAN being run on a non-root URL (#948, #913)
* Fix resource edit errors losing info (#580)
* Fix Czech translation (#900)
* Allow JSON filters for datastore_search on GET requests (#917)
* Install vdm from the Python Package Index (#764)
* Allow extra parameters on Solr queries (#739)
* Create site user at startup if it does not exist (#952)
* Fix modal popups positioning (#828)
* Fix wrong redirect on dataset form on IE (#963)


v2.0 2013-05-10
===============

Expand Down
2 changes: 1 addition & 1 deletion ckan/__init__.py
@@ -1,4 +1,4 @@
__version__ = '2.0.1b'
__version__ = '2.0.1'

__description__ = 'Comprehensive Knowledge Archive Network (CKAN) Software'
__long_description__ = \
Expand Down
9 changes: 9 additions & 0 deletions ckan/config/environment.py
Expand Up @@ -18,6 +18,8 @@
import ckan.plugins as p
import ckan.lib.helpers as h
import ckan.lib.app_globals as app_globals
import ckan.logic as logic


log = logging.getLogger(__name__)

Expand Down Expand Up @@ -347,3 +349,10 @@ def genshi_lookup_attr(cls, obj, key):

for plugin in p.PluginImplementations(p.IConfigurable):
plugin.configure(config)

# Here we create the site user if they are not already in the database
try:
logic.get_action('get_site_user')({'ignore_auth': True}, None)
except sqlalchemy.exc.ProgrammingError:
# The database is not initialised. This is a bit dirty.
pass
2 changes: 1 addition & 1 deletion ckan/lib/helpers.py
Expand Up @@ -131,7 +131,7 @@ def _add_i18n_to_url(url_to_amend, **kw):
root = ''
if kw.get('qualified', False):
# if qualified is given we want the full url ie http://...
root = _routes_default_url_for('/', qualified=True)[:-1] + root
root = _routes_default_url_for('/', qualified=True)[:-1]
# ckan.root_path is defined when we have none standard language
# position in the url
root_path = config.get('ckan.root_path', None)
Expand Down
8 changes: 4 additions & 4 deletions ckan/logic/auth/get.py
Expand Up @@ -191,10 +191,10 @@ def tag_show_rest(context, data_dict):
return tag_show(context, data_dict)

def get_site_user(context, data_dict):
if not context.get('ignore_auth'):
return {'success': False, 'msg': 'Only internal services allowed to use this action'}
else:
return {'success': True}
# FIXME this is available to sysadmins currently till
# @auth_sysadmins_check decorator is added
return {'success': False,
'msg': 'Only internal services allowed to use this action'}


def member_roles_list(context, data_dict):
Expand Down
3 changes: 0 additions & 3 deletions ckan/public/base/css/fuchsia.css
Expand Up @@ -7701,9 +7701,6 @@ textarea {
.context-info.editing .module-content {
margin-top: 0;
}
.modal {
top: 50%;
}
.hero {
background: url("../../../base/images/background-tile.png");
padding: 20px 0;
Expand Down
2 changes: 1 addition & 1 deletion ckan/public/base/css/fuchsia.min.css

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions ckan/public/base/css/green.css
Expand Up @@ -7701,9 +7701,6 @@ textarea {
.context-info.editing .module-content {
margin-top: 0;
}
.modal {
top: 50%;
}
.hero {
background: url("../../../base/images/background-tile.png");
padding: 20px 0;
Expand Down
2 changes: 1 addition & 1 deletion ckan/public/base/css/green.min.css

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions ckan/public/base/css/main.css
Expand Up @@ -7701,9 +7701,6 @@ textarea {
.context-info.editing .module-content {
margin-top: 0;
}
.modal {
top: 50%;
}
.hero {
background: url("../../../base/images/background-tile.png");
padding: 20px 0;
Expand Down
2 changes: 1 addition & 1 deletion ckan/public/base/css/main.debug.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ckan/public/base/css/main.min.css

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions ckan/public/base/css/maroon.css
Expand Up @@ -7701,9 +7701,6 @@ textarea {
.context-info.editing .module-content {
margin-top: 0;
}
.modal {
top: 50%;
}
.hero {
background: url("../../../base/images/background-tile.png");
padding: 20px 0;
Expand Down
2 changes: 1 addition & 1 deletion ckan/public/base/css/maroon.min.css

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions ckan/public/base/css/red.css
Expand Up @@ -7701,9 +7701,6 @@ textarea {
.context-info.editing .module-content {
margin-top: 0;
}
.modal {
top: 50%;
}
.hero {
background: url("../../../base/images/background-tile.png");
padding: 20px 0;
Expand Down
2 changes: 1 addition & 1 deletion ckan/public/base/css/red.min.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions ckan/public/base/javascript/modules/autocomplete.js
Expand Up @@ -80,6 +80,12 @@ this.ckan.module('autocomplete', function (jQuery, _) {
// This is not part of the plugins API and so may break at any time.
select2.search.on('keydown', this._onKeydown);
}

// This prevents Internet Explorer from causing a window.onbeforeunload
// even from firing unnecessarily
$('.select2-choice', select2.container).on('click', function() {
return false;
});
},

/* Looks up the completions for the current search term and passes them
Expand Down
3 changes: 2 additions & 1 deletion ckan/public/base/javascript/modules/autocomplete.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion ckan/public/base/javascript/modules/confirm-action.js
Expand Up @@ -50,7 +50,10 @@ this.ckan.module('confirm-action', function (jQuery, _) {
this.modal.modal('show');

// Center the modal in the middle of the screen.
this.modal.css('margin-top', this.modal.height() * -0.5);
this.modal.css({
'margin-top': this.modal.height() * -0.5,
'top': '50%'
});
},

/* Performs the action for the current item.
Expand Down
2 changes: 1 addition & 1 deletion ckan/public/base/javascript/modules/confirm-action.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions ckan/public/base/less/layout.less
Expand Up @@ -136,7 +136,3 @@
}
}
}

.modal {
top: 50%;
}
7 changes: 7 additions & 0 deletions doc/conf.py
Expand Up @@ -49,6 +49,13 @@
.. |storage_dir| replace:: |storage_parent_dir|/default
.. |reload_apache| replace:: sudo service apache2 reload
.. |solr| replace:: Solr
.. |restructuredtext| replace:: reStructuredText
.. |nginx| replace:: Nginx
.. |sqlite| replace:: SQLite
.. |python| replace:: Python
.. |sqlalchemy| replace:: SQLAlchemy
.. |javascript| replace:: JavaScript
.. |apache| replace:: Apache
'''

Expand Down
4 changes: 2 additions & 2 deletions doc/install-from-package.rst
Expand Up @@ -27,7 +27,7 @@ CKAN:

#. Download the CKAN package::

wget http://packaging.ckan.org/python-ckan-2.0_amd64.deb
wget http://packaging.ckan.org/python-ckan_2.0_amd64.deb

.. note:: If ``wget`` is not present, you can install it
via::
Expand All @@ -36,7 +36,7 @@ CKAN:

#. Install the CKAN package::

sudo dpkg -i python-ckan-2.0_amd64.deb
sudo dpkg -i python-ckan_2.0_amd64.deb

.. note:: If you get the following error it means that for some reason the
Apache WSGI module was not enabled::
Expand Down
135 changes: 135 additions & 0 deletions doc/upgrading-a-package-install.rst
@@ -0,0 +1,135 @@
===========================
Upgrading a package install
===========================


----------------------------
Upgrading to a patch release
----------------------------

.. note::

*Patch releases* of CKAN are releases that increment the third digit in the
version number. For example, if you're upgrading from CKAN ``2.0`` to CKAN
``2.0.1`` then you're upgrading to a new patch release. Patch releases
should not contain any backwards-incompatible changes.

See :doc:`release-cycle` for more detail about the different types CKAN release.

Patch releases are distributed in the same package as the minor release they
belong to, so for example CKAN ``2.0``, ``2.0.1``, ``2.0.2``, etc. will all be
installed using the CKAN ``2.0`` package (``python-ckan_2.0_amd64.deb``):

#. Download the CKAN package::

wget http://packaging.ckan.org/python-ckan_2.0_amd64.deb

You can check the actual CKAN version from a package running the following
command::

dpkg --info python-ckan_2.0_amd64.deb

Look for the ``Version`` field in the output::

...
Package: python-ckan
Version: 2.0.1-3
...

#. Install the package with the following command::

sudo dpkg -i python-ckan_2.0_amd64.deb

This will **not** replace or modify any configuration files that you already
have on the server, including the CKAN config file or any |apache| or
|nginx| configuration files.

Your CKAN instance should be upgraded straight away.

.. note::

When upgrading from 2.0 to 2.0.1 you may see some vdm related warnings when
installing the package::

dpkg: warning: unable to delete old directory '/usr/lib/ckan/default/src/vdm': Directory not empty

These are due to vdm not longer being installed from source. You can ignore
them and delete the folder manually if you want.


-------------------------------------------
Upgrading a 1.X Package Install to CKAN 2.0
-------------------------------------------

.. note::

If you want to upgrade to a 1.X version of CKAN rather than to CKAN 2.0, see
the `documentation
<http://docs.ckan.org/en/ckan-1.8/install-from-package.html#upgrading-a-package-install>`_
relevant to the old CKAN packaging system.

The CKAN 2.0 package requires Ubuntu 12.04 64-bit, whereas previous CKAN
packages used Ubuntu 10.04. CKAN 2.0 also introduces many
backwards-incompatible feature changes (see :ref:`the changelog <changelog>`).
So it's not possible to automatically upgrade to a CKAN 2.0 package install.

However, you can install CKAN 2.0 (either on the same server that contained
your CKAN 1.x site, or on a different machine) and then manually migrate your
database and any custom configuration, extensions or templates to your new CKAN
2.0 site. We will outline the main steps for migrating below.

#. Create a dump of your CKAN 1.x database::

sudo -u ckanstd /var/lib/ckan/std/pyenv/bin/paster --plugin=ckan db dump db-1.x.dump --config=/etc/ckan/std/std.ini

#. If you want to install CKAN 2.0 on the same server that your CKAN 1.x site
was on, uninstall the CKAN 1.x package first::

sudo apt-get autoremove ckan

#. Install CKAN 2.0, either from a :doc:`package install <install-from-package>`
if you have Ubuntu 12.04 64-bit, or from a
:doc:`source install <install-from-source>` otherwise.

#. Load your database dump from CKAN 1.x into CKAN 2.0. This will migrate all
of your datasets, resources, groups, tags, user accounts, and other data to
CKAN 2.0. Your database schema will be automatically upgraded, and your
search index rebuilt.

First, activate your CKAN virtual environment and change to the ckan dir:

.. parsed-literal::
|activate|
cd |virtualenv|/src/ckan
Now, load your database. **This will delete any data already present in your
new CKAN 2.0 database**. If you've installed CKAN 2.0 on a different
machine from 1.x, first copy the database dump file to that machine.
Then run these commands:

.. parsed-literal::
paster db clean -c |production.ini|
paster db load -c |production.ini| db-1.x.dump
#. If you had any custom config settings in your CKAN 1.x instance that you
want to copy across to your CKAN 2.0 instance, then update your CKAN 2.0
|production.ini| file with these config settings. Note that not all CKAN 1.x
config settings are still supported in CKAN 2.0, see :doc:`configuration`
for details.

In particular, CKAN 2.0 introduces an entirely new authorization system
and any custom authorization settings you had in CKAN 1.x will have to be
reconsidered for CKAN 2.0. See :doc:`authorization` for details.

#. If you had any extensions installed in your CKAN 1.x instance that you also
want to use with your CKAN 2.0 instance, install those extensions in CKAN
2.0. Not all CKAN 1.x extensions are compatible with CKAN 2.0. Check each
extension's documentation for CKAN 2.0 compatibility and install
instructions.

#. If you had any custom templates in your CKAN 1.x instance, these will need
to be adapted before they can be used with CKAN 2.0. CKAN 2.0 introduces
an entirely new template system based on Jinja2 rather than on Genshi.
See :doc:`theming` for details.

0 comments on commit 43f6b8f

Please sign in to comment.