Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
projets:paslarbre [2017/06/18 23:17] – [Paslarbre] gepeto | projets:paslarbre [2024/02/09 16:56] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 28: | Ligne 28: | ||
==== À la main ==== | ==== À la main ==== | ||
après un sudo su | après un sudo su | ||
+ | |||
+ | **Fixer la partie réseau** | ||
< | < | ||
echo " | echo " | ||
echo " | echo " | ||
- | 127.0.0.1i | + | 127.0.0.1 localhost www.paslarbre.local paslarbre.local paslarbre |
192.168.4.1 www.paslarbre.local paslarbre.local paslarbre | 192.168.4.1 www.paslarbre.local paslarbre.local paslarbre | ||
" > /etc/hosts | " > /etc/hosts | ||
- | apt-get install dnsmasq iptables | + | cat <<EOF > / |
+ | source / | ||
+ | |||
+ | allow-hotplug eth0 | ||
+ | iface eth0 inet dhcp | ||
+ | |||
+ | auto lo | ||
+ | iface lo inet loopback | ||
+ | |||
+ | allow-hotplug wlan0 | ||
+ | iface wlan0 inet static | ||
+ | address 192.168.4.1 | ||
+ | netmask 255.255.255.0 | ||
+ | network 192.168.4.0 | ||
+ | broadcast 192.168.4.255 | ||
+ | EOF | ||
+ | |||
+ | apt install dnsmasq iptables | ||
+ | apt remove network-manager | ||
apt-get install avahi-daemon | apt-get install avahi-daemon | ||
Ligne 40: | Ligne 60: | ||
domain=local" | domain=local" | ||
- | apt-get install npm | ||
- | apt-get install redis-server | ||
</ | </ | ||
+ | |||
+ | **Partie hostapd.conf** | ||
+ | < | ||
+ | sudo apt-get -y install iw dnsmasq hostapd | ||
+ | sed -i ' | ||
+ | |||
+ | cat <<EOF > / | ||
+ | # Interface wlan du Wifi | ||
+ | interface=wlan0 | ||
+ | # Driver à utiliser | ||
+ | # | ||
+ | # | ||
+ | # Nom de la Piratebox | ||
+ | # | ||
+ | ssid=PASLARBRE | ||
+ | # Mode Wifi (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g) | ||
+ | hw_mode=g | ||
+ | # Canal de fréquence Wifi (1-14) | ||
+ | channel=6 | ||
+ | # Wifi ouvert à tous, pas d' | ||
+ | auth_algs=1 | ||
+ | # Pour activer les fonctionnalités Wifi N | ||
+ | # | ||
+ | # | ||
+ | EOF | ||
+ | </ | ||
+ | |||
**Partie dnsmasq.conf** | **Partie dnsmasq.conf** | ||
< | < | ||
Ligne 67: | Ligne 112: | ||
sudo git clone https:// | sudo git clone https:// | ||
sudo chown scrumblr | sudo chown scrumblr | ||
- | cd /var/www/scrumblr | + | cd /var/www/scrumb |
+ | |||
+ | apt-get install npm | ||
+ | apt-get install redis-server lr | ||
npm install | npm install | ||
sudo su scrumblr -s /bin/bash | sudo su scrumblr -s /bin/bash | ||
Ligne 77: | Ligne 126: | ||
</ | </ | ||
< | < | ||
- | cat <<EOF | + | cat << |
[Unit] | [Unit] | ||
Description=Scrumblr service | Description=Scrumblr service | ||
Ligne 90: | Ligne 139: | ||
User=scrumblr | User=scrumblr | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
- | ExecStart=/ | + | ExecStart=/ |
[Install] | [Install] | ||
Ligne 116: | Ligne 165: | ||
iptables-save -c > / | iptables-save -c > / | ||
+ | systemctl daemon-reload | ||
systemctl enable hostapd | systemctl enable hostapd | ||
systemctl start hostapd | systemctl start hostapd | ||
Ligne 122: | Ligne 172: | ||
systemctl enable scrumblr | systemctl enable scrumblr | ||
systemctl start scrumblr | systemctl start scrumblr | ||
+ | #systemctl disable avahi # si jamais de connexion lan | ||
</ | </ | ||
===== Paslarbre ===== | ===== Paslarbre ===== | ||
Apres: | Apres: | ||
+ | < | ||
+ | apt install redis-tools # pour une petite base de données | ||
+ | apt install python-pip # pour des outils python | ||
+ | pip install rdbtools | ||
+ | </ | ||
* relocalisation de toutes fonts en locale | * relocalisation de toutes fonts en locale | ||
* coup de peinture dans les css et pages | * coup de peinture dans les css et pages | ||
- | * script listant dans une page foret les paslarbres accessibles | + | * script listant dans une page "/foret" |
* modifications de quelques autre script js | * modifications de quelques autre script js | ||
- | Voici le paslarbre à décompresser en place /www/ :{{ :projets:scrumblr.tgz |}} | + | * extrait_base.sh < |
+ | # | ||
+ | # archive la base si il y a une modification | ||
+ | cd / | ||
+ | redis-cli --rdb / | ||
+ | rdb --command json / | ||
+ | diff / | ||
+ | RET=$? | ||
+ | if [ $RET -eq 0 ];then | ||
+ | exit 0 | ||
+ | else | ||
+ | mv / | ||
+ | cp dump.json | ||
+ | fi | ||
+ | exit 0 | ||
+ | </ | ||
+ | * extrait_room.sh < | ||
+ | # | ||
+ | # renvoi la liste des room scrumblr | ||
+ | redis-cli --scan " | ||
+ | exit 0 | ||
+ | </ | ||
+ | * fait_page_liste.sh < | ||
+ | # | ||
+ | # liste les room, paslarbres de redis et en fait une page jade | ||
+ | cd / | ||
+ | cat ./ | ||
+ | for i in `../ | ||
+ | do | ||
+ | echo " | ||
+ | < | ||
+ | p.home!= '<a href=\" | ||
+ | rbre/ | ||
+ | <br> " >> ./ | ||
+ | done | ||
+ | |||
+ | cat ./ | ||
+ | exit 0 | ||
+ | </ | ||
+ | * **rdb** extrait d'une base redis < | ||
+ | # | ||
+ | # EASY-INSTALL-ENTRY-SCRIPT: | ||
+ | __requires__ = ' | ||
+ | import sys | ||
+ | from pkg_resources import load_entry_point | ||
+ | |||
+ | if __name__ == ' | ||
+ | sys.exit( | ||
+ | load_entry_point(' | ||
+ | ) | ||
+ | </ | ||
+ | Voici le paslarbre à décompresser en place /www/ :{{ :projets:scrumblr_paslarbre.tgz |}}, directement fonctionnel | ||
j'ai aussi un crontab -e avec | j'ai aussi un crontab -e avec |