installmgr/README.md

74 lines
1.6 KiB
Markdown
Raw Normal View History

2021-09-18 17:38:52 +02:00
# InstallMgr
2021-09-18 22:36:55 +02:00
Mini-app Flask remplaçant les CGI scripts de `scodoc.iutv`.
2021-09-18 17:38:52 +02:00
## 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
2021-10-14 10:51:13 +02:00
## Installation
1. Créer un utilisateur
2024-05-13 15:48:40 +02:00
```bash
adduser installmgr
```
2021-10-14 10:51:13 +02:00
2. Cloner le dépot
2024-05-13 15:48:40 +02:00
```bash
git clone https://scodoc.org/git/ScoDoc/installmgr.git /opt/installmgr
chown -R installmgr:installmgr /opt/installmgr
```
2021-10-14 10:51:13 +02:00
3. Créer l'environnement
2024-05-13 15:48:40 +02:00
```bash
su - installmgr
cd /opt/installmgr
python3 -m venv venv
source venv/bin/activate
pip install wheel
pip install -r requirements.txt
```
2021-10-14 10:51:13 +02:00
4. Créer les répertoires
2024-05-13 15:48:40 +02:00
```bash
mkdir incoming_dumps
# et éventuellement:
echo 1000 > counter
```
2021-10-14 10:51:13 +02:00
5. Configurer nginx
2024-05-13 15:48:40 +02:00
```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;
}
```
2021-10-14 10:51:13 +02:00
6. Installer le service
2024-05-13 15:48:40 +02:00
```bash
cp etc/installmgr.service /etc/systemd/system/
systemctl daemon-reload
systemctl start installmgr
```
2021-10-14 10:51:13 +02:00
7. Tester
Depuis un client extérieur,
2024-05-13 15:48:40 +02:00
```bash
http https://scodoc.org/scodoc-installmgr/last_stable_version
```