Skip to content

Commit

Permalink
Merge pull request #576 from matthiaskoenig/develop
Browse files Browse the repository at this point in the history
Minor release: 0.8.0b14
  • Loading branch information
matthiaskoenig authored Jun 15, 2020
2 parents 7b2f9d7 + 96a53ca commit 2c47355
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 26 deletions.
2 changes: 1 addition & 1 deletion backend/pkdb_app/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Definition of version string.
"""
__version__ = "0.8.0b13"
__version__ = "0.8.0b14"
1 change: 1 addition & 0 deletions backend/pkdb_app/info_nodes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class DTypes(models.TextChoices):
ntype = models.CharField(null=False, blank=False, choices=NTypes.choices, max_length=20)
dtype = models.CharField(null=False, blank=False, choices=DTypes.choices, max_length=20)


def annotations_strings(self):
return [f"relation <{annotation.relation}>:, {annotation.term}" for annotation in self.annotations.all()]

Expand Down
1 change: 1 addition & 0 deletions backend/pkdb_app/info_nodes/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def NTypes():
"choice": Choice,
}


def update_or_create(self, validated_data, instance=None, update_document=True):
synonyms_data = validated_data.pop("synonyms", [])
parents_data = validated_data.pop("parents", [])
Expand Down
22 changes: 11 additions & 11 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
pip>=20.0.2
pip>=20.1.1
Markdown>=3.1.1
gunicorn>=20.0.4
json-logging>=1.0.5
psycopg2-binary>=2.8.4
psycopg2-binary>=2.8.5

# django
Django == 3.0.7
django-model-utils>=4.0.0
django-extra-fields>=2.0.2
django-storages>=1.8
django-extra-fields>=2.0.3
django-storages>=1.9.1
django-filter>=2.2.0
django-cors-headers>=2.4.0
django-rest-email-auth
django-cors-headers>=3.2.1
django-rest-email-auth>=2.1.0

# REST API
djangorestframework>=3.11.0
elasticsearch-dsl==7.1.0
elasticsearch-dsl==7.2.0
django-elasticsearch-dsl==7.1.1
django-elasticsearch-dsl-drf>=0.20.5

# analysis
ipykernel>=5.1.3
pandas>=0.25.3
pandas>=1.0.2
numpy>=1.18.1
scipy>=1.4.1
matplotlib>=3.1.2
pint>=0.10-1
matplotlib>=3.2.0
pint>=0.11

-e git://github.com/matthiaskoenig/pkdb_analysis.git@bf6077a4702838886f148c4e70de0b7ec2a3f3b9#egg=pkdb_analysis
pkdb-analysis>=0.1.5

6 changes: 5 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ echo "-------------------------"
echo "UPLOAD DATA"
echo "-------------------------"
$HOME/envs/pkdb_data/bin/upload_nodes
$HOME/envs/pkdb_data/bin/upload_studies

# run upload and allow disconnect of connection
# FIXME: add logging
nohup $HOME/envs/pkdb_data/bin/upload_studies &




Expand Down
10 changes: 6 additions & 4 deletions docker-compose-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ services:

postgres:
restart: always
image: postgres:12.1
image: postgres:12.3
ports:
- "5433:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${PKDB_DB_NAME}
- POSTGRES_USER=${PKDB_DB_USER}
- POSTGRES_PASSWORD=${PKDB_DB_PASSWORD}

elasticsearch:
restart: always
Expand All @@ -47,9 +51,7 @@ services:
memlock:
soft: -1
hard: -1

image: elasticsearch:7.5.1

image: elasticsearch:7.7.1
ports:
- "9123:9200"
volumes:
Expand Down
10 changes: 7 additions & 3 deletions docker-compose-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,19 @@ volumes:
services:
postgres:
restart: always
image: postgres:12.1
image: postgres:12.3
ports:
- "5433:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${PKDB_DB_NAME}
- POSTGRES_USER=${PKDB_DB_USER}
- POSTGRES_PASSWORD=${PKDB_DB_PASSWORD}

elasticsearch:
restart: always
image: elasticsearch:7.5.1
image: elasticsearch:7.7.1
environment:
- "ES_JAVA_OPTS=-Xms6g -Xmx6g"
- bootstrap.memory_lock=true
Expand Down Expand Up @@ -86,7 +90,7 @@ services:

nginx:
restart: always
image: nginx:1.17.7
image: nginx:1.18.0
ports:
- 8888:80
volumes:
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions nginx/pk-db.com
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ server {

location / {
# return 200 "ssl on proxy";
proxy_pass http://172.107.0.10:8888;
proxy_set_header HOST $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
proxy_set_header X-Forwarded-Proto https;
port_in_redirect off;
proxy_pass http://127.0.0.1:8888;
# proxy_set_header HOST $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-for $remote_addr;
# proxy_set_header X-Forwarded-Proto https;
# port_in_redirect off;
}
}
47 changes: 47 additions & 0 deletions nginx/pk-db.com_proxy
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# ------------------
# PK-DB
# ------------------
access_log /var/www/logs/pk-db.com_access.log;
error_log /var/www/logs/pk-db.com_error.log;

server {
listen 80;
listen [::]:80;

server_name pk-db.com pk-db.de www.pk-db.com www.pk-db.de;
return 301 https://pk-db.com$request_uri;
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;

server_name www.pk-db.com pk-db.de www.pk-db.de;
ssl_certificate /etc/letsencrypt/live/pk-db.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/pk-db.com/privkey.pem;

return 301 https://pk-db.com$request_uri;
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;

server_name pk-db.com;

ssl_certificate /etc/letsencrypt/live/pk-db.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/pk-db.com/privkey.pem;
include /etc/nginx/snippets/ssl.conf;

client_max_body_size 100m;

location / {
# return 200 "ssl on proxy";
proxy_pass http://172.107.0.10:8888;
proxy_set_header HOST $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
proxy_set_header X-Forwarded-Proto https;
port_in_redirect off;
}
}
22 changes: 22 additions & 0 deletions nginx/ssl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ssl_session_cache shared:le_nginx_SSL:1m;
ssl_session_timeout 1440m;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;

# ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS";

ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA512:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:ECDH+AESGCM:ECDH+AES256:DH+AESGCM:DH+AES256:RSA+AESGCM:!aNULL:!eNULL:!LOW:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS;

ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0

ssl_session_cache shared:TLS:2m;

# OCSP stapling
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8;

# Set HSTS to 365 days
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains';

0 comments on commit 2c47355

Please sign in to comment.