|
1 | | -# ckanext-cookie-banner |
2 | | -Cookie Banner Plugin for CKAN |
| 1 | +[](https://github.com/JiscSD/ckanext-ukdstheme/actions) |
| 2 | + |
| 3 | +# Cookie Banner Plugin for CKAN |
| 4 | + |
| 5 | +This is the cookie banner plugin for UKDS CKAN instance. |
| 6 | +It includes the necessary JavaScript files to apply the civic cookie banner. |
| 7 | + |
| 8 | +## Features included |
| 9 | +1. Cookie Banner Displayed |
| 10 | +2. Configured correct text |
| 11 | +3. Link to the UKDS Privacy Policy |
| 12 | +4. Ability to change appearance and behaviour of the cookie banner |
| 13 | + |
| 14 | + |
| 15 | +## Requirements |
| 16 | + |
| 17 | +This plugin is developed and tested on CKAN version 2.9 & 2.11 |
| 18 | + |
| 19 | +Compatibility with core CKAN versions: |
| 20 | + |
| 21 | +| CKAN version | Compatible? | |
| 22 | +|-----------------|-------------| |
| 23 | +| 2.9 | yes | |
| 24 | +| 2.10 | not tested | |
| 25 | +| 2.11 | yes | |
| 26 | + |
| 27 | + |
| 28 | +## Installation |
| 29 | + |
| 30 | +To install ckanext-cookie_banner: |
| 31 | + |
| 32 | +1. Activate your CKAN virtual environment, for example: |
| 33 | +``` |
| 34 | + . /usr/lib/ckan/default/bin/activate |
| 35 | +``` |
| 36 | +2. Clone the source and install it on the virtualenv |
| 37 | +``` |
| 38 | + cd /usr/lib/ckan/default/src |
| 39 | + python3 -m pip install -e git+https://github.com/JiscSD/ckanext-cookie-banner.git#egg=ckanext-cookie-banner |
| 40 | + |
| 41 | + then reset the permissions for the new ckanext-cookie-banner directory to 'ckan' |
| 42 | +``` |
| 43 | +3. Add `cookie_banner` to the `ckan.plugins` setting in your CKAN |
| 44 | + config file (by default the config file is located at |
| 45 | + `/etc/ckan/default/ckan.ini`). |
| 46 | + |
| 47 | +4. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu: |
| 48 | +``` |
| 49 | + sudo service apache2 reload |
| 50 | +``` |
| 51 | +or if the server is on AWS, called |
| 52 | +``` |
| 53 | + sudo systemctl restart nginx |
| 54 | +``` |
| 55 | + |
| 56 | +## Updating to a new version |
| 57 | + |
| 58 | +To update ckanext-cookie_banner: |
| 59 | + |
| 60 | +1. Activate your CKAN virtual environment, for example: |
| 61 | +``` |
| 62 | + . /usr/lib/ckan/default/bin/activate |
| 63 | +``` |
| 64 | +2. pull the latest version then install it on the virtualenv |
| 65 | +``` |
| 66 | + cd /usr/lib/ckan/default/src/ckanext-cookie-banner |
| 67 | + git pull |
| 68 | + pip install -e . |
| 69 | + |
| 70 | + then reset the permissions for the ckanext-cookie-banner directory to 'ckan' |
| 71 | +``` |
| 72 | + |
| 73 | +3. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu: |
| 74 | +``` |
| 75 | + sudo service apache2 reload |
| 76 | +``` |
| 77 | +or if the server is on AWS, called |
| 78 | +``` |
| 79 | + sudo reboot now |
| 80 | +``` |
| 81 | + |
| 82 | +## Config settings |
| 83 | + |
| 84 | +None at present |
| 85 | + |
| 86 | +## Developer installation |
| 87 | + |
| 88 | +To install ckanext-cookie_banner for development, activate your CKAN virtualenv and |
| 89 | +do: |
| 90 | + |
| 91 | + python3 -m pip install -e git+https://github.com/JiscSD/ckanext-cookie-banner.git#egg=ckanext-cookie-banner |
| 92 | + cd ckanext-cookie-banner |
| 93 | + python3 setup.py develop |
| 94 | + python3 -m pip install -r dev-requirements.txt |
| 95 | + |
| 96 | + |
| 97 | +## Tests |
| 98 | + |
| 99 | +To run the tests, do: |
| 100 | + |
| 101 | + pytest --ckan-ini=test.ini |
| 102 | + |
| 103 | + |
| 104 | +## Releasing a new version of ckanext-cookie_banner |
| 105 | + |
| 106 | +If ckanext-cookie_banner should be available on PyPI you can follow these steps to publish a new version: |
| 107 | + |
| 108 | +1. Update the version number in the `setup.py` file. See [PEP 440](http://legacy.python.org/dev/peps/pep-0440/#public-version-identifiers) for how to choose version numbers. |
| 109 | + |
| 110 | +2. Make sure you have the latest version of necessary packages: |
| 111 | + |
| 112 | + pip install --upgrade setuptools wheel twine |
| 113 | + |
| 114 | +3. Create a source and binary distributions of the new version: |
| 115 | + |
| 116 | + python setup.py sdist bdist_wheel && twine check dist/* |
| 117 | + |
| 118 | + Fix any errors you get. |
| 119 | + |
| 120 | +4. Upload the source distribution to PyPI: |
| 121 | + |
| 122 | + twine upload dist/* |
| 123 | + |
| 124 | +5. Commit any outstanding changes: |
| 125 | + |
| 126 | + git commit -a |
| 127 | + git push |
| 128 | + |
| 129 | +6. Tag the new release of the project on GitHub with the version number from |
| 130 | + the `setup.py` file. For example if the version number in `setup.py` is |
| 131 | + 0.0.1 then do: |
| 132 | + |
| 133 | + git tag 0.0.1 |
| 134 | + git push --tags |
| 135 | + |
| 136 | +## License |
| 137 | + |
| 138 | +[Unlicense](https://unlicense.org/) |
0 commit comments