app | ||
etc | ||
.flaskenv | ||
.gitignore | ||
installmgr.py | ||
README.md | ||
requirements.txt |
InstallMgr
Mini-app Flask remplaçant les CGI scripts de scodoc.iutv
.
API
-
last_stable_version : numéro de la dernière release "officielle"
-
upload_dump : réception (POST) d'un fichier de dump
-
version?mode=${mode}&release=${SCODOC_RELEASE}&sn=${SN}" mode = install | upgrade release = current client release sn = client serial number returns: serial number
Installation
- Créer un utilisateur
adduser installmgr
- Cloner le dépot
cd /opt git clone https://scodoc.org/git/viennet/installmgr.git chown -R installmgr installmgr
- Créer l'environnement
su - installmgr cd /opt/installmgr python3 -m venv venv source venv/bin/activate pip install wheel pip install -r requirements.txt
- Créer les répertoires
mkdir incoming_dumps
et éventuellement:
echo 1000 > counter
- Configurer nginx
location /scodoc-installmgr { # forward application requests to the gunicorn server proxy_pass http://localhost:8010; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_connect_timeout 120; client_max_body_size 100m; }
- Installer le service
cp etc/installmgr.service /etc/systemd/system/ systemctl daemon-reload systemctl start installmgr
- Tester
Depuis un client extérieur,
http https://scodoc.org/scodoc-installmgr/last_stable_version