wok-tiny annotate manager/receipt @ rev 133

Add fbvnc-config & fbvnc-auth
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Aug 23 12:08:35 2017 +0200 (2017-08-23)
parents 371673f39e46
children 1e55ea7da8de
rev   line source
pascal@11 1 # SliTaz package receipt.
pascal@11 2
pascal@11 3 PACKAGE="manager"
pascal@11 4 VERSION="1.0"
pascal@11 5 CATEGORY="network"
pascal@11 6 SHORT_DESC="Tiny SliTaz Web Manager"
pascal@11 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@90 8 LICENSE="BSD"
pascal@55 9 WEB_SITE="http://tiny.slitaz.org/"
pascal@11 10 CONFIG_FILES="/etc/httpd.conf"
pascal@11 11 DEPENDS="base-tiny"
pascal@11 12 CONFIG_FILES="/etc/daemons.conf /etc/rcS.conf"
pascal@11 13
pascal@11 14 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@11 15 genpkg_rules()
pascal@11 16 {
pascal@94 17 cp -a $stuff/. $fs
pascal@11 18 }
pascal@11 19
pascal@11 20 post_install()
pascal@11 21 {
pascal@86 22 grep -q inetd $1/etc/rcS.conf ||
pascal@86 23 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
pascal@86 24 grep -q /httpd $1/etc/inetd.conf || cat >> $1/etc/inetd.conf <<EOT
pascal@97 25 http stream tcp nowait root httpd httpd -i -u 0:0
pascal@11 26 EOT
pascal@11 27 while read line comment ; do
pascal@11 28 grep -qs "^$line" $1/etc/httpd.conf && continue
pascal@11 29 echo "$line $comment" >> $1/etc/httpd.conf
pascal@11 30 done <<EOT
pascal@11 31 H:/var/www # define the server root.
pascal@11 32 I:index.sh # Show index.html when a directory is requested
pascal@11 33 *.sh:/bin/sh # run xxx.sh through an interpreter
pascal@11 34 A:127.0.0.1 # Allow local loopback connections
pascal@11 35 $( . $1/etc/network.conf
pascal@11 36 while [ -n "$IP" ]; do
pascal@45 37 IFS=. ; set -- $IP $NETMASK ; unset IFS
pascal@45 38 echo "A: $(($1 & $5)).$(($2 & $6)).$(($3 & $7)).$(($4 & $8))/$NETMASK"
pascal@11 39 IP="$LAN_IP" ; NETMASK="$LAN_NETMASK" ; LAN_IP=""
pascal@11 40 done )
pascal@11 41 D:* # Deny from other IP connections
pascal@11 42 /adm:admin:$MANAGER_PASSWORD # Require user admin, pwd setup on urls starting with /adm/
pascal@11 43 EOT
pascal@11 44 grep -qs "^E404:" $1/etc/httpd.conf || cat >> $1/etc/httpd.conf <<EOT
pascal@11 45 E404:/var/www/E404.html # the 404 (not found) error page
pascal@11 46 EOT
pascal@11 47 }
pascal@11 48
pascal@11 49 config_form()
pascal@11 50 {
pascal@11 51 [ -n "$MANAGER_PASSWORD" ] || MANAGER_PASSWORD=setup
pascal@11 52 cat <<EOT
pascal@11 53 <table>
pascal@11 54 <tr>
pascal@11 55 <td>Admin password ( for http://the-tiny-server/adm/ )</td>
pascal@11 56 <td><input type="text" name="MANAGER_PASSWORD" value="$MANAGER_PASSWORD" /></td>
pascal@11 57 </tr>
pascal@11 58 </table>
pascal@11 59 EOT
pascal@11 60 }
pascal@11 61