Skip to content
Snippets Groups Projects
Commit 081ec8de authored by Samir Faci's avatar Samir Faci
Browse files

Updating postgres image to 12 to match image used for testing.

ChangeLog:
  - Upgrade docker DB image.
  - Upgrade psycopg2 version.
parent 733341d3
No related branches found
No related tags found
No related merge requests found
...@@ -16,4 +16,3 @@ tls=${TLS_ENABLED} ...@@ -16,4 +16,3 @@ tls=${TLS_ENABLED}
[dud:topology] [dud:topology]
nrmmap=${NRM_FILE} nrmmap=${NRM_FILE}
...@@ -15,7 +15,7 @@ services: ...@@ -15,7 +15,7 @@ services:
#volumes: #volumes:
# - ./config/myNRMFile.nrm:/home/opennsa/opennsa/config/opennsa.nrm # - ./config/myNRMFile.nrm:/home/opennsa/opennsa/config/opennsa.nrm
db: db:
image: postgres:9.6.5 image: postgres:12
##Expose 5432 locally ##Expose 5432 locally
ports: ports:
- 5432:5432 - 5432:5432
...@@ -2,7 +2,7 @@ version: "3.7" ...@@ -2,7 +2,7 @@ version: "3.7"
services: services:
db: db:
image: postgres:9.6.5 image: postgres:12
expose: expose:
- 5432 - 5432
volumes: volumes:
......
...@@ -5,7 +5,6 @@ FROM debian:stable-slim ...@@ -5,7 +5,6 @@ FROM debian:stable-slim
LABEL maintainer="Henrik Thostrup Jensen <htj@nordu.net>" LABEL maintainer="Henrik Thostrup Jensen <htj@nordu.net>"
# -- Environment -- # -- Environment --
ENV GIT_REPO https://github.com/NORDUnet/opennsa
ENV USER opennsa ENV USER opennsa
...@@ -19,26 +18,15 @@ ADD . /home/$USER/opennsa/ ...@@ -19,26 +18,15 @@ ADD . /home/$USER/opennsa/
# pyasn1 and crypto is needed for ssh backends # pyasn1 and crypto is needed for ssh backends
RUN apt update \ RUN apt update \
&& apt install -y \ && apt install -y \
git-core \ libpq-dev \
python3 \ python3 \
python3-twisted-bin \
python3-openssl \
python3-psycopg2 \
python3-pip \ python3-pip \
python3-cryptography \ netcat \
python3-dateutil \ iputils-ping \
&& pip3 install \ && pip3 install -r /home/$USER/opennsa/requirements.txt \
twistar \
service-identity \
pyasn1 \
# -- Instal OpenNSA --
# && echo git clone $GIT_REPO \
# && su - $USER -c "git clone $GIT_REPO" \
## Unsure why but this needs to be pulled away from the main apt install
&& chown $USER:$USER -R /home/opennsa/opennsa \ && chown $USER:$USER -R /home/opennsa/opennsa \
&& apt install -y netcat iputils-ping \
# -- Cleanup -- # -- Cleanup --
&& apt remove -y git-core python3-pip \ && apt remove -y python3-pip \
&& apt autoremove -y \ && apt autoremove -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& cp /home/$USER/opennsa/docker/run_opennsa.sh /home/$USER/opennsa \ && cp /home/$USER/opennsa/docker/run_opennsa.sh /home/$USER/opennsa \
......
...@@ -44,11 +44,14 @@ class opennsaTlsContext: ...@@ -44,11 +44,14 @@ class opennsaTlsContext:
try: try:
CACertificates.append(ssl.Certificate.loadPEM(CAFileContent)) CACertificates.append(ssl.Certificate.loadPEM(CAFileContent))
except crypto.Error as error: except crypto.Error as error:
log.msg('Cannot load CA certificate from %s: %s' % (CAFilename, error), system = LOG_SYSTEM) log.msg(f'Cannot load CA certificate from {CAFilename}: {error}', system=LOG_SYSTEM)
else: else:
log.msg('Loaded CA certificate %s' % (str(CACertificates[-1].getSubject())), system = LOG_SYSTEM) try:
log.msg(f'Loaded CA certificate {CACertificates[-1].getSubject()}', system=LOG_SYSTEM)
except:
log.msg("Failed to serialize Certificate Subject")
if len(CACertificates) == 0: if len(CACertificates) == 0:
print('No certificiates loaded for CTX verificiation. CA verification will not work.') print('No certificates loaded for CTX verification. CA verification will not work.')
return ssl.trustRootFromCertificates(CACertificates) return ssl.trustRootFromCertificates(CACertificates)
def getTrustRoot(self): def getTrustRoot(self):
......
#twisted>=19.7.0
twisted>=21.2.0 twisted>=21.2.0
twistar>=2.0 twistar>=2.0
#psycopg2>=2.7,<2.8 --no-binary psycopg2 psycopg2>=2.9,<2.10 --no-binary psycopg2
psycopg2
pyOpenSSL>=17.5.0 pyOpenSSL>=17.5.0
python-dateutil python-dotenv>=0.19.0
service_identity cryptography>=3.4.8
idna python-dateutil>=2.8,<2.9
\ No newline at end of file service-identity>=21.1.0,<22.0.0
idna>=3.2,<3.3
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment