# Project name
SEBN Taskbar Manager
## Description
Administration panel for SEBN Taskbar Client.
## Department
PIT
## Maintainer
Mykyta Nehrych
## Website
http://terdvp0001.sebn.com/sebn-taskbar-manager/
## Type
Internal Software
## Icon
faTableCellsLarge
### Major technologies
- [Django](https://www.djangoproject.com/)
- [Python](https://www.python.org/)
- [Poetry](https://python-poetry.org/) as dependency management tool
- [Mypy](https://mypy.readthedocs.io/en/stable/) as static type checker for Python
### Getting Started
1. Install dev requirements with poetry with `poetry install --with dev-environment`. Add `virtualenvs.in-project = true` in `%appdata%\pypoetry\config.toml` for creating .venv folder inside project.
Install [gettext](https://www.gnu.org/software/gettext/) for compiling binary translation files manually or restart development container.
Update message files: `django-admin makemessages --all` or `django-admin makemessages -l uk_UA`
Compile binaries: `django-admin compilemessages -i .venv`
2. Build dev image:
`docker compose -f development.yml --env-file .env.development build`
3. Run dev:
`docker compose -f development.yml --env-file .env.development up`
*Attach debugger to remote process at port:*\
8001 - backend\
8002 - celery task-queue\
8003 - telegram-bot
4. Build prod:
`docker compose -f build.yml --env-file .env.build build --no-cache`
5. Run prod:
`docker compose -f production.yml --env-file .env.production up`
Also must be runned proxy, sebn-db and rabbitmq services for correct testing.
###### .env file (.env.development and .env.production)
```INI
ADMIN=
CELERY_BROKER=amqp://[RABBITMQ_DEFAULT_USER]:[RABBITMQ_DEFAULT_PASS]@celery:5672 # or leave empty for built-in redis usage
COMPOSE_FILE=
DATA_ACQUISITION_URL=http://*.*.*.*/
EMAIL_HOST=
EMAIL_PORT=
LANG=
LDAP_ADMINS=
LDAP_BASE=
LDAP_DOMAIN=
LDAP_USERNAME=
LDAP_PASSWORD=
LDAP_HOST=
LDAP_PORT=
MYSQL_DATABASE=
MYSQL_HOST=
MYSQL_PASSWORD=
MYSQL_PORT=
MYSQL_ROOT_PASSWORD=
MYSQL_USER=
RABBITMQ_DEFAULT_PASS=[.env.development only]
RABBITMQ_DEFAULT_USER=[.env.development only]
SECRET_KEY=
SERVER_EMAIL=
TELEGRAM_BOT_TOKEN=[]
TZ=
```
###### Models json configurations
Sysaid client configuration:
```JSON
{
"impact": {
"data": {
"1": "... continues",
"2": "... limited",
"3": "... impossible"
},
"default": "1"
},
"urgency": {
"data": {
"1": "... high",
"2": "... medium",
"3": "... low"
},
"default": "2"
}
}
```
---
Sysaid backend configuration:
```JSON
{
"cookie": "communityUserName=...;communityUserHash=...",
"server": "https://...:8443/",
"locations": {
"LOCATION1": "1",
"LOCATION2": "2",
"LOCATION3": "3"
},
"request_user": "...",
"response_id_regex": " | "
}
```
---
Redmine client configuration:
```JSON
{
"priority": {
"data": {
"1": "priority text",
"2": "...",
"3": "...",
"4": "...",
"5": "..."
},
"default": "2"
},
"statuses_to_change": {
"close": {
"label": "Close...",
"status_id": "1"
}
}
}
```
---
Redmine backend configuration:
```JSON
{
"api-key": "",
"api-url": "http://hostname/redmine/"
}
```
---
Helpdesk department model configuration:
```JSON
{
"redmine": {
"identifier": "..."
},
"telegram": {
"chat_id": -100xxxxxxxxxx
}
}
```
*send telegram message to category chat_id, if not exist to department chat_id*
---
Category model configuration:
```JSON
{
"redmine": {
"project_id": "000"
},
"telegram": {
"chat_id": -100xxxxxxxxxx
}
}
```
---
###### Nginx configuration:
```Bash
# sebn-taskbar-manager http
location /sebn-taskbar-manager/ {
set $service sebn-taskbar-manager-http;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://$service;
client_max_body_size 500m;
}
# sebn-taskbar-manager websockets
location /sebn-taskbar-manager/ws/ {
set $service sebn-taskbar-manager-ws;
proxy_pass http://$service;
proxy_read_timeout 60s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
```