Sebastien Laithier 70f2fdea55 Updating README
2022-08-18 10:58:18 +02:00

64 lines
2.2 KiB
Markdown

# Updates Dashboard
## Summary
This is a tool to have a clear view of the which servers are outdated, and keep trace of the updates.
## Technical information
It runs with Django. The information are daily generated by an ansible playbook, which is not located in this repo (infrastructure/updates-dashboard-ansible).
## Install
Dependencies in case of Debian 10.
```
apt install python3-venv libmariadb-dev-compat libmariadb-dev mariadb-client python3-dev gcc
```
Following procedure to install the apps.
```
useradd -d /var/www/updates-dashboard/ -g www-data -M -s /bin/false www-updash
cd /var/www/
git clone git@gitlab.infolegale.net:infrastructure/updates-dashboard.git updates-dashboard
chown -R www-updash:www-data updates-dashboard
touch /var/log/gunicorn.log
chown www-updash:www-data /var/log/gunicorn.log
cd updates-dashboard
python3 -m venv updash-venv
source updash-venv/bin/activate
(updash-venv) pip install -r requirements.txt
cp defaults/settings_local.py updatesdashboard/
cp defaults/gunicorn.service /etc/systemd/system/
cp defaults/updates-dashboard.conf /etc/nginx/sites-available
cd /etc/nginx/sites-enabled
ln -s /etc/nginx/sites-avaiable/updates-dashboard.conf .
```
* Set `settings_local.py` with correct values
* Set `gunicorn.service` with correct values
* Set `updates-dashboard.conf` with correct values
```shell
systemctl daemon-reload
systemctl enable gunicorn.service
nginx -t
systemctl reload nginx
```
To initialize the project:
```shell
(updash-venv) ./manage.py makemigrations
(updash-venv) ./manage.py makemigrations dashboard
(updash-venv) ./manage.py collectstatic
(updash-venv) ./manage.py migrate
(updash-venv) ./manage.py loaddata dashboard/fixtures/os.yaml
(updash-venv) ./manage.py loaddata dashboard/fixtures/teams.yaml
```
Vérifier les flux de mise à jour des données. Ansible->Dashboard
Vérifier le sql mode de la base de données
```shell
set @@global.sql_mode='NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
```
## TODO
* playbook to install via ansible ?
* playbook to update via ansible ?
* buttons should be 'previous / next results' instead of 'previous / next day'