From 3010514398c28831038f054b8e4cc459ba8a68b1 Mon Sep 17 00:00:00 2001
From: David Beniamine <david.beniamine@imag.fr>
Date: Tue, 7 Mar 2017 15:34:23 +0100
Subject: [PATCH] Readme up and apache2 conf

---
 Readme.md                | 62 ++++++++++++++++++++++++++++++++++------
 apache2/passchecker.conf | 26 +++++++++++++++++
 2 files changed, 80 insertions(+), 8 deletions(-)
 create mode 100644 apache2/passchecker.conf

diff --git a/Readme.md b/Readme.md
index 320c93a..85e6e79 100644
--- a/Readme.md
+++ b/Readme.md
@@ -1,20 +1,65 @@
-# Tetras Pass
+# Pass Checker
 
 ## Installation
 
-**TODO**
+### Pé requis
 
-## Utilisation
+Installez pip3, sur debian / ubuntu / mint : `sudo apt-get install python3-pip`
+
+### Installation simple
+
+1.  Clonez ce dépot:
+
+        git clone https://gitlab.tetras-libre.fr/tetras-libre/PasswordTester passchecker
+
+2.  Installez le logiciel
+
+        cd passchecker
+        sudo pip3 install -e .
+
+### Installation web (derrière un proxy apache)
+
+
+1.  Clonez ce dépot dans /var/www:
+
+        git clone https://gitlab.tetras-libre.fr/tetras-libre/PasswordTester passchecker
+
+2.  Installez le logiciel
 
-**TODO**
+        cd passchecker
+        sudo pip3 install -e .
 
-### Console
+3.  Donnez les droits à l'utilisateur www-data
 
-**TODO**
+    chown -R www-data: /var/www/passcheker
+
+4.  Copiez et lancez le service systemd
+
+        cp /var/www/passcheker/service/passchecker.service /etc/systemd/system
+        systemctl daemon-reload
+        systemctl start passchecker
+
+5.  Copiez et adaptez fichier apache2:
+
+        cp /var/www/passcheker/apache2/passchecker.conf /et/apache2/sites-available
+        a2ensite passchecker.conf
+        apachectl restart
+
+## Utilisation
+
+### Ligne de commande :
+
+Tapez `passchecker`  et suivez les instructions
 
 ### Web
 
-**TODO**
+Lancez `passchecker --web` puis ouvrez votre navigateur sur la page
+[indiquée](http://localhost:8842/cgi-bin/index.py) et suivez les indications.
+
+### Avancés
+
+Pour des reglagesavancé, voir `passchecker --help`
+
 
 ## Todo
 
@@ -31,11 +76,12 @@
 + [X] Packages
 + [X] Installeur
 + [X] Service systemd
++ [X] Site apche2
 + [ ] Tests
 
 ## Licences
 
-[Tetra Pass](https://gitlab.tetras-libre.fr/tetras-libre/tetras-pass) est Logiciel développé par
+[Pass Checker](https://gitlab.tetras-libre.fr/tetras-libre/PasswordTester) est Logiciel développé par
 [Tetras Libre](http://tetras-libre.fr),
 distribué sous Licence [AGPL](https://www.gnu.org/licenses/agpl.html) V3.0.
 
diff --git a/apache2/passchecker.conf b/apache2/passchecker.conf
new file mode 100644
index 0000000..667d958
--- /dev/null
+++ b/apache2/passchecker.conf
@@ -0,0 +1,26 @@
+<VirtualHost *>
+    ServerAdmin <ADMIN>
+    ServerName passchecker.<FQDN>
+    ServerSignature Off
+    CustomLog /var/log/apache2/passchecker_access.log combined
+    ErrorLog /var/log/apache2/passchecker_error.log
+    ErrorLog syslog:local2
+
+    RewriteEngine On
+    RewriteRule ^/$ /cgi-bin/index.py [L,R=301]
+    RewriteRule ^$ /cgi-bin/index.py [L,R=301]
+    <IfModule mod_proxy.c>
+        ProxyVia On
+        ProxyRequests Off
+        ProxyPass / http://localhost:8842/
+        ProxypassReverse / http://localhost:8842/
+        ProxyPreserveHost on
+        <Proxy *>
+            Options FollowSymLinks MultiViews
+            AllowOverride All
+            Order allow,deny
+            allow from all
+        </Proxy>
+    </IfModule>
+</VirtualHost>
+
-- 
GitLab