|
| 1 | + |
| 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 | + |
| 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 |
0 commit comments