diff --git a/README.md b/README.md index 7e6bbd6..009da72 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,63 @@ -# Updates-dashboard +# Updates Dashboard -# Description +## Summary -* Front : Projet Django de consultation/gestion des données -* Ansible : Playbooks ansible de génération des données +This is a tool 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 located in ../ansible in this repo. + +## 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' diff --git a/ansible/2022-08-17.csv b/ansible/2022-08-17.csv deleted file mode 100644 index ed86e8a..0000000 --- a/ansible/2022-08-17.csv +++ /dev/null @@ -1,19 +0,0 @@ -vlearning-db001-tst.infolegale.net;Debian;10;0;5 -app-db001-tst.infolegale.net;Debian;10;0;9 -consults-db001-tst.infolegale.net;Debian;10;0;147 -vador-db001-tst.infolegale.net;Debian;10;0;147 -tlearning-db003-tst.infolegale.net;Ubuntu;18.04;0;308 -transdb-db001-tst.infolegale.net;Debian;10;0;147 -mysql8-db001-tst.infolegale.net;Debian;11;3;119 -mongo-db001-tst.infolegale.net;Ubuntu;20.04;0;28 -orchestrator-mgr001-tst.infolegale.net;Ubuntu;20.04;0;28 -redis5-db001-tst.infolegale.net;Debian;10;0;326 -redis-db001-tst.infolegale.net;Ubuntu;18.04;0;326 -docker-hpv001-tst.infolegale.net;Ubuntu;20.04;0;106 -docker-hpv002-tst.infolegale.net;Ubuntu;20.04;0;398 -docker-hpv004-tst.infolegale.net;Ubuntu;20.04;0;28 -rundeck-sch001-tst.infolegale.net;Debian;10;0;91 -docker-hpv003-tst.infolegale.net;Ubuntu;20.04;0;125 -proxysql-db001-tst.infolegale.net;Ubuntu;20.04;0;475 -docker-hpv005-tst.infolegale.net;Ubuntu;20.04;0;119 -docker-hpv006-tst.infolegale.net;Ubuntu;20.04;0;309 diff --git a/ansible/README.md b/ansible/README.md deleted file mode 100644 index 0215239..0000000 --- a/ansible/README.md +++ /dev/null @@ -1,22 +0,0 @@ -## Name -Playbooks ansible utilisés pour récupérer les informations à intégrer dans l'updates-dashboard. - -## Description -Les playbooks vont récuperer et afficher les informations suivantes sur les machines : -* Main.yml : hostname, distribution, version, update disponible, uptime. -* Packages.yml : hostname, paquet, version. - -La liste des paquets à vérifier se trouve dans le playbook packages.yml. -Un callback particulier est utilisé pour afficher seulement les informations voulues pour construire le csv. - -## Usage - -* Ajouter callback_plugins=./hooks/ à ansible.cfg -``` -export ANSIBLE_STDOUT_CALLBACK="update_dashboard" -DATE=$(date '+%Y-%m-%d') -ansible-playbook -i hosts-tst playbooks/main.yml > $DATE.csv -``` - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg deleted file mode 100644 index 64fe4aa..0000000 --- a/ansible/ansible.cfg +++ /dev/null @@ -1,12 +0,0 @@ -[defaults] -vault_password_file = ~/.vault_password -roles_path = roles -interpreter_python = auto -callback_plugins = ./hooks/ -fact_caching = jsonfile -fact_caching_connection = ~/.cache/ansible/ -deprecation_warnings=False -[hashi_vault_collection] -url = "https://vault.infolegale.net" -token_file = .vault-token -token_validate = None diff --git a/ansible/hooks/__pycache__/update_dashboard.cpython-38.pyc b/ansible/hooks/__pycache__/update_dashboard.cpython-38.pyc deleted file mode 100644 index dac381c..0000000 Binary files a/ansible/hooks/__pycache__/update_dashboard.cpython-38.pyc and /dev/null differ diff --git a/ansible/hooks/update_dashboard.py b/ansible/hooks/update_dashboard.py deleted file mode 100644 index 19e2d7c..0000000 --- a/ansible/hooks/update_dashboard.py +++ /dev/null @@ -1,23 +0,0 @@ -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -from ansible.plugins.callback import CallbackBase - - -class CallbackModule(CallbackBase): - - CALLBACK_VERSION = 2.0 - CALLBACK_TYPE = 'stdout' - CALLBACK_NAME = 'update_dashboard' - - def v2_runner_on_ok(self, result): - if result._task.action == 'debug': - ansible_msg = result._result.get('msg', None) - if ansible_msg: - print(ansible_msg) - - def v2_runner_on_unreachable(self, result): - print("%s;UNREACHABLE" % result._host.get_name()) - - def v2_runner_on_failed(self, result, ignore_errors=False): - print("%s;FAILED" % result._host.get_name()) diff --git a/ansible/hosts-tst b/ansible/hosts-tst deleted file mode 100644 index 860a0a4..0000000 --- a/ansible/hosts-tst +++ /dev/null @@ -1,44 +0,0 @@ -########## -# VARS -########## -[all:vars] -env='tst' -symfony_env="recette" -vmpass='$6$oIJS8mHoKPJVXZIR$fQVPI7.M9/3wD6O.8JS5iYIL6v0tx3BfmiHKIeb/h88yL9R9GYsGJnePK9UEoBZ2F8AfZhwHGRvV3iv9CGChV.' -relayhost='maildump.infolegale.net' -scriptsToSupervise=[['borg-backup.sh','129600']] -graylogapp="graylog-log001-stg.infolegale.net:12201" -cmk_server_ip="10.12.251.1" - -[mysql] -tlearning-db003-tst.infolegale.net -vlearning-db001-tst.infolegale.net -app-db001-tst.infolegale.net -consults-db001-tst.infolegale.net -vador-db001-tst.infolegale.net -transdb-db001-tst.infolegale.net -mysql8-db001-tst.infolegale.net - -[mongo] -mongo-db001-tst.infolegale.net - -[mgr] -orchestrator-mgr001-tst.infolegale.net - -[redis] -redis-db001-tst.infolegale.net -redis5-db001-tst.infolegale.net - -[docker] -docker-hpv001-tst.infolegale.net -docker-hpv002-tst.infolegale.net -docker-hpv003-tst.infolegale.net -docker-hpv004-tst.infolegale.net -docker-hpv005-tst.infolegale.net -docker-hpv006-tst.infolegale.net - -[proxysql] -proxysql-db001-tst.infolegale.net - -[rundeck] -rundeck-sch001-tst.infolegale.net diff --git a/ansible/playbooks/auto-updates-result.yml b/ansible/playbooks/auto-updates-result.yml deleted file mode 100644 index 01fe11d..0000000 --- a/ansible/playbooks/auto-updates-result.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- - -# This is to get the auto-updates script status from log file -# It returns in stat_log: -# - OUT if file older than 40 days -# - ERR if recent but ERROR in file -# - OK if recent and OK in file -# nothing else (main playbook manage it as an UNK status) - -- name: check if there is an auto-updates log file - stat: path="{{ log_dir }}/scripts/auto-updates.log" - register: stat_log - -- name: set error status - set_fact: auto_updates_status=ERR - when: not stat_log.stat.exists - -- name: check if log file is less than 1 month old - shell: "find {{ log_dir }}/scripts/ -name 'auto-updates.log' -mtime -40 | wc -l" - register: date_log - when: stat_log.stat.exists - -- name: set outdated status - set_fact: auto_updates_status=OUT - when: date_log.stdout is defined and date_log.stdout != "1" - -- name: check ok status if recent log file - command: "grep OK {{ log_dir }}/scripts/auto-updates.log" - register: ok_log - failed_when: False - when: date_log.stdout is defined and date_log.stdout == "1" - -- name: set ok status - set_fact: auto_updates_status=OK - when: ok_log.rc is defined and ok_log.rc != 1 - -- name: check error if old log file - command: "grep ERROR {{ log_dir }}/scripts/auto-updates.log" - register: error_log - failed_when: false - when: date_log.stdout is defined and date_log.stdout == "1" - -- name: set error status - set_fact: auto_updates_status=ERR - when: error_log.rc is defined and error_log.rc != 1 - -- name: check running status if recent log file - command: "grep RUNNING {{ log_dir }}/scripts/auto-updates.log" - register: running_log - failed_when: false - when: stat_log.stat.exists - -- name: set error status - set_fact: auto_updates_status=ERR - when: running_log.rc is defined and running_log.rc != 1 diff --git a/ansible/playbooks/main.yml b/ansible/playbooks/main.yml deleted file mode 100644 index bf2f874..0000000 --- a/ansible/playbooks/main.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- - -### -# This playbook aims to retrieve a 'state' of our servers, ie for each server: -# - what is the OS, in which version (we focus on debian / ubuntu and centos) -# - for centos and debian-based distribs, how many available updates are there? -# -# Call it with the callback made for it: callback_plugin=update_dashboard in ansible.cfg -# or after running export ANSIBLE_STDOUT_CALLBACK="update_dashboard" -# also: callback_plugins = ./hooks/callback:/usr/share/ansible_plugins/callback_plugins -### - -- hosts: "all" - - strategy: free - - tasks: - - # - ## All hosts ## - # - - - name: get uptime - shell: uptime=$(uptime | grep -o "[0-9][0-9]* days" | awk '{ print $1 }'); if [ "$uptime" ]; then echo $uptime; else echo 0; fi - register: uptime - changed_when: False - tags: - - skip_ansible_lint - - # get number of updates and debug - - name: (debian) update apt cache if older than 1 day - apt: update_cache=yes cache_valid_time=86400 - register: update_cache_result - ignore_errors: yes - - - name: (debian) check available updates on debian systems - shell: apt-get --dry-run dist-upgrade | grep '^Inst' | wc -l warn=no - register: available_updates - when: update_cache_result is succeeded - - - name: (Debian) output - debug: msg="{{ inventory_hostname }};{{ ansible_distribution }};{{ ansible_distribution_major_version }};{{ available_updates.stdout | default('') }};{{ uptime.stdout }}" - when: ansible_distribution == "Debian" - - - name: (Ubuntu) output - debug: msg="{{ inventory_hostname }};{{ ansible_distribution }};{{ ansible_distribution_version }};{{ available_updates.stdout | default('') }};{{ uptime.stdout }}" - when: ansible_distribution == "Ubuntu" diff --git a/ansible/playbooks/packages.yml b/ansible/playbooks/packages.yml deleted file mode 100644 index d6e3c53..0000000 --- a/ansible/playbooks/packages.yml +++ /dev/null @@ -1,68 +0,0 @@ ---- - -- hosts: all - - strategy: free - - vars: - - packages : - - apt - - apache2 - - bash - - check-mk-agent - - elasticsearch - - libc-bin - - make - - mysql-server - - nginx - - openssh-server - - php5 - - php7.0 - - php7.1 - - php7.2 - - php7.4 - - postfix - - proxysql - - redis - - redis-server - - sphinxsearch - - sudo - - systemd - - tasks: - - # Loop on package list to get versions - - - name: Check packages lists - include: packages_include.yml package="{{ item }}" - with_items: - - "{{ packages }}" - - - # Get the RUNNING kernel - - ## Debian - - - when: ansible_distribution == "Debian" and ansible_distribution_major_version|int >= 7 - block: - - - name: (Debian) get kernel version - shell: uname -v | awk '{ print $4 }' - register: kernel_version_debian - changed_when: false - - - name: (Debian) Kernel output - debug: msg="{{ inventory_hostname }};kernel;{{ kernel_version_debian.stdout }}" - - ## Ubuntu - - - when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 16 - block: - - - name: (Ubuntu) get kernel version - shell: uname -r - register: kernel_version_ubuntu - changed_when: false - - - name: (ubuntu) Kernel output - debug: msg="{{ inventory_hostname }};kernel;{{ kernel_version_ubuntu.stdout }}" diff --git a/ansible/playbooks/packages_include.yml b/ansible/playbooks/packages_include.yml deleted file mode 100644 index 24317d1..0000000 --- a/ansible/playbooks/packages_include.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - -- name: check package version - shell: dpkg -l | awk '$2=="{{ package }}" { print $3 }' - register: package_version_debian - changed_when: false - -- name: output - debug: msg="{{ inventory_hostname }};{{ package }};{{ package_version_debian.stdout }}" - when: package_version_debian.stdout != "" diff --git a/front/dashboard/__init__.py b/dashboard/__init__.py similarity index 100% rename from front/dashboard/__init__.py rename to dashboard/__init__.py diff --git a/front/dashboard/admin.py b/dashboard/admin.py similarity index 100% rename from front/dashboard/admin.py rename to dashboard/admin.py diff --git a/front/dashboard/apps.py b/dashboard/apps.py similarity index 100% rename from front/dashboard/apps.py rename to dashboard/apps.py diff --git a/front/dashboard/fixtures/os.yaml b/dashboard/fixtures/os.yaml similarity index 100% rename from front/dashboard/fixtures/os.yaml rename to dashboard/fixtures/os.yaml diff --git a/front/dashboard/fixtures/teams.yaml b/dashboard/fixtures/teams.yaml similarity index 100% rename from front/dashboard/fixtures/teams.yaml rename to dashboard/fixtures/teams.yaml diff --git a/front/dashboard/models.py b/dashboard/models.py similarity index 100% rename from front/dashboard/models.py rename to dashboard/models.py diff --git a/front/dashboard/module.py b/dashboard/module.py similarity index 100% rename from front/dashboard/module.py rename to dashboard/module.py diff --git a/front/dashboard/static/css/bootstrap-rtl.css b/dashboard/static/css/bootstrap-rtl.css similarity index 100% rename from front/dashboard/static/css/bootstrap-rtl.css rename to dashboard/static/css/bootstrap-rtl.css diff --git a/front/dashboard/static/css/bootstrap-rtl.min.css b/dashboard/static/css/bootstrap-rtl.min.css similarity index 100% rename from front/dashboard/static/css/bootstrap-rtl.min.css rename to dashboard/static/css/bootstrap-rtl.min.css diff --git a/front/dashboard/static/css/bootstrap.css b/dashboard/static/css/bootstrap.css similarity index 100% rename from front/dashboard/static/css/bootstrap.css rename to dashboard/static/css/bootstrap.css diff --git a/front/dashboard/static/css/bootstrap.min.css b/dashboard/static/css/bootstrap.min.css similarity index 100% rename from front/dashboard/static/css/bootstrap.min.css rename to dashboard/static/css/bootstrap.min.css diff --git a/front/dashboard/static/css/custom.css b/dashboard/static/css/custom.css similarity index 100% rename from front/dashboard/static/css/custom.css rename to dashboard/static/css/custom.css diff --git a/front/dashboard/static/css/datatables.min.css b/dashboard/static/css/datatables.min.css similarity index 100% rename from front/dashboard/static/css/datatables.min.css rename to dashboard/static/css/datatables.min.css diff --git a/front/dashboard/static/css/plugins/morris.css b/dashboard/static/css/plugins/morris.css similarity index 100% rename from front/dashboard/static/css/plugins/morris.css rename to dashboard/static/css/plugins/morris.css diff --git a/front/dashboard/static/css/sb-admin-rtl.css b/dashboard/static/css/sb-admin-rtl.css similarity index 100% rename from front/dashboard/static/css/sb-admin-rtl.css rename to dashboard/static/css/sb-admin-rtl.css diff --git a/front/dashboard/static/css/sb-admin.css b/dashboard/static/css/sb-admin.css similarity index 100% rename from front/dashboard/static/css/sb-admin.css rename to dashboard/static/css/sb-admin.css diff --git a/front/dashboard/static/font-awesome/css/font-awesome.css b/dashboard/static/font-awesome/css/font-awesome.css similarity index 100% rename from front/dashboard/static/font-awesome/css/font-awesome.css rename to dashboard/static/font-awesome/css/font-awesome.css diff --git a/front/dashboard/static/font-awesome/css/font-awesome.min.css b/dashboard/static/font-awesome/css/font-awesome.min.css similarity index 100% rename from front/dashboard/static/font-awesome/css/font-awesome.min.css rename to dashboard/static/font-awesome/css/font-awesome.min.css diff --git a/front/dashboard/static/font-awesome/fonts/FontAwesome.otf b/dashboard/static/font-awesome/fonts/FontAwesome.otf similarity index 100% rename from front/dashboard/static/font-awesome/fonts/FontAwesome.otf rename to dashboard/static/font-awesome/fonts/FontAwesome.otf diff --git a/front/dashboard/static/font-awesome/fonts/fontawesome-webfont.eot b/dashboard/static/font-awesome/fonts/fontawesome-webfont.eot similarity index 100% rename from front/dashboard/static/font-awesome/fonts/fontawesome-webfont.eot rename to dashboard/static/font-awesome/fonts/fontawesome-webfont.eot diff --git a/front/dashboard/static/font-awesome/fonts/fontawesome-webfont.svg b/dashboard/static/font-awesome/fonts/fontawesome-webfont.svg similarity index 100% rename from front/dashboard/static/font-awesome/fonts/fontawesome-webfont.svg rename to dashboard/static/font-awesome/fonts/fontawesome-webfont.svg diff --git a/front/dashboard/static/font-awesome/fonts/fontawesome-webfont.ttf b/dashboard/static/font-awesome/fonts/fontawesome-webfont.ttf similarity index 100% rename from front/dashboard/static/font-awesome/fonts/fontawesome-webfont.ttf rename to dashboard/static/font-awesome/fonts/fontawesome-webfont.ttf diff --git a/front/dashboard/static/font-awesome/fonts/fontawesome-webfont.woff b/dashboard/static/font-awesome/fonts/fontawesome-webfont.woff similarity index 100% rename from front/dashboard/static/font-awesome/fonts/fontawesome-webfont.woff rename to dashboard/static/font-awesome/fonts/fontawesome-webfont.woff diff --git a/front/dashboard/static/font-awesome/less/bordered-pulled.less b/dashboard/static/font-awesome/less/bordered-pulled.less similarity index 100% rename from front/dashboard/static/font-awesome/less/bordered-pulled.less rename to dashboard/static/font-awesome/less/bordered-pulled.less diff --git a/front/dashboard/static/font-awesome/less/core.less b/dashboard/static/font-awesome/less/core.less similarity index 100% rename from front/dashboard/static/font-awesome/less/core.less rename to dashboard/static/font-awesome/less/core.less diff --git a/front/dashboard/static/font-awesome/less/fixed-width.less b/dashboard/static/font-awesome/less/fixed-width.less similarity index 100% rename from front/dashboard/static/font-awesome/less/fixed-width.less rename to dashboard/static/font-awesome/less/fixed-width.less diff --git a/front/dashboard/static/font-awesome/less/font-awesome.less b/dashboard/static/font-awesome/less/font-awesome.less similarity index 100% rename from front/dashboard/static/font-awesome/less/font-awesome.less rename to dashboard/static/font-awesome/less/font-awesome.less diff --git a/front/dashboard/static/font-awesome/less/icons.less b/dashboard/static/font-awesome/less/icons.less similarity index 100% rename from front/dashboard/static/font-awesome/less/icons.less rename to dashboard/static/font-awesome/less/icons.less diff --git a/front/dashboard/static/font-awesome/less/larger.less b/dashboard/static/font-awesome/less/larger.less similarity index 100% rename from front/dashboard/static/font-awesome/less/larger.less rename to dashboard/static/font-awesome/less/larger.less diff --git a/front/dashboard/static/font-awesome/less/list.less b/dashboard/static/font-awesome/less/list.less similarity index 100% rename from front/dashboard/static/font-awesome/less/list.less rename to dashboard/static/font-awesome/less/list.less diff --git a/front/dashboard/static/font-awesome/less/mixins.less b/dashboard/static/font-awesome/less/mixins.less similarity index 100% rename from front/dashboard/static/font-awesome/less/mixins.less rename to dashboard/static/font-awesome/less/mixins.less diff --git a/front/dashboard/static/font-awesome/less/path.less b/dashboard/static/font-awesome/less/path.less similarity index 100% rename from front/dashboard/static/font-awesome/less/path.less rename to dashboard/static/font-awesome/less/path.less diff --git a/front/dashboard/static/font-awesome/less/rotated-flipped.less b/dashboard/static/font-awesome/less/rotated-flipped.less similarity index 100% rename from front/dashboard/static/font-awesome/less/rotated-flipped.less rename to dashboard/static/font-awesome/less/rotated-flipped.less diff --git a/front/dashboard/static/font-awesome/less/spinning.less b/dashboard/static/font-awesome/less/spinning.less similarity index 100% rename from front/dashboard/static/font-awesome/less/spinning.less rename to dashboard/static/font-awesome/less/spinning.less diff --git a/front/dashboard/static/font-awesome/less/stacked.less b/dashboard/static/font-awesome/less/stacked.less similarity index 100% rename from front/dashboard/static/font-awesome/less/stacked.less rename to dashboard/static/font-awesome/less/stacked.less diff --git a/front/dashboard/static/font-awesome/less/variables.less b/dashboard/static/font-awesome/less/variables.less similarity index 100% rename from front/dashboard/static/font-awesome/less/variables.less rename to dashboard/static/font-awesome/less/variables.less diff --git a/front/dashboard/static/font-awesome/scss/_bordered-pulled.scss b/dashboard/static/font-awesome/scss/_bordered-pulled.scss similarity index 100% rename from front/dashboard/static/font-awesome/scss/_bordered-pulled.scss rename to dashboard/static/font-awesome/scss/_bordered-pulled.scss diff --git a/front/dashboard/static/font-awesome/scss/_core.scss b/dashboard/static/font-awesome/scss/_core.scss similarity index 100% rename from front/dashboard/static/font-awesome/scss/_core.scss rename to dashboard/static/font-awesome/scss/_core.scss diff --git a/front/dashboard/static/font-awesome/scss/_fixed-width.scss b/dashboard/static/font-awesome/scss/_fixed-width.scss similarity index 100% rename from front/dashboard/static/font-awesome/scss/_fixed-width.scss rename to dashboard/static/font-awesome/scss/_fixed-width.scss diff --git a/front/dashboard/static/font-awesome/scss/_icons.scss b/dashboard/static/font-awesome/scss/_icons.scss similarity index 100% rename from front/dashboard/static/font-awesome/scss/_icons.scss rename to dashboard/static/font-awesome/scss/_icons.scss diff --git a/front/dashboard/static/font-awesome/scss/_larger.scss b/dashboard/static/font-awesome/scss/_larger.scss similarity index 100% rename from front/dashboard/static/font-awesome/scss/_larger.scss rename to dashboard/static/font-awesome/scss/_larger.scss diff --git a/front/dashboard/static/font-awesome/scss/_list.scss b/dashboard/static/font-awesome/scss/_list.scss similarity index 100% rename from front/dashboard/static/font-awesome/scss/_list.scss rename to dashboard/static/font-awesome/scss/_list.scss diff --git a/front/dashboard/static/font-awesome/scss/_mixins.scss b/dashboard/static/font-awesome/scss/_mixins.scss similarity index 100% rename from front/dashboard/static/font-awesome/scss/_mixins.scss rename to dashboard/static/font-awesome/scss/_mixins.scss diff --git a/front/dashboard/static/font-awesome/scss/_path.scss b/dashboard/static/font-awesome/scss/_path.scss similarity index 100% rename from front/dashboard/static/font-awesome/scss/_path.scss rename to dashboard/static/font-awesome/scss/_path.scss diff --git a/front/dashboard/static/font-awesome/scss/_rotated-flipped.scss b/dashboard/static/font-awesome/scss/_rotated-flipped.scss similarity index 100% rename from front/dashboard/static/font-awesome/scss/_rotated-flipped.scss rename to dashboard/static/font-awesome/scss/_rotated-flipped.scss diff --git a/front/dashboard/static/font-awesome/scss/_spinning.scss b/dashboard/static/font-awesome/scss/_spinning.scss similarity index 100% rename from front/dashboard/static/font-awesome/scss/_spinning.scss rename to dashboard/static/font-awesome/scss/_spinning.scss diff --git a/front/dashboard/static/font-awesome/scss/_stacked.scss b/dashboard/static/font-awesome/scss/_stacked.scss similarity index 100% rename from front/dashboard/static/font-awesome/scss/_stacked.scss rename to dashboard/static/font-awesome/scss/_stacked.scss diff --git a/front/dashboard/static/font-awesome/scss/_variables.scss b/dashboard/static/font-awesome/scss/_variables.scss similarity index 100% rename from front/dashboard/static/font-awesome/scss/_variables.scss rename to dashboard/static/font-awesome/scss/_variables.scss diff --git a/front/dashboard/static/font-awesome/scss/font-awesome.scss b/dashboard/static/font-awesome/scss/font-awesome.scss similarity index 100% rename from front/dashboard/static/font-awesome/scss/font-awesome.scss rename to dashboard/static/font-awesome/scss/font-awesome.scss diff --git a/front/dashboard/static/fonts/glyphicons-halflings-regular.eot b/dashboard/static/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from front/dashboard/static/fonts/glyphicons-halflings-regular.eot rename to dashboard/static/fonts/glyphicons-halflings-regular.eot diff --git a/front/dashboard/static/fonts/glyphicons-halflings-regular.svg b/dashboard/static/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from front/dashboard/static/fonts/glyphicons-halflings-regular.svg rename to dashboard/static/fonts/glyphicons-halflings-regular.svg diff --git a/front/dashboard/static/fonts/glyphicons-halflings-regular.ttf b/dashboard/static/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from front/dashboard/static/fonts/glyphicons-halflings-regular.ttf rename to dashboard/static/fonts/glyphicons-halflings-regular.ttf diff --git a/front/dashboard/static/fonts/glyphicons-halflings-regular.woff b/dashboard/static/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from front/dashboard/static/fonts/glyphicons-halflings-regular.woff rename to dashboard/static/fonts/glyphicons-halflings-regular.woff diff --git a/front/dashboard/static/fonts/glyphicons-halflings-regular.woff2 b/dashboard/static/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from front/dashboard/static/fonts/glyphicons-halflings-regular.woff2 rename to dashboard/static/fonts/glyphicons-halflings-regular.woff2 diff --git a/front/dashboard/static/images/favicon.ico b/dashboard/static/images/favicon.ico similarity index 100% rename from front/dashboard/static/images/favicon.ico rename to dashboard/static/images/favicon.ico diff --git a/front/dashboard/static/js/bootstrap.js b/dashboard/static/js/bootstrap.js similarity index 100% rename from front/dashboard/static/js/bootstrap.js rename to dashboard/static/js/bootstrap.js diff --git a/front/dashboard/static/js/bootstrap.min.js b/dashboard/static/js/bootstrap.min.js similarity index 100% rename from front/dashboard/static/js/bootstrap.min.js rename to dashboard/static/js/bootstrap.min.js diff --git a/front/dashboard/static/js/datatables.min.js b/dashboard/static/js/datatables.min.js similarity index 100% rename from front/dashboard/static/js/datatables.min.js rename to dashboard/static/js/datatables.min.js diff --git a/front/dashboard/static/js/html-to-csv.js b/dashboard/static/js/html-to-csv.js similarity index 100% rename from front/dashboard/static/js/html-to-csv.js rename to dashboard/static/js/html-to-csv.js diff --git a/front/dashboard/static/js/jquery.js b/dashboard/static/js/jquery.js similarity index 100% rename from front/dashboard/static/js/jquery.js rename to dashboard/static/js/jquery.js diff --git a/front/dashboard/static/js/plugins/flot/excanvas.min.js b/dashboard/static/js/plugins/flot/excanvas.min.js similarity index 100% rename from front/dashboard/static/js/plugins/flot/excanvas.min.js rename to dashboard/static/js/plugins/flot/excanvas.min.js diff --git a/front/dashboard/static/js/plugins/flot/flot-data.js b/dashboard/static/js/plugins/flot/flot-data.js similarity index 100% rename from front/dashboard/static/js/plugins/flot/flot-data.js rename to dashboard/static/js/plugins/flot/flot-data.js diff --git a/front/dashboard/static/js/plugins/flot/jquery.flot.js b/dashboard/static/js/plugins/flot/jquery.flot.js similarity index 100% rename from front/dashboard/static/js/plugins/flot/jquery.flot.js rename to dashboard/static/js/plugins/flot/jquery.flot.js diff --git a/front/dashboard/static/js/plugins/flot/jquery.flot.pie.js b/dashboard/static/js/plugins/flot/jquery.flot.pie.js similarity index 100% rename from front/dashboard/static/js/plugins/flot/jquery.flot.pie.js rename to dashboard/static/js/plugins/flot/jquery.flot.pie.js diff --git a/front/dashboard/static/js/plugins/flot/jquery.flot.resize.js b/dashboard/static/js/plugins/flot/jquery.flot.resize.js similarity index 100% rename from front/dashboard/static/js/plugins/flot/jquery.flot.resize.js rename to dashboard/static/js/plugins/flot/jquery.flot.resize.js diff --git a/front/dashboard/static/js/plugins/flot/jquery.flot.tooltip.min.js b/dashboard/static/js/plugins/flot/jquery.flot.tooltip.min.js similarity index 100% rename from front/dashboard/static/js/plugins/flot/jquery.flot.tooltip.min.js rename to dashboard/static/js/plugins/flot/jquery.flot.tooltip.min.js diff --git a/front/dashboard/static/js/plugins/morris/morris-data.js b/dashboard/static/js/plugins/morris/morris-data.js similarity index 100% rename from front/dashboard/static/js/plugins/morris/morris-data.js rename to dashboard/static/js/plugins/morris/morris-data.js diff --git a/front/dashboard/static/js/plugins/morris/morris.js b/dashboard/static/js/plugins/morris/morris.js similarity index 100% rename from front/dashboard/static/js/plugins/morris/morris.js rename to dashboard/static/js/plugins/morris/morris.js diff --git a/front/dashboard/static/js/plugins/morris/morris.min.js b/dashboard/static/js/plugins/morris/morris.min.js similarity index 100% rename from front/dashboard/static/js/plugins/morris/morris.min.js rename to dashboard/static/js/plugins/morris/morris.min.js diff --git a/front/dashboard/static/js/plugins/morris/raphael.min.js b/dashboard/static/js/plugins/morris/raphael.min.js similarity index 100% rename from front/dashboard/static/js/plugins/morris/raphael.min.js rename to dashboard/static/js/plugins/morris/raphael.min.js diff --git a/front/dashboard/templates/404.html b/dashboard/templates/404.html similarity index 100% rename from front/dashboard/templates/404.html rename to dashboard/templates/404.html diff --git a/front/dashboard/templates/generic.html b/dashboard/templates/generic.html similarity index 100% rename from front/dashboard/templates/generic.html rename to dashboard/templates/generic.html diff --git a/front/dashboard/templates/history.html b/dashboard/templates/history.html similarity index 100% rename from front/dashboard/templates/history.html rename to dashboard/templates/history.html diff --git a/front/dashboard/templates/index.html b/dashboard/templates/index.html similarity index 100% rename from front/dashboard/templates/index.html rename to dashboard/templates/index.html diff --git a/front/dashboard/templates/manage-packages.html b/dashboard/templates/manage-packages.html similarity index 100% rename from front/dashboard/templates/manage-packages.html rename to dashboard/templates/manage-packages.html diff --git a/front/dashboard/templates/manage.html b/dashboard/templates/manage.html similarity index 100% rename from front/dashboard/templates/manage.html rename to dashboard/templates/manage.html diff --git a/front/dashboard/templates/os-statistics.html b/dashboard/templates/os-statistics.html similarity index 100% rename from front/dashboard/templates/os-statistics.html rename to dashboard/templates/os-statistics.html diff --git a/front/dashboard/templates/packages-list.html b/dashboard/templates/packages-list.html similarity index 100% rename from front/dashboard/templates/packages-list.html rename to dashboard/templates/packages-list.html diff --git a/front/dashboard/templates/packages.html b/dashboard/templates/packages.html similarity index 100% rename from front/dashboard/templates/packages.html rename to dashboard/templates/packages.html diff --git a/front/dashboard/templates/registration/login.html b/dashboard/templates/registration/login.html similarity index 100% rename from front/dashboard/templates/registration/login.html rename to dashboard/templates/registration/login.html diff --git a/front/dashboard/templates/server-list.html b/dashboard/templates/server-list.html similarity index 100% rename from front/dashboard/templates/server-list.html rename to dashboard/templates/server-list.html diff --git a/front/dashboard/templates/squeleton.html b/dashboard/templates/squeleton.html similarity index 100% rename from front/dashboard/templates/squeleton.html rename to dashboard/templates/squeleton.html diff --git a/front/dashboard/tests.py b/dashboard/tests.py similarity index 100% rename from front/dashboard/tests.py rename to dashboard/tests.py diff --git a/front/dashboard/urls.py b/dashboard/urls.py similarity index 100% rename from front/dashboard/urls.py rename to dashboard/urls.py diff --git a/front/dashboard/views.py b/dashboard/views.py similarity index 100% rename from front/dashboard/views.py rename to dashboard/views.py diff --git a/front/defaults/gunicorn.service b/defaults/gunicorn.service similarity index 100% rename from front/defaults/gunicorn.service rename to defaults/gunicorn.service diff --git a/front/defaults/settings_local.py b/defaults/settings_local.py similarity index 100% rename from front/defaults/settings_local.py rename to defaults/settings_local.py diff --git a/front/defaults/updates-dashboard.conf b/defaults/updates-dashboard.conf similarity index 100% rename from front/defaults/updates-dashboard.conf rename to defaults/updates-dashboard.conf diff --git a/front/README.md b/front/README.md deleted file mode 100644 index 009da72..0000000 --- a/front/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Updates Dashboard - -## Summary - -This is a tool 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 located in ../ansible in this repo. - -## 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' diff --git a/front/manage.py b/manage.py similarity index 100% rename from front/manage.py rename to manage.py diff --git a/front/requirements.txt b/requirements.txt similarity index 100% rename from front/requirements.txt rename to requirements.txt diff --git a/front/updatesdashboard/__init__.py b/updatesdashboard/__init__.py similarity index 100% rename from front/updatesdashboard/__init__.py rename to updatesdashboard/__init__.py diff --git a/front/updatesdashboard/settings.py b/updatesdashboard/settings.py similarity index 100% rename from front/updatesdashboard/settings.py rename to updatesdashboard/settings.py diff --git a/front/updatesdashboard/urls.py b/updatesdashboard/urls.py similarity index 100% rename from front/updatesdashboard/urls.py rename to updatesdashboard/urls.py diff --git a/front/updatesdashboard/wsgi.py b/updatesdashboard/wsgi.py similarity index 100% rename from front/updatesdashboard/wsgi.py rename to updatesdashboard/wsgi.py