petition/README.md

46 lines
1.0 KiB
Markdown

# Service PETITION
# Installation
## Installation des pré-requis
```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
```
## Création utilisateur
```bash
adduser --system \
--home /srv/petition.chalec.org/ \
--shell /bin/bash \
--group \
pytition
```
Connection de l'utilisateur :
```bash
su pytition
```
## Création des dossiers
```bash
mkdir -p /srv/petition.chalec.org/tools
mkdir -p /srv/petition.chalec.org/www/{static,mediaroot}
```
## Installation
Récupération de la version :
```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
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/
pip3 install -r requirements.txt
```