7 Commits
v0.4 ... v0.9b

7 changed files with 128 additions and 0 deletions

36
ap23/goss/sv/goss.yaml Normal file
View File

@ -0,0 +1,36 @@
file:
#check si latest.sql.gs existe
/root/latest.sql.gz:
exists: true
filetype: file
command:
#check le contenue de la crontab
crontab -l:
exit-status: 0
stdout:
- 0 21 * * 1-7 /root/svbase.sh
stderr: []
timeout: 10000
#check la sortie du fichier hostname de ap23
ssh root@ap23 hostname:
exit-status: 0
stdout:
- ap23
stderr: []
timeout: 10000
interface:
#check l'existence de la carte enp0s3, son adresse ipv4, mac et sa valeur mtu
enp0s3:
exists: true
addrs:
- 192.168.0.33/24
- fe80::a00:27ff:fe06:7232/64
mtu: 1500

39
ap23/script/ScriptDokuWikiv2.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
set -e
#ip dans la variable $3
ip=$(ip -br a|grep UP|awk '{print $3}'|cut -f1 -d'/')
#dependances
apt install apache2 php php-mbstring php-xml php-gd -y
#telechargement dokuwiki et deplacement dans /var/www/html/dokuwiki et suppression archive plus utile
cd /tmp
wget http://depl.sio.lan/store/dokuwiki-stable.tgz
tar -xzvf dokuwiki-stable.tgz
rm dokuwiki-stable.tgz
#check si bonne version de dokuwiki extraite
if [ ! -d dokuwiki-2020-07-29 ] ; then
echo "Erreur de version dokuwiki : version attendue : dokuwiki-2020-07-29"
exit 1
fi
#deplacement dans le repertoire de base apache2/dokuwiki
mv dokuwiki-2020-07-29 dokuwiki
mv dokuwiki /var/www/html
cd /var/www/html
#suppresion index.html pas necessaire si present
if [ -d index.html ] ; then
rm index.html
fi
cd /var/www/html/dokuwiki
chown -R root:root .
chown -R www-data:www-data data lib conf
#nettoyage affichage et resultat
clear
echo "Installation de dokuwiki terminee."
echo "Connectez-vous avec un navigateur à l'adresse http://$ip/dokuwiki/install.php"

24
ap23/script/ScriptDokuwiki.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
#set -e
set -u
#instalation des paquets
apt install -y wget apache2 php php-gd php-mbstring php-xml
#srcipt installation
cd /tmp || return
wget http://depl.sio.lan/store/dokuwiki-stable.tgz
tar xvfs dokuwiki-stable.tgz
mkdir /var/www/html/doku
if [[! -d dokuwiki-2020-07-29]] ; then
echo"$0 : erreur version dokuwiki"
fi
cp -a dokuwiki-2020-07-29/* /var/www/html/doku
cd /var/www/html/doku || return
chown -R root:root .
chown -R www-data:www-data data lib conf
adresse=$(ip -br a|grep UP|awk '{print $3}t'|cut -f1 -d'/')
echo "installation du dokuwiki terminee.Conecter vous a l'adresse http://${adresse}/doku"
exit 0

14
ap23/script/dau.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
set -e
set -u
#check si il y a un argument et exit 1 si y'a pas
if [ ! "$1" ] ; then
echo "Usage : $0 user >> /var/www/html/dokuwiki/conf/users.auth.php"
exit 1
fi
# chiffremment du mot de passe $1 avec bcrypt
hashpass=$(htpasswd -bnBC 10 "$1" "$1")
echo "${hashpass}:${1}:${1}@localhost:${1},user"

11
ap23/script/dau2.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
set -u
./dau.sh anthony >> /var/www/html/dokuwiki/conf/users.auth.php
./dau.sh rayan >> /var/www/html/dokuwiki/conf/users.auth.php
./dau.sh mathis >> /var/www/html/dokuwiki/conf/users.auth.php
./dau.sh lucas >> /var/www/html/dokuwiki/conf/users.auth.php
./dau.sh adrien >> /var/www/html/dokuwiki/conf/users.auth.php

4
ap23/script/users.txt Normal file
View File

@ -0,0 +1,4 @@
anthony: anthony arnoux
mathis: mathis laceppe
lucas: lucas seignez
rayan: rayan