doc install

This commit is contained in:
Emmanuel Viennet 2021-10-14 10:51:13 +02:00
parent 2de03687f6
commit 3689bf1db5
3 changed files with 58 additions and 3 deletions

View File

@ -14,3 +14,58 @@ Mini-app Flask remplaçant les CGI scripts de `scodoc.iutv`.
sn = client serial number sn = client serial number
returns: serial number returns: serial number
## Installation
1. Créer un utilisateur
adduser installmgr
2. Cloner le dépot
cd /opt
git clone https://scodoc.org/git/viennet/installmgr.git
chown -R installmgr installmgr
3. 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
4. Créer les répertoires
mkdir incoming_dumps
# et éventuellement:
echo 1000 > counter
5. 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;
}
6. Installer le service
cp etc/installmgr.service /etc/systemd/system/
systemctl daemon-reload
systemctl start installmgr
7. Tester
Depuis un client extérieur,
http https://scodoc.org/scodoc-installmgr/last_stable_version

View File

@ -22,7 +22,7 @@ DEBUG = False # if false, don't publish error messages
@bp.route("/scodoc-installmgr/last_stable_version") @bp.route("/scodoc-installmgr/last_stable_version")
def last_stable_version(): def last_stable_version():
# LAST_RELEASE_TAG=$(curl "$GITEA_RELEASE_URL" | jq ".[].tag_name" | tr -d -c "0-9.\n" | sort --version-sort | tail -1) # LAST_RELEASE_TAG=$(curl "$GITEA_RELEASE_URL" | jq ".[].tag_name" | tr -d -c "0-9.\n" | sort --version-sort | tail -1)
return "9.0.30" return "9.0.51"
@bp.route("/scodoc-installmgr/upload-dump", methods=["POST"]) @bp.route("/scodoc-installmgr/upload-dump", methods=["POST"])

View File

@ -15,8 +15,8 @@ After=network.target
#StartLimitIntervalSec=0 #StartLimitIntervalSec=0
[Service] [Service]
User=scodoc User=installmgr
Group=scodoc Group=installmgr
WorkingDirectory=/opt/installmgr WorkingDirectory=/opt/installmgr
Environment=FLASK_RUN_PORT=5010 Environment=FLASK_RUN_PORT=5010
ExecStart=/opt/installmgr/venv/bin/gunicorn -b localhost:8010 -w 2 installmgr:app ExecStart=/opt/installmgr/venv/bin/gunicorn -b localhost:8010 -w 2 installmgr:app