Skip to content

Molgen #1

Merged
merged 149 commits into from Jun 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
6ff16c6
init commit
mvogl Jul 5, 2017
9af4734
Adding models
mvogl Jul 5, 2017
4ac8214
add tests
mvogl Jul 5, 2017
539e319
pipeline prt1
mvogl Jul 5, 2017
1c058ed
Add .gitlab-ci.yml
mvogl Jul 5, 2017
9eb4ac2
db settings
mvogl Jul 5, 2017
0463b41
db set 2
mvogl Jul 5, 2017
b76828e
Update .gitlab-ci.yml
mvogl Jul 5, 2017
295c368
Update .gitlab-ci.yml
mvogl Jul 5, 2017
b368f33
Update .gitlab-ci.yml
mvogl Jul 5, 2017
60315c2
Update .gitlab-ci.yml
mvogl Jul 5, 2017
242d1e3
Update .gitlab-ci.yml
mvogl Jul 5, 2017
f69419d
Update .gitlab-ci.yml
mvogl Jul 5, 2017
cfd9233
Update .gitlab-ci.yml
mvogl Jul 5, 2017
4c27cbe
Update .gitlab-ci.yml
mvogl Jul 5, 2017
45052b6
deploy via compose
mvogl Jul 6, 2017
008dd51
edit db setings
mvogl Jul 6, 2017
591849a
edit db setings 2
mvogl Jul 6, 2017
5dc0d0c
admin settings -- still no pwd from ENV
mvogl Jul 6, 2017
80840d6
Update .gitlab-ci.yml
mvogl Jul 6, 2017
2470813
fix waiting time for postgres
mvogl Jul 6, 2017
7883e70
load static files
mvogl Jul 6, 2017
fea84be
vol for static files
mvogl Jul 6, 2017
8494e79
auto nginx
mvogl Jul 6, 2017
9fbc459
auto nginx host
mvogl Jul 6, 2017
7546c86
chg pipeline
mvogl Jul 6, 2017
00ec119
bad req bug
mvogl Jul 6, 2017
8b5ea9d
Update .gitlab-ci.yml
mvogl Jul 6, 2017
cdf7518
new branch, env for deploy
mvogl Jul 7, 2017
3533d74
Update .gitlab-ci.yml
mvogl Jul 7, 2017
0225f97
fix model order
mvogl Jul 7, 2017
ed0ff99
Update .gitlab-ci.yml
mvogl Jul 7, 2017
d254549
Merge branch 'master' into 'dev'
mvogl Jul 7, 2017
88e0792
model defaults featured/published
mvogl Jul 7, 2017
43f4f5d
Merge branch 'dev' of https://gitlab.gwdg.de/malte.vogl/eoa-django-te…
mvogl Jul 7, 2017
321131b
model defaults 2
mvogl Jul 7, 2017
76ee06c
Merge branch 'dev' into 'master'
mvogl Jul 7, 2017
76e0e27
extend model author
mvogl Jul 7, 2017
77bab98
models: imagefield dep.
mvogl Jul 7, 2017
9d76f3f
deps for imagefield 2
mvogl Jul 7, 2017
cdfad4b
model fix
mvogl Jul 7, 2017
44bf074
models added
mvogl Jul 7, 2017
3f9b9b2
more models
mvogl Jul 7, 2017
5a7f54f
more model
mvogl Jul 7, 2017
f02731f
more model 2
mvogl Jul 7, 2017
3a74abf
more model 3
mvogl Jul 7, 2017
2f67ffa
fix defautl
mvogl Jul 7, 2017
1e38481
fix null=True
mvogl Jul 7, 2017
588f647
order of classes
mvogl Jul 7, 2017
42f9aae
typo odels
mvogl Jul 7, 2017
9e1062b
Klaus testing a third user
Jul 11, 2017
9693999
addings models
mvogl Jul 11, 2017
bd420da
Merge branch 'dev' of https://gitlab.gwdg.de/EditionOpenAccess/eoa-dj…
mvogl Jul 11, 2017
6da27b4
Merge branch 'dev' into 'master'
mvogl Jul 11, 2017
9bb652b
Add models to admin interface, dbg model definitions
mvogl Jul 11, 2017
ab1d657
Merge branch 'dev' into 'master'
mvogl Jul 11, 2017
9bc08ec
add docker-compose down and sleep to update files properly
mvogl Jul 11, 2017
402fdc9
Merge branch 'dev' into 'master'
mvogl Jul 11, 2017
4cf7011
removing volume from docker-compose, lots of migration errors
mvogl Jul 11, 2017
b5f9f32
Merge branch 'dev' into 'master'
mvogl Jul 11, 2017
15a5fca
Remove volume from postgres, leads to migration errors
mvogl Jul 11, 2017
f1d5518
Update start_deploy.sh
mvogl Jul 11, 2017
f4e7fbd
Add assertRaises test
mvogl Jul 12, 2017
cd97a7c
chg folder strct
mvogl Jul 12, 2017
92fdebd
fix emailfield **def not working
mvogl Jul 12, 2017
ea60c26
Merge branch 'dev'
mvogl Jul 12, 2017
99788fa
Add publications app, starting templates
mvogl Jul 21, 2017
3aa3537
Adding views,urls,importer
mvogl Jul 25, 2017
543b3e0
requier lxml
mvogl Jul 25, 2017
4c18381
Merge branch 'dev' into 'master'
mvogl Jul 25, 2017
3e6931c
Ignore migration folders
mvogl Jul 25, 2017
558964e
Delete migrations from git
mvogl Jul 25, 2017
e0b2b93
Merge branch 'dev' into 'master'
mvogl Jul 25, 2017
f41afb4
chg order of middleware
mvogl Jul 25, 2017
2b792ab
Merge branch 'dev' into 'master'
mvogl Jul 25, 2017
6ec68ca
tei importer testing
mvogl Jul 26, 2017
725f02a
Merge branch 'dev' into 'master'
mvogl Jul 26, 2017
1223c39
first view
mvogl Jul 26, 2017
0f43992
Merge branch 'dev' into 'master'
mvogl Jul 26, 2017
26938f7
adding working view
mvogl Jul 27, 2017
dd78845
Merge branch 'dev' into 'master'
mvogl Jul 27, 2017
3e6d69b
reseting migrations
mvogl Jul 27, 2017
1cbf1bc
Merge branch 'dev' into 'master'
mvogl Jul 27, 2017
de06908
increase waiting time, for db to be ready
mvogl Jul 27, 2017
37dd13b
add waiting for postgres
mvogl Jul 27, 2017
f1a205f
rm waiting time
mvogl Jul 27, 2017
f39b1df
Merge branch 'master' into 'dev'
mvogl Jul 27, 2017
7eee86a
Merge branch 'dev' into 'master'
mvogl Jul 27, 2017
b3fd29b
add psql client
mvogl Jul 27, 2017
411f1fc
Merge branch 'dev' of https://gitlab.gwdg.de/EditionOpenAccess/eoa-dj…
mvogl Jul 27, 2017
0a77577
Merge branch 'dev' into 'master'
mvogl Jul 27, 2017
1d62fe7
add abstract xmlElement model
mvogl Jul 28, 2017
f289774
Mixed content model tests
mvogl Jul 31, 2017
59b320a
include hstore extension
mvogl Aug 1, 2017
af6df49
fix typos
mvogl Aug 1, 2017
f69ff8d
add hstore for tests
mvogl Aug 1, 2017
6edada4
chg psql path
mvogl Aug 1, 2017
b4190a2
chg psql path
mvogl Aug 1, 2017
5302418
chg psql path
mvogl Aug 1, 2017
a0aacc1
chg psql path
mvogl Aug 1, 2017
9423416
chg psql path
mvogl Aug 1, 2017
1b3c2fc
chg psql path
mvogl Aug 1, 2017
d14eb41
Merge branch 'dev' into 'master'
mvogl Aug 1, 2017
cbb9e5f
add docker postgres with hstore
mvogl Aug 1, 2017
64a9009
Merge branch 'dev' into 'master'
mvogl Aug 1, 2017
6a02e55
chg usage
mvogl Aug 1, 2017
c29fc8d
Merge branch 'dev' into 'master'
mvogl Aug 1, 2017
b73c663
refactor to use bs4 and full xml structure
mvogl Aug 1, 2017
0df3727
Merge branch 'dev' into 'master'
mvogl Aug 1, 2017
0c38f95
working models and view
mvogl Aug 2, 2017
fbeecb8
working models and view, typo
mvogl Aug 2, 2017
7225564
working models and view, arg extentsion
mvogl Aug 2, 2017
20a0d9c
working models and view, arg extentsion, typo
mvogl Aug 2, 2017
f30a8c9
hstore again
mvogl Aug 2, 2017
ac8e434
revert
mvogl Aug 2, 2017
a6eaf13
pubPlace
mvogl Aug 2, 2017
cb1c7ab
Merge branch 'dev' into 'master'
mvogl Aug 2, 2017
590d407
noinput yes
mvogl Aug 2, 2017
bd62ac7
Merge branch 'dev' into 'master'
mvogl Aug 2, 2017
392d3d0
fix editors and authors
mvogl Aug 2, 2017
3062efe
Merge branch 'dev' into 'master'
mvogl Aug 2, 2017
22633c3
Update .gitlab-ci.yml
mvogl Dec 15, 2017
04acf05
Update loaddjango.sh
mvogl Dec 15, 2017
b677274
Update loaddjango.sh
mvogl Dec 15, 2017
bf25293
echo pwd for debugging
mvogl Dec 15, 2017
90b5bba
Merge branch 'dev' into 'master'
mvogl Dec 15, 2017
b64ac28
read env var as str
mvogl Dec 15, 2017
f91f07a
Merge branch 'dev' into 'master'
mvogl Dec 15, 2017
a70e2be
rem pwd echo
mvogl Dec 20, 2017
335ae99
Merge branch 'dev' into 'master'
mvogl Dec 20, 2017
f6cce37
use letsencrypt
mvogl Jan 3, 2018
cc5daeb
add cert dir
mvogl Jan 3, 2018
95f70f0
Merge branch 'dev' into 'master'
mvogl Jan 3, 2018
35746d9
force head to origin/master
mvogl Jan 3, 2018
4aeb85a
Merge branch 'dev' into 'master'
mvogl Jan 3, 2018
fd3c3d6
fix typo
mvogl Jan 3, 2018
bbba2a9
Merge branch 'dev' into 'master'
mvogl Jan 3, 2018
993f207
no html2 in django
mvogl Jan 3, 2018
6d0b939
Merge branch 'dev' into 'master'
mvogl Jan 3, 2018
1f93c50
redirect from http, edit env address
mvogl Jan 3, 2018
cc6a289
Merge branch 'dev' into 'master'
mvogl Jan 3, 2018
0b8e076
Add new file
mvogl Jan 15, 2018
604a761
text
Jan 15, 2018
b30e9a3
Merge branch 'dev' into 'master'
mvogl Jan 15, 2018
bf56ba5
test mirror
mvogl Jan 19, 2018
9b91c56
one more try
mvogl Jan 19, 2018
87ead69
Merge branch 'dev' of gitlab.gwdg.de:EditionOpenAccess/eoa-django-tes…
mvogl Jun 13, 2018
77504c4
Merge branch 'master' of https://github.molgen.mpg.de/EditionOpenAcce…
mvogl Jun 13, 2018
45ca16b
init mirror
mvogl Jun 13, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
@@ -0,0 +1,7 @@
# excluded files are not sent to build context
# this keeps docker files smaller and file transfers lower
.dockerignore
.gitignore
.gitlab-ci.yml
myvenv
eoa-venv
12 changes: 12 additions & 0 deletions .gitignore
@@ -0,0 +1,12 @@
*.pyc
*~
*.key
*.pem
*.crt
__pychache__
myvenv
eoa-venv
db.sqlite3
/static
.DS_Store
**/migrations
42 changes: 42 additions & 0 deletions .gitlab-ci.yml
@@ -0,0 +1,42 @@
image: django:latest

.shared_hidden_key: &test
services:
- postgres:latest

.shared_hidden_key: &deploy
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'

stages:
- test
- deploy

variables:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: dev

all_tests:
<<: *test
stage: test
script:
- pip install -r config/requirements.txt
- PGPASSWORD=dev psql -h postgres -U postgres -d template1 -c 'create extension hstore;'
- sh scripts/run_tests.sh

deploy:
<<: *deploy
stage: deploy
script:
- ssh -t cloud@$DEPLOYHOST "export ADMIN_PWD=$DJANGO_ADMIN_PWD && cd django/eoa-django-test && git fetch --all && git reset --hard origin/master && sh scripts/start_deploy.sh "
environment:
name: production
url: https://c105-187.cloud.gwdg.de/publications/studies/312/index.html
only:
- master
when: manual
8 changes: 8 additions & 0 deletions Dockerfile
@@ -0,0 +1,8 @@
FROM python:3.5
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD config/requirements.txt /code/
RUN apt-get update && apt-get install -y postgresql-client
RUN pip3 install -r requirements.txt
ADD . /code/
4 changes: 3 additions & 1 deletion README.md → README
@@ -1,5 +1,7 @@
Using TEI importer for Django models
------------------------------------

This example shows how to use Django models to import a TEI document.
This example shows how to use Django models to import a TEI document.
A view for TEI documents is used to display the database entry as a basic html side.

Mirror is maintained. Or not.
1 change: 1 addition & 0 deletions config/certs/placeholder.txt
@@ -0,0 +1 @@
no text
43 changes: 43 additions & 0 deletions config/nginx/mydjango.conf
@@ -0,0 +1,43 @@
upstream web {
ip_hash;
server web:8000;
}

server {
listen 80;
listen [::]:80;
return 301 https://$host$request_uri;
}


server {

location /static/ {
autoindex on;
alias /static/;
}

location / {
proxy_pass http://web/;
}

location /.well-known {
alias /var/www/c105-187.cloud.gwdg.de/.well-known;
}

listen 443 ssl default_server;
listen [::]:443 ssl default_server;
server_name c105-187.cloud.gwdg.de;
ssl_certificate /etc/nginx/certs/fullchain.pem;
ssl_certificate_key /etc/nginx/certs/privkey.pem;

ssl_stapling on;
ssl_stapling_verify on;

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";
}
8 changes: 8 additions & 0 deletions config/requirements.txt
@@ -0,0 +1,8 @@
Django
psycopg2
Pillow
xmltodict
django-cms
django-sekizai
lxml
beautifulsoup4
32 changes: 32 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,32 @@
version: '3'

services:
nginx:
image: nginx:latest
environment:
- DEPLOYHOST
ports:
- "80:80"
- "443:443"
volumes:
- .:/code
- ./config/certs:/etc/nginx/certs:ro
- ./config/nginx:/etc/nginx/conf.d
- ./static:/static
depends_on:
- web
web:
build: .
environment:
- ADMIN_PWD
command: ["scripts/wait_for_pg.sh","postgres","sh","scripts/loaddjango.sh"]
depends_on:
- postgres
volumes:
- .:/code
- ./static:/static
#expose:
# - "8000"

postgres:
build: ./scripts/pghstore/.
Empty file added eoa/__init__.py
Empty file.
17 changes: 17 additions & 0 deletions eoa/admin.py
@@ -0,0 +1,17 @@
from django.contrib import admin
from .models import *

admin.site.register(Publication)
admin.site.register(Author)
admin.site.register(Citation)
admin.site.register(Part)
admin.site.register(Chapter)
admin.site.register(Section)
admin.site.register(Subsection)
admin.site.register(Subsubsection)
admin.site.register(Paragraph)
admin.site.register(MixedContent)
admin.site.register(Text)
admin.site.register(Table)
admin.site.register(Figure)
# Register your models here.
5 changes: 5 additions & 0 deletions eoa/apps.py
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class EoaConfig(AppConfig):
name = 'eoa'