2022-04-05 12:58:31 +02:00
|
|
|
# Service PETITION
|
|
|
|
|
2022-05-04 17:04:55 +02:00
|
|
|
# Installation
|
|
|
|
## Installation des pré-requis
|
2022-05-04 17:19:40 +02:00
|
|
|
```bash
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install git virtualenv python3-dev build-essential mariadb-server gettext libzip-dev libssl-dev
|
|
|
|
sudo apt install python3-mysqldb/stable
|
|
|
|
```
|
2022-05-04 17:04:55 +02:00
|
|
|
|
|
|
|
## Création utilisateur
|
2022-05-04 17:19:40 +02:00
|
|
|
```bash
|
|
|
|
adduser --system \
|
2022-05-04 17:04:55 +02:00
|
|
|
--home /srv/petition.chalec.org/ \
|
|
|
|
--shell /bin/bash \
|
|
|
|
--group \
|
2022-05-04 17:19:40 +02:00
|
|
|
pytition
|
|
|
|
```
|
2022-05-04 17:04:55 +02:00
|
|
|
Connection de l'utilisateur :
|
2022-05-04 17:19:40 +02:00
|
|
|
```bash
|
|
|
|
su pytition
|
|
|
|
```
|
2022-05-04 17:04:55 +02:00
|
|
|
|
|
|
|
## Création des dossiers
|
2022-05-04 17:19:40 +02:00
|
|
|
```bash
|
|
|
|
mkdir -p /srv/petition.chalec.org/tools
|
|
|
|
mkdir -p /srv/petition.chalec.org/www/{static,mediaroot}
|
|
|
|
```
|
2022-04-05 12:58:31 +02:00
|
|
|
|
|
|
|
## Installation
|
2022-05-04 17:04:55 +02:00
|
|
|
Récupération de la version :
|
2022-04-05 12:58:31 +02:00
|
|
|
|
2022-05-04 17:19:40 +02:00
|
|
|
```bash
|
|
|
|
version=$(curl -s https://api.github.com/repos/pytition/pytition/releases/latest | grep "tag_name" | cut -d : -f2,3 | tr -d \" | tr -d ,)
|
|
|
|
```
|
|
|
|
|
|
|
|
```bash
|
|
|
|
virtualenv -p python3 pytition_venv
|
2022-05-04 17:04:55 +02:00
|
|
|
wget https://github.com/pytition/Pytition/archive/refs/tags/v2.4.tar.gz
|
|
|
|
tar -xvf v2.4.tar.gz -C ~/www --strip 1
|
|
|
|
source ./pytition_venv/bin/activate
|
|
|
|
cd ~/www/
|
2022-05-04 17:19:40 +02:00
|
|
|
pip3 install -r requirements.txt
|
|
|
|
```
|
2022-04-05 12:58:31 +02:00
|
|
|
|