Ajouter h5ai pour l'affichage des fichiers

H5AI est un ensemble de scripts écrits en php qui améliore grandement l'affichage des répertoires de la PédagoBox : icônes, moteur de recherche…

Méthode

Modifications du fichier /opt/piratebox/conf/lighttpd/lighttpd.conf pour préparer l'installation de h5ai et l'activation de php.

sudo nano /opt/piratebox/conf/lighttpd/lighttpd.conf

1
# modif par Patrice ->  "/_h5ai/public/index.php" # note : index.xhtml provoque une erreur d'affichage  pb avec Canoprof : utiliser generation export serveur local pour index.html
2
3
index-file.names            = ( "index.php", "index.html",
4
                                "index.htm", "default.htm",
5
                               " index.lighttpd.html", "/_h5ai/public/index.php" )
6
1
## Uncommenting the following line enables PHP for the
2
## complete PirateBox
3
4
# modif par Patrice # ->
5
include "/opt/piratebox/conf/lighttpd/fastcgi-php.conf"
6

Relancer la piratebox :

sudo reboot

Méthode

Faire en sorte que php soit actif dans tout le répertoire /opt/piratebox/www

sudo nano /opt/piratebox/conf/lighttpd/fastcgi-php.conf

1
#-------------------- FAST CGI stuff
2
3
# modif par Patrice "^/content/" -> "^/"
4
$HTTP["url"] =~ "^/" {
5
        fastcgi.server = (
6
                ".php" => ((
7
                                "bin-path" => "/usr/bin/php-cgi",
8
                                "socket" => "/tmp/php.socket",
9
                                "max-procs" => 1
10
                        ))
11
        )
12
}

Relancer la piratebox :

sudo reboot

MéthodeInstallation de h5ai

d'abord on sort de la connexion ssh

exit

puis on expédie le fichier téléchargé depuis son ordi vers la piratebox

sudo scp h5ai-0.29.0.zip alarm@alarmpi:

on se reconnectes en ssh à la piratebox

ssh alarm@alarmpi

on dézippe l'archive

sudo unzip h5ai-0.29.0.zip

on déplace le répertoire _h5ai dans /www/

sudo cp -r _h5ai/ /opt/piratebox/www/

on édite le fichier de configuration de h5ai pour y faire toutes les personnalisations que l'on souhaite, notamment le passage au français (mais il y a bien d'autres config possible ; consulter la doc sur son site pour les découvrir) :

sudo nano /opt/piratebox/www/_h5ai/private/conf/options.json

1
/* modif par Patrice modetoggle false-> true */
2
3
    "view": {
4
        "binaryPrefix": false,
5
        "disableSidebar": false,
6
        "fallbackMode": false,
7
        "fastBrowsing": true,
8
        "fonts": ["Ubuntu", "Roboto", "Helvetica", "Arial", "sans-serif"],
9
        "fontsMono": ["Ubuntu Mono", "Monaco", "Lucida Sans Typewriter", "monospace"],
10
        "hidden": ["^\\.", "^_h5ai"],
11
        "hideFolders": false,
12
        "hideIf403": true,
13
        "hideParentFolder": false,
14
        "maxIconSize": 40,
15
        "modes": ["details", "grid", "icons"],
16
        "modeToggle": true,
17
        "setParentFolderLabels": true,
18
        "sizes": [20, 40, 60, 80, 100, 140, 180, 220, 260, 300],
19
        "theme": "comity",
20
        "unmanaged": ["index.html", "index.htm", "index.php"],
21
        "unmanagedInNewWindow": false
22
    },
23
24
25
/* modif par Patrice enabled true->false */
26
27
    "custom": {
28
        "enabled": false
29
    },
30
31
32
33
/* modif par Patrice en->fr */
34
35
    "l10n": {
36
        "enabled": true,
37
        "lang": "fr",
38
        "useBrowserLang": true
39
    },
40
41
 
42
43
/* modif par Patrice enabled true -> false autoplay true -> false */
44
45
    "preview-aud": {
46
        "enabled": false,
47
        "autoplay": false,
48
        "types": ["aud"]
49
    },
50
51
52
53
/* modif par Patrice enabled true -> false */
54
55
    "preview-img": {
56
        "enabled": false,
57
        "size": false,
58
        "types": ["img", "img-bmp", "img-gif", "img-ico", "img-jpg", "img-png", "img-raw", "img-svg"]
59
    },
60
61
62
/* modif par Patrice enabled true -> false */
63
64
    "preview-txt": {
65
        "enabled": false,
66
        "styles": {
67
            "txt": 1,
68
            "txt-authors": 1,
69
            "txt-c": 3,
70
            "txt-cpp": 3,
71
            "txt-css": 3,
72
            "txt-diff": 1,
73
            "txt-go": 3,
74
            "txt-h": 3,
75
            "txt-hpp": 3,
76
            "txt-install": 1,
77
            "txt-js": 3,
78
            "txt-json": 3,
79
            "txt-less": 3,
80
            "txt-license": 1,
81
            "txt-log": 1,
82
            "txt-makefile": 1,
83
            "txt-md": 2,
84
            "txt-py": 3,
85
            "txt-rb": 3,
86
            "txt-readme": 1,
87
            "txt-rtf": 1,
88
            "txt-rust": 3,
89
            "txt-script": 3,
90
            "txt-xml": 1
91
        }
92
    },
93
94
95
96
/* modif par Patrice enabled true->false autoplay true->false*/
97
98
    "preview-vid": {
99
        "enabled": false,
100
        "autoplay": false,
101
        "types": ["vid-avi", "vid-flv", "vid-mkv", "vid-mov", "vid-mp4", "vid-mpg", "vid-webm"]
102
    },
103
104
105
106
/* modif par Patrice enabled false->true */
107
108
    "search": {
109
        "enabled": true,
110
        "advanced": true,
111
        "debounceTime": 300,
112
        "ignorecase": true
113
    },
114
115
 
116
117
/* modif par Patrice enabled true -> false */
118
119
    "thumbnails": {
120
        "enabled": false,
121
        "img": ["img-bmp", "img-gif", "img-ico", "img-jpg", "img-png"],
122
        "mov": ["vid-avi", "vid-flv", "vid-mkv", "vid-mov", "vid-mp4", "vid-mpg", "vid-webm"],
123
        "doc": ["x-pdf", "x-ps"],
124
        "delay": 1,
125
        "size": 240,
126
        "exif": false,
127
        "chunksize": 20
128
    },
129
130
 
131
132
/* modif par Patrice enable true -> false */
133
134
    "tree": {
135
        "enabled": false,
136
        "show": true,
137
        "maxSubfolders": 50,
138
        "naturalSort": true,
139
        "ignorecase": true
140
    }
141
142