Compare commits
	
		
			6 Commits
		
	
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | 1cc2a50df8 | |
|  | a7774f6a41 | |
|  | b776c4811b | |
|  | ebe3cbedc6 | |
|  | 371cb55544 | |
|  | 87e1d6b8f0 | 
							
								
								
									
										140
									
								
								README.md
								
								
								
								
							
							
						
						
									
										140
									
								
								README.md
								
								
								
								
							|  | @ -1,61 +1,79 @@ | ||||||
| # eva | # eva | ||||||
| 
 | 
 | ||||||
| A simple tool for on- and offboarding people in a mid sized organisation. | A simple tool for on- and offboarding people in a mid sized organisation. | ||||||
| 
 | 
 | ||||||
| "EVA" is an german acronym for "Eintritt, Veränderung, Austritt", | "EVA" is an german acronym for "Eintritt, Veränderung, Austritt", | ||||||
| meaning "Onboarding, Change, Offboarding" | meaning "Onboarding, Change, Offboarding" | ||||||
| 
 | 
 | ||||||
| # development | # development | ||||||
| 
 | 
 | ||||||
| - install gettext for instance via "apt install gettext" for translations | - install gettext for instance via `apt install gettext` for translations | ||||||
| 
 | - set up a virtual environment with virtualenvwrapper or some other environment managing tool | ||||||
| - set up a virtual environment with virtualenvwrapper or some other | - use this environment and do | ||||||
| environment managing tool | ``` | ||||||
| 
 | pip install django django-multiselectfield django-formtools django-allauth | ||||||
| - use this environment and do | ``` | ||||||
| 
 | - clone this repository | ||||||
|     pip install django django-multiselectfield django-formtools django-allauth | - `ln -sr eva/settings_development.py eva/settings.py` | ||||||
| 
 | - initialise your database with `python manage.py migrate` | ||||||
| - clone this repository | - start your development server with `python manage.py runserver` | ||||||
| 
 | 
 | ||||||
| - ln -sr eva/settings_development.py eva/settings.py | # oauth | ||||||
| 
 | 
 | ||||||
| - initialise your database with | - You need to add oauth information in the django backend via .../admin in "Social Accounts" | ||||||
| 
 | 
 | ||||||
|     python manage.py migrate | # production | ||||||
| 
 | 
 | ||||||
| - start your development server with | - you can use gunicorn as server for example instead of the django development server. | ||||||
| 
 | - we use whitenoise for serving static files | ||||||
|     python manage.py runserver | - we still use the development SQLITE database from django | ||||||
| 
 | 
 | ||||||
| # oauth | do the following in the project main directory: | ||||||
| 
 | ``` | ||||||
| - You need to add oauth information in the django backend via .../admin in "Social Accounts" |   ln -sr eva/settings_production.py eva/settings.py | ||||||
| 
 | ``` | ||||||
| # production | edit /secrets.json to contain something similar to | ||||||
| 
 | ``` | ||||||
| - you can use gunicorn as server for example instead of the django development server. |   { | ||||||
| 
 |     "SECRET_KEY": "THIS IS ANOTHER SECRET!" | ||||||
| - we use whitenoise for serving static files |   } | ||||||
| 
 | ``` | ||||||
| - we still use the development SQLITE database from django | run the following commands: | ||||||
| 
 | ``` | ||||||
| do the following in the project main directory: |   python3 manage.py migrate | ||||||
| 
 |   python3 manage.py collectstatic | ||||||
|   ln -sr eva/settings_production.py eva/settings.py |   django-admin compilemessages | ||||||
| 
 | ``` | ||||||
| edit /secrets.json to contain something similar to | 
 | ||||||
| 
 | As root create a file `/etc/systemd/system` (it's already deployed by puppet when the corresponding manifest is applied): | ||||||
|   { | 
 | ||||||
|     "SECRET_KEY": "THIS IS ANOTHER SECRET!" | ``` | ||||||
|   } | # /etc/systemd/system/eva.service | ||||||
| 
 | # | ||||||
| run the following commands: | 
 | ||||||
| 
 | [Unit] | ||||||
|   python3 manage.py migrate | Description=gunicorn EVA daemon | ||||||
|   python3 manage.py collectstatic | After=network.target | ||||||
|   django-admin compilemessages | 
 | ||||||
| 
 | [Service] | ||||||
| server starts with | Type=simple | ||||||
| 
 | User=eva | ||||||
|   export PYTHONUNBUFFERED=TRUE; nohup gunicorn --forwarded-allow-ips="*" -b '0:8000' eva.wsgi &> logfile & | Group=eva | ||||||
|  | RuntimeDirectory=eva | ||||||
|  | WorkingDirectory=/home/eva/eva | ||||||
|  | Environment=PYTHONUNBUFFERED=TRUE | ||||||
|  | ExecStart=/usr/bin/gunicorn  --forwarded-allow-ips='*' -b '0:8000' eva.wsgi | ||||||
|  | ExecReload=/bin/kill -s HUP $MAINPID | ||||||
|  | KillMode=mixed | ||||||
|  | TimeoutStopSec=5 | ||||||
|  | PrivateTmp=true | ||||||
|  | 
 | ||||||
|  | [Install] | ||||||
|  | WantedBy=multi-user.target | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
|  | Adapt the paths in the file accordingly. Then, still as root, run: | ||||||
|  | ``` | ||||||
|  | systemctl enable --now eva.service | ||||||
|  | ``` | ||||||
|  | This enables the service to start at boot time and starts it immediately now. The daemon logs to the journal. You can see the last 10 lines by running `systemctl status eva.service` or the whole log by running `journalctl -u eva.service`. The usual switches to manipulate that output are available. | ||||||
|  | @ -0,0 +1,24 @@ | ||||||
|  | # Generated by Django 4.2.4 on 2023-08-11 10:28 | ||||||
|  | 
 | ||||||
|  | from django.db import migrations, models | ||||||
|  | import multiselectfield.db.fields | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class Migration(migrations.Migration): | ||||||
|  | 
 | ||||||
|  |     dependencies = [ | ||||||
|  |         ('evapp', '0003_auto_20220208_0955'), | ||||||
|  |     ] | ||||||
|  | 
 | ||||||
|  |     operations = [ | ||||||
|  |         migrations.AlterField( | ||||||
|  |             model_name='employee', | ||||||
|  |             name='accounts', | ||||||
|  |             field=multiselectfield.db.fields.MultiSelectField(blank=True, choices=[('OTRSWMDE', 'OTRS Ticketsystem'), ('CIVIC1', 'Civic CRM (allgemein)'), ('CIVIC2', 'Civic CRM (Mailings, impliziert allgemein)'), ('WEB', 'www.wikimedia.de (edit)'), ('BLOG', 'blog.wikimedia.de (edit)'), ('FORUM', 'forum.wikimedia.de')], max_length=10, null=True, verbose_name='Zusätzliche Accounts'), | ||||||
|  |         ), | ||||||
|  |         migrations.AlterField( | ||||||
|  |             model_name='employee', | ||||||
|  |             name='department', | ||||||
|  |             field=models.CharField(choices=[('COENG', 'Communitys & Engagement'), ('SOFT', 'Softwareentwicklung'), ('CENT', 'Central'), ('KOMAD', 'Kommunikation & Advocacy'), ('VOR', 'Vorstand')], max_length=5, verbose_name='Bereich'), | ||||||
|  |         ), | ||||||
|  |     ] | ||||||
|  | @ -0,0 +1,19 @@ | ||||||
|  | # Generated by Django 4.2.4 on 2023-08-17 11:08 | ||||||
|  | 
 | ||||||
|  | from django.db import migrations | ||||||
|  | import multiselectfield.db.fields | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class Migration(migrations.Migration): | ||||||
|  | 
 | ||||||
|  |     dependencies = [ | ||||||
|  |         ('evapp', '0004_alter_employee_accounts_alter_employee_department'), | ||||||
|  |     ] | ||||||
|  | 
 | ||||||
|  |     operations = [ | ||||||
|  |         migrations.AlterField( | ||||||
|  |             model_name='employee', | ||||||
|  |             name='accounts', | ||||||
|  |             field=multiselectfield.db.fields.MultiSelectField(blank=True, choices=[('OTRSWMDE', 'OTRS Ticketsystem'), ('CIVIC1', 'Civic CRM (allgemein)'), ('CIVIC2', 'Civic CRM (Mailings, impliziert allgemein)'), ('WEB', 'www.wikimedia.de (edit)'), ('BLOG', 'blog.wikimedia.de (edit)'), ('FORUM', 'forum.wikimedia.de')], max_length=40, null=True, verbose_name='Zusätzliche Accounts'), | ||||||
|  |         ), | ||||||
|  |     ] | ||||||
|  | @ -7,10 +7,10 @@ from django.utils.translation import gettext_lazy as _ | ||||||
| # suboptimal implementation in views.EvaFormView.beautify_data() | # suboptimal implementation in views.EvaFormView.beautify_data() | ||||||
| # | # | ||||||
| 
 | 
 | ||||||
| DEPARTMENT_CHOICES = {'PROG': _('Programme'), | DEPARTMENT_CHOICES = {'COENG': _('Communitys & Engagement'), | ||||||
|                       'SOFT': _('Softwareentwicklung'), |                       'SOFT': _('Softwareentwicklung'), | ||||||
|                       'CENT': 'Central', |                       'CENT': 'Central', | ||||||
|                       'KOMEV': _('Kommunikation und Events'), |                       'KOMAD': _('Kommunikation & Advocacy'), | ||||||
|                       'VOR': _('Vorstand'),} |                       'VOR': _('Vorstand'),} | ||||||
| 
 | 
 | ||||||
| VENDOR_CHOICES = {'STANDARD': 'Dell Latitude', | VENDOR_CHOICES = {'STANDARD': 'Dell Latitude', | ||||||
|  | @ -70,7 +70,7 @@ class Employee(models.Model): | ||||||
|     keyboard = models.CharField(max_length=2, choices=KEYBOARD_CHOICES.items(), default='DE', verbose_name=_("Tastaturlayout")) |     keyboard = models.CharField(max_length=2, choices=KEYBOARD_CHOICES.items(), default='DE', verbose_name=_("Tastaturlayout")) | ||||||
|     comment = models.TextField(max_length=500, null=True, blank=True, verbose_name=_("zusätzliche IT-Anforderungen")) |     comment = models.TextField(max_length=500, null=True, blank=True, verbose_name=_("zusätzliche IT-Anforderungen")) | ||||||
|     language = models.CharField(max_length=3, choices=LANG_CHOICES.items(), default="GER", verbose_name=_("Sprache")) |     language = models.CharField(max_length=3, choices=LANG_CHOICES.items(), default="GER", verbose_name=_("Sprache")) | ||||||
|     accounts = MultiSelectField(choices=ACCOUNT_CHOICES.items(), null=True, blank=True, verbose_name=_("Zusätzliche Accounts")) |     accounts = MultiSelectField(choices=ACCOUNT_CHOICES.items(), max_length=40, null=True, blank=True, verbose_name=_("Zusätzliche Accounts")) | ||||||
|     lists = models.CharField(max_length=100, null=True, blank=True, verbose_name=_("Zusätzliche Mailinglisten")) |     lists = models.CharField(max_length=100, null=True, blank=True, verbose_name=_("Zusätzliche Mailinglisten")) | ||||||
|     rebu2go = models.BooleanField(verbose_name=_("Rebu2Go-Zugang benötigt?"), default=False) |     rebu2go = models.BooleanField(verbose_name=_("Rebu2Go-Zugang benötigt?"), default=False) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -32,7 +32,7 @@ MAILS = { | ||||||
|                 ], |                 ], | ||||||
|             }, |             }, | ||||||
|             'CENTRAL': { |             'CENTRAL': { | ||||||
|                 'MAIL': 'eileen.miedtank@wikimedia.de', |                 'MAIL': 'anna.noelte@wikimedia.de', | ||||||
|                 'DATA': [ |                 'DATA': [ | ||||||
|                     'department', 'team', 'language', 'mobile', 'rebu2go' |                     'department', 'team', 'language', 'mobile', 'rebu2go' | ||||||
|                 ], |                 ], | ||||||
|  | @ -48,6 +48,11 @@ MAILS = { | ||||||
|                 'DATA': [ |                 'DATA': [ | ||||||
|                     'team', 'department', 'language', |                     'team', 'department', 'language', | ||||||
|                 ] |                 ] | ||||||
|  |             }, | ||||||
|  |             'FINANCE': { | ||||||
|  |                 'MAIL': 'claudia.langrock@wikimedia.de', | ||||||
|  |                 'DATA': [ | ||||||
|  |                     'rebu2go' | ||||||
|  |                 ] | ||||||
|             } |             } | ||||||
| 
 |  | ||||||
|         } |         } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue