wok-tiny view wiki/receipt @ rev 45

manager, wiki: fix subnet in /etc/httpd.conf
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Apr 01 15:47:10 2011 +0200 (2011-04-01)
parents a82306dc8fef
children d3c5f3688ec0
line source
1 # SliTaz package receipt.
3 PACKAGE="wiki"
4 VERSION="1.0"
5 CATEGORY="network"
6 SHORT_DESC="Tiny SliTaz Wiki"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 WEB_SITE="http://mirror.slitaz.org/pizza/tiny/"
9 DEPENDS="base-tiny"
10 CONFIG_FILES="/etc/daemons.conf /etc/rcS.conf"
12 # Rules to gen a SliTaz package suitable for Tazpkg.
13 genpkg_rules()
14 {
15 cp -a stuff/. $fs
16 }
18 post_install()
19 {
20 grep -q httpd $1/etc/rcS.conf ||
21 sed -i 's/^RUN_DAEMONS="/&httpd /' $1/etc/rcS.conf
22 grep -q HTTPD_OPTIONS $1/etc/daemons.conf ||
23 cat >> $1/etc/daemons.conf <<EOT
25 # Http daemon options.
26 HTTPD_OPTIONS="-u 0:0"
27 EOT
28 while read line comment ; do
29 grep -qs "^$line" $1/etc/httpd.conf && continue
30 echo "$line $comment" >> $1/etc/httpd.conf
31 done <<EOT
32 H:/var/www # define the server root.
33 I:index.sh # Show index.html when a directory is requested
34 *.sh:/bin/sh # run xxx.sh through an interpreter
35 A:127.0.0.1 # Allow local loopback connections
36 $( . $1/etc/network.conf
37 while [ -n "$IP" ]; do
38 IFS=. ; set -- $IP $NETMASK ; unset IFS
39 echo "A: $(($1 & $5)).$(($2 & $6)).$(($3 & $7)).$(($4 & $8))/$NETMASK"
40 IP="$LAN_IP" ; NETMASK="$LAN_NETMASK" ; LAN_IP=""
41 done )
42 D:* # Deny from other IP connections
43 EOT
44 sed -i "s/^PASSWORD=.*/PASSWORD=\"$WIKI_PASSWORD\"/" \
45 $1/var/www/wiki/config*.sh
46 }
48 config_form()
49 {
50 [ -n "$WIKI_PASSWORD" ] || WIKI_PASSWORD=test
51 cat <<EOT
52 <table>
53 <tr>
54 <td>Wiki password</td>
55 <td><input type="text" name="WIKI_PASSWORD" value="$WIKI_PASSWORD" /></td>
56 </tr>
57 </table>
58 EOT
59 }