Update¶
Since 1.0.0, this project updates like any other project. First, update the source code, if you use git:
$ git pull origin master
or if you installed django-ca via pip:
$ pip install -U django-ca
then upgrade with these commands:
$ pip install -U -r requirements.txt
$ python ca/manage.py migrate
$ python ca/manage.py collectstatic # if you use the webinterface
Warning
If you installed django-ca in a virtualenv, don’t forget to activate it before executing any python or pip commands using:
source bin/activate
Update to 1.19.0 or later¶
If you use docker-compose, you need to backup private keys and update your docker-compose.yml
before upgrading. If you don’t private keys will be lost. The change to docker-compose.yml
will make
sure that keys will survive the next update.
First, you need to copy your private keys to a permanently stored location. If you do not have any keys in
either the backend or frontend, mv
will throw an error, which is of course fine in this case:
$ docker-compose exec backend mkdir -p /var/lib/django-ca/certs/ca/shared/backend/
$ docker-compose exec backend /bin/sh -c "cp /var/lib/django-ca/certs/ca/*.key /var/lib/django-ca/certs/ca/shared/backend/"
$ docker-compose exec frontend mkdir -p /var/lib/django-ca/certs/ca/shared/frontend/
$ docker-compose exec frontend /bin/sh -c "cp /var/lib/django-ca/certs/ca/*.key /var/lib/django-ca/certs/ca/shared/frontend/"
Note that if you have stored private keys in any custom location with the --path
argument, you need to
backup these locations as well.
Second, update your docker-compose.yml
file. Either get the latest version of the file, or apply this diff:
--- docker-compose.yml.orig
+++ docker-compose.yml
@@ -33,6 +33,7 @@ services:
- database
- public
volumes:
+ - backend_ca_dir:/var/lib/django-ca/certs/
- shared_ca_dir:/var/lib/django-ca/certs/ca/shared/
- ocsp_key_dir:/var/lib/django-ca/certs/ocsp/
- shared:/var/lib/django-ca/shared/
@@ -65,6 +66,7 @@ services:
- frontend
volumes:
- static:/usr/share/django-ca/static/
+ - frontend_ca_dir:/var/lib/django-ca/certs/
- shared_ca_dir:/var/lib/django-ca/certs/ca/shared/
- ocsp_key_dir:/var/lib/django-ca/certs/ocsp/
- shared:/var/lib/django-ca/shared/
@@ -116,6 +118,8 @@ services:
volumes:
shared:
static:
+ backend_ca_dir:
+ frontend_ca_dir:
shared_ca_dir:
ocsp_key_dir:
nginx_config:
Third, do a normal upgrade:
$ docker-compose pull
$ docker-compose up -d
Finally, move the keys from the temporary location to the primary location:
$ docker-compose exec backend /bin/sh -c "mv /var/lib/django-ca/certs/ca/shared/backend/*.key /var/lib/django-ca/certs/ca/"
$ docker-compose exec backend rmdir /var/lib/django-ca/certs/ca/shared/backend/
$ docker-compose exec frontend /bin/sh -c "mv /var/lib/django-ca/certs/ca/shared/frontend/*.key /var/lib/django-ca/certs/ca/"
$ docker-compose exec frontend rmdir /var/lib/django-ca/certs/ca/shared/frontend/
Update to 1.14.0 or later¶
django-ca has changed the layout of the CA_PROFILES, you have to update any any custom setting. Please see documentation for django-ca 1.16 for more detailed instructions.
The old profile settings will be supported until (and including) version 1.16.
Update to 1.12.0 or later¶
Please see documentation for previous versions on documentation how to upgrade.