From 7eae484f087556ef085a82619c60da656ae52f2c Mon Sep 17 00:00:00 2001
From: hanlucen <hanlucen@zhumengyuan.com>
Date: Thu, 30 Jul 2020 10:44:33 +0800
Subject: [PATCH] chore(deps): update all deps to the latest version

---
 .gitignore                       |  1 +
 rootfs/Dockerfile.test           | 10 +++++---
 rootfs/api/models/certificate.py |  2 +-
 rootfs/dev_requirements.txt      |  2 +-
 rootfs/requirements.txt          | 44 ++++++++++++++++----------------
 5 files changed, 32 insertions(+), 27 deletions(-)

diff --git a/.gitignore b/.gitignore
index ce893f85d..adfb1601f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,3 +43,4 @@ vendor/
 
 # generated bintray scripts during ci
 client/_scripts/ci/bintray-ci.json
+.idea
diff --git a/rootfs/Dockerfile.test b/rootfs/Dockerfile.test
index d278dd497..139773530 100644
--- a/rootfs/Dockerfile.test
+++ b/rootfs/Dockerfile.test
@@ -3,7 +3,11 @@ FROM python:3.7-alpine
 COPY requirements.txt /app/requirements.txt
 COPY dev_requirements.txt /app/dev_requirements.txt
 
-ENV PGDATA /var/lib/postgresql/11
+RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
+  && apk update \
+  && apk add postgresql==12.3-r2
+
+ENV PGDATA /var/lib/postgresql/12
 RUN mkdir -p /run/postgresql $PGDATA \
   && chown -R postgres:postgres /run/postgresql $PGDATA \
   && apk add --update --virtual .build-deps \
@@ -12,8 +16,8 @@ RUN mkdir -p /run/postgresql $PGDATA \
     libffi-dev \
     musl-dev \
     openldap-dev \
-  && pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt \
-  && pip3 install --disable-pip-version-check --no-cache-dir -r /app/dev_requirements.txt \
+  && pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt -i https://mirrors.aliyun.com/pypi/simple \
+  && pip3 install --disable-pip-version-check --no-cache-dir -r /app/dev_requirements.txt -i https://mirrors.aliyun.com/pypi/simple \
   && runDeps="$( \
     scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
     | tr ',' '\n' \
diff --git a/rootfs/api/models/certificate.py b/rootfs/api/models/certificate.py
index c7c2d03da..2b8136e8c 100644
--- a/rootfs/api/models/certificate.py
+++ b/rootfs/api/models/certificate.py
@@ -149,7 +149,7 @@ def save(self, *args, **kwargs):
         self.subject = '/' + '/'.join('%s=%s' % (key.decode(encoding='UTF-8'), value.decode(encoding='UTF-8')) for key, value in subject)  # noqa
 
         # public fingerprint of certificate
-        self.fingerprint = certificate.digest('sha256')
+        self.fingerprint = certificate.digest('sha256').decode()
 
         # SubjectAltName from the certificate - return a list
         self.san = get_subj_alt_name(certificate)
diff --git a/rootfs/dev_requirements.txt b/rootfs/dev_requirements.txt
index 07816b022..e2ca830fe 100644
--- a/rootfs/dev_requirements.txt
+++ b/rootfs/dev_requirements.txt
@@ -1,5 +1,5 @@
 # test module
-test
+# test
 # Run "make test-unit" for the % of code exercised during tests
 coverage==4.4.1
 
diff --git a/rootfs/requirements.txt b/rootfs/requirements.txt
index 376cca772..cc7bc06dc 100644
--- a/rootfs/requirements.txt
+++ b/rootfs/requirements.txt
@@ -1,23 +1,23 @@
 # Drycc controller requirements
-backoff==1.4.3
-django==1.11.29
-django-auth-ldap==1.2.15
-django-cors-middleware==1.3.1
-django-guardian==1.4.9
-djangorestframework==3.9.4
-docker==3.7.2
-gunicorn==19.9.0
-idna==2.6
-jmespath==0.9.3
-jsonfield==2.0.2
-jsonschema==2.6.0
-morph==0.1.2
-ndg-httpsclient==0.4.2
-packaging==16.8
-pyasn1==0.3.2
-psycopg2-binary==2.7.5
-pyldap==2.4.37
-pyOpenSSL==17.5.0
-pytz==2017.2
-requests==2.20.0
-requests-toolbelt==0.8.0
+backoff==1.10.0
+django==2.2.14
+django-auth-ldap==2.2.0
+django-cors-middleware==1.5.0
+django-guardian==2.3.0
+djangorestframework==3.11.0
+docker==4.2.2
+gunicorn==20.0.4
+idna==2.10
+jmespath==0.10.0
+jsonfield==3.1.0
+jsonschema==3.2.0
+morph==0.1.4
+ndg-httpsclient==0.5.1
+packaging==20.4
+pyasn1==0.4.8
+psycopg2-binary==2.8.5
+pyldap==3.0.0.post1
+pyOpenSSL==19.1.0
+pytz==2020.1
+requests==2.24.0
+requests-toolbelt==0.9.1
