cookutils rev 898

Add lighttpd/*: this is for cook.slitaz.org Lighttpd-driven web interface.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu May 11 00:17:06 2017 +0300 (2017-05-11)
parents fe29568da760
children ea11d3c96873
files lighttpd/README.md lighttpd/cooker-emerald.css lighttpd/cooker-goldenrod.css lighttpd/cooker-like2016.css lighttpd/cooker-sky.css lighttpd/cooker-terminal.css lighttpd/cooker.css lighttpd/cooker.js lighttpd/index.cgi lighttpd/lighttpd/lighttpd.conf lighttpd/lighttpd/vhosts.conf lighttpd/listing.js lighttpd/slitaz-cooker.png
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/lighttpd/README.md	Thu May 11 00:17:06 2017 +0300
     1.3 @@ -0,0 +1,68 @@
     1.4 +<meta charset="UTF-8">
     1.5 +
     1.6 +index.cgi readme
     1.7 +================
     1.8 +
     1.9 +This CGI script is intended to be used on the Lighttpd powered SliTaz web
    1.10 +server. The configuration uses the modules:
    1.11 +
    1.12 +  * mod_rewrite:  to have cacheable, reusable, human friendly URIs
    1.13 +  * mod_compress: to save traffic
    1.14 +
    1.15 +Examples of human friendly URIs:
    1.16 +
    1.17 +  * /busybox                   : the page contains all about busybox package
    1.18 +  * /busybox/receipt           : the page with the busybox's receipt
    1.19 +  * /busybox/files             : the page with the file listing
    1.20 +  * /busybox/file/bin/busybox  : get the specified file
    1.21 +  * /get/busybox-1.26.2.tazpkg : get the specified package
    1.22 +
    1.23 +Example of traffic saving:
    1.24 +
    1.25 +  * glibc.log in plain form:      8.3 MB
    1.26 +  * glibc.log in compressed form: 0.3 MB (3% of the original size)
    1.27 +
    1.28 +
    1.29 +Notes about logs
    1.30 +----------------
    1.31 +
    1.32 +Single resource should be associated with the discrete URI. But due to log
    1.33 +rotation, glibc.log.2 become glibc.log.3 after package rebuilding. In such
    1.34 +situation:
    1.35 +
    1.36 +  1. we can't point to the specified log and line within it (URI changed);
    1.37 +  2. caching will fail, already cached log change the name.
    1.38 +
    1.39 +The solution implemented is virtually append log name with the UNIX timestamp
    1.40 +of last modification of the log instead of sequental numbers. So, for example,
    1.41 +'glibc.log.2' will virtually became 'glibc.log.1482699768'. To found the matched
    1.42 +log we need to cycle among ten or less 'glibc.log*' physical files and compare
    1.43 +the files modification date with date in question.
    1.44 +
    1.45 +
    1.46 +Full list of implemented human friendly URIs
    1.47 +--------------------------------------------
    1.48 +
    1.49 +URI syntax             | Description                            | URI example
    1.50 +-----------------------|----------------------------------------|-----------------------
    1.51 +/                      | cooker home page                       | /
    1.52 +/‹pkg›                 | brief info about ‹pkg›                 | /busybox
    1.53 +/‹pkg›/receipt         | display ‹pkg› receipt                  | /busybox/receipt
    1.54 +/‹pkg›/description     | display ‹pkg› description              | /busybox/description
    1.55 +/‹pkg›/stuff/‹stuff›   | display ‹stuff› file                   | /busybox/stuff/www/httpd/404.html
    1.56 +/‹pkg›/files           | display ‹pkg› files list               | /busybox/files
    1.57 +/‹pkg›/file/‹file›     | get the ‹file› from the ‹pkg›          | /busybox/file/bin/busybox
    1.58 +/get/‹package.tazpkg›  | get the specified ‹package.tazpkg›     | /get/busybox-1.26.2.tazpkg
    1.59 +/src/‹tarball›         | get the specified sources ‹tarball›    | /src/busybox-1.26.2.tar.bz2
    1.60 +/‹pkg›/man             | list of man pages, display default one | /cmark/man
    1.61 +/‹pkg›/man/‹page›      | display specified man ‹page›           | /cmark/man/cmark.1
    1.62 +.                      | .                                      | /man-db/man/es/mandb.8
    1.63 +/‹pkg›/doc             | list of existing documentation files   | .
    1.64 +/‹pkg›/doc/‹doc›       | display specified documentation file   | .
    1.65 +/‹pkg›/info            | list of existing info files            | .
    1.66 +/‹pkg›/info/‹info›     | display specified info file            | .
    1.67 +/‹pkg›/log             | display the latest cooking log         | /busybox/log
    1.68 +/‹pkg›/log/‹timestamp› | display the specified cooking log      | /busybox/log/1482700678
    1.69 +
    1.70 +
    1.71 +((unfinished))
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/lighttpd/cooker-emerald.css	Thu May 11 00:17:06 2017 +0300
     2.3 @@ -0,0 +1,6 @@
     2.4 +@import url("cooker.css");
     2.5 +html,body{background-color:palegreen}
     2.6 +header{background:repeating-linear-gradient(135deg,hsla(100,100%,20%,.7),hsla(100,100%,20%,.7) 10px,hsla(100,50%,20%,.7) 10px,hsla(100,50%,20%,.7) 20px),repeating-linear-gradient(45deg,hsla(100,100%,20%,.7),hsla(100,100%,20%,.7) 10px,hsla(100,50%,20%,.7) 10px,hsla(100,50%,20%,.7) 20px)}
     2.7 +header{text-shadow:0 3px 3px #000}
     2.8 +.log u{color:olive}
     2.9 +header h1::before{content: url("data:image/svg+xml,<svg height='40' width='40' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><filter id='a' color-interpolation-filters='sRGB' height='1.1' width='1.1' x='0' y='0'><feGaussianBlur stdDeviation='.7'/></filter><linearGradient id='b' gradientUnits='userSpaceOnUse' spreadMethod='pad' x1='20' x2='20' xlink:href='%23c' y1='13.5' y2='37.5'/><linearGradient id='c' gradientUnits='userSpaceOnUse' spreadMethod='pad' x1='20' x2='20' y1='2.5' y2='37.5'><stop offset='0' stop-color='%23ff7825'/><stop offset='1' stop-color='%23762400'/></linearGradient><path d='m30.2 28.3c0-.9-4-3.5-4.9-3.9-.1 1.7.3 2.5-.2 4.6-.4 2.1-1.4 4.2-2.8 5.7-1.2 1.3-2.5 2.1-4.4 2.1-2.6 0-4-2.3-4.6-4.8-.5-3.8 1.1-7 1.1-7.4-.5-.1-4.3 2.2-5.7 3.2-.8 3 .4 7.2 2.5 10.9-3.5-3.2-5-7.8-5.6-11.6 2.3-1.8 4.3-2.3 5.5-3.6-.9 0-5.3.4-5.9 1-.8 1.6-1.3 6.8-1.2 10.2-2.5-4.7-1.2-11.2-1.1-11.9.3-.8 7.8-1.2 8.4-1.8-.5-.4-4.5-1.6-7.1-3 .3-1.6 3.2-8.2 6.4-10.6-1.1 2.2-3.1 7.3-3.4 9.3.6.4 5.3 2.4 6 2.3-.4-.7-3.5-3.1-3.9-3.8.8-3.2 6.7-9 8.5-9.8-2 1.9-5.3 6.7-5.7 9.2 1.7 1.7 3.9 3.8 4.9 4.1.3-.1.4-.7.4-1.1.6-2.8 3.2-3.7 4.1-3.7 1.2 0 2.5 1.4 2.7 2.3.1.7-.2 2 0 2.8 1.1-.4 5.7-3.6 6.3-4.4.4-3.3-1.3-6.6-3.2-9.5 2.5 1.4 5.6 6.8 6 9.9-.7 1.1-4 2.7-5 3.9.7 0 5.4-1.5 6.4-2.2.4-.4.4-.8.4-1.1 0-2.8-.4-6.3-1.1-8.8 2.5 2.8 3.4 7 3.6 10.4 0 .4-.1.6-.1 1-1.1.5-7.4 2.4-7.5 2.9-.1.3 5.3.7 7.6 1.5-.4 3.7-1.8 8.7-4.3 11.6.6-2.5 1.7-6.8 1.4-9.9-1.8-.4-5.3-1.1-5.5-.8-.3.4 4.2 2.6 4.2 3.7-1.3 3.9-4.9 8.8-8.6 11.4 4.5-5.6 5.5-9 5.4-10.5z' filter='url(%23a)'/><path d='m30.2 26.3c0-.9-4-3.5-4.9-3.9-.1 1.7.3 2.5-.2 4.6-.4 2.1-1.4 4.2-2.8 5.7-1.2 1.3-2.5 2.1-4.4 2.1-2.6 0-4-2.3-4.6-4.8-.5-3.8 1.1-7 1.1-7.4-.5-.1-4.3 2.2-5.7 3.2-.8 3 .4 7.2 2.5 10.9-3.5-3.2-5-7.8-5.6-11.6 2.3-1.8 4.3-2.3 5.5-3.6-.9 0-5.3.4-5.9 1-.8 1.6-1.3 6.8-1.2 10.2-2.5-4.7-1.2-11.2-1.1-11.9.3-.8 7.8-1.2 8.4-1.8-.5-.4-4.5-1.6-7.1-3 .3-1.6 3.2-8.2 6.4-10.6-1.1 2.2-3.1 7.3-3.4 9.3.6.4 5.3 2.4 6 2.3-.4-.7-3.5-3.1-3.9-3.8.8-3.2 6.7-9 8.5-9.8-2 1.9-5.3 6.7-5.7 9.2 1.7 1.7 3.9 3.8 4.9 4.1.3-.1.4-.7.4-1.1.6-2.8 3.2-3.7 4.1-3.7 1.2 0 2.5 1.4 2.7 2.3.1.7-.2 2 0 2.8 1.1-.4 5.7-3.6 6.3-4.4.4-3.3-1.3-6.6-3.2-9.5 2.5 1.4 5.6 6.8 6 9.9-.7 1.1-4 2.7-5 3.9.7 0 5.4-1.5 6.4-2.2.4-.4.4-.8.4-1.1 0-2.8-.4-6.3-1.1-8.8 2.5 2.8 3.4 7 3.6 10.4 0 .4-.1.6-.1 1-1.1.5-7.4 2.4-7.5 2.9-.1.3 5.3.7 7.6 1.5-.4 3.7-1.8 8.7-4.3 11.6.6-2.5 1.7-6.8 1.4-9.9-1.8-.4-5.3-1.1-5.5-.8-.3.4 4.2 2.6 4.2 3.7-1.3 3.9-4.9 8.8-8.6 11.4 4.5-5.6 5.5-9 5.4-10.5z' fill='url(%23b)' stroke-width='.4'/></svg>")}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/lighttpd/cooker-goldenrod.css	Thu May 11 00:17:06 2017 +0300
     3.3 @@ -0,0 +1,7 @@
     3.4 +@import url("cooker.css");
     3.5 +html,body{background-color:palegoldenrod}
     3.6 +progress::-moz-progress-bar{background-color:hsla(30,60%,40%,.7)}
     3.7 +progress::-webkit-progress-value{background-color:hsla(30,60%,40%,.7)}
     3.8 +header{background-color:hsla(40,70%,50%,.7);color:#000;box-shadow:0 -3px 0 rgba(0,0,0,.3) inset}
     3.9 +header a{color:rgba(0,0,0,.7)}
    3.10 +header a:hover{color:rgba(0,0,0,.8);text-shadow:0 0 4px rgba(0,0,0,.5)}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/lighttpd/cooker-like2016.css	Thu May 11 00:17:06 2017 +0300
     4.3 @@ -0,0 +1,168 @@
     4.4 +/* CSS style for SliTaz Cooker */
     4.5 +
     4.6 +html { min-height: 102%; }
     4.7 +body { font: 13px sans-serif, vernada, arial; margin: 0; }
     4.8 +h1 { margin: 0; padding: 8px; color: #fff; font-size: 20px; }
     4.9 +h1 a { color: #fff; text-decoration: none; }
    4.10 +h2 { color: #444; }
    4.11 +h3 { color: #666; font-size: 140%; }
    4.12 +a { text-decoration: underline; color: #215090; }
    4.13 +a:hover { text-decoration: none; }
    4.14 +hr { margin: 0; border: 1px solid #cfcfcf; }
    4.15 +pre, table {
    4.16 +	background-color: #f8f8f8;
    4.17 +	border: 1px solid #ddd;
    4.18 +	padding: 10px;
    4.19 +	overflow: auto;
    4.20 +	font-size: 96%;
    4.21 +	font-family: monospace;
    4.22 +}
    4.23 +pre .underline { display: none; }
    4.24 +
    4.25 +
    4.26 +/* Header */
    4.27 +
    4.28 +header {
    4.29 +	color: #fff;
    4.30 +	background: #222;
    4.31 +	height: 40px;
    4.32 +	border-bottom: 4px solid #afafaf;
    4.33 +}
    4.34 +header h1::before {
    4.35 +	content: '';
    4.36 +	display: inline-block;
    4.37 +	background: url("/images/logo.png") no-repeat left;
    4.38 +	width: 40px;
    4.39 +	height: 40px;
    4.40 +	vertical-align: middle;
    4.41 +}
    4.42 +
    4.43 +header h1 {
    4.44 +	margin: 0;
    4.45 +	padding: 0;
    4.46 +	white-space: nowrap;
    4.47 +	float: left;
    4.48 +}
    4.49 +
    4.50 +header h1 a {
    4.51 +	color: #fff;
    4.52 +	text-decoration: none;
    4.53 +	font-size: 20px;
    4.54 +	font-style: italic;
    4.55 +}
    4.56 +
    4.57 +header h1 a:hover, #network a:hover {
    4.58 +	color: #afafaf;
    4.59 +}
    4.60 +
    4.61 +/* Header links */
    4.62 +
    4.63 +.network {
    4.64 +	float: right;
    4.65 +	padding: 14px 5px 0;
    4.66 +	font-size: 12px;
    4.67 +}
    4.68 +
    4.69 +.network a {
    4.70 +	padding: 0 4px;
    4.71 +	color: #fff;
    4.72 +	font-weight: bold;
    4.73 +	text-decoration: none;
    4.74 +}
    4.75 +
    4.76 +/* Content */
    4.77 +
    4.78 +main {
    4.79 +	margin: 40px 80px;
    4.80 +	text-align: justify;
    4.81 +}
    4.82 +.r { float: right; }
    4.83 +form button[type='submit'] { display: none; }
    4.84 +table { width: 100%; }
    4.85 +td { padding: 0; }
    4.86 +td:first-child { white-space:nowrap; width:5rem; }
    4.87 +table td:nth-child(2)::before { content:' : '; }
    4.88 +.activity .r { display: none; }
    4.89 +.log a[name] { text-decoration: none; }
    4.90 +
    4.91 +.span-ok    { color: #0a0; }
    4.92 +.span-red   { color: red; }
    4.93 +.span-sky   { color: blue; }
    4.94 +.span-no    { color: #d90; }
    4.95 +.span-line  { color: #888; }
    4.96 +.log-date   { color: #666; font-size: 95%; }
    4.97 +.sh-comment { color: #a00; }
    4.98 +.sh-val     { color: #e50; font-weight: bold; }
    4.99 +.var        { color: #05a; }
   4.100 +
   4.101 +/* Colored log */
   4.102 +
   4.103 +.log b  { font-weight: normal;   color: red; }
   4.104 +.log u  { text-decoration: none; color: darkorange; }
   4.105 +.log i  { font-style: normal;    color: green; }
   4.106 +.log em { font-style: normal; }
   4.107 +
   4.108 +/* Buttons */
   4.109 +
   4.110 +.button {
   4.111 +	cursor: pointer;
   4.112 +	padding: 4px;
   4.113 +	margin: 4px 0px;
   4.114 +	display: inline-block;
   4.115 +}
   4.116 +
   4.117 +a.button, .meter span {
   4.118 +	text-decoration: none;
   4.119 +	color: #666;
   4.120 +}
   4.121 +
   4.122 +.button:hover {
   4.123 +	border: 1px solid #999;
   4.124 +}
   4.125 +
   4.126 +progress {
   4.127 +	width: 100%;
   4.128 +	box-sizing: border-box;
   4.129 +	margin: 0;
   4.130 +	padding: 0;
   4.131 +	height: 23px;
   4.132 +}
   4.133 +.meter { height: 23px; overflow: hidden; }
   4.134 +progress::-webkit-progress-bar { background: #9dff4a; }
   4.135 +progress::-webkit-progress-value { background: #9dff4a; }
   4.136 +progress::-moz-progress-bar { background: #9dff4a; }
   4.137 +.meter span {
   4.138 +	display: block;
   4.139 +	position: relative;
   4.140 +	margin: -20px 6px;
   4.141 +}
   4.142 +
   4.143 +.button, progress {
   4.144 +	border: 1px solid #cccccc;
   4.145 +	font-size: 14px;
   4.146 +	line-height: 1.2em;
   4.147 +	background-image: -webkit-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5);
   4.148 +	background-image: -moz-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5);
   4.149 +	-webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
   4.150 +	-moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
   4.151 +	box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
   4.152 +}
   4.153 +
   4.154 +/* Round corner */
   4.155 +
   4.156 +pre, .button, progress, table {
   4.157 +	-moz-border-radius: 4px;
   4.158 +	-webkit-border-radius: 4px;
   4.159 +	border-radius: 4px;
   4.160 +}
   4.161 +
   4.162 +/* Footer */
   4.163 +
   4.164 +footer {
   4.165 +	text-align: center;
   4.166 +	padding: 20px;
   4.167 +	border-top: 1px solid #ddd;
   4.168 +	font-size: 90%;
   4.169 +}
   4.170 +
   4.171 +footer a { padding: 0 2px; }
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/lighttpd/cooker-sky.css	Thu May 11 00:17:06 2017 +0300
     5.3 @@ -0,0 +1,8 @@
     5.4 +@import url("cooker.css");
     5.5 +html,body{background-color:powderblue}
     5.6 +progress::-moz-progress-bar{background-color:hsla(200,100%,40%,0.7)}
     5.7 +progress::-webkit-progress-value{background-color:hsla(200,100%,40%,0.7)}
     5.8 +header{background:none}
     5.9 +header{background: url("data:image/svg+xml,<svg height='50' width='1600' xmlns='http://www.w3.org/2000/svg'><path d='m0 0h1600v50h-1600z' fill='%236495ED'/><path d='m476 0c-7 0-9 5-9 5s-1-2-4-2c-5 0-6 5-6 5s-6 1-6 7c0 7 7 7 7 7h26s7 0 7-7c0-6-5-7-5-7s-1-8-10-8zm852 8s-2-2-5-2c-6 0-7 7-7 7s-7 1-7 9c0 9 9 9 9 9h33s9 0 9-9c0-7-7-9-7-9s-2-11-13-11c-10 0-12 6-12 6zm-319-6c-10 0-14 8-14 8s-2-3-6-3c-7 0-8 8-8 8s-8 1-8 10c0 10 10 10 10 10h39s10 0 10-10c0-8-8-10-8-10s-2-13-15-13zm-294 0c-4 0-7 4-7 4s-1-1-3-1c-3 0-4 4-4 4s-4 1-4 5c0 5 5 5 5 5h20s5 0 5-5-4-5-4-5-2-7-8-7zm-72 13s-2-3-8-3c-8 0-11 11-11 11s-11 3-11 13c0 14 14 14 14 14h51s14 0 14-14c0-11-10-13-10-13s-5-17-20-17c-13 0-19 9-19 9zm559 2s-2-3-6-3c-7 0-9 8-9 8s-8 1-8 10c0 10 10 10 10 10h39s10 0 10-10c0-8-8-10-8-10s-2-13-15-13c-9 0-13 8-13 8zm-797-8c-10 0-15 8-15 8s-2-3-7-3c-9 0-9 9-9 9s-9 2-9 11c0 11 11 11 11 11h42s11 0 11-11c0-9-9-11-9-11s0-14-15-14zm412 9s-2-2-5-2c-6 0-7 7-7 7s-7 1-7 9c0 9 9 9 9 9h33s9 0 9-9c0-7-7-9-7-9s-2-11-13-11c-10 0-12 6-12 6zm-309 1s-1-2-5-2c-7 0-7 7-7 7s-7 1-7 9c0 9 9 9 9 9h33s9 0 9-9c0-8-7-9-7-9s-1-11-13-11c-9 0-12 6-12 6zm947 0c-6 0-9 5-9 5s-1-2-4-2c-5 0-6 5-6 5s-6 1-6 7c0 7 7 7 7 7h26s7 0 7-7c0-6-5-7-5-7s-2-8-10-8zm-564 1c-7 0-9 5-9 5s-1-2-4-2c-5 0-6 5-6 5s-6 1-6 7c0 7 7 7 7 7h26s7 0 7-7c0-5-5-7-5-7s-1-8-10-8zm201 11c-5 0-7 4-7 4s-1-1-3-1c-3 0-4 4-4 4s-4 1-4 5c0 5 5 5 5 5h20s5 0 5-5c0-4-4-5-4-5s-2-7-8-7z' fill='%23CCC' opacity='.4'/></svg>") repeat-x;background-color:#6495ED}
    5.10 +header a,header a:hover{color:hsla(250,100%,20%,.7)}
    5.11 +header a:hover{text-shadow:0 0 4px hsla(0,0%,100%,.9)}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/lighttpd/cooker-terminal.css	Thu May 11 00:17:06 2017 +0300
     6.3 @@ -0,0 +1,279 @@
     6.4 +/* CSS style for SliTaz Cooker */
     6.5 +
     6.6 +*{font:14px/18px monospace;margin:0;padding:0}
     6.7 +html,body{height:100%;color:#888;background-color:#000}
     6.8 +#container {
     6.9 +	position: relative;
    6.10 +	min-height: 100%;
    6.11 +	margin: 0 auto;
    6.12 +}
    6.13 +
    6.14 +
    6.15 +/* HEADER */
    6.16 +
    6.17 +header,body>h2{background-color:#333}
    6.18 +header h1{display:inline-block;padding:18px 0}
    6.19 +header h1,body>h2{white-space:nowrap}
    6.20 +body>h2{padding:1rem 0}
    6.21 +header h1::before{content:'#! '}
    6.22 +header a,body>h2{color:#CCC}
    6.23 +.network{float:right}
    6.24 +.network a{padding:18px 8px 18px 0}
    6.25 +header select, header option {
    6.26 +	background-color: transparent;
    6.27 +	color: inherit;
    6.28 +	border: none;
    6.29 +}
    6.30 +
    6.31 +
    6.32 +/* FOOTER */
    6.33 +
    6.34 +footer, div.foot {
    6.35 +	padding: 18px 0;
    6.36 +	clear: both;
    6.37 +	text-align: center;
    6.38 +	color: #CCC;
    6.39 +	background-color: #333;
    6.40 +
    6.41 +	position: absolute;
    6.42 +	bottom: 0;
    6.43 +	width: 100%;
    6.44 +}
    6.45 +footer a+a::before {
    6.46 +	display: inline-block;
    6.47 +	content: ' • ';
    6.48 +	color: #E81;
    6.49 +}
    6.50 +
    6.51 +
    6.52 +/* CONTENT */
    6.53 +
    6.54 +h2,h3{font-weight:bold;background-color:#333}
    6.55 +h2::before,h3::before{content:'#'}
    6.56 +h2{color:#F0F}
    6.57 +h3{color:#FF0}
    6.58 +a{display:inline-block;text-decoration:none;color:#00F}
    6.59 +a:hover,body>h2:hover{text-decoration:underline}
    6.60 +pre {
    6.61 +	background-color: rgba(0,0,0,0.03);
    6.62 +	border: 1px solid rgba(0,0,0,0.1);
    6.63 +	margin: 18px 0 0;
    6.64 +	overflow: auto;
    6.65 +	font: 13px/18px monospace;
    6.66 +}
    6.67 +li::before{content:'  * '}
    6.68 +p{margin-top:18px}
    6.69 +
    6.70 +main{margin:auto;padding:0 0 54px}
    6.71 +section{margin-bottom:18px}
    6.72 +#content2, div.list {
    6.73 +	width: 100%; box-sizing: border-box;
    6.74 +	max-width: 700px;
    6.75 +	margin: auto;
    6.76 +	padding: 18px 0;
    6.77 +}
    6.78 +#info{margin:18px 0}
    6.79 +
    6.80 +.btnList{margin-bottom:18px}
    6.81 +
    6.82 +.span-ok    { color: #0a0; }
    6.83 +.span-red   { color: red; }
    6.84 +.span-sky   { color: blue; }
    6.85 +.span-no    { color: #d90; }
    6.86 +.span-line  { color: #888; }
    6.87 +.log-date   { color: #666; font-size: 95%; }
    6.88 +.sh-comment { color: #a00; }
    6.89 +.sh-val     { color: #e50; font-weight: bold; }
    6.90 +.var        { color: #05a; }
    6.91 +
    6.92 +
    6.93 +/* Colored log */
    6.94 +
    6.95 +.log b  { font-weight: normal;   color: red; }
    6.96 +.log u  { text-decoration: none; color: darkorange; }
    6.97 +.log i  { font-style: normal;    color: green; }
    6.98 +.log em { font-style: normal;    background-color: lightsteelblue; font-weight: bold; display: inline-block; width: 100%; }
    6.99 +
   6.100 +
   6.101 +
   6.102 +/* Buttons */
   6.103 +
   6.104 +.button,button{color:#888}
   6.105 +.button::before,button::before{content:'['}
   6.106 +.button::after,button::after{content:']'}
   6.107 +.button.active {
   6.108 +	color: inherit;
   6.109 +	border: none;
   6.110 +	text-decoration: none;
   6.111 +}
   6.112 +.button:hover, button:hover, input:hover {
   6.113 +	color: #FFF;
   6.114 +	text-decoration: none;
   6.115 +}
   6.116 +.button[data-acc]::before {
   6.117 +	content: attr(data-acc);
   6.118 +	padding:0 8px;
   6.119 +	background-color: orange;
   6.120 +	color: #000;
   6.121 +	display: inline-block;
   6.122 +	text-transform: uppercase;
   6.123 +}
   6.124 +.btnList .button::after{content:''}
   6.125 +
   6.126 +
   6.127 +/* Search box */
   6.128 +
   6.129 +.search input{font-size:inherit;font-family:inherit;color:inherit;border:none;height:inherit}
   6.130 +.search button{border:0;height:inherit;float:right;background:transparent;cursor:pointer}
   6.131 +
   6.132 +
   6.133 +
   6.134 +
   6.135 +
   6.136 +.log a[name]{text-decoration:none;color:#666}
   6.137 +.log a[name]:hover{color:#FFF}
   6.138 +
   6.139 +.r{float:right}
   6.140 +
   6.141 +[class*="bigicon-"] {
   6.142 +	margin: 0.5rem 0;
   6.143 +	padding: 1rem 0.8rem 1rem 3rem;
   6.144 +	background-color: hsla(0,0%,100%,0.8);
   6.145 +	box-shadow: 0 0 3px rgba(0,0,0,0.4);
   6.146 +}
   6.147 +
   6.148 +
   6.149 +a:target { background-color: yellow; }
   6.150 +
   6.151 +
   6.152 +/* Table */
   6.153 +
   6.154 +table{width:100%;box-sizing:border-box;border-collapse:collapse}
   6.155 +td{vertical-align:top}
   6.156 +td:first-child{white-space:nowrap;width:5rem}
   6.157 +td+td,th+th { border-left: 1px solid rgba(0,0,0,0.1); }
   6.158 +.activity td:first-child, .cooknotes td:first-child, td.m { color: #444; }
   6.159 +table td:nth-child(2)::before{content:': '}
   6.160 +.activity .r.c20::after{content:'  '}
   6.161 +
   6.162 +div.list td, div.list th { padding: 5px 2px; }
   6.163 +
   6.164 +.texinfo pre { display: none; }
   6.165 +.texinfo pre:target { display: block; }
   6.166 +
   6.167 +
   6.168 +/* HTML5 progress */
   6.169 +
   6.170 +.meter{height:18px}
   6.171 +.meter progress {
   6.172 +	height: inherit;
   6.173 +	width: 100%;
   6.174 +	display: inline-block;
   6.175 +	vertical-align: middle;
   6.176 +	border: none;
   6.177 +}
   6.178 +progress {
   6.179 +	border: 1px solid rgba(0,0,0,0.2);
   6.180 +	background-color: hsla(0,0%,100%,0.6);
   6.181 +	box-shadow: inset 0 0 4px rgba(0,0,0,0.1);
   6.182 +	-webkit-transition: all .5s; transition: all .5s;
   6.183 +}
   6.184 +progress::-webkit-progress-bar {
   6.185 +	background-color: hsla(0,0%,100%,0.6);
   6.186 +	box-shadow: inset 0 0 4px rgba(0,0,0,0.1);
   6.187 +}
   6.188 +progress::-webkit-progress-value {
   6.189 +	background-color: hsla(100,100%,40%,0.7);
   6.190 +	-webkit-transition: all .5s; transition: all .5s;
   6.191 +}
   6.192 +progress::-moz-progress-bar {
   6.193 +	background-color: hsla(100,100%,40%,0.7);
   6.194 +	transition: all .5s;
   6.195 +}
   6.196 +.meter span {
   6.197 +	display: block;
   6.198 +	white-space: nowrap;
   6.199 +	position: relative;
   6.200 +	margin-top: -18px;
   6.201 +	text-align: center;
   6.202 +	color: #000;
   6.203 +}
   6.204 +
   6.205 +
   6.206 +
   6.207 +
   6.208 +/* Documents iframe */
   6.209 +
   6.210 +iframe {
   6.211 +	border: none;
   6.212 +}
   6.213 +
   6.214 +
   6.215 +/* Terminal colors */
   6.216 +
   6.217 +pre.files { background-color: hsla(0,0%,0%,0.8); color: hsla(0,0%,100%,0.9); }
   6.218 +pre.files a { text-decoration: none; }
   6.219 +.c00 { color: #d3d7cf; } .c01 { color: #555753; }
   6.220 +.c10 { color: #cc0000; } .c11 { color: #ef2929; }
   6.221 +.c20 { color: #4e9a06; } .c21 { color: #8ae234; }
   6.222 +.c30 { color: #c4a000; } .c31 { color: #fce94f; }
   6.223 +.c40 { color: #3465a4; } .c41 { color: #729fcf; }
   6.224 +.c50 { color: #75507b; } .c51 { color: #ad7fa8; }
   6.225 +.c60 { color: #06989a; } .c61 { color: #34e2e2; }
   6.226 +.c70 { color: #2e3436; } .c71 { color: #eeeeec; }
   6.227 +.c01,.c11,.c21,.c31,.c41,.c51,.c61,.c71 { font-weight: bold; }
   6.228 +
   6.229 +/* Old webkit-gtk compatibility */
   6.230 +
   6.231 +header, footer, main {
   6.232 +	display: block;
   6.233 +}
   6.234 +
   6.235 +
   6.236 +/* FOLLOWING CSS HAS SOME CHANGES FOR SLITAZ COOKER! */
   6.237 +
   6.238 +/* http://prismjs.com/download.html?themes=prism-okaidia&languages=markup+css+clike+javascript+asciidoc+bash+c+css-extras+diff+ini+markdown+perl+python */
   6.239 +/**
   6.240 + * okaidia theme for JavaScript, CSS and HTML
   6.241 + * Loosely based on Monokai textmate theme by http://www.monokai.nl/
   6.242 + * @author ocodia
   6.243 + */
   6.244 +code[class*="language-"], pre[class*="language-"] {
   6.245 +	color: #f8f8f2;
   6.246 +	background: none;
   6.247 +	text-shadow: 0 1px rgba(0,0,0,0.3);
   6.248 +	text-align: left;
   6.249 +	white-space: pre;
   6.250 +	word-spacing: normal;
   6.251 +	word-break: normal;
   6.252 +	word-wrap: normal;
   6.253 +	-moz-tab-size: 4; -o-tab-size: 4; tab-size: 4;
   6.254 +	-webkit-hyphens: none; -moz-hyphens: none; hyphens: none;
   6.255 +}
   6.256 +/* Code blocks */
   6.257 +pre[class*="language-"] {
   6.258 +	padding: 1em;
   6.259 +	margin: .5em 0;
   6.260 +	overflow: auto;
   6.261 +}
   6.262 +:not(pre) > code[class*="language-"], pre[class*="language-"] {
   6.263 +	background: #272822;
   6.264 +}
   6.265 +/* Inline code */
   6.266 +:not(pre) > code[class*="language-"] {
   6.267 +	padding: .1em;
   6.268 +	white-space: normal;
   6.269 +}
   6.270 +.token.comment,.token.prolog,.token.doctype,.token.cdata{color:slategray;}
   6.271 +.token.punctuation{color:#f8f8f2;}
   6.272 +.namespace{opacity:.7;}
   6.273 +.token.property,.token.tag,.token.constant,.token.symbol,.token.deleted{color:#f92672;}
   6.274 +.token.boolean,.token.number,.token.coord{color:#ae81ff;}
   6.275 +.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#a6e22e;}
   6.276 +.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string,.token.variable{color:#f8f8f2;}
   6.277 +.token.atrule,.token.attr-value,.token.function{color:#e6db74;}
   6.278 +.token.keyword{color:#66d9ef;}
   6.279 +.token.regex,.token.important{color:#fd971f;}
   6.280 +.token.important,.token.bold{font-weight:bold;}
   6.281 +.token.italic{font-style:italic;}
   6.282 +.token.entity{cursor:help;}
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/lighttpd/cooker.css	Thu May 11 00:17:06 2017 +0300
     7.3 @@ -0,0 +1,463 @@
     7.4 +/* CSS style for SliTaz Cooker */
     7.5 +
     7.6 +html, body {
     7.7 +	height: 100%;
     7.8 +	margin: 0;
     7.9 +	font: 14px/18px sans-serif;
    7.10 +	color: rgba(0,0,0,0.9);
    7.11 +	background-color: hsl(0, 0%, 98%);
    7.12 +}
    7.13 +#container {
    7.14 +	position: relative;
    7.15 +	min-height: 100%;
    7.16 +	margin: 0 auto;
    7.17 +}
    7.18 +
    7.19 +
    7.20 +/* HEADER */
    7.21 +
    7.22 +header,   body>h2 {
    7.23 +	background-color: rgba(0,0,0,0.7);
    7.24 +	text-align: justify;
    7.25 +	box-shadow: 0 -8px 8px rgba(0,0,0,0.3) inset;
    7.26 +	line-height: 0;
    7.27 +}
    7.28 +header::before, header::after {
    7.29 +	display: inline-block;
    7.30 +	width: 100%;
    7.31 +	overflow: hidden; height: 0; content: ''; visibility: hidden;
    7.32 +}
    7.33 +header h1 {
    7.34 +	display: inline-block;
    7.35 +}
    7.36 +header h1,   body>h2 {
    7.37 +	margin: auto 0;
    7.38 +	box-sizing: border-box;
    7.39 +	white-space: nowrap;
    7.40 +	vertical-align: middle;
    7.41 +}
    7.42 +body>h2 {
    7.43 +	padding: 5px 0;
    7.44 +}
    7.45 +header h1::before,   body>h2::before {
    7.46 +	display: inline-block;
    7.47 +	content: url("data:image/svg+xml,<svg height='40' width='40' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><linearGradient id='a' gradientUnits='userSpaceOnUse' x1='20' x2='20' y1='2.5' y2='37.5'><stop offset='0' stop-color='%23ff7825'/><stop offset='1' stop-color='%23762400'/></linearGradient><path d='m30.2 26.3c0-.9-4-3.5-4.9-3.9-.1 1.7.3 2.5-.2 4.6-.4 2.1-1.4 4.2-2.8 5.7-1.2 1.3-2.5 2.1-4.4 2.1-2.6 0-4-2.3-4.6-4.8-.5-3.8 1.1-7 1.1-7.4-.5-.1-4.3 2.2-5.7 3.2-.8 3 .4 7.2 2.5 10.9-3.5-3.2-5-7.8-5.6-11.6 2.3-1.8 4.3-2.3 5.5-3.6-.9 0-5.3.4-5.9 1-.8 1.6-1.3 6.8-1.2 10.2-2.5-4.7-1.2-11.2-1.1-11.9.3-.8 7.8-1.2 8.4-1.8-.5-.4-4.5-1.6-7.1-3 .3-1.6 3.2-8.2 6.4-10.6-1.1 2.2-3.1 7.3-3.4 9.3.6.4 5.3 2.4 6 2.3-.4-.7-3.5-3.1-3.9-3.8.8-3.2 6.7-9 8.5-9.8-2 1.9-5.3 6.7-5.7 9.2 1.7 1.7 3.9 3.8 4.9 4.1.3-.1.4-.7.4-1.1.6-2.8 3.2-3.7 4.1-3.7 1.2 0 2.5 1.4 2.7 2.3.1.7-.2 2 0 2.8 1.1-.4 5.7-3.6 6.3-4.4.4-3.3-1.3-6.6-3.2-9.5 2.5 1.4 5.6 6.8 6 9.9-.7 1.1-4 2.7-5 3.9.7 0 5.4-1.5 6.4-2.2.4-.4.4-.8.4-1.1 0-2.8-.4-6.3-1.1-8.8 2.5 2.8 3.4 7 3.6 10.4 0 .4-.1.6-.1 1-1.1.5-7.4 2.4-7.5 2.9-.1.3 5.3.7 7.6 1.5-.4 3.7-1.8 8.7-4.3 11.6.6-2.5 1.7-6.8 1.4-9.9-1.8-.4-5.3-1.1-5.5-.8-.3.4 4.2 2.6 4.2 3.7-1.3 3.9-4.9 8.8-8.6 11.4 4.5-5.6 5.5-9 5.4-10.5z' fill='url(%23a)'/></svg>");
    7.48 +	vertical-align: middle;
    7.49 +}
    7.50 +header a,   body>h2 {
    7.51 +	color: hsla(0, 0%, 100%, 0.7);
    7.52 +	-webkit-transition: .2s text-shadow; transition: .2s text-shadow;
    7.53 +	text-decoration: none;
    7.54 +}
    7.55 +header a:hover,   body>h2:hover {
    7.56 +	color: hsla(0, 0%, 100%, 1);
    7.57 +	text-shadow: 0 0 4px hsla(0, 0%, 100%, 0.5);
    7.58 +	text-decoration: none;
    7.59 +}
    7.60 +header h1 a,   body>h2 {
    7.61 +	font: bold italic 20px/20px sans-serif;
    7.62 +}
    7.63 +.network {
    7.64 +	display: inline-block;
    7.65 +	text-align: left;
    7.66 +	vertical-align: middle;
    7.67 +	font-size: 12px;
    7.68 +	line-height: normal;
    7.69 +	color: #999;
    7.70 +}
    7.71 +.network a {
    7.72 +	display: inline-block;
    7.73 +	padding: 8px 6px;
    7.74 +	vertical-align: middle;
    7.75 +}
    7.76 +header select, header option {
    7.77 +	background-color: transparent;
    7.78 +	color: inherit;
    7.79 +	border: none;
    7.80 +	font-size: inherit;
    7.81 +}
    7.82 +
    7.83 +
    7.84 +/* FOOTER */
    7.85 +
    7.86 +footer, div.foot {
    7.87 +	padding: 20px 0;
    7.88 +	clear: both;
    7.89 +	text-align: center;
    7.90 +	font-size: 90%;
    7.91 +	color: #666;
    7.92 +	background-color: hsla(0, 0%, 20%, 0.1);
    7.93 +	box-shadow: 0 4px 8px hsla(0, 0%, 0%, 0.2) inset;
    7.94 +
    7.95 +	position: absolute;
    7.96 +	bottom: 0;
    7.97 +	width: 100%;
    7.98 +}
    7.99 +footer a+a::before {
   7.100 +	display: inline-block;
   7.101 +	content: ' • ';
   7.102 +	color: #E81;
   7.103 +}
   7.104 +footer div {
   7.105 +	margin: 12px;
   7.106 +}
   7.107 +
   7.108 +
   7.109 +
   7.110 +/* CONTENT */
   7.111 +
   7.112 +h2 {
   7.113 +	margin: 0; padding: 0.2rem;
   7.114 +	font: bold 1.3rem/2rem sans-serif;
   7.115 +	color: rgba(0,0,0,0.7);
   7.116 +}
   7.117 +section h2, section h3 {
   7.118 +	background-color: rgba(0,0,0,0.05);
   7.119 +	border-top-left-radius: 4px;
   7.120 +	border-top-right-radius: 4px;
   7.121 +}
   7.122 +h3 {
   7.123 +	margin: 0; padding: 0.2rem;
   7.124 +	font: bold 1.15rem/1.5rem sans-serif;
   7.125 +	color: rgba(0,0,0,0.6);
   7.126 +}
   7.127 +a {
   7.128 +	text-decoration: none;
   7.129 +	color: hsl(215, 60%, 40%);
   7.130 +	-webkit-transition: .2s border-color, .2s box-shadow; transition: .2s border-color, .2s box-shadow;
   7.131 +	border-bottom: 1px solid transparent;
   7.132 +}
   7.133 +main td a:hover, p a:hover {
   7.134 +	text-decoration: none;
   7.135 +	color: hsl(215, 100%, 40%);
   7.136 +	border-color: hsl(215, 100%, 40%);
   7.137 +}
   7.138 +pre {
   7.139 +	background-color: rgba(0,0,0,0.03);
   7.140 +	border: 1px solid rgba(0,0,0,0.1);
   7.141 +	padding: 8px;
   7.142 +	margin: 0;
   7.143 +	overflow: auto;
   7.144 +	font: 13px/16px monospace;
   7.145 +}
   7.146 +pre .underline { border-bottom: 1px solid #444; display: block; right: 0; }
   7.147 +
   7.148 +/* Content */
   7.149 +
   7.150 +main {
   7.151 +	margin: auto;
   7.152 +	padding: 0.5em 0.5em 5em;
   7.153 +}
   7.154 +#content2, div.list {
   7.155 +	width: 100%; box-sizing: border-box;
   7.156 +	max-width: 700px;
   7.157 +	margin: auto;
   7.158 +	padding: 0.5em;
   7.159 +}
   7.160 +
   7.161 +
   7.162 +.span-ok    { color: #0a0; }
   7.163 +.span-red   { color: red; }
   7.164 +.span-sky   { color: blue; }
   7.165 +.span-no    { color: #d90; }
   7.166 +.span-line  { color: #888; }
   7.167 +.log-date   { color: #666; font-size: 95%; }
   7.168 +.sh-comment { color: #a00; }
   7.169 +.sh-val     { color: #e50; font-weight: bold; }
   7.170 +.var        { color: #05a; }
   7.171 +
   7.172 +
   7.173 +/* Colored log */
   7.174 +
   7.175 +.log b  { font-weight: normal;   color: red; }
   7.176 +.log u  { text-decoration: none; color: darkorange; }
   7.177 +.log i  { font-style: normal;    color: green; }
   7.178 +.log em { font-style: normal;    background-color: lightsteelblue; font-weight: bold; display: inline-block; width: 100%; }
   7.179 +
   7.180 +
   7.181 +
   7.182 +/* Buttons */
   7.183 +
   7.184 +.button {
   7.185 +	display: inline-block;
   7.186 +	padding: 4px;
   7.187 +	margin: 2px 0;
   7.188 +	text-decoration: none;
   7.189 +	color: rgba(0,0,0,0.7);
   7.190 +	border: 1px solid;
   7.191 +	border-color: rgba(0,0,0,0.3) rgba(0,0,0,0.5) rgba(0,0,0,0.5) rgba(0,0,0,0.3);
   7.192 +	-moz-user-select: none;
   7.193 +}
   7.194 +.button.active {
   7.195 +	color: inherit;
   7.196 +	padding: 5px;
   7.197 +	border: none;
   7.198 +	box-shadow: 0 0 3px rgba(0,0,0,0.7) inset;
   7.199 +	text-decoration: none;
   7.200 +}
   7.201 +.button:not(.active):hover, input:hover {
   7.202 +	color: inherit;
   7.203 +	box-shadow: 0 0 4px rgba(0,0,0,0.3);
   7.204 +	text-decoration: none;
   7.205 +	outline: none;
   7.206 +}
   7.207 +.button[data-acc]::before {
   7.208 +	content: attr(data-acc);
   7.209 +	display: inline-block;
   7.210 +	padding-right: 4px;
   7.211 +	margin-right: 4px;
   7.212 +	text-align: center;
   7.213 +	text-transform: uppercase;
   7.214 +	border-right: 1px solid;
   7.215 +	border-color: inherit;
   7.216 +}
   7.217 +
   7.218 +
   7.219 +/* Search box */
   7.220 +
   7.221 +.search input {
   7.222 +	padding: 2px;
   7.223 +	font-size: inherit;
   7.224 +	font-family: inherit;
   7.225 +	color: inherit;
   7.226 +	border: 1px solid rgba(0,0,0,0.3);
   7.227 +	-webkit-transition: .2s box-shadow, .5s padding cubic-bezier(.68,-0.55,.27,1.55);
   7.228 +			transition: .2s box-shadow, .5s padding cubic-bezier(.68,-0.55,.27,1.55);
   7.229 +	float: right;
   7.230 +	height: 28px;
   7.231 +	box-sizing: border-box;
   7.232 +}
   7.233 +.search input:focus {
   7.234 +	padding-right: 22px;
   7.235 +}
   7.236 +.search button {
   7.237 +	background: transparent url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15'><path d='m5.5 1c5.5.3 5.5 5.5 5.5 5.5 0 1.8-1 3.1-1 3.1l3.8 3.8-1.4 1.4-3.8-3.8s-1.3 1-3.1 1c-5.5-.3-5.5-5.5-5.5-5.5s0-5.2 5.5-5.5zm0 2c-3.5.2-3.5 3.5-3.5 3.5s0 3.3 3.5 3.5c3.5-.2 3.5-3.5 3.5-3.5s0-3.3-3.5-3.5z'/></svg>") no-repeat 0 0;
   7.238 +	border: 0;
   7.239 +	width: 19px;
   7.240 +	height: 19px;
   7.241 +	text-indent: -99999px;
   7.242 +	margin-left: -22px;
   7.243 +	margin-top: 6px;
   7.244 +	padding: 0;
   7.245 +	opacity: 0.6;
   7.246 +	cursor: pointer;
   7.247 +	float: right;
   7.248 +}
   7.249 +
   7.250 +
   7.251 +/* Round corner */
   7.252 +
   7.253 +pre, .button, .search input, [class*="bigicon-"], progress {
   7.254 +	border-radius: 3px;
   7.255 +}
   7.256 +
   7.257 +
   7.258 +
   7.259 +.log a[name] { text-decoration: none; color: #666; }
   7.260 +.log a[name]:hover { color: #000; }
   7.261 +
   7.262 +.r { float: right; }
   7.263 +form.r, .button.r { margin: 3px 3px 0; }
   7.264 +
   7.265 +.button.r        { background-color: white; }
   7.266 +.button.receipt  { background-color: greenyellow; }
   7.267 +.button.website  { background-color: skyblue; }
   7.268 +.button.files    { background-color: khaki; }
   7.269 +.button.desc     { background-color: sandybrown; }
   7.270 +.button.download { background-color: gold; }
   7.271 +.button.source   { background-color: yellow; }
   7.272 +.button.browse   { background-color: tan; }
   7.273 +.button.doc      { background-color: plum; }
   7.274 +.button.log      { background-color: lightgray; }
   7.275 +
   7.276 +.icon::before {
   7.277 +	height: 16px;
   7.278 +	vertical-align: -2px;
   7.279 +	display: inline-block;
   7.280 +	padding-right: 2px;
   7.281 +	opacity: 0.6;
   7.282 +}
   7.283 +.icon.receipt::before { content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><path d='m6.2 2-.2 1.8-1.6.9-1.7-.8-1.8 3 1.5 1.1v1.9l-1.5 1.1 1.8 3 1.7-.8 1.6.9.2 1.8h3.6l.2-1.8 1.6-.9 1.7.8 1.8-3-1.5-1.1v-1.9l1.5-1.1-1.8-3-1.7.8-1.6-.9-.2-1.8zm1.8 5s1.9 0 2 2c-.1 2-2 2-2 2s-1.9 0-2-2c.1-2 2-2 2-2z'/></svg>"); }
   7.284 +.icon.website::before { content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><path d='m8 2c-7 .3-7 7-7 7s0 6.7 7 7c7-.3 7-7 7-7s0-6.7-7-7zm-.3 1.9c-.8 1.9-.5 3 0 3.6-1 0-1-.8-1.8-.8-.3 0-.5.4-.5.7 0 2 4.8.8 4.8 3.3 0 1.6-1 2.6-2.7 3.2 0-1.9-.7-2.2-1.8-2.9-.3-.2-.3-.3-.2-.6.2-.6.4-.9 1-1.3-1.3-.3-2.4-.6-3.3-1.4 0-1 1.7-3.8 4.5-3.8zm4.5 2.4c.7 1 1.1 2.6.5 4.2-.6-1.1-1.7-1.7-1.7-2.5s1-1.7 1.2-1.7z'/></svg>"); }
   7.285 +.icon.files::before { content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><path d='m5 2v1h3.4l4.6 4.6v5.4h1c1 0 1-1 1-1v-7l-4-4h-5s-1 0-1 1zm-3 3v10s0 1 1 1h8s1 0 1-1v-7l-4-4h-5s-1 0-1 1z'/></svg>"); }
   7.286 +.icon.desc::before { content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><path d='m3 2c-2 0-2 2-2 2v10c0 2 2 2 2 2h10s2 0 2-2v-10c0-2-2-2-2-2zm1 3h8v1h-8zm0 3h8v1h-8zm0 3h6v1h-6z'/></svg>"); }
   7.287 +.icon.download::before, .icon.source::before { content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='16'><path d='m5 2v5h-2.3l4.3 6.3 4.4-6.3h-2.4v-5zm-4 12v2h12.1v-2z'/></svg>"); }
   7.288 +.icon.browse::before { content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><path d='m8 4s-5.4-.4-8 5c2.6 5.4 8 5 8 5s5.4.4 8-5c-2.6-5.4-8-5-8-5zm3 5c-.2 4-5.8 4-6 0 .2-4 5.8-4 6 0zm-4 0c0 1.3 2 1.3 2 0s-2-1.3-2 0z'/></svg>"); }
   7.289 +.icon.doc::before { content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><path d='m4.5 3c-2.5 0-3.5 1-3.5 1v12.1s1-1 3.5-1 3.5 1 3.5 1 1-1 3.5-1 3.5 1 3.5 1v-12.1s-1-1-3.5-1-3.5 1-3.5 1-1-1-3.5-1zm7 1.2c1.5 0 2.5.4 2.5.4v9.7s-1-.4-2.5-.4c-2.5 0-3.5 1-3.5 1v-9.7s1-1 3.5-1z'/></svg>"); }
   7.290 +.icon.log::before { content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><path d='m8 2c-7 .4-7 7-7 7s0 6.6 7 7c7-.4 7-7 7-7s0-6.6-7-7zm0 2c5 .3 5 5 5 5s0 4.7-5 5c-5-.3-5-5-5-5s0-4.7 5-5zm-1 1v4.4l2.8 2.8 1.4-1.4-2.2-2.2v-3.6z'/></svg>"); }
   7.291 +.icon.more::before { content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' height='16' width='16'><path d='m3 7c-2 .1-2 2-2 2s0 1.9 2 2c2-.1 2-2 2-2s0-1.9-2-2zm5 0c-2 .1-2 2-2 2s0 1.9 2 2c2-.1 2-2 2-2s0-1.9-2-2zm5 0c-2 .1-2 2-2 2s0 1.9 2 2c2-.1 2-2 2-2s0-1.9-2-2z'/></svg>"); }
   7.292 +.icon.bell::before { content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' height='16' width='16'><path d='m9.6 2.7s-3.4-.2-4.5 3c-1.9 4.6-2.5 3.8-2.8 4.4-.2.6.4.8.4.8l9.3 3.3s.5.2.8-.3-.9-.5.7-5.2c1-3.5-1.6-5.1-1.6-5.1s.3-1.1-.8-1.5c-1-.4-1.5.6-1.5.6zm-2.9 11s-.4 1.4 1.3 2.2c2 .4 2.3-.9 2.3-.9z'/></svg>"); }
   7.293 +
   7.294 +.bigicon-i {
   7.295 +	background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><path d='m16 2c-14 .7-14 14-14 14s0 13.3 14 14c14-.7 14-14 14-14s0-13.3-14-14zm0 5.5c2.5 0 2.5 2.5 2.5 2.5s0 2.5-2.5 2.5-2.5-2.5-2.5-2.5 0-2.5 2.5-2.5zm-2 6.5h4v10h-4z' fill='%2329F'/></svg>") no-repeat 0.5rem 50%;
   7.296 +}
   7.297 +.bigicon-w {
   7.298 +	background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><path d='m16 1.3c-.7 0-1.3.3-1.7 1l-14 24.7c-.8 1.4.2 3 1.7 3h28c1.5 0 2.5-1.6 1.7-3l-14-24.7c-.4-.7-1-1-1.7-1zm-2 6.7h4v12h-4zm0 14h4v4h-4z' fill='%23F90'/></svg>") no-repeat 0.5rem 50%;
   7.299 +}
   7.300 +.bigicon-e {
   7.301 +	background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><path d='m16 2c-14 .7-14 14-14 14s0 13.3 14 14c14-.7 14-14 14-14s0-13.3-14-14zm-2 4h4v12h-4zm0 16h4v4h-4z' fill='%23F43'/></svg>") no-repeat 0.5rem 50%;
   7.302 +}
   7.303 +[class*="bigicon-"] {
   7.304 +	margin: 0.5rem 0;
   7.305 +	padding: 1rem 0.8rem 1rem 3rem;
   7.306 +	background-color: hsla(0,0%,100%,0.8);
   7.307 +	box-shadow: 0 0 3px rgba(0,0,0,0.4);
   7.308 +}
   7.309 +
   7.310 +
   7.311 +a:target { background-color: yellow; }
   7.312 +
   7.313 +
   7.314 +/* Table */
   7.315 +
   7.316 +table { width: 100%; box-sizing: border-box; border-collapse: collapse; /*box-shadow: 0 0 4px rgba(0,0,0,0.3);*/ }
   7.317 +th { background-color: rgba(0,0,0,0.2); padding: 3px; }
   7.318 +td { padding: 2px; vertical-align: top; }
   7.319 +td:first-child { white-space: nowrap; width: 5rem; }
   7.320 +td+td, th+th { border-left: 1px solid rgba(0,0,0,0.1); }
   7.321 +.activity td:first-child, .cooknotes td:first-child, td.m { color: rgba(0,0,0,0.6); }
   7.322 +
   7.323 +tbody tr:nth-child(odd) {
   7.324 +	background-color: hsla(0, 0%, 100%, 0.3);
   7.325 +}
   7.326 +tbody tr:nth-child(even) {
   7.327 +	background-color: hsla(0, 0%,   0%, 0.05);
   7.328 +}
   7.329 +
   7.330 +
   7.331 +
   7.332 +div.list td, div.list th { padding: 5px 2px; }
   7.333 +
   7.334 +.texinfo pre { display: none; }
   7.335 +.texinfo pre:target { display: block; }
   7.336 +
   7.337 +section, div.list {
   7.338 +	margin: 0.6rem 0;
   7.339 +	padding: 4px;
   7.340 +	box-shadow: 0 0 4px rgba(0,0,0,0.3);
   7.341 +	border-radius: 4px;
   7.342 +}
   7.343 +div.list {
   7.344 +	margin: 2rem auto;
   7.345 +}
   7.346 +
   7.347 +
   7.348 +/* HTML5 progress */
   7.349 +
   7.350 +.meter {
   7.351 +	height: 1.4rem;
   7.352 +	color: inherit;
   7.353 +}
   7.354 +.meter progress {
   7.355 +	height: inherit;
   7.356 +	width: 100%;
   7.357 +	box-sizing: border-box;
   7.358 +	display: inline-block;
   7.359 +	vertical-align: middle;
   7.360 +}
   7.361 +progress {
   7.362 +	border: 1px solid rgba(0,0,0,0.2);
   7.363 +	background-color: hsla(0,0%,100%,0.6);
   7.364 +	box-shadow: inset 0 0 4px rgba(0,0,0,0.1);
   7.365 +	-webkit-transition: all .5s; transition: all .5s;
   7.366 +}
   7.367 +progress::-webkit-progress-bar {
   7.368 +	background-color: hsla(0,0%,100%,0.6);
   7.369 +	box-shadow: inset 0 0 4px rgba(0,0,0,0.1);
   7.370 +}
   7.371 +progress::-webkit-progress-value {
   7.372 +	background-color: hsla(100,100%,40%,0.7);
   7.373 +	-webkit-transition: all .5s; transition: all .5s;
   7.374 +}
   7.375 +progress::-moz-progress-bar {
   7.376 +	background-color: hsla(100,100%,40%,0.7);
   7.377 +	transition: all .5s;
   7.378 +}
   7.379 +.meter span {
   7.380 +	display: block;
   7.381 +	white-space: nowrap;
   7.382 +	position: relative;
   7.383 +	margin: -1.3rem auto 0 0.1rem;
   7.384 +	text-align: center;
   7.385 +}
   7.386 +
   7.387 +
   7.388 +
   7.389 +
   7.390 +/* Documents iframe */
   7.391 +
   7.392 +iframe {
   7.393 +	border: none;
   7.394 +}
   7.395 +
   7.396 +
   7.397 +/* Terminal colors */
   7.398 +
   7.399 +pre.files { background-color: hsla(0,0%,0%,0.8); color: hsla(0,0%,100%,0.9); }
   7.400 +pre.files a { text-decoration: none; }
   7.401 +pre.files a:hover { text-decoration: underline; }
   7.402 +.c00 { color: #d3d7cf; } .c01 { color: #555753; }
   7.403 +.c10 { color: #cc0000; } .c11 { color: #ef2929; }
   7.404 +.c20 { color: #4e9a06; } .c21 { color: #8ae234; }
   7.405 +.c30 { color: #c4a000; } .c31 { color: #fce94f; }
   7.406 +.c40 { color: #3465a4; } .c41 { color: #729fcf; }
   7.407 +.c50 { color: #75507b; } .c51 { color: #ad7fa8; }
   7.408 +.c60 { color: #06989a; } .c61 { color: #34e2e2; }
   7.409 +.c70 { color: #2e3436; } .c71 { color: #eeeeec; }
   7.410 +.c01,.c11,.c21,.c31,.c41,.c51,.c61,.c71 { font-weight: bold; }
   7.411 +
   7.412 +/* Old webkit-gtk compatibility */
   7.413 +
   7.414 +header, footer, main {
   7.415 +	display: block;
   7.416 +}
   7.417 +
   7.418 +
   7.419 +/* FOLLOWING CSS HAS SOME CHANGES FOR SLITAZ COOKER! */
   7.420 +
   7.421 +/* http://prismjs.com/download.html?themes=prism-okaidia&languages=markup+css+clike+javascript+asciidoc+bash+c+css-extras+diff+ini+markdown+perl+python */
   7.422 +/**
   7.423 + * okaidia theme for JavaScript, CSS and HTML
   7.424 + * Loosely based on Monokai textmate theme by http://www.monokai.nl/
   7.425 + * @author ocodia
   7.426 + */
   7.427 +code[class*="language-"], pre[class*="language-"] {
   7.428 +	color: #f8f8f2;
   7.429 +	background: none;
   7.430 +	text-shadow: 0 1px rgba(0,0,0,0.3);
   7.431 +	text-align: left;
   7.432 +	white-space: pre;
   7.433 +	word-spacing: normal;
   7.434 +	word-break: normal;
   7.435 +	word-wrap: normal;
   7.436 +	-moz-tab-size: 4; -o-tab-size: 4; tab-size: 4;
   7.437 +	-webkit-hyphens: none; -moz-hyphens: none; hyphens: none;
   7.438 +}
   7.439 +/* Code blocks */
   7.440 +pre[class*="language-"] {
   7.441 +	padding: 1em;
   7.442 +	margin: .5em 0;
   7.443 +	overflow: auto;
   7.444 +}
   7.445 +:not(pre) > code[class*="language-"], pre[class*="language-"] {
   7.446 +	background: #272822;
   7.447 +}
   7.448 +/* Inline code */
   7.449 +:not(pre) > code[class*="language-"] {
   7.450 +	padding: .1em;
   7.451 +	border-radius: .3em;
   7.452 +	white-space: normal;
   7.453 +}
   7.454 +.token.comment,.token.prolog,.token.doctype,.token.cdata{color:slategray;}
   7.455 +.token.punctuation{color:#f8f8f2;}
   7.456 +.namespace{opacity:.7;}
   7.457 +.token.property,.token.tag,.token.constant,.token.symbol,.token.deleted{color:#f92672;}
   7.458 +.token.boolean,.token.number,.token.coord{color:#ae81ff;}
   7.459 +.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#a6e22e;}
   7.460 +.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string,.token.variable{color:#f8f8f2;}
   7.461 +.token.atrule,.token.attr-value,.token.function{color:#e6db74;}
   7.462 +.token.keyword{color:#66d9ef;}
   7.463 +.token.regex,.token.important{color:#fd971f;}
   7.464 +.token.important,.token.bold{font-weight:bold;}
   7.465 +.token.italic{font-style:italic;}
   7.466 +.token.entity{cursor:help;}
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/lighttpd/cooker.js	Thu May 11 00:17:06 2017 +0300
     8.3 @@ -0,0 +1,105 @@
     8.4 +//
     8.5 +// Set of scripts for SliTaz Cooker
     8.6 +// that make the better user interaction with it
     8.7 +//
     8.8 +
     8.9 +
    8.10 +// Start updating percents of package completion
    8.11 +
    8.12 +function startUpdating(pkg) {
    8.13 +	upID = setInterval(function() {
    8.14 +		var upct = new XMLHttpRequest();
    8.15 +		upct.onreadystatechange = function() {
    8.16 +			if (this.readyState == 4 && this.status == 200) {
    8.17 +				response = this.responseText.trim();
    8.18 +				if (response == 'reload') {
    8.19 +					// Package in question not cooked now (finished) ->
    8.20 +					// Server sends 'reload' response ->
    8.21 +					// Stop updating and reload the page
    8.22 +					clearInterval(upID);
    8.23 +					location.reload();
    8.24 +				} else {
    8.25 +					// Update text and gauge value
    8.26 +					var pct = document.getElementById('pct');
    8.27 +					if (pct !== null) pct.innerHTML = response + '%';
    8.28 +					var gauge = document.getElementById('gauge');
    8.29 +					if (gauge !== null) gauge.value = response;
    8.30 +				}
    8.31 +			}
    8.32 +		};
    8.33 +		upct.open('GET', '?pct=' + pkg, true);
    8.34 +		upct.responseType = 'text';
    8.35 +		upct.send();
    8.36 +	}, 10000);
    8.37 +}
    8.38 +
    8.39 +
    8.40 +// Stop updating percents of package completion
    8.41 +
    8.42 +function stopUpdating() {
    8.43 +	clearInterval(upID);
    8.44 +	// Also remove the table row containing gauge because it will be no actual anymore
    8.45 +	document.getElementById('pct').innerHTML = '';
    8.46 +	// first "parentElement" of gauge is <td>, second - is <tr>
    8.47 +	document.getElementById('gauge').parentElement.parentElement.remove();
    8.48 +}
    8.49 +
    8.50 +
    8.51 +// Decide whether we need to update percentage
    8.52 +
    8.53 +if (typeof updatePkg !== 'undefined')
    8.54 +	startUpdating(updatePkg);
    8.55 +
    8.56 +
    8.57 +// Calculate and show server date
    8.58 +
    8.59 +function calcAndShowDate() {
    8.60 +	var serverDateNow = new Date() - deltaTime;
    8.61 +	var serverDateString = new Date(serverDateNow).toISOString();
    8.62 +	// Format string in form 'YYYY-mm-dd HH:MM UTC'
    8.63 +	document.getElementById('date').innerHTML = serverDateString.substring(0, 10) + ' ' + serverDateString.substring(11, 16) + ' UTC';
    8.64 +}
    8.65 +
    8.66 +
    8.67 +// Update "server date" on the page
    8.68 +// First, wait for the next minute beginning, update once, then update every minute
    8.69 +
    8.70 +function refreshDate(firstWait, serverTimeMs) {
    8.71 +	deltaTime = new Date() - serverTimeMs;
    8.72 +	var id1 = setTimeout(function() {
    8.73 +		calcAndShowDate();
    8.74 +		var id2 = setInterval(calcAndShowDate, 60000);
    8.75 +	}, firstWait);
    8.76 +}
    8.77 +
    8.78 +
    8.79 +// Resize the iframe containing document to fit it's height without scrolling
    8.80 +
    8.81 +function resizeIframe(theframe) {
    8.82 +	var height = theframe.contentWindow.document.body.scrollHeight;
    8.83 +	// Limit height for VERY long documents (lua->doc->manual.html)
    8.84 +	// because TazWeb fails on this
    8.85 +	if ( height > 20000 ) {
    8.86 +		height = 480;
    8.87 +		theframe.focus();
    8.88 +	}
    8.89 +	theframe.style.height = height + 'px';
    8.90 +}
    8.91 +
    8.92 +
    8.93 +/* http://prismjs.com/download.html?themes=prism-okaidia&languages=markup+css+clike+javascript+asciidoc+bash+c+css-extras+diff+ini+makefile+markdown+perl+python */
    8.94 +var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function(e){var t=n.util.type(e);switch(t){case"Object":var a={};for(var r in e)e.hasOwnProperty(r)&&(a[r]=n.util.clone(e[r]));return a;case"Array":return e.map&&e.map(function(e){return n.util.clone(e)})}return e}},languages:{extend:function(e,t){var a=n.util.clone(n.languages[e]);for(var r in t)a[r]=t[r];return a},insertBefore:function(e,t,a,r){r=r||n.languages;var l=r[e];if(2==arguments.length){a=arguments[1];for(var i in a)a.hasOwnProperty(i)&&(l[i]=a[i]);return l}var o={};for(var s in l)if(l.hasOwnProperty(s)){if(s==t)for(var i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);o[s]=l[s]}return n.languages.DFS(n.languages,function(t,n){n===r[e]&&t!=e&&(this[t]=o)}),r[e]=o},DFS:function(e,t,a,r){r=r||{};for(var l in e)e.hasOwnProperty(l)&&(t.call(e,l,e[l],a||l),"Object"!==n.util.type(e[l])||r[n.util.objId(e[l])]?"Array"!==n.util.type(e[l])||r[n.util.objId(e[l])]||(r[n.util.objId(e[l])]=!0,n.languages.DFS(e[l],t,l,r)):(r[n.util.objId(e[l])]=!0,n.languages.DFS(e[l],t,null,r)))}},plugins:{},highlightAll:function(e,t){var a={callback:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};n.hooks.run("before-highlightall",a);for(var r,l=a.elements||document.querySelectorAll(a.selector),i=0;r=l[i++];)n.highlightElement(r,e===!0,a.callback)},highlightElement:function(t,a,r){for(var l,i,o=t;o&&!e.test(o.className);)o=o.parentNode;o&&(l=(o.className.match(e)||[,""])[1].toLowerCase(),i=n.languages[l]),t.className=t.className.replace(e,"").replace(/\s+/g," ")+" language-"+l,o=t.parentNode,/pre/i.test(o.nodeName)&&(o.className=o.className.replace(e,"").replace(/\s+/g," ")+" language-"+l);var s=t.textContent,u={element:t,language:l,grammar:i,code:s};if(n.hooks.run("before-sanity-check",u),!u.code||!u.grammar)return u.code&&(u.element.textContent=u.code),n.hooks.run("complete",u),void 0;if(n.hooks.run("before-highlight",u),a&&_self.Worker){var g=new Worker(n.filename);g.onmessage=function(e){u.highlightedCode=e.data,n.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,r&&r.call(u.element),n.hooks.run("after-highlight",u),n.hooks.run("complete",u)},g.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else u.highlightedCode=n.highlight(u.code,u.grammar,u.language),n.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,r&&r.call(t),n.hooks.run("after-highlight",u),n.hooks.run("complete",u)},highlight:function(e,t,r){var l=n.tokenize(e,t);return a.stringify(n.util.encode(l),r)},tokenize:function(e,t){var a=n.Token,r=[e],l=t.rest;if(l){for(var i in l)t[i]=l[i];delete t.rest}e:for(var i in t)if(t.hasOwnProperty(i)&&t[i]){var o=t[i];o="Array"===n.util.type(o)?o:[o];for(var s=0;s<o.length;++s){var u=o[s],g=u.inside,c=!!u.lookbehind,h=!!u.greedy,f=0,d=u.alias;if(h&&!u.pattern.global){var p=u.pattern.toString().match(/[imuy]*$/)[0];u.pattern=RegExp(u.pattern.source,p+"g")}u=u.pattern||u;for(var m=0,y=0;m<r.length;y+=r[m].length,++m){var v=r[m];if(r.length>e.length)break e;if(!(v instanceof a)){u.lastIndex=0;var b=u.exec(v),k=1;if(!b&&h&&m!=r.length-1){if(u.lastIndex=y,b=u.exec(e),!b)break;for(var w=b.index+(c?b[1].length:0),_=b.index+b[0].length,P=m,A=y,j=r.length;j>P&&_>A;++P)A+=r[P].length,w>=A&&(++m,y=A);if(r[m]instanceof a||r[P-1].greedy)continue;k=P-m,v=e.slice(y,A),b.index-=y}if(b){c&&(f=b[1].length);var w=b.index+f,b=b[0].slice(f),_=w+b.length,x=v.slice(0,w),O=v.slice(_),S=[m,k];x&&S.push(x);var N=new a(i,g?n.tokenize(b,g):b,d,b,h);S.push(N),O&&S.push(O),Array.prototype.splice.apply(r,S)}}}}}return r},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,l=0;r=a[l++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.length=0|(a||"").length,this.greedy=!!r};if(a.stringify=function(e,t,r){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join("");var l={type:e.type,content:a.stringify(e.content,t,r),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:r};if("comment"==l.type&&(l.attributes.spellcheck="true"),e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o=Object.keys(l.attributes).map(function(e){return e+'="'+(l.attributes[e]||"").replace(/"/g,"&quot;")+'"'}).join(" ");return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+(o?" "+o:"")+">"+l.content+"</"+l.tag+">"},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,l=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),l&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return r&&(n.filename=r.src,!document.addEventListener||n.manual||r.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
    8.95 +Prism.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/i,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&amp;/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
    8.96 +Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:{pattern:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/(<style[\w\W]*?>)[\w\W]*?(?=<\/style>)/i,lookbehind:!0,inside:Prism.languages.css,alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag));
    8.97 +Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};
    8.98 +Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*\*?|\/|~|\^|%|\.{3}/}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\\\|\\?[^\\])*?`/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(<script[\w\W]*?>)[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:"language-javascript"}}),Prism.languages.js=Prism.languages.javascript;
    8.99 +!function(a){var i={pattern:/(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\]\\]|\\.)*\]|[^\]\\]|\\.)*\]/m,lookbehind:!0,inside:{quoted:{pattern:/([$`])(?:(?!\1)[^\\]|\\.)*\1/,inside:{punctuation:/^[$`]|[$`]$/}},interpreted:{pattern:/'(?:[^'\\]|\\.)*'/,inside:{punctuation:/^'|'$/}},string:/"(?:[^"\\]|\\.)*"/,variable:/\w+(?==)/,punctuation:/^\[|\]$|,/,operator:/=/,"attr-value":/(?!^\s+$).+/}};a.languages.asciidoc={"comment-block":{pattern:/^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m,alias:"comment"},table:{pattern:/^\|={3,}(?:(?:\r?\n|\r).*)*?(?:\r?\n|\r)\|={3,}$/m,inside:{specifiers:{pattern:/(?!\|)(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*])?(?:[<^>](?:\.[<^>])?|\.[<^>])?[a-z]*)(?=\|)/,alias:"attr-value"},punctuation:{pattern:/(^|[^\\])[|!]=*/,lookbehind:!0}}},"passthrough-block":{pattern:/^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^\++|\++$/}},"literal-block":{pattern:/^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^(?:-+|\.+)|(?:-+|\.+)$/}},"other-block":{pattern:/^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/}},"list-punctuation":{pattern:/(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im,lookbehind:!0,alias:"punctuation"},"list-label":{pattern:/(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im,lookbehind:!0,alias:"symbol"},"indented-block":{pattern:/((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/,lookbehind:!0},comment:/^\/\/.*/m,title:{pattern:/^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} +.+|^\.(?![\s.]).*/m,alias:"important",inside:{punctuation:/^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/}},"attribute-entry":{pattern:/^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,alias:"tag"},attributes:i,hr:{pattern:/^'{3,}$/m,alias:"punctuation"},"page-break":{pattern:/^<{3,}$/m,alias:"punctuation"},admonition:{pattern:/^(?:TIP|NOTE|IMPORTANT|WARNING|CAUTION):/m,alias:"keyword"},callout:[{pattern:/(^[ \t]*)<?\d*>/m,lookbehind:!0,alias:"symbol"},{pattern:/<\d+>/,alias:"symbol"}],macro:{pattern:/\b[a-z\d][a-z\d-]*::?(?:(?:\S+)??\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:{"function":/^[a-z\d-]+(?=:)/,punctuation:/^::?/,attributes:{pattern:/(?:\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:i.inside}}},inline:{pattern:/(^|[^\\])(?:(?:\B\[(?:[^\]\\"]|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?: ['`]|.)+?(?:(?:\r?\n|\r)(?: ['`]|.)+?)*['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"]|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,lookbehind:!0,inside:{attributes:i,url:{pattern:/^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/,inside:{punctuation:/^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/}},"attribute-ref":{pattern:/^\{.+\}$/,inside:{variable:{pattern:/(^\{)[a-z\d,+_-]+/,lookbehind:!0},operator:/^[=?!#%@$]|!(?=[:}])/,punctuation:/^\{|\}$|::?/}},italic:{pattern:/^(['_])[\s\S]+\1$/,inside:{punctuation:/^(?:''?|__?)|(?:''?|__?)$/}},bold:{pattern:/^\*[\s\S]+\*$/,inside:{punctuation:/^\*\*?|\*\*?$/}},punctuation:/^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/}},replacement:{pattern:/\((?:C|TM|R)\)/,alias:"builtin"},entity:/&#?[\da-z]{1,8};/i,"line-continuation":{pattern:/(^| )\+$/m,lookbehind:!0,alias:"punctuation"}},i.inside.interpreted.inside.rest={macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity},a.languages.asciidoc["passthrough-block"].inside.rest={macro:a.languages.asciidoc.macro},a.languages.asciidoc["literal-block"].inside.rest={callout:a.languages.asciidoc.callout},a.languages.asciidoc.table.inside.rest={"comment-block":a.languages.asciidoc["comment-block"],"passthrough-block":a.languages.asciidoc["passthrough-block"],"literal-block":a.languages.asciidoc["literal-block"],"other-block":a.languages.asciidoc["other-block"],"list-punctuation":a.languages.asciidoc["list-punctuation"],"indented-block":a.languages.asciidoc["indented-block"],comment:a.languages.asciidoc.comment,title:a.languages.asciidoc.title,"attribute-entry":a.languages.asciidoc["attribute-entry"],attributes:a.languages.asciidoc.attributes,hr:a.languages.asciidoc.hr,"page-break":a.languages.asciidoc["page-break"],admonition:a.languages.asciidoc.admonition,"list-label":a.languages.asciidoc["list-label"],callout:a.languages.asciidoc.callout,macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity,"line-continuation":a.languages.asciidoc["line-continuation"]},a.languages.asciidoc["other-block"].inside.rest={table:a.languages.asciidoc.table,"list-punctuation":a.languages.asciidoc["list-punctuation"],"indented-block":a.languages.asciidoc["indented-block"],comment:a.languages.asciidoc.comment,"attribute-entry":a.languages.asciidoc["attribute-entry"],attributes:a.languages.asciidoc.attributes,hr:a.languages.asciidoc.hr,"page-break":a.languages.asciidoc["page-break"],admonition:a.languages.asciidoc.admonition,"list-label":a.languages.asciidoc["list-label"],macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity,"line-continuation":a.languages.asciidoc["line-continuation"]},a.languages.asciidoc.title.inside.rest={macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity},a.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&amp;/,"&"))})}(Prism);
   8.100 +!function(e){var t={variable:[{pattern:/\$?\(\([\w\W]+?\)\)/,inside:{variable:[{pattern:/(^\$\(\([\w\W]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee]-?\d+)?)\b/,operator:/--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\([^)]+\)|`[^`]+`/,inside:{variable:/^\$\(|^`|\)$|`$/}},/\$(?:[a-z0-9_#\?\*!@]+|\{[^}]+\})/i]};e.languages.bash={shebang:{pattern:/^#!\s*\/bin\/bash|^#!\s*\/bin\/sh/,alias:"important"},comment:{pattern:/(^|[^"{\\])#.*/,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<\s*)(?:"|')?(\w+?)(?:"|')?\s*\r?\n(?:[\s\S])*?\r?\n\2/g,lookbehind:!0,greedy:!0,inside:t},{pattern:/(["'])(?:\\\\|\\?[^\\])*?\1/g,greedy:!0,inside:t}],variable:t.variable,"function":{pattern:/(^|\s|;|\||&)(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|npm|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)(?=$|\s|;|\||&)/,lookbehind:!0},keyword:{pattern:/(^|\s|;|\||&)(?:let|:|\.|if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)(?=$|\s|;|\||&)/,lookbehind:!0},"boolean":{pattern:/(^|\s|;|\||&)(?:true|false)(?=$|\s|;|\||&)/,lookbehind:!0},operator:/&&?|\|\|?|==?|!=?|<<<?|>>|<=?|>=?|=~/,punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];]/};var a=t.variable[1].inside;a["function"]=e.languages.bash["function"],a.keyword=e.languages.bash.keyword,a.boolean=e.languages.bash.boolean,a.operator=e.languages.bash.operator,a.punctuation=e.languages.bash.punctuation}(Prism);
   8.101 +Prism.languages.c=Prism.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0},directive:{pattern:/(#\s*)\b(define|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,lookbehind:!0,alias:"keyword"}}},constant:/\b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|stdin|stdout|stderr)\b/}),delete Prism.languages.c["class-name"],delete Prism.languages.c["boolean"];
   8.102 +Prism.languages.css.selector={pattern:/[^\{\}\s][^\{\}]*(?=\s*\{)/,inside:{"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+(?:\(.*\))?/,"class":/\.[-:\.\w]+/,id:/#[-:\.\w]+/,attribute:/\[[^\]]+\]/}},Prism.languages.insertBefore("css","function",{hexcode:/#[\da-f]{3,6}/i,entity:/\\[\da-f]{1,8}/i,number:/[\d%\.]+/});
   8.103 +Prism.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d+.*$/m],deleted:/^[-<].*$/m,inserted:/^[+>].*$/m,diff:{pattern:/^!(?!!).+$/m,alias:"important"}};
   8.104 +Prism.languages.ini={comment:/^[ \t]*;.*$/m,selector:/^[ \t]*\[.*?\]/m,constant:/^[ \t]*[^\s=]+?(?=[ \t]*=)/m,"attr-value":{pattern:/=.*/,inside:{punctuation:/^[=]/}}};
   8.105 +Prism.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|.)*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},builtin:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,symbol:{pattern:/^[^:=\r\n]+(?=\s*:(?!=))/m,inside:{variable:/\$+(?:[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:[/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,{pattern:/(\()(?:addsuffix|abspath|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:s|list)?)(?=[ \t])/,lookbehind:!0}],operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/};
   8.106 +Prism.languages.markdown=Prism.languages.extend("markup",{}),Prism.languages.insertBefore("markdown","prolog",{blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},code:[{pattern:/^(?: {4}|\t).+/m,alias:"keyword"},{pattern:/``.+?``|`[^`\n]+`/,alias:"keyword"}],title:[{pattern:/\w+.*(?:\r?\n|\r)(?:==+|--+)/,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#+.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])([\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:/(^|[^\\])(\*\*|__)(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/,lookbehind:!0,inside:{punctuation:/^\*\*|^__|\*\*$|__$/}},italic:{pattern:/(^|[^\\])([*_])(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/,lookbehind:!0,inside:{punctuation:/^[*_]|[*_]$/}},url:{pattern:/!?\[[^\]]+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[[^\]\n]*\])/,inside:{variable:{pattern:/(!?\[)[^\]]+(?=\]$)/,lookbehind:!0},string:{pattern:/"(?:\\.|[^"\\])*"(?=\)$)/}}}}),Prism.languages.markdown.bold.inside.url=Prism.util.clone(Prism.languages.markdown.url),Prism.languages.markdown.italic.inside.url=Prism.util.clone(Prism.languages.markdown.url),Prism.languages.markdown.bold.inside.italic=Prism.util.clone(Prism.languages.markdown.italic),Prism.languages.markdown.italic.inside.bold=Prism.util.clone(Prism.languages.markdown.bold);
   8.107 +Prism.languages.perl={comment:[{pattern:/(^\s*)=\w+[\s\S]*?=cut.*/m,lookbehind:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0}],string:[{pattern:/\b(?:q|qq|qx|qw)\s*([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s+([a-zA-Z0-9])(?:[^\\]|\\[\s\S])*?\1/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*\((?:[^()\\]|\\[\s\S])*\)/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*\{(?:[^{}\\]|\\[\s\S])*\}/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*\[(?:[^[\]\\]|\\[\s\S])*\]/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*<(?:[^<>\\]|\\[\s\S])*>/,greedy:!0},{pattern:/("|`)(?:[^\\]|\\[\s\S])*?\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:/\b(?:m|qr)\s*([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s+([a-zA-Z0-9])(?:[^\\]|\\.)*?\1[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngc]*/,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\2(?:[^\\]|\\[\s\S])*?\2[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s+([a-zA-Z0-9])(?:[^\\]|\\[\s\S])*?\2(?:[^\\]|\\[\s\S])*?\2[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\((?:[^()\\]|\\[\s\S])*\)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\{(?:[^{}\\]|\\[\s\S])*\}\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\[(?:[^[\]\\]|\\[\s\S])*\]\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*<(?:[^<>\\]|\\[\s\S])*>\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?((::)*'?(?!\d)[\w$]+)+(::)*/i,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*>|\b_\b/,alias:"symbol"},vstring:{pattern:/v\d+(\.\d+)*|\d+(\.\d+){2,}/,alias:"string"},"function":{pattern:/sub [a-z0-9_]+/i,inside:{keyword:/sub/}},keyword:/\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b-?(0x[\dA-Fa-f](_?[\dA-Fa-f])*|0b[01](_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(lt|gt|le|ge|eq|ne|cmp|not|and|or|xor)\b/,punctuation:/[{}[\];(),:]/};
   8.108 +Prism.languages.python={"triple-quoted-string":{pattern:/"""[\s\S]+?"""|'''[\s\S]+?'''/,alias:"string"},comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:{pattern:/("|')(?:\\\\|\\?[^\\\r\n])*?\1/,greedy:!0},"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,"boolean":/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/};
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/lighttpd/index.cgi	Thu May 11 00:17:06 2017 +0300
     9.3 @@ -0,0 +1,1205 @@
     9.4 +#!/bin/sh
     9.5 +#
     9.6 +# SliTaz Cooker CGI + Lighttpd web interface.
     9.7 +#
     9.8 +
     9.9 +# Make request URI relative to the script name
    9.10 +base="$(dirname "$SCRIPT_NAME")"; [ "$base" == '/' ] && base=''
    9.11 +REQUEST_URI=$(echo "$REQUEST_URI" | sed "s|^$base/*|/|; s|\?.*||")
    9.12 +
    9.13 +# Split the URI request to /pkg/cmd/arg
    9.14 +export pkg=$(echo "$REQUEST_URI" | cut -d/ -f2)
    9.15 +export cmd=$(echo "$REQUEST_URI" | cut -d/ -f3)
    9.16 +export arg=$(echo "$REQUEST_URI" | sed 's|^/[^/]*/[^/]*/||')
    9.17 +
    9.18 +
    9.19 +. /usr/lib/slitaz/httphelper.sh
    9.20 +
    9.21 +[ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf
    9.22 +[ -f "./cook.conf" ] && . ./cook.conf
    9.23 +wok="$WOK"
    9.24 +title=${title:-SliTaz Cooker}
    9.25 +# Cooker DB files.
    9.26 +activity="$CACHE/activity"
    9.27 +commits="$CACHE/commits"
    9.28 +cooklist="$CACHE/cooklist"
    9.29 +cookorder="$CACHE/cookorder"
    9.30 +command="$CACHE/command"; touch $command
    9.31 +blocked="$CACHE/blocked"
    9.32 +broken="$CACHE/broken"
    9.33 +cooknotes="$CACHE/cooknotes"
    9.34 +cooktime="$CACHE/cooktime"
    9.35 +wokrev="$CACHE/wokrev"
    9.36 +
    9.37 +# Path to markdown to html convertor
    9.38 +cmark_opts='--smart -e table -e strikethrough -e autolink -e tagfilter'
    9.39 +if [ -n "$(which cmark 2>/dev/null)" ]; then
    9.40 +	md2html="$(which cmark) $cmark_opts"
    9.41 +elif [ -x "./cmark" ]; then
    9.42 +	md2html="./cmark $cmark_opts"
    9.43 +elif [ -n "$(which sundown 2>/dev/null)" ]; then
    9.44 +	md2html=$(which sundown)
    9.45 +elif [ -x "./sundown" ]; then
    9.46 +	md2html="./sundown"
    9.47 +fi
    9.48 +
    9.49 +
    9.50 +
    9.51 +
    9.52 +# Search form redirection
    9.53 +if [ -n "$(GET search)" ]; then
    9.54 +	echo -e "HTTP/1.1 301 Moved Permanently\nLocation: $base/$(GET q)\n\n"
    9.55 +	exit 0
    9.56 +fi
    9.57 +
    9.58 +
    9.59 +# Show the running command and it's progression
    9.60 +
    9.61 +running_command() {
    9.62 +	state="$(cat $command)"
    9.63 +	local pct
    9.64 +	if [ -n "$state" ];then
    9.65 +		echo -n "$state</td></tr><tr><td>Completion</td>"
    9.66 +		set -- $(grep "^$state" $cooktime)
    9.67 +		[ -n "$1" -a $2 -ne 0 ] && pct=$((($(date +%s)-$3)*100/$2))
    9.68 +		[ -n "$pct" ] && max="max='100'"
    9.69 +		echo -n "<td><progress id='gauge' $max value='$pct' title='Click to stop updating' onclick='stopUpdating()'>"
    9.70 +		echo -n "</progress> <span id='pct'>${pct:-?}%</span>"
    9.71 +		[ "$2" -gt 60 ] &&
    9.72 +			echo -n "</td></tr><tr><td>Estimated end time</td><td>$(date +%H:%M -ud @$(($2+$3)))"
    9.73 +	else
    9.74 +		echo 'not running'
    9.75 +	fi
    9.76 +}
    9.77 +
    9.78 +
    9.79 +# HTML page header
    9.80 +
    9.81 +page_header() {
    9.82 +	local theme t='' css
    9.83 +	theme=$(COOKIE theme)
    9.84 +	[ "$theme" == 'default' ] && theme=''
    9.85 +	[ -n "$theme" ] && theme="-$theme"
    9.86 +	css="cooker$theme.css"
    9.87 +
    9.88 +	echo -e 'Content-Type: text/html; charset=UTF-8\n'
    9.89 +
    9.90 +	cat <<EOT
    9.91 +<!DOCTYPE html>
    9.92 +<html lang="en">
    9.93 +<head>
    9.94 +	<title>$([ -n "$pkg" ] && echo "$pkg - ")$title</title>
    9.95 +	<link rel="stylesheet" href="/$css">
    9.96 +	<link rel="icon" type="image/png" href="/slitaz-cooker.png">
    9.97 +	<!-- mobile -->
    9.98 +	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    9.99 +	<meta name="theme-color" content="#222">
   9.100 +	<!-- rss -->
   9.101 +	<link rel="alternate" type="application/rss+xml" title="$title Feed" href="?rss">
   9.102 +</head>
   9.103 +<body>
   9.104 +<div id="container">
   9.105 +<header>
   9.106 +	<h1><a href="$base/">$title</a></h1>
   9.107 +	<div class="network">
   9.108 +		<a href="http://www.slitaz.org/">Home</a>
   9.109 +		<a href="http://bugs.slitaz.org/">Bugs</a>
   9.110 +		<a href="http://hg.slitaz.org/wok-next/">Hg</a>
   9.111 +		<a href="http://roadmap.slitaz.org/">Roadmap</a>
   9.112 +		<a href="http://pizza.slitaz.me/">Pizza</a>
   9.113 +		<a href="http://tank.slitaz.org/">Tank</a>
   9.114 +		|
   9.115 +		<a href="$base/cross/">Cross</a>
   9.116 +		<a href="$base/i486.cgi">i486</a>
   9.117 +		<a href="$base/cookiso.cgi">ISO</a>
   9.118 +		<select onChange="window.location.href=this.value" style="display: none">
   9.119 +			<option value=".">Go to…</option>
   9.120 +			<option value="http://www.slitaz.org/">Home</option>
   9.121 +			<option value="http://bugs.slitaz.org/">Bug tracker</option>
   9.122 +			<option value="http://hg.slitaz.org/wok/">Hg wok</option>
   9.123 +			<option value="http://roadmap.slitaz.org/">Roadmap</option>
   9.124 +			<option value="http://pizza.slitaz.me/">Pizza</option>
   9.125 +			<option value="http://tank.slitaz.org/">Tank</option>
   9.126 +			<option disabled>---------</option>
   9.127 +			<option value="cross/">Cross</option>
   9.128 +			<option value="i486.cgi">i486</option>
   9.129 +			<option value="cookiso.cgi">ISO</option>
   9.130 +		</select>
   9.131 +	</div>
   9.132 +</header>
   9.133 +
   9.134 +<main>
   9.135 +EOT
   9.136 +
   9.137 +	[ -n "$(GET debug)" ] && echo "<pre><code class='language-ini'>$(env | sort)</code></pre>"
   9.138 +}
   9.139 +
   9.140 +
   9.141 +# HTML page footer
   9.142 +
   9.143 +page_footer() {
   9.144 +	date_now=$(date +%s)
   9.145 +	sec_now=$(date +%S); sec_now=${sec_now#0} # remove one leading zero
   9.146 +	wait_sec=$(( 60 - $sec_now ))
   9.147 +	cat <<EOT
   9.148 +</main>
   9.149 +
   9.150 +<footer>
   9.151 +	<a href="http://www.slitaz.org/">SliTaz Website</a>
   9.152 +	<a href="$base/">Cooker</a>
   9.153 +	<a href="$base/doc/cookutils/cookutils.html">Documentation</a>
   9.154 +	<a href="$base/?theme">Theme</a>
   9.155 +</footer>
   9.156 +</div>
   9.157 +<script src="/cooker.js"></script>
   9.158 +<script>refreshDate(${wait_sec}000, ${date_now}000)</script>
   9.159 +</body>
   9.160 +</html>
   9.161 +EOT
   9.162 +}
   9.163 +
   9.164 +
   9.165 +show_note() {
   9.166 +	echo "<div class='bigicon-$1'>$2</div>"
   9.167 +}
   9.168 +
   9.169 +
   9.170 +not_found() {
   9.171 +	local file="${1#$PKGS/}"; file="${file#$LOGS/}"; file="${file#$WOK/}"
   9.172 +	echo "HTTP/1.1 404 Not Found"
   9.173 +	page_header
   9.174 +	echo "<h2>Not Found</h2>"
   9.175 +	case $2 in
   9.176 +		pkg)
   9.177 +			show_note e "The requested package “$(basename "$(dirname "$file")")” was not found." ;;
   9.178 +		*)
   9.179 +			show_note e "The requested file “$file” was not found." ;;
   9.180 +	esac
   9.181 +	page_footer
   9.182 +}
   9.183 +
   9.184 +
   9.185 +manage_modified() {
   9.186 +	local file="$1" option="$2" nul day mon year time hh mm ss date_s
   9.187 +	if [ ! -f "$file" ]; then
   9.188 +		if [ "$option" == 'silently-absent' ]; then
   9.189 +			echo "HTTP/1.1 404 Not Found"
   9.190 +			return
   9.191 +		else
   9.192 +			not_found "$file" "$2"
   9.193 +			exit
   9.194 +		fi
   9.195 +	fi
   9.196 +	[ "$option" == 'no-last-modified' ] && return
   9.197 +	if [ -n "$HTTP_IF_MODIFIED_SINCE" ]; then
   9.198 +		echo "$HTTP_IF_MODIFIED_SINCE" | \
   9.199 +		while read nul day mon year time nul; do
   9.200 +			case $mon in
   9.201 +				Jan) mon='01';; Feb) mon='02';; Mar) mon='03';; Apr) mon='04';;
   9.202 +				May) mon='05';; Jun) mon='06';; Jul) mon='07';; Aug) mon='08';;
   9.203 +				Sep) mon='09';; Oct) mon='10';; Nov) mon='11';; Dec) mon='12';;
   9.204 +			esac
   9.205 +			hh=$(echo $time | cut -d: -f1)
   9.206 +			mm=$(echo $time | cut -d: -f2)
   9.207 +			ss=$(echo $time | cut -d: -f3)
   9.208 +			date_s=$(date -ud "$year$mon$day$hh$mm.$ss" +%s)
   9.209 +#			if [ "$date_s" -ge "$(date -ur "$file" +%s)" ]; then
   9.210 +#				echo -e 'HTTP/1.1 304 Not Modified\n'
   9.211 +#				exit
   9.212 +#			fi
   9.213 +# TODO: improve caching control
   9.214 +		done
   9.215 +	fi
   9.216 +	echo "Last-Modified: $(date -Rur "$file" | sed 's|UTC|GMT|')"
   9.217 +	echo "Cache-Control: public, max-age=3600"
   9.218 +}
   9.219 +
   9.220 +
   9.221 +# Query '?pct=<package>': update percentage
   9.222 +
   9.223 +if [ -n "$(GET pct)" ]; then
   9.224 +	pkg="$(GET pct)"
   9.225 +	state="$(cat $command)"
   9.226 +	if [ "$state" == "cook:$pkg" ]; then
   9.227 +		set -- $(grep "^$state" $cooktime)
   9.228 +		[ -n "$1" ] && pct=$(( ($(date +%s) - $3) * 100 / $2 ))
   9.229 +		echo "${pct:-?}"
   9.230 +	else
   9.231 +		echo 'reload'
   9.232 +	fi
   9.233 +	exit 0
   9.234 +fi
   9.235 +
   9.236 +
   9.237 +# Query '?poke': poke cooker
   9.238 +
   9.239 +if [ -n "$(GET poke)" ]; then
   9.240 +	touch $CACHE/cooker-request
   9.241 +	echo -e "Location: ${HTTP_REFERER:-${REQUEST_URI%\?*}}\n"
   9.242 +	exit
   9.243 +fi
   9.244 +
   9.245 +
   9.246 +# Query '?recook=<package>': query to recook package
   9.247 +
   9.248 +if [ -n "$(GET recook)" ]; then
   9.249 +	pkg="$(GET recook)"
   9.250 +	case "$HTTP_USER_AGENT" in
   9.251 +		*SliTaz*)
   9.252 +			grep -qs "^$pkg$" $CACHE/recook-packages ||
   9.253 +			echo "$pkg" >>    $CACHE/recook-packages
   9.254 +	esac
   9.255 +	echo -e "Location: ${HTTP_REFERER:-${REQUEST_URI%\?*}}\n"
   9.256 +	exit
   9.257 +fi
   9.258 +
   9.259 +
   9.260 +# Query '/i/<log>/<pkg>': show indicator icon
   9.261 +# Can't use ?query - not able to change '+' to '%2B' in the sed rules (see log handler)
   9.262 +
   9.263 +if [ "$pkg" == 'i' ]; then
   9.264 +	echo -en "Content-Type: image/svg+xml\n\n<svg xmlns='http://www.w3.org/2000/svg' height='12' width='8'><path d='"
   9.265 +	if [ $LOGS/$cmd -nt $PKGS/$arg.tazpkg ]; then
   9.266 +		echo "m1 2-1 1v8l1 1h6l1-1v-8l-1-1z' fill='#090'/></svg>"
   9.267 +	else
   9.268 +		echo "m0 3v8l1 1h6l1-1v-8l-1-1h-6zm3 0h2v5h-2zm0 6h2v2h-2z' fill='#d00'/></svg>"
   9.269 +	fi
   9.270 +	exit
   9.271 +fi
   9.272 +
   9.273 +
   9.274 +# Query '?theme[=<theme>]': change UI theme
   9.275 +
   9.276 +if [ -n "$(GET theme)" ]; then
   9.277 +	theme="$(GET theme)"
   9.278 +	case $theme in
   9.279 +		theme)
   9.280 +			current=$(COOKIE theme)
   9.281 +			page_header
   9.282 +			cat <<EOT
   9.283 +<section>
   9.284 +	<h2>Change theme</h2>
   9.285 +	<p>Current theme: “${current:-default}”. Select other:</p>
   9.286 +	<ul>
   9.287 +		$(
   9.288 +			for i in default emerald sky goldenrod like2016 terminal; do
   9.289 +				[ "$i" == "${current:-default}" ] || echo "<li><a href="$base/?theme=$i">$i</a></li>"
   9.290 +			done
   9.291 +		)
   9.292 +	</ul>
   9.293 +</section>
   9.294 +EOT
   9.295 +			page_footer
   9.296 +			exit 0
   9.297 +			;;
   9.298 +		default|emerald|sky|goldenrod|like2016|terminal)
   9.299 +			# Expires in a year
   9.300 +			expires=$(date -uRd @$(($(date +%s)+31536000)) | sed 's|UTC|GMT|')
   9.301 +			echo -e "HTTP/1.1 302 Found\nLocation: $base/\nCache-Control: no-cache\nSet-Cookie: theme=$theme; expires=$expires\n\n"
   9.302 +			exit 0
   9.303 +			;;
   9.304 +	esac
   9.305 +fi
   9.306 +
   9.307 +
   9.308 +#case "$QUERY_STRING" in
   9.309 +#	stuff*)
   9.310 +#		file="$wok/$(GET stuff)"
   9.311 +#		manage_modified "$file"
   9.312 +#		;;
   9.313 +#
   9.314 +#	pkg=*|receipt=*|description=*|files=*|log=*|man=*|doc=*|info=*)
   9.315 +#		type=${QUERY_STRING%%=*}
   9.316 +#		pkg=$(GET $type)
   9.317 +#		case "$type" in
   9.318 +#			description)
   9.319 +#				manage_modified "$wok/$pkg/receipt" 'no-last-modified'
   9.320 +#				manage_modified "$wok/$pkg/description.txt" 'silently-absent'
   9.321 +#				;;
   9.322 +#			log)
   9.323 +#				manage_modified "$wok/${pkg%%.log*}/receipt" 'no-last-modified'
   9.324 +#				manage_modified "$LOGS/$pkg"
   9.325 +#				;;
   9.326 +#			*)
   9.327 +#				manage_modified "$wok/$pkg/receipt" pkg
   9.328 +#				;;
   9.329 +#		esac
   9.330 +#		;;
   9.331 +#esac
   9.332 +
   9.333 +
   9.334 +# RSS feed generator
   9.335 +# URI: ?rss[&limit={1..100}]
   9.336 +
   9.337 +if [ -n "$(GET rss)" ]; then
   9.338 +	limit=$(GET limit); limit="${limit:-12}"; [ "$limit" -gt 100 ] && limit='100'
   9.339 +	pubdate=$(date -Rur$(ls -t $FEEDS/*.xml | head -n1) | sed 's|UTC|GMT|')
   9.340 +	cooker_url="http://$HTTP_HOST$base/"
   9.341 +	cat <<EOT
   9.342 +Content-Type: application/rss+xml
   9.343 +
   9.344 +<?xml version="1.0" encoding="utf-8" ?>
   9.345 +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
   9.346 +<channel>
   9.347 +	<title>$title</title>
   9.348 +	<description>The SliTaz packages cooker feed</description>
   9.349 +	<link>$cooker_url</link>
   9.350 +	<lastBuildDate>$pubdate</lastBuildDate>
   9.351 +	<pubDate>$pubdate</pubDate>
   9.352 +	<atom:link href="$cooker_url?rss" rel="self" type="application/rss+xml" />
   9.353 +EOT
   9.354 +	for rss in $(ls -t $FEEDS/*.xml | head -n$limit); do
   9.355 +		sed "s|http[^=]*=|$cooker_url|; s|<guid|& isPermaLink=\"false\"|g; s|</pubDate| GMT&|g" $rss
   9.356 +	done
   9.357 +	cat <<EOT
   9.358 +</channel>
   9.359 +</rss>
   9.360 +EOT
   9.361 +	exit 0
   9.362 +fi
   9.363 +
   9.364 +
   9.365 +
   9.366 +
   9.367 +#
   9.368 +# Functions
   9.369 +#
   9.370 +
   9.371 +
   9.372 +# Unpack to stdout
   9.373 +
   9.374 +docat() {
   9.375 +	case "$1" in
   9.376 +		*gz)   zcat ;;
   9.377 +		*bz2) bzcat ;;
   9.378 +		*xz)  xzcat ;;
   9.379 +		*)      cat
   9.380 +	esac < $1
   9.381 +}
   9.382 +
   9.383 +
   9.384 +# Tiny texinfo converter
   9.385 +
   9.386 +info2html() {
   9.387 +	sed \
   9.388 +		-e 's|&|\&amp;|g; s|<|\&lt;|g; s|>|\&gt;|g' \
   9.389 +		-e 's|^\* \(.*\)::|* <a href="#\1">\1</a>  |' \
   9.390 +		-e 's|\*note \(.*\)::|<a href="#\1">\1</a>|' \
   9.391 +		-e '/^File: / s|(dir)|Top|g' \
   9.392 +		-e '/^File: / s|Next: \([^,]*\)|<a class="button" href="#\1">Next: \1</a>|' \
   9.393 +		-e '/^File: / s|Prev: \([^,]*\)|<a class="button" href="#\1">Prev: \1</a>|' \
   9.394 +		-e '/^File: / s|Up: \([^,]*\)|<a class="button" href="#\1">Up: \1</a>|' \
   9.395 +		-e '/^File: / s|^.* Node: \([^,]*\), *\(.*\)$|<pre id="\1">\2|' \
   9.396 +		-e '/^<pre id=/ s|^\([^>]*>\)\(<a[^>]*>Next: [^,]*\), *\(<a[^>]*>Prev: [^,]*\), *\(<a[^>]*>Up: .*\)|\1 \3 \4 \2|' \
   9.397 +		-e '/^Tag Table:$/,/^End Tag Table$/d' \
   9.398 +		-e '/INFO-DIR/,/^END-INFO-DIR/d' \
   9.399 +		-e "s|https*://[^>),'\"\`’ ]*|<a href=\"&\">&</a>|g" \
   9.400 +		-e "s|ftp://[^>),\"\` ]*|<a href=\"&\">&</a>|g" \
   9.401 +		-e 's|^\* Menu:|<b>Menu:</b>|' \
   9.402 +		-e "s|^|</pre>|"
   9.403 +}
   9.404 +
   9.405 +
   9.406 +# Put some colors into log and DB files.
   9.407 +
   9.408 +syntax_highlighter() {
   9.409 +	case $1 in
   9.410 +		log)
   9.411 +			# If variables not defined - define them with some rare values
   9.412 +			: ${_src=#_#_#}
   9.413 +			: ${_install=#_#_#}
   9.414 +			: ${_fs=#_#_#}
   9.415 +			: ${_stuff=#_#_#}
   9.416 +			# Use one-letter html tags to save some bytes :)
   9.417 +			# <b>is error (red)</b> <u>is warning (orange)</u> <i>is informal (green)</i>
   9.418 +			sed	-e 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g' \
   9.419 +				-e 's#OK$#<i>OK</i>#' \
   9.420 +				-e 's#\([Dd]one\)$#<i>\1</i>#' \
   9.421 +				-e 's#Success$#<i>Success</i>#' \
   9.422 +				-e 's#\([^a-z]\)ok$#\1<i>ok</i>#' \
   9.423 +				-e 's#\([^a-z]\)yes$#\1<i>yes</i>#' \
   9.424 +				-e 's#\([^a-z]\)no$#\1<u>no</u>#' \
   9.425 +				-e 's#\([^a-z]\)none$#\1<u>none</u>#' \
   9.426 +				-e 's#\([^a-z]\)false$#\1<u>false</u>#' \
   9.427 +				-e 's#\(^checking .*\.\.\. \)\(.*\)$#\1<i>\2</i>#' \
   9.428 +				\
   9.429 +				-e 's#\( \[Y[nm/]\?\] n\)$# <u>\1</u>#' \
   9.430 +				-e 's#\( \[N[ym/]\?\] y\)$# <i>\1</i>#' \
   9.431 +				-e 's# y$# <i>y</i>#' \
   9.432 +				-e 's# n$# <u>n</u>#' \
   9.433 +				-e 's#(NEW) *$#<b>(NEW)</b>#' \
   9.434 +				\
   9.435 +				-e 's#.*(pkg/local).*#<i>\0</i>#' \
   9.436 +				-e 's#.*(web/cache).*#<u>\0</u>#' \
   9.437 +				\
   9.438 +				-e 's#\([^a-zA-Z]\)\([Ee]rror\)$#\1<b>\2</b>#' \
   9.439 +				-e 's#ERROR:#<b>ERROR:</b>#g' \
   9.440 +				\
   9.441 +				-e 's#^.*[Ff]ailed.*#<b>\0</b>#' \
   9.442 +				-e 's#^.*[Ff]atal.*#<b>\0</b>#' \
   9.443 +				-e 's#^.*[Nn]ot found.*#<b>\0</b>#' \
   9.444 +				-e 's#^.*[Nn]o such file.*#<b>\0</b>#' \
   9.445 +				-e 's#^.*No package .* found.*#<b>\0</b>#' \
   9.446 +				-e 's#^.*Unable to find.*#<b>\0</b>#' \
   9.447 +				-e 's#^.*[Ii]nvalid.*#<b>\0</b>#' \
   9.448 +				-e 's#\([Nn][Oo][Tt] found\)$#<b>\1</b>#' \
   9.449 +				-e 's#\(found\)$#<i>\1</i>#' \
   9.450 +				\
   9.451 +				-e 's#^.*WARNING:.*#<u>\0</u>#' \
   9.452 +				-e 's#^.*warning:.*#<u>\0</u>#' \
   9.453 +				-e 's#^.* [Ee]rror:* .*#<b>\0</b>#' \
   9.454 +				-e 's#^.*terminated.*#<b>\0</b>#' \
   9.455 +				-e 's#\(missing\)#<b>\1</b>#g' \
   9.456 +				-e 's#^.*[Cc]annot find.*#<b>\0</b>#' \
   9.457 +				-e 's#^.*unrecognized options.*#<u>\0</u>#' \
   9.458 +				-e 's#^.*does not.*#<u>\0</u>#' \
   9.459 +				-e 's#^.*[Ii]gnoring.*#<u>\0</u>#' \
   9.460 +				-e 's#^.*note:.*#<u>\0</u>#' \
   9.461 +				\
   9.462 +				-e 's#^.* will not .*#<u>\0</u>#' \
   9.463 +				-e 's!^Hunk .* succeeded at .*!<u>\0</u>!' \
   9.464 +				-e 's#^.* Warning: .*#<u>\0</u>#' \
   9.465 +				\
   9.466 +				-e "s#^Executing:\([^']*\).#<em>\0</em>#" \
   9.467 +				-e "s#^Making.*#<em>\0</em>#" \
   9.468 +				-e "s#^Scanning dependencies of target .*#<em>\0</em>#" \
   9.469 +				-e "s#^====\([^']*\).#<span class='span-line'>\0</span>#g" \
   9.470 +				-e "s#^[a-zA-Z0-9]\([^']*\) :: #<span class='span-sky'>\0</span>#g" \
   9.471 +				-e "s#[fh]tt*ps*://[^ '\"]*#<a href='\0'>\0</a>#g" \
   9.472 +				\
   9.473 +				-e "s|$_src|<span class='var'>\${src}</span>|g;
   9.474 +					s|$_install|<span class='var'>\${install}</span>|g;
   9.475 +					s|$_fs|<span class='var'>\${fs}</span>|g;
   9.476 +					s|$_stuff|<span class='var'>\${stuff}</span>|g" \
   9.477 +				-e "s|\[9\([1-6]\)m|<span class='c\1'>|;
   9.478 +					s|\[39m|</span>|;"
   9.479 +			;;
   9.480 +
   9.481 +		files)
   9.482 +			# Highlight the Busybox's `ls` output
   9.483 +			awk '{
   9.484 +				part1 = substr($0,  0, 16);
   9.485 +				part2 = substr($0, 17,  9);
   9.486 +				part3 = substr($0, 26,  9);
   9.487 +				part4 = substr($0, 35);
   9.488 +				if (part2 != "root     ") part2 = "<span class=\"c11\">" part2 "</span>";
   9.489 +				if (part3 != "root     ") part3 = "<span class=\"c11\">" part3 "</span>";
   9.490 +				print part1 part2 part3 part4;
   9.491 +			}' | \
   9.492 +			sed "s|\[\([01]\);3\([1-7]\)m|<a class='c\2\1'>|g;
   9.493 +				 s|\[\([01]\);0m|<a class='c0\1'>|g;
   9.494 +				 s|\[0m|</a>|g;
   9.495 +				 s|^\(lrwxrwxrwx\)|<span class='c61'>\1</span>|;
   9.496 +				 s|^\(-rwxr-xr-x\)|<span class='c21'>\1</span>|;
   9.497 +				 s|^\(-rw-r--r--\)|<span class='c31'>\1</span>|;
   9.498 +				 s|^\([lrwx-]*\)|<span class='c11'>\1</span>|;
   9.499 +				"
   9.500 +			;;
   9.501 +	esac
   9.502 +}
   9.503 +
   9.504 +
   9.505 +show_code() {
   9.506 +	echo -n "<pre><code class=\"language-$1\">"
   9.507 +	sed 's|&|\&amp;|g; s|<|\&lt;|g; s|>|\&gt;|g'
   9.508 +	echo '</code></pre>'
   9.509 +}
   9.510 +
   9.511 +
   9.512 +datalist() {
   9.513 +	(
   9.514 +		cd $wok
   9.515 +
   9.516 +		ls | awk '
   9.517 +		BEGIN{printf("<datalist id=\"packages\">")}
   9.518 +		     {printf("<option>%s</option>",$1)}
   9.519 +		END  {printf("</datalist>")}
   9.520 +		'
   9.521 +	)
   9.522 +}
   9.523 +
   9.524 +
   9.525 +mklog() {
   9.526 +	awk '
   9.527 +	BEGIN { printf("<pre class=\"log dog\">\n") }
   9.528 +		  { print }
   9.529 +	  END { print "</pre>" }'
   9.530 +}
   9.531 +
   9.532 +
   9.533 +summary() {
   9.534 +	log="$1"
   9.535 +	pkg="$(basename ${log%%.log*})"
   9.536 +
   9.537 +	if [ -f "$log" ]; then
   9.538 +		if grep -q "cook:$pkg$" $command; then
   9.539 +			show_note i "The Cooker is currently building $pkg"
   9.540 +		elif fgrep -q "Summary for:" $log; then
   9.541 +			sed '/^Summary for:/,$!d' $log | head -n13 | awk '
   9.542 +			BEGIN { print "<section>" }
   9.543 +			{
   9.544 +				if (NR==1) {
   9.545 +					printf("<h3>%s</h3>\n<table>\n", $0)
   9.546 +				} else if ($0 !~ "===") {
   9.547 +					split($0, s, " : ");
   9.548 +					printf("<tr><td>%s</td><td>%s</td></tr>", s[1], s[2]);
   9.549 +				}
   9.550 +			}
   9.551 +			END { print "</table></section>" }
   9.552 +			'
   9.553 +		elif fgrep -q "Debug information" $log; then
   9.554 +			echo -e '<section>\n<h3>Debug information</h3>'
   9.555 +			sed -e '/^Debug information/,$!d; /^===/d; /^$/d' $log | sed -n '1!p' | \
   9.556 +			if [ -n "$2" ]; then
   9.557 +				syntax_highlighter log | sed 's|\([0-9][0-9]*\):|<a href="#l\1">\1</a>:|'
   9.558 +			else
   9.559 +				sed 's|^[0-9][0-9]*:||' | syntax_highlighter log
   9.560 +			fi | mklog
   9.561 +			echo '</section>'
   9.562 +		fi
   9.563 +	else
   9.564 +		[ -n "$pkg" -a -d "$wok/$pkg" ] && show_note e "No log for $pkg"
   9.565 +	fi
   9.566 +}
   9.567 +
   9.568 +
   9.569 +active() {
   9.570 +	[ "$cmd" == "$1" -o "$cmd" == "${2:-$1}" ] && echo -n ' active'
   9.571 +}
   9.572 +
   9.573 +
   9.574 +pkg_info() {
   9.575 +	local log active bpkg
   9.576 +	log="$LOGS/$pkg.log"
   9.577 +
   9.578 +	echo "<h2>Package “$pkg”</h2>"
   9.579 +	echo '<div id="info">'
   9.580 +	echo "<a class='button icon receipt$(active receipt stuff)' href='$base/$pkg/receipt'>receipt &amp; stuff</a>"
   9.581 +
   9.582 +	unset WEB_SITE WANTED
   9.583 +	. $wok/$pkg/receipt
   9.584 +
   9.585 +	[ -n "$WEB_SITE" ] &&
   9.586 +		echo "<a class='button icon website' href='$WEB_SITE' target='_blank' rel='noopener noreferrer'>web site</a>"
   9.587 +
   9.588 +	if [ -f "$wok/$pkg/taz/$PACKAGE-$VERSION/receipt" ]; then
   9.589 +		echo "<a class='button icon files$(active files)' href='$base/$pkg/files'>files</a>"
   9.590 +
   9.591 +		[ -f "$wok/$pkg/description.txt" ] &&
   9.592 +			echo "<a class='button icon desc$(active description)' href='$base/$pkg/description'>description</a>"
   9.593 +
   9.594 +		unset EXTRAVERSION
   9.595 +		. $wok/$pkg/taz/$PACKAGE-$VERSION/receipt
   9.596 +		for filename in "$PACKAGE-$VERSION$EXTRAVERSION.tazpkg" "$PACKAGE-$VERSION$EXTRAVERSION-$ARCH.tazpkg"; do
   9.597 +			[ -f "$PKGS/$filename" ] &&
   9.598 +				echo "<a class='button icon download' href='$base/get/$filename'>download</a>"
   9.599 +		done
   9.600 +
   9.601 +	fi
   9.602 +
   9.603 +	[ -n "$TARBALL" -a -s "$SRC/$TARBALL" ] &&
   9.604 +		echo "<a class='button icon source' href='$base/src/$TARBALL'>source</a>"
   9.605 +
   9.606 +	echo "<a class='button icon browse' href='$base/$pkg/browse/'>browse</a>"
   9.607 +
   9.608 +	[ -x ./man2html -a -d "$wok/$pkg/install/usr/share/man" ] &&
   9.609 +		echo "<a class='button icon doc$(active man)' href='$base/$pkg/man/'>man</a>"
   9.610 +
   9.611 +	[ -d "$wok/$pkg/install/usr/share/doc" -o -d "$wok/$pkg/install/usr/share/gtk-doc" ] &&
   9.612 +		echo "<a class='button icon doc$(active doc)' href='$base/$pkg/doc/'>doc</a>"
   9.613 +
   9.614 +	[ -d "$wok/$pkg/install/usr/share/info" ] &&
   9.615 +		echo "<a class='button icon doc$(active info)' href='$base/$pkg/info/#Top'>info</a>"
   9.616 +
   9.617 +	[ -s "$log" ] &&
   9.618 +		echo "<a class='button icon log$(active log)' href='$base/$pkg/log/'>logs</a>"
   9.619 +
   9.620 +	echo '</div>'
   9.621 +}
   9.622 +
   9.623 +
   9.624 +mktable() {
   9.625 +	sed 's# : #|#' | awk -vc="$1" '
   9.626 +	BEGIN { printf("<table class=\"%s\">\n", c); FS="|" }
   9.627 +		  { printf("<tr><td>%s</td>", $1);
   9.628 +			if (NF == 2) printf("<td>%s</td>", $2);
   9.629 +			printf("</tr>\n", $2) }
   9.630 +	  END { print "</table>" }'
   9.631 +}
   9.632 +
   9.633 +
   9.634 +section() {
   9.635 +	local i=$(basename "$1")
   9.636 +	echo -e '\n\n<section>'
   9.637 +	[ $(wc -l < $1) -gt $2 ] && echo "<a class='button icon more r' href='?$i'>${3#*|}</a>"
   9.638 +	echo "<h2>${3%|*}</h2>"
   9.639 +	mktable "$i"
   9.640 +	echo '</section>'
   9.641 +}
   9.642 +
   9.643 +
   9.644 +
   9.645 +
   9.646 +#
   9.647 +# Load requested page
   9.648 +#
   9.649 +
   9.650 +if [ -z "$pkg" ]; then
   9.651 +
   9.652 +	page_header
   9.653 +	if [ -n "$QUERY_STRING" -a "$QUERY_STRING" != 'debug' ]; then
   9.654 +
   9.655 +		for list in activity cooknotes cooklist; do
   9.656 +			[ -n "$(GET $list)" ] || continue
   9.657 +			[ "$list" == 'cooklist' ] && nb="- Packages: $(wc -l < $cooklist)"
   9.658 +			echo '<section id="content2">'
   9.659 +			echo "<h2>DB: $list $nb</h2>"
   9.660 +			tac $CACHE/$list | sed 's|cooker.cgi?pkg=||;
   9.661 +				s|\[ Done|<span class="r c20">Done|;
   9.662 +				s|\[ Failed|<span class="r c10">Failed|;
   9.663 +				s| \]|</span>|' | mktable $list
   9.664 +			echo '</section>'
   9.665 +		done
   9.666 +
   9.667 +		if [ -n "$(GET broken)" ]; then
   9.668 +			echo '<div id="content2">'
   9.669 +			echo "<h2>DB: broken - Packages: $(wc -l < $broken)</h2>"
   9.670 +			sort $CACHE/broken | sed "s|^[^']*|<a href='$base/\0'>\0</a>|g" | mktable
   9.671 +			echo '</div>'
   9.672 +		fi
   9.673 +
   9.674 +		case "$QUERY_STRING" in
   9.675 +			*.log)
   9.676 +				log=$LOGS/$QUERY_STRING
   9.677 +				name=$(basename $log)
   9.678 +				if [ -f "$log" ]; then
   9.679 +					echo "<h2>Log for: ${name%.log}</h2>"
   9.680 +					if fgrep -q "Summary" $log; then
   9.681 +						echo '<pre class="log">'
   9.682 +						grep -A 20 '^Summary' $log | syntax_highlighter log
   9.683 +						echo '</pre>'
   9.684 +					fi
   9.685 +					echo '<pre class="log">'
   9.686 +					syntax_highlighter log < $log
   9.687 +					echo '</pre>'
   9.688 +				else
   9.689 +					show_note e "No log file: $log"
   9.690 +				fi
   9.691 +				;;
   9.692 +		esac
   9.693 +		page_footer
   9.694 +		exit 0
   9.695 +	fi
   9.696 +
   9.697 +
   9.698 +	# We may have a toolchain.cgi script for cross cooker's
   9.699 +	if [ -f "toolchain.cgi" ]; then
   9.700 +		toolchain="toolchain.cgi"
   9.701 +	else
   9.702 +		toolchain="slitaz-toolchain/"
   9.703 +	fi
   9.704 +	# Main page with summary. Count only package include in ARCH,
   9.705 +	# use 'cooker arch-db' to manually create arch.$ARCH files.
   9.706 +	inwok=$(ls $WOK/*/arch.$ARCH | wc -l)
   9.707 +	cooked=$(ls $PKGS/*.tazpkg | wc -l)
   9.708 +	unbuilt=$(($inwok - $cooked))
   9.709 +	pct=0; [ $inwok -gt 0 ] && pct=$(( ($cooked * 100) / $inwok ))
   9.710 +	cat <<EOT
   9.711 +<div id="content2">
   9.712 +
   9.713 +<section>
   9.714 +<form method="get" action="" class="search r">
   9.715 +	<input type="hidden" name="search" value="pkg"/>
   9.716 +	<button type="submit" title="Search">Search</button>
   9.717 +	<input type="search" name="q" placeholder="Package" list="packages" autocorrect="off" autocapitalize="off"/>
   9.718 +</form>
   9.719 +
   9.720 +<h2>Summary</h2>
   9.721 +EOT
   9.722 +
   9.723 +mktable <<EOT
   9.724 +Cooker state     : $(running_command)
   9.725 +Wok revision     : <a href='$WOK_URL' target='_blank' rel='noopener noreferrer'>$(cat $wokrev)</a>
   9.726 +Commits to cook  : $(wc -l < $commits)
   9.727 +Current cooklist : $(wc -l < $cooklist)
   9.728 +Broken packages  : $(wc -l < $broken)
   9.729 +Blocked packages : $(wc -l < $blocked)
   9.730 +Architecture     : $ARCH, <a href="$toolchain">toolchain</a>
   9.731 +Server date      : <span id='date'>$(date -u '+%F %R %Z')</span>
   9.732 +EOT
   9.733 +
   9.734 +	# If command is "cook:*", update gauge and percentage periodically.
   9.735 +	# If different package is cooking, reload the page (with new settings)
   9.736 +	cmd="$(cat $command)"
   9.737 +	case "$cmd" in
   9.738 +		cook:*)
   9.739 +			pkg=${cmd#*:}
   9.740 +			echo "<script>updatePkg = '${pkg//+/%2B}';</script>"
   9.741 +			;;
   9.742 +	esac
   9.743 +
   9.744 +	if [ -e "$CACHE/cooker-request" -a ! -s $command ]; then
   9.745 +		if [ "$activity" -nt "$CACHE/cooker-request" ]; then
   9.746 +			echo '<a class="button icon bell r" href="?poke">Wake up</a>'
   9.747 +		else
   9.748 +			show_note i 'Cooker will be launched in the next 5 minutes.'
   9.749 +		fi
   9.750 +	fi
   9.751 +
   9.752 +	cat <<EOT
   9.753 +<p>Packages: $inwok in the wok · $cooked cooked · $unbuilt unbuilt</p>
   9.754 +
   9.755 +<div class="meter"><progress max="100" value="$pct">${pct}%</progress><span>${pct}%</span></div>
   9.756 +
   9.757 +<p>
   9.758 +	Service logs:
   9.759 +	<a href="?cookorder.log">cookorder</a> ·
   9.760 +	<a href="?commits.log">commits</a> ·
   9.761 +	<a href="?pkgdb.log">pkgdb</a>
   9.762 +</p>
   9.763 +</section>
   9.764 +EOT
   9.765 +
   9.766 +	tac $activity | head -n12 | sed 's|cooker.cgi?pkg=||;
   9.767 +		s|\[ Done|<span class="r c20">Done|;
   9.768 +		s|\[ Failed|<span class="r c10">Failed|;
   9.769 +		s| \]|</span>|;
   9.770 +		s|%2B|\+|g' | \
   9.771 +		section $activity 12 "Activity|More activity"
   9.772 +
   9.773 +	[ -s "$cooknotes" ] && tac $cooknotes | head -n12 | \
   9.774 +		section $cooknotes 12 "Cooknotes|More notes"
   9.775 +
   9.776 +	[ -s "$commits" ] &&
   9.777 +		section $commits 20 "Commits|More commits" < $commits
   9.778 +
   9.779 +	[ -s "$cooklist" ] && head -n 20 $cooklist | \
   9.780 +		section $cooklist 20 "Cooklist|Full cooklist"
   9.781 +
   9.782 +	[ -s "$broken" ] && head -n20 $broken | sed "s|^[^']*|<a href='\0'>\0</a>|g" | \
   9.783 +		section $broken 20 "Broken|All broken packages"
   9.784 +
   9.785 +	[ -s "$blocked" ] && sed "s|^[^']*|<a href='\0'>\0</a>|g" $blocked | \
   9.786 +		section $blocked 12 "Blocked|All blocked packages"
   9.787 +
   9.788 +	cd $PKGS
   9.789 +	ls -let *.tazpkg | awk '
   9.790 +	(NR<=20){
   9.791 +		sub(/:[0-9][0-9]$/, "", $9);
   9.792 +		mon = index("  JanFebMarAprMayJunJulAugSepOctNovDec", $7) / 3;
   9.793 +		printf("%d-%02d-%02d %s : <a href=\"get/%s\">%s</a>\n", $10, mon, $8, $9, $11, $11);
   9.794 +	}' | \
   9.795 +		section $activity 1000 "Latest cook"
   9.796 +
   9.797 +	echo '</div>'
   9.798 +	datalist
   9.799 +	page_footer
   9.800 +	exit 0
   9.801 +fi
   9.802 +
   9.803 +
   9.804 +case "$cmd" in
   9.805 +	'')
   9.806 +		page_header
   9.807 +		log=$LOGS/$pkg.log
   9.808 +
   9.809 +		# Package info.
   9.810 +		if [ -f "$wok/$pkg/receipt" ]; then
   9.811 +			pkg_info
   9.812 +		else
   9.813 +			if [ $(ls $wok/*$pkg*/receipt 2>/dev/null | wc -l) -eq 0 ]; then
   9.814 +				echo "<h2>Not Found</h2>"
   9.815 +				show_note e "The requested package <b>$pkg</b> was not found on this server."
   9.816 +			else
   9.817 +				# Search page
   9.818 +				echo "<section><h2>Package names matching “$pkg”</h2>"
   9.819 +				echo "<table><thead><tr><th>Name</th><th>Description</th><th>Category</th></tr></thead><tbody>"
   9.820 +				for i in $(cd $wok; ls *$pkg*/receipt); do
   9.821 +					pkg=$(dirname $i)
   9.822 +					unset SHORT_DESC CATEGORY
   9.823 +					. $wok/$pkg/receipt
   9.824 +					echo -n "<tr><td><a href="$base/$pkg">$pkg</a></td>"
   9.825 +					echo -n "<td>$SHORT_DESC</td><td>$CATEGORY</td></tr>"
   9.826 +				done
   9.827 +				echo '</tbody></table></section>'
   9.828 +				unset pkg
   9.829 +			fi
   9.830 +			page_footer
   9.831 +			exit 0
   9.832 +		fi
   9.833 +
   9.834 +		# Check for a log file and display summary if it exists.
   9.835 +		summary "$log"
   9.836 +
   9.837 +		# Display <Recook> button only for SliTaz web browser
   9.838 +		if [ -f "$log" ]; then
   9.839 +			case "$HTTP_USER_AGENT" in
   9.840 +				*SliTaz*)
   9.841 +					if [ -f $CACHE/cooker-request -a -n "$HTTP_REFERER" ]; then
   9.842 +						if grep -qs "^$pkg$" $CACHE/recook-packages; then
   9.843 +							show_note i "The package “$pkg” has been requested for recook"
   9.844 +						else
   9.845 +							echo "<a class='button' href='$base/?recook=${pkg//+/%2B}'>Recook $pkg</a>"
   9.846 +						fi
   9.847 +					fi
   9.848 +					;;
   9.849 +			esac
   9.850 +		fi
   9.851 +		;;
   9.852 +
   9.853 +	receipt)
   9.854 +		page_header
   9.855 +		pkg_info
   9.856 +		echo "<a class='button receipt' href='$base/$pkg/receipt'>receipt</a>"
   9.857 +		( cd $wok/$pkg; find stuff -type f 2>/dev/null ) | sort | \
   9.858 +		awk -vb="$base/$pkg" '{printf("<a class=\"button\" href=\"%s/%s\">%s</a>\n", b, $0, $0)}'
   9.859 +
   9.860 +		show_code bash < $wok/$pkg/receipt
   9.861 +		;;
   9.862 +
   9.863 +	stuff)
   9.864 +		page_header
   9.865 +		pkg_info
   9.866 +		file="$pkg/stuff/$arg"
   9.867 +		echo "<a class='button' href='$base/$pkg/receipt'>receipt</a>"
   9.868 +		( cd $wok/$pkg; find stuff -type f 2>/dev/null ) | sort | \
   9.869 +		awk -vb="$base/$pkg" -va="stuff/$arg" '{
   9.870 +			printf("<a class=\"button%s\" href=\"%s/%s\">%s</a>\n", a==$0 ? " receipt" : "", b, $0, $0)
   9.871 +		}'
   9.872 +
   9.873 +		if [ -f "$wok/$file" ]; then
   9.874 +			case $file in
   9.875 +				*.desktop|*.theme)   class="ini" ;;
   9.876 +				*.patch|*.diff|*.u)  class="diff" ;;
   9.877 +				*.sh)                class="bash" ;;
   9.878 +				*.conf*|*.ini)
   9.879 +					class="bash"
   9.880 +					[ -n "$(cut -c1 < $wok/$file | fgrep '[')" ] && class="ini"
   9.881 +					;;
   9.882 +				*.pl)           class="perl" ;;
   9.883 +				*.c|*.h|*.awk)  class="clike" ;;
   9.884 +				*.svg)          class="svg" ;;
   9.885 +				*Makefile*)     class="makefile" ;;
   9.886 +				*.po|*.pot)     class="bash" ;;
   9.887 +				*.css)          class="css" ;;
   9.888 +				*.htm|*.html)   class="html" ;;
   9.889 +				*.js)           class="js" ;;
   9.890 +				*.txt)          class="asciidoc" ;;
   9.891 +				*)
   9.892 +					case $(head -n1 $wok/$file) in
   9.893 +						*!/bin/sh*|*!/bin/bash*) class="bash" ;;
   9.894 +					esac
   9.895 +					if [ -z "$class" -a "$(head -n1 $wok/$file | cut -b1)" == '#' ]; then
   9.896 +						class="bash"
   9.897 +					fi
   9.898 +					if [ -z "$class" ]; then
   9.899 +						# Follow Busybox restrictions. Search for non-printable chars
   9.900 +						if [ $(tr -d '[:alnum:][:punct:][:blank:][:cntrl:]' < "$wok/$file" | wc -c) -gt 0 ]; then
   9.901 +							raw="true"
   9.902 +						fi
   9.903 +					fi
   9.904 +					;;
   9.905 +			esac
   9.906 +
   9.907 +			# Display image
   9.908 +			case $file in
   9.909 +				*.png|*.svg|*.jpg|*.jpeg|*.ico)
   9.910 +					echo "<img src='$base/$pkg/browse/stuff/$arg' style='display: block; max-width: 100%; margin: auto'/>"
   9.911 +					;;
   9.912 +			esac
   9.913 +
   9.914 +			# Display colored listing for all text-based documents (also for *.svg)
   9.915 +			case $file in
   9.916 +				*.png|*.jpg|*.jpeg|*.ico) ;;
   9.917 +				*)
   9.918 +					if [ -z "$raw" ]; then
   9.919 +						cat $wok/$file | show_code $class
   9.920 +					fi
   9.921 +					;;
   9.922 +			esac
   9.923 +
   9.924 +			# Display hex dump for binary files
   9.925 +			if [ -n "$raw" ]; then
   9.926 +				hexdump -C $wok/$file | show_code #| sed 's|^\([0-9a-f][0-9a-f]*\)|<span class="c2">\1</span>|'
   9.927 +			fi
   9.928 +		else
   9.929 +			show_note e "File “$file” absent!"
   9.930 +		fi
   9.931 +		;;
   9.932 +
   9.933 +	files)
   9.934 +		page_header
   9.935 +		pkg_info
   9.936 +
   9.937 +		packaged=$(mktemp)
   9.938 +
   9.939 +		# find main package
   9.940 +		wanted=$(. $wok/$pkg/receipt; echo $WANTED)
   9.941 +		main=${wanted:-$pkg}
   9.942 +		# identify splitted packages
   9.943 +		split="$main $(. $wok/$main/receipt; echo $SPLIT)"
   9.944 +		[ -d "$wok/$main-dev" ] && split="$split $main-dev"
   9.945 +		split="$(echo $split | tr ' ' '\n' | sort -u)"
   9.946 +		# finally we need the version
   9.947 +		ver=$(. $wok/$main/receipt; echo $VERSION$EXTRAVERSION)
   9.948 +
   9.949 +		for p in $split; do
   9.950 +			namever="$p-$ver"
   9.951 +			if [ -d "$wok/$p/taz/$p-$ver" ]; then
   9.952 +				indir=$p
   9.953 +			elif [ -d "$wok/$main/taz/$p-$ver" ]; then
   9.954 +				indir=$main
   9.955 +			fi
   9.956 +			dir="$wok/$indir/taz/$p-$ver/fs"
   9.957 +
   9.958 +			size=$(du -hs $dir | awk '{ sub(/\.0/, ""); print $1 }')
   9.959 +
   9.960 +			echo "<section><h3>Files of package “$namever” ($size):</h3>"
   9.961 +			echo -en '<pre class="files">\n<span class="underline">permissions·lnk·user    ·'
   9.962 +			echo -en 'group   ·     size·date &amp; time ·file name\n</span>'
   9.963 +			find $dir -not -type d -print0 | sort -z | xargs -0 ls -ld --color=always | \
   9.964 +			syntax_highlighter files | \
   9.965 +			sed "s|\([^>]*\)>/.*/fs\([^<]*\)\(<.*\)$|\1 href='$base/$indir/browse/taz/$p-$ver/fs\2'>\2\3|" | \
   9.966 +			awk 'BEGIN { FS="\""; }
   9.967 +				{ gsub("+", "%2B", $2); print; }'
   9.968 +			echo '</pre></section>'
   9.969 +			cat $wok/$indir/taz/$p-$ver/files.list >> $packaged
   9.970 +		done
   9.971 +
   9.972 +		# find repeatedly packaged files
   9.973 +		repeats="$(sort $packaged | uniq -d)"
   9.974 +		if [ -n "$repeats" ]; then
   9.975 +			echo -n '<section><h3>Repeatedly packaged files:</h3><pre class="files">'
   9.976 +			echo "$repeats" | sed 's|^|<span class="c11">!!!</span> |'
   9.977 +			echo "</pre></section>"
   9.978 +		fi
   9.979 +
   9.980 +		# find unpackaged files
   9.981 +		all_files=$(mktemp)
   9.982 +		cd $wok/$main/install; find ! -type d | sed 's|\.||' > $all_files
   9.983 +		orphans="$(sort $all_files $packaged | uniq -u)"
   9.984 +		if [ -n "$orphans" ]; then
   9.985 +			echo -n '<section><h3>Unpackaged files:</h3><pre class="files">'
   9.986 +			echo "$orphans" | awk '
   9.987 +			function tag(text, color) { printf("<span class=\"c%s1\">%s</span> %s\n", color, text, $0); }
   9.988 +			/\/perllocal.pod$/ || /\/\.packlist$/ || /\/share\/bash-completion\// { tag("---", 0); next }
   9.989 +			/\.pod$/  { tag("pod", 5); next }
   9.990 +			/\/share\/man\// { tag("man", 5); next }
   9.991 +			/\/share\/doc\// || /\/share\/gtk-doc\// || /\/share\/info\// || /\/share\/devhelp\// { tag("doc", 5); next }
   9.992 +			/\/share\/icons\// { tag("ico", 2); next }
   9.993 +			/\/share\/locale\// { tag("loc", 4); next }
   9.994 +			/\.h$/ || /\.a$/ || /\.la$/ || /\.pc$/ || /\/bin\/.*-config$/ { tag("dev", 3); next }
   9.995 +			{ tag("???", 1) }
   9.996 +			'
   9.997 +			echo '</pre></section>'
   9.998 +		fi
   9.999 +		;;
  9.1000 +
  9.1001 +	description)
  9.1002 +		page_header
  9.1003 +		pkg_info
  9.1004 +		desc="$WOK$REQUEST_URI.txt"
  9.1005 +		if [ -s "$desc" ]; then
  9.1006 +			echo '<div id="content2">'
  9.1007 +			if [ -n "$md2html" ]; then
  9.1008 +				$md2html $desc
  9.1009 +			else
  9.1010 +				show_code markdown < $desc
  9.1011 +			fi
  9.1012 +			echo '</div>'
  9.1013 +		else
  9.1014 +			show_note w "No description of $pkg"
  9.1015 +		fi
  9.1016 +		;;
  9.1017 +
  9.1018 +	log)
  9.1019 +		page_header
  9.1020 +		pkg_info
  9.1021 +		[ -z "$arg" ] && arg=$(stat -c %Y $LOGS/$pkg.log)
  9.1022 +
  9.1023 +		echo '<div class="btnList">'
  9.1024 +		acc='l'
  9.1025 +		while read log; do
  9.1026 +			timestamp=$(stat -c %Y $log)
  9.1027 +			class=''
  9.1028 +			if [ "$arg" == "$timestamp" ]; then
  9.1029 +				class=' log'
  9.1030 +				logfile="$log"
  9.1031 +			fi
  9.1032 +			echo -n "<a class='button$class' data-acc='$acc' accesskey='$acc' href='$base/$pkg/log/$timestamp'>"
  9.1033 +			echo "$(stat -c %y $log | cut -d: -f1,2)</a>"
  9.1034 +			case $acc in
  9.1035 +				l) acc=0;;
  9.1036 +				*) acc=$((acc+1));;
  9.1037 +			esac
  9.1038 +		done <<EOT
  9.1039 +$(find $LOGS -name "$pkg.log*" | sort)
  9.1040 +EOT
  9.1041 +		echo '</div>'
  9.1042 +
  9.1043 +		if [ -z "$logfile" ]; then
  9.1044 +			show_note e "Requested log is absent"
  9.1045 +			page_footer
  9.1046 +			exit 0
  9.1047 +		fi
  9.1048 +
  9.1049 +		# Define cook variables for syntax highlighter
  9.1050 +		if [ -s "$WOK/$pkg/receipt" ]; then
  9.1051 +			. "$WOK/$pkg/receipt"
  9.1052 +			_wok='/home/slitaz/wok'
  9.1053 +			_src="$_wok/$pkg/source/$PACKAGE-$VERSION"
  9.1054 +			_install="$_wok/$pkg/install"
  9.1055 +			_fs="$_wok/$pkg/taz/$PACKAGE-$VERSION/fs"
  9.1056 +			_stuff="$_wok/$pkg/stuff"
  9.1057 +		fi
  9.1058 +
  9.1059 +#		if [ ! -f "gzlog/$pkg.$arg" ]; then
  9.1060 +#			{
  9.1061 +#				summary "$logfile" links
  9.1062 +#
  9.1063 +#				syntax_highlighter log < $logfile | awk '
  9.1064 +#				BEGIN { print "<pre class=\"log\">"; }
  9.1065 +#				      { printf("<a name=\"l%d\" href=\"#l%d\">%5d</a>  %s\n", NR, NR, NR, $0); }
  9.1066 +#				END   { print "</pre>"; }
  9.1067 +#				'
  9.1068 +#
  9.1069 +#				page_footer
  9.1070 +#			} | gzip > gzlog/$pkg.$arg
  9.1071 +#		fi
  9.1072 +
  9.1073 +		blog=$(basename $logfile)
  9.1074 +		summary "$logfile" links
  9.1075 +
  9.1076 +		# disable next `sed` for the 'like2016' theme
  9.1077 +		theme=$(COOKIE theme); theme=${theme:-default}; [ "$theme" != 'like2016' ] && theme=''
  9.1078 +		cat $logfile | syntax_highlighter log | \
  9.1079 +		sed -e "/(pkg\/local$theme):/ s|: \([^<]*\)|<img src='$base/i/$blog/\1'> \1|" | \
  9.1080 +		awk '
  9.1081 +		BEGIN { print "<pre class=\"log\">"; }
  9.1082 +		      { printf("<a name=\"l%d\" href=\"#l%d\">%5d</a>  %s\n", NR, NR, NR, $0); }
  9.1083 +		END   { print "</pre>"; }
  9.1084 +		'
  9.1085 +		;;
  9.1086 +
  9.1087 +
  9.1088 +	man|doc|info)
  9.1089 +		page_header
  9.1090 +		pkg_info
  9.1091 +		echo '<div style="max-height: 6.4em; overflow: auto; padding: 0 4px">'
  9.1092 +
  9.1093 +		dir="wok/$pkg/install/usr/share/$cmd"
  9.1094 +		[ "$cmd" == 'doc' ] && dir="$dir wok/$pkg/install/usr/share/gtk-doc"
  9.1095 +		if [ "$cmd" == 'doc' -a -z "$arg" ]; then
  9.1096 +			try=$(for i in $dir; do find $i -name 'index.htm*'; done | sed q)
  9.1097 +			[ -n "$try" ] && arg="$try"
  9.1098 +		fi
  9.1099 +		while read i; do
  9.1100 +			[ -s "$i" ] || continue
  9.1101 +			case "$i" in
  9.1102 +				*.jp*g|*.png|*.gif|*.svg|*.css) continue
  9.1103 +			esac
  9.1104 +			i=${i#$dir/}
  9.1105 +			[ -n "$arg" ] || arg="$i"
  9.1106 +			class=''; [ "$arg" == "$i" ] && class=" doc"
  9.1107 +			case "$cmd" in
  9.1108 +				man)
  9.1109 +					case $i in
  9.1110 +						man*) lang='';;
  9.1111 +						*)    lang="${i%%/*}: ";;
  9.1112 +					esac
  9.1113 +					man=$(basename $i .gz)
  9.1114 +					echo "<a class='button$class' href='$base/$pkg/man/$i'>$lang${man%.*} (${man##*.})</a>"
  9.1115 +					;;
  9.1116 +				doc)
  9.1117 +					echo "<a class='button$class' href='$base/$pkg/doc/$i'>$(basename $i .gz)</a>"
  9.1118 +					;;
  9.1119 +				info)
  9.1120 +					info=$(basename $i)
  9.1121 +					echo "<a class='button$class' href='$base/$pkg/info/$i#Top'>${info/.info/}</a>"
  9.1122 +					;;
  9.1123 +			esac
  9.1124 +		done <<EOT
  9.1125 +$(for i in $dir; do find $i -type f; done | sort)
  9.1126 +EOT
  9.1127 +		echo '</div>'
  9.1128 +
  9.1129 +		[ -f "$arg" ] || arg="$dir/$arg"
  9.1130 +		if [ -f "$arg" ]; then
  9.1131 +			tmp="$(mktemp)"
  9.1132 +			docat "$arg" > $tmp
  9.1133 +			[ -s "$tmp" ] &&
  9.1134 +			case "$cmd" in
  9.1135 +				info)
  9.1136 +					echo '<div id="content2" class="texinfo"><pre class="first">'
  9.1137 +					info2html < "$tmp"
  9.1138 +					echo '</pre></div>'
  9.1139 +					;;
  9.1140 +				doc)
  9.1141 +					case "$arg" in
  9.1142 +						*.sgml|*.devhelp2) class='xml';;
  9.1143 +						*.py)       class='python';; # pycurl package
  9.1144 +						*.css)      class='css';;
  9.1145 +						*)          class='asciidoc';;
  9.1146 +					esac
  9.1147 +					case "$arg" in
  9.1148 +						*.htm*)
  9.1149 +							case $arg in
  9.1150 +								wok/*) page="${arg#wok/}"; page="$base/$pkg/browse/${page#*/}";;
  9.1151 +								*)     page="$base/$pkg/browse/install/usr/share/$cmd/$arg";;
  9.1152 +							esac
  9.1153 +							# make the iframe height so long to contain it's content without scrollbar
  9.1154 +							echo "<iframe id='idoc' src='$page' width='100%' onload='resizeIframe(this)'></iframe>"
  9.1155 +							;;
  9.1156 +						*.pdf)
  9.1157 +							case $arg in
  9.1158 +								wok/*) page="${arg#wok/}"; page="$base/$pkg/browse/${page#*/}";;
  9.1159 +								*)     page="$base/$pkg/browse/install/usr/share/$cmd/$arg";;
  9.1160 +							esac
  9.1161 +							cat <<EOT
  9.1162 +<object id="idoc" data="$page" width="100%" height="100%" type="application/pdf" style="min-height: 600px">
  9.1163 +	$(show_note w "Missing PDF plugin.<br/>Get the file <a href="$page">$(basename "$page")</a>.")
  9.1164 +</object>
  9.1165 +EOT
  9.1166 +							;;
  9.1167 +						*)
  9.1168 +							show_code $class < "$tmp"
  9.1169 +							;;
  9.1170 +					esac
  9.1171 +					;;
  9.1172 +				man)
  9.1173 +					#export TEXTDOMAIN='man2html'
  9.1174 +					echo "<div id='content2'>"
  9.1175 +
  9.1176 +					html=$(./man2html "$tmp" | sed -e '1,/<header>/d' -e '/<footer>/,$d' \
  9.1177 +					-e 's|<a href="file:///[^>]*>\([^<]*\)</a>|\1|g' \
  9.1178 +					-e 's|<a href="?[1-9]\+[^>]*>\([^<]*\)</a>|\1|g')
  9.1179 +
  9.1180 +					if [ -n "$(echo "$html" | fgrep 'The requested file /tmp/tmp.')" ]; then
  9.1181 +						# Process the pre-formatted man-cat page
  9.1182 +						echo '<pre>'
  9.1183 +						sed '
  9.1184 +							s|M-bM-^@M-^S|—|g;
  9.1185 +							s|M-bM-^@M-^\\|<b>|g;
  9.1186 +							s|M-bM-^@M-^]|</b>|g
  9.1187 +							s|M-bM-^@M-^X|<u>|g;
  9.1188 +							s|M-bM-^@M-^Y|</u>|g;
  9.1189 +							s|M-BM-||g;
  9.1190 +							' "$tmp"
  9.1191 +						echo '</pre>'
  9.1192 +					else
  9.1193 +						echo "$html"
  9.1194 +					fi
  9.1195 +					echo "</div>"
  9.1196 +					;;
  9.1197 +			esac
  9.1198 +			rm -f $tmp
  9.1199 +		else
  9.1200 +			show_note e "File “$arg” not exists!"
  9.1201 +		fi
  9.1202 +		;;
  9.1203 +
  9.1204 +esac
  9.1205 +
  9.1206 +
  9.1207 +page_footer
  9.1208 +exit 0
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/lighttpd/lighttpd/lighttpd.conf	Thu May 11 00:17:06 2017 +0300
    10.3 @@ -0,0 +1,243 @@
    10.4 +# /etc/lighttpd/lighttpd.conf: SliTaz LightTPD
    10.5 +# Web server configuration file.
    10.6 +# Configuration du serveur web.
    10.7 +#
    10.8 +# Documentation : /usr/share/doc/slitaz/handbook/web-server.html
    10.9 +#                 http://trac.lighttpd.net/trac/wiki#Documentation
   10.10 +#
   10.11 +#
   10.12 +
   10.13 +# Root documents.
   10.14 +#
   10.15 +server.document-root = "/var/www/"
   10.16 +
   10.17 +# Port, default for HTTP traffic is 80.
   10.18 +#
   10.19 +server.port = 80
   10.20 +
   10.21 +# Server, user and group name.
   10.22 +#
   10.23 +server.username = "www"
   10.24 +server.groupname = "www"
   10.25 +
   10.26 +# Server header.
   10.27 +# Be nice and keep it at lighttpd and SliTaz GNU/Linux.
   10.28 +#
   10.29 +server.tag = "lighttpd (SliTaz GNU/Linux)"
   10.30 +
   10.31 +# Directory listings.
   10.32 +#
   10.33 +dir-listing.activate = "enable"
   10.34 +dir-listing.encoding = "utf-8"
   10.35 +
   10.36 +# File to open by default.
   10.37 +#
   10.38 +index-file.names = ( "index.html", "index.php", "index.cgi", "index.sh" )
   10.39 +
   10.40 +# Log messages.
   10.41 +#
   10.42 +accesslog.filename = "/var/log/lighttpd/access.log"
   10.43 +server.errorlog  = "/var/log/lighttpd/error.log"
   10.44 +
   10.45 +# Server pid file
   10.46 +server.pid-file = "/var/run/lighttpd.pid"
   10.47 +
   10.48 +# MIME type.
   10.49 +#
   10.50 +mimetype.assign = (
   10.51 +  # Consult /usr/share/mime/packages/freedesktop.org.xml for MIME Types.
   10.52 +  # text
   10.53 +  ".html"     => "text/html; charset=UTF-8",
   10.54 +  ".htm"      => "text/html; charset=UTF-8",
   10.55 +  ".xhtml"    => "application/xhtml+xml; charset=UTF-8",
   10.56 +  ".txt"      => "text/plain; charset=UTF-8",
   10.57 +  ".list"     => "text/plain; charset=UTF-8",
   10.58 +  ".conf"     => "text/plain; charset=UTF-8",
   10.59 +  ".cooklist" => "text/plain; charset=UTF-8",
   10.60 +  "README"    => "text/x-readme; charset=UTF-8",
   10.61 +  "AUTHORS"   => "text/x-authors; charset=UTF-8",
   10.62 +  "COPYING"   => "text/x-copying; charset=UTF-8",
   10.63 +  "CREDITS"   => "text/x-credits; charset=UTF-8",
   10.64 +  "INSTALL"   => "text/x-install; charset=UTF-8",
   10.65 +  "ChangeLog" => "text/x-changelog; charset=UTF-8",
   10.66 +  "receipt"   => "text/plain; charset=UTF-8",
   10.67 +  ".log"      => "text/x-log; charset=UTF-8",
   10.68 +  ".diff"     => "text/x-patch; charset=UTF-8",
   10.69 +  ".patch"    => "text/x-patch; charset=UTF-8",
   10.70 +  ".css"      => "text/css; charset=UTF-8",
   10.71 +  ".js"       => "application/javascript; charset=UTF-8",
   10.72 +  ".xml"      => "application/xml; charset=UTF-8",
   10.73 +  ".desktop"  => "application/x-desktop; charset=UTF-8",
   10.74 +  ".m4"       => "application/x-m4; charset=UTF-8",
   10.75 +  "Makefile"  => "text/x-makefile",
   10.76 +  ".md"       => "text/markdown",
   10.77 +  # images
   10.78 +  ".jpg"      => "image/jpeg",
   10.79 +  ".jpeg"     => "image/jpeg",
   10.80 +  ".png"      => "image/png",
   10.81 +  ".gif"      => "image/gif",
   10.82 +  ".xbm"      => "image/x-xbitmap",
   10.83 +  ".xpm"      => "image/x-xpixmap",
   10.84 +  ".pnm"      => "image/x-portable-anymap",
   10.85 +  ".pbm"      => "image/x-portable-bitmap",
   10.86 +  ".pgm"      => "image/x-portable-graymap",
   10.87 +  ".ppm"      => "image/x-portable-pixmap",
   10.88 +  ".ico"      => "image/vnd.microsoft.icon",
   10.89 +  ".svg"      => "image/svg+xml",
   10.90 +  ".svgz"     => "image/svg+xml-compressed",
   10.91 +  ".bmp"      => "image/bmp",
   10.92 +  ".wbmp"     => "image/vnd.wap.wbmp",
   10.93 +  ".tif"      => "image/tiff",
   10.94 +  ".tiff"     => "image/tiff",
   10.95 +  # documents
   10.96 +  ".pdf"      => "application/pdf",
   10.97 +  ".ps"       => "application/postscript",
   10.98 +  ".epub"     => "application/epub+zip",
   10.99 +  # archives / packages
  10.100 +  ".cpio.gz"  => "application/x-cpio-compressed",
  10.101 +  ".cpio"     => "application/x-cpio",
  10.102 +  ".tar.gz"   => "application/x-compressed-tar",
  10.103 +  ".gz"       => "application/gzip",
  10.104 +  ".tar.bz2"  => "application/x-bzip-compressed-tar",
  10.105 +  ".bz2"      => "application/x-bzip",
  10.106 +  ".tar.xz"   => "application/x-xz-compressed-tar",
  10.107 +  ".xz"       => "application/x-xz",
  10.108 +  ".tar.lzma" => "application/x-lzma-compressed-tar",
  10.109 +  ".lzma"     => "application/x-lzma",
  10.110 +  ".tar.Z"    => "application/x-tarz",
  10.111 +  ".Z"        => "application/x-compress",
  10.112 +  ".tar"      => "application/x-tar",
  10.113 +  ".zip"      => "application/zip",
  10.114 +  ".cab"      => "application/vnd.ms-cab-compressed",
  10.115 +  ".7z"       => "application/x-7z-compressed",
  10.116 +  ".a"        => "application/x-archive",
  10.117 +  ".arj"      => "application/x-arj",
  10.118 +  ".bcpio"    => "application/x-bcpio",
  10.119 +  ".rar"      => "application/x-rar",
  10.120 +
  10.121 +  ".tazpkg"   => "application/x-tazpkg",
  10.122 +  # multimedia
  10.123 +  ".ogg"      => "audio/ogg",
  10.124 +  # scripts / programming languages
  10.125 +  ".sh"       => "application/x-shellscript",
  10.126 +  ".cgi"      => "application/x-shellscript",
  10.127 +  ".csh"      => "application/x-csh",
  10.128 +  ".awk"      => "application/x-awk",
  10.129 +  ".pl"       => "application/x-perl",
  10.130 +  ".pod"      => "application/x-perl",
  10.131 +  ".php"      => "application/x-php",
  10.132 +  ".py"       => "text/x-python",
  10.133 +  ".pyc"      => "application/x-python-bytecode",
  10.134 +  ".pyo"      => "application/x-python-bytecode",
  10.135 +  ".rb"       => "application/x-ruby",
  10.136 +  ".rs"       => "text/rust",
  10.137 +  ".hh"       => "text/x-c++hdr",
  10.138 +  ".cpp"      => "text/x-c++src",
  10.139 +  ".h"        => "text/x-chdr",
  10.140 +  ".c"        => "text/x-csrc",
  10.141 +  ".cmake"    => "text/x-cmake",
  10.142 +  ".vala"     => "text/x-vala",
  10.143 +  ".vapi"     => "text/x-vala",
  10.144 +  ".p"        => "text/x-pascal",
  10.145 +  ".pas"      => "text/x-pascal",
  10.146 +  ".lua"      => "text/x-lua",
  10.147 +  # other
  10.148 +  ".torrent"  => "application/x-bittorrent",
  10.149 +  ".iso"      => "application/x-cd-image",
  10.150 +  ".otf"      => "application/x-font-otf",
  10.151 +  ".ttf"      => "application/x-font-ttf",
  10.152 +  ".ttc"      => "application/x-font-ttf",
  10.153 +  ".gmo"      => "application/x-gettext-translation",
  10.154 +  ".mo"       => "application/x-gettext-translation",
  10.155 +  ".po"       => "text/x-gettext-translation",
  10.156 +  ".pot"      => "text/x-gettext-translation-template",
  10.157 +  ".ts"       => "text/vnd.trolltech.linguist",
  10.158 +  ".exe"      => "application/x-ms-dos-executable",
  10.159 +  ".o"        => "application/x-object",
  10.160 +  ".la"       => "application/x-shared-library-la",
  10.161 +  ".so"       => "application/x-sharedlib",
  10.162 +)
  10.163 +
  10.164 +# Deny access the file-extensions.
  10.165 +#
  10.166 +url.access-deny = ( "~", ".inc" )
  10.167 +
  10.168 +# Modules to load.
  10.169 +# See /usr/lib/lighttpd for all available modules.
  10.170 +#
  10.171 +server.modules = (
  10.172 +  "mod_access",
  10.173 +  "mod_accesslog",
  10.174 +  "mod_alias",
  10.175 +  "mod_cgi",
  10.176 +  "mod_rewrite",
  10.177 +  "mod_status",
  10.178 +  "mod_userdir",
  10.179 +  "mod_compress"
  10.180 +)
  10.181 +
  10.182 +# User directory module.
  10.183 +#
  10.184 +userdir.path = "Public"
  10.185 +userdir.exclude-user = ("root")
  10.186 +
  10.187 +# Status module.
  10.188 +#
  10.189 +status.status-url = "/server-status"
  10.190 +
  10.191 +# Compress module
  10.192 +#
  10.193 +compress.allowed-encodings = ("gzip", "deflate")
  10.194 +compress.cache-dir = "/var/cache/lighttpd/compress/"
  10.195 +compress.filetype  = ("text/plain", "text/html", "application/javascript", "text/css", "text/html")
  10.196 +
  10.197 +## CGI module. You can install Perl and assign .pl and .cgi script
  10.198 +# to /usr/bin/perl.
  10.199 +#
  10.200 +$HTTP["url"] =~ "/cgi-bin/" {
  10.201 +  cgi.assign = (
  10.202 +    ".sh"  => "/bin/sh",
  10.203 +    ".cgi" => "/bin/sh"
  10.204 +  )
  10.205 +}
  10.206 +
  10.207 +# Fast CGI modules for PHP.
  10.208 +#
  10.209 +#fastcgi.server = ( ".php" => (( 
  10.210 +  #"bin-path" => "/usr/bin/php-cgi",
  10.211 +  #"socket" => "/tmp/php.socket"
  10.212 +  #)))
  10.213 +
  10.214 +# Alias URLs for localhost (doc, examples and PHP info).
  10.215 +#
  10.216 +$HTTP["remoteip"] =~ "127.0.0.1" {
  10.217 +  alias.url += (
  10.218 +    "/doc/" => "/usr/share/doc/",
  10.219 +    "/examples/" => "/usr/share/examples/",
  10.220 +    "/phpinfo/" => "/usr/share/phpinfo/"
  10.221 +  )
  10.222 +}
  10.223 +
  10.224 +## Virtual hosts.
  10.225 +#
  10.226 +# If you want name-based virtual hosting load mod_simple_vhost.
  10.227 +#
  10.228 +# You can directly put vhost in this file or use a sepate one for all
  10.229 +# virtual hosting.
  10.230 +#
  10.231 +include "vhosts.conf"
  10.232 +
  10.233 +# Example.org
  10.234 +#
  10.235 +#$HTTP["host"] =~ "(^|\.)example\.org$" {
  10.236 +  #server.document-root = "/var/www/vhost/exemple.com/html"
  10.237 +  #server.errorlog = "/var/log/lighttpd/example.org-error.log"
  10.238 +  #accesslog.filename = "/var/log/lighttpd/example.org-access.log"
  10.239 +#}
  10.240 +
  10.241 +# Deny access for all image stealers (anti-hotlinking for images)
  10.242 +#
  10.243 +#$HTTP["referer"] !~ "^($|http://www\.example\.org)" {
  10.244 +#  url.access-deny = ( ".jpg", ".jpeg", ".png" )
  10.245 +#}
  10.246 +
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/lighttpd/lighttpd/vhosts.conf	Thu May 11 00:17:06 2017 +0300
    11.3 @@ -0,0 +1,44 @@
    11.4 +# /etc/lighttpd/vhosts.conf : Virtual hosts configuration file.
    11.5 +#
    11.6 +
    11.7 +# cook.slitaz.org
    11.8 +#
    11.9 +$HTTP["host"] =~ "cook\.slitaz\.org$" {
   11.10 +  server.document-root = "/home/slitaz/www/cook"
   11.11 +  server.errorlog = "/var/log/lighttpd/cook.slitaz.org-error.log"
   11.12 +  accesslog.filename = "/var/log/lighttpd/cook.slitaz.org-access.log"
   11.13 +  cgi.assign = ( ".cgi" => "/bin/sh" )
   11.14 +  index-file.names = ( "index.cgi" )
   11.15 +
   11.16 +  url.rewrite-once = (
   11.17 +    # ./wok -> symlink to wok folder
   11.18 +    "^/next/([^/]+)/browse(.+)" => "/next/wok/$1/$2",
   11.19 +         "^/([^/]+)/browse(.+)" =>      "/wok/$1/$2",
   11.20 +    # ./packages -> symlink to packages folder
   11.21 +    "^/next/get/(.+)" => "/next/packages/$1",
   11.22 +         "^/get/(.+)" =>      "/packages/$1",
   11.23 +    # ./src -> symlink to sources folder
   11.24 +    "^/next/src/(.+)" => "/next/src/$1",
   11.25 +         "^/src/(.+)" =>      "/src/$1"
   11.26 +  )
   11.27 +
   11.28 +  url.rewrite-if-not-file = (
   11.29 +    "^/next/[^\?]*\?(.+)" => "/next/index.cgi?$1",
   11.30 +    "^/next/.*"           => "/next/index.cgi",
   11.31 +    "^/[^\?]*\?(.+)"      =>      "/index.cgi?$1",
   11.32 +    "^/.*"                =>      "/index.cgi"
   11.33 +  )
   11.34 +
   11.35 +# First enable compressing globally in lighttpd.conf:  server.modules = ( ... "mod_compress" ... )
   11.36 +# Also use global settings or change them here:
   11.37 +#  compress.allowed-encodings = ("gzip", "deflate")
   11.38 +#  compress.cache-dir = "/var/www/cache/"
   11.39 +#  compress.filetype = ("text/plain", "text/html")
   11.40 +
   11.41 +# External js supported only since lighttpd 1.4.42, try to inject js here :-D
   11.42 +#  dir-listing.external-css = "/cooker.css"
   11.43 +#  dir-listing.external-js  = "/listing.js"
   11.44 +  dir-listing.external-css = "/cooker.css\" /><script src=\"/listing.js\"></script><meta name=\""
   11.45 +# Result:
   11.46 +# <link rel="stylesheet" type="text/css" href="/cooker.css" /><script src="/listing.js"></script><meta name="" />
   11.47 +}
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/lighttpd/listing.js	Thu May 11 00:17:06 2017 +0300
    12.3 @@ -0,0 +1,7 @@
    12.4 +// Click on header return us to the package page
    12.5 +function setLink() {
    12.6 +  document.getElementsByTagName("h2")[0].onclick = function() {
    12.7 +    location.href = location.pathname.replace(/\/browse\/.*/, "");
    12.8 +  }
    12.9 +}
   12.10 +document.addEventListener("DOMContentLoaded", setLink);
    13.1 Binary file lighttpd/slitaz-cooker.png has changed