Skip to content

Commit bdf1240

Browse files
author
Michael Gebauer | TU
committed
Final Release
0 parents  commit bdf1240

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+8837
-0
lines changed

.docs/screen1.png

750 KB
Loading

.github/workflows/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Docker Compose Actions Workflow
2+
on: push
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Run TILTer
9+
run: docker-compose build

.gitignore

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/python
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
4+
5+
### Python ###
6+
# Byte-compiled / optimized / DLL files
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# C extensions
12+
*.so
13+
14+
# Distribution / packaging
15+
.Python
16+
build/
17+
develop-eggs/
18+
dist/
19+
downloads/
20+
eggs/
21+
.eggs/
22+
lib/
23+
lib64/
24+
parts/
25+
sdist/
26+
var/
27+
wheels/
28+
pip-wheel-metadata/
29+
share/python-wheels/
30+
*.egg-info/
31+
.installed.cfg
32+
*.egg
33+
MANIFEST
34+
35+
# PyInstaller
36+
# Usually these files are written by a python script from a template
37+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38+
*.manifest
39+
*.spec
40+
41+
# Installer logs
42+
pip-log.txt
43+
pip-delete-this-directory.txt
44+
45+
# Unit test / coverage reports
46+
htmlcov/
47+
.tox/
48+
.nox/
49+
.coverage
50+
.coverage.*
51+
.cache
52+
nosetests.xml
53+
coverage.xml
54+
*.cover
55+
*.py,cover
56+
.hypothesis/
57+
.pytest_cache/
58+
pytestdebug.log
59+
60+
# Translations
61+
*.mo
62+
*.pot
63+
64+
# Django stuff:
65+
*.log
66+
local_settings.py
67+
db.sqlite3
68+
db.sqlite3-journal
69+
70+
# Flask stuff:
71+
instance/
72+
.webassets-cache
73+
74+
# Scrapy stuff:
75+
.scrapy
76+
77+
# Sphinx documentation
78+
docs/_build/
79+
doc/_build/
80+
81+
# PyBuilder
82+
target/
83+
84+
# Jupyter Notebook
85+
.ipynb_checkpoints
86+
87+
# IPython
88+
profile_default/
89+
ipython_config.py
90+
91+
# pyenv
92+
.python-version
93+
94+
# pipenv
95+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
97+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
98+
# install all needed dependencies.
99+
#Pipfile.lock
100+
101+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
102+
__pypackages__/
103+
104+
# Celery stuff
105+
celerybeat-schedule
106+
celerybeat.pid
107+
108+
# SageMath parsed files
109+
*.sage.py
110+
111+
# Environments
112+
.env
113+
.venv
114+
env/
115+
venv/
116+
ENV/
117+
env.bak/
118+
venv.bak/
119+
pythonenv*
120+
121+
# Spyder project settings
122+
.spyderproject
123+
.spyproject
124+
125+
# Rope project settings
126+
.ropeproject
127+
128+
# mkdocs documentation
129+
/site
130+
131+
# mypy
132+
.mypy_cache/
133+
.dmypy.json
134+
dmypy.json
135+
136+
# Pyre type checker
137+
.pyre/
138+
139+
# pytype static type analyzer
140+
.pytype/
141+
142+
# profiling data
143+
.prof
144+
145+
# End of https://www.toptal.com/developers/gitignore/api/python
146+
147+
148+
# Created by https://www.toptal.com/developers/gitignore/api/macos
149+
# Edit at https://www.toptal.com/developers/gitignore?templates=macos
150+
151+
### macOS ###
152+
# General
153+
.DS_Store
154+
.AppleDouble
155+
.LSOverride
156+
157+
# Icon must end with two \r
158+
Icon
159+
160+
161+
# Thumbnails
162+
._*
163+
164+
# Files that might appear in the root of a volume
165+
.DocumentRevisions-V100
166+
.fseventsd
167+
.Spotlight-V100
168+
.TemporaryItems
169+
.Trashes
170+
.VolumeIcon.icns
171+
.com.apple.timemachine.donotpresent
172+
173+
# Directories potentially created on remote AFP share
174+
.AppleDB
175+
.AppleDesktop
176+
Network Trash Folder
177+
Temporary Items
178+
.apdisk
179+
180+
# End of https://www.toptal.com/developers/gitignore/api/macos
181+
182+
# project ignores
183+
volumes/*
184+
.vscode

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 DaSKITA
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
![Docker Compose Actions Workflow](https://github.com/DaSKITA/tilter/workflows/Docker%20Compose%20Actions%20Workflow/badge.svg)
2+
3+
# tilter
4+
Annotation tool _TILTer_ for the annotation and conversion of privacy policies into the [TILT schema](https://github.com/Transparency-Information-Language/schema).
5+
6+
7+
## Run Application
8+
9+
### Prerequisites
10+
11+
* Python 3.7.0 or above
12+
* [Docker](https://docs.docker.com/get-docker/)
13+
* [docker-compose](https://docs.docker.com/compose/install/)
14+
15+
16+
### SetUp
17+
#### Docker-Compose
18+
19+
1. Type `source ops/variables/local.txt`
20+
2. Type `docker-compose up` in the Terminal Window.
21+
3. Access [http://localhost:5000](http://localhost:5000) and [http://localhost:5000/api/docs/](http://localhost:5000/api/docs/) in your favorite Browser
22+
23+
24+
#### Local
25+
26+
This is a setup Guide for Ubuntu.
27+
28+
1. Create a Python Environment with `python -m venv <your-env-name>`
29+
2. Activate your python environment with `source <your-env-name>/bin/activate`
30+
3. Upgrade Pip with `python -m pip install -U pip` and install all necessary packages with `pip install -r app/requirements.txt`
31+
4. Type `source ops/variables/local.txt`
32+
5. Run the app with `./scripts/start_local.sh`
33+
34+
35+
## Deployment
36+
37+
The TILTer ist currently deployed in a [google compute engine](http://34.89.190.55:5000/).
38+
Deplyoment is not automated. Inside the engine the repository is clonded and has to be manually synched with
39+
the remote repository. For access to the compute engine ask Michael, to provide you with the necessary
40+
`ssh-keys` and Username.
41+
The ssh-connection can be established via `ssh -i [Path_to_Private_Key] [USERNAME]@34.89.190.55`.
42+
In the engine a log is created from the console output via nohub. All output is saved in `nohub.out` in the
43+
root directory of the titler.
44+
45+
It is recommended to use screens for managing the application on the compute engine.
46+
<br>
47+
Start a new screen by: `screen -S <screen_name>`
48+
<br>
49+
Reattach a screen by: `screen -r <screen_name>`
50+
<br>
51+
See all screens with: `screen ls`
52+
53+
Deployment variables are stored seperately.
54+
55+
The deployment will be active for 90 days (from 31.05.2021) without any costs. Afterwards running the TILTer
56+
will costs ~13 Euros per month.
57+
58+
The Deployment can be accessed under: http://34.89.190.55:5000
59+
## Versions
60+
61+
### v0.1
62+
![](./.docs/screen1.png)
63+
64+
## Languages and Translations
65+
Currently supported Languages are English (standard) and German. These are realized using the `pybabel` package. For more information regarding this topic please visit the [babel documentation](http://babel.pocoo.org/en/latest/index.html).
66+
67+
### Adding New Languages
68+
New languages are added using the `pybabel` command as follows:
69+
1. Append the code for the new Language to the `LANGUAGES`-list in `config.py`. For available language codes check the [babel documentation](http://babel.pocoo.org/en/latest/index.html).
70+
2. Add new text to be translated using the `_([text])` command, where `[text]` is the string to be translated.
71+
3. Execute `pybabel extract -F babel.cfg -o translations/messages.pot .` in `/app/`.
72+
4. Execute `pybabel init -i translations/messages.pot -d translations -l [code]` in `app`, where `[code]` is the language code you chose in the first step.
73+
5. Now add translations using `msgstr ""` entries in the file to `/app/translations/[code]/LC_MESSAGES/messages.po`, where `[code]` again is the language code you chose in the first step.
74+
6. Compile the changes using `pybabel compile -d translations` in `/app/`.
75+
7. Restart the flask application via docker.
76+
77+
### Updating Existing Languages
78+
When updating existing languages there is no need to follow the whole procedure above. Instead use the following steps:
79+
1. Add new text to be translated using the `_([text])` command, where `[text]` is the string to be translated.
80+
2. Execute `pybabel extract -F babel.cfg -o translations/messages.pot .` in `/app/`.
81+
3. Execute `pybabel update -i translations/messages.pot -d translations` in `/app/`.
82+
4. Now add translations using `msgstr ""` entries in the file to `/app/translations/[code]/LC_MESSAGES/messages.po`, where `[code]` is the language code associated with the target language.
83+
5. Compile the changes using `pybabel compile -d translations` in `/app/`.
84+
6. Restart the flask application via docker.
85+
86+
## License
87+
MIT License
88+
89+
2020
90+
91+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
92+
93+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
94+
95+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
96+
97+
### Dependencies
98+
This software depends on the following third party software products:
99+
- [label-studio](https://github.com/heartexlabs/label-studio-frontend) under Apache 2.0 License
100+
- [bootstrap](https://github.com/twbs/bootstrap) under MIT License
101+
- [flask](https://github.com/pallets/flask) under BSD-3-Clause License

app/__init__.py

Whitespace-only changes.

app/api/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)