wok-tiny view wiki/receipt @ rev 126

Update config_form()
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 12 19:39:46 2017 +0100 (2017-02-12)
parents bb00d1e3b0f7
children a28c45a86936
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 LICENSE="BSD"
9 WEB_SITE="http://tiny.slitaz.org/"
10 DEPENDS="base-tiny"
11 CONFIG_FILES="/etc/daemons.conf /etc/rcS.conf"
13 # Rules to gen a SliTaz package suitable for Tazpkg.
14 genpkg_rules()
15 {
16 cp -a $stuff/. $fs
17 }
19 post_install()
20 {
21 grep -q inetd $1/etc/rcS.conf ||
22 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
23 grep -q /httpd $1/etc/inetd.conf || cat >> $1/etc/inetd.conf <<EOT
24 http stream tcp nowait root httpd httpd -i -u 0:0
25 EOT
26 while read line comment ; do
27 grep -qs "^$line" $1/etc/httpd.conf && continue
28 echo "$line $comment" >> $1/etc/httpd.conf
29 done <<EOT
30 H:/var/www # define the server root.
31 I:index.sh # Show index.html when a directory is requested
32 *.sh:/bin/sh # run xxx.sh through an interpreter
33 A:127.0.0.1 # Allow local loopback connections
34 $( . $1/etc/network.conf
35 while [ -n "$IP" ]; do
36 IFS=. ; set -- $IP $NETMASK ; unset IFS
37 echo "A: $(($1 & $5)).$(($2 & $6)).$(($3 & $7)).$(($4 & $8))/$NETMASK"
38 IP="$LAN_IP" ; NETMASK="$LAN_NETMASK" ; LAN_IP=""
39 done )
40 D:* # Deny from other IP connections
41 EOT
42 sed -i "s/^PASSWORD=.*/PASSWORD=\"$WIKI_PASSWORD\"/" \
43 $1/var/www/wiki/config*.sh
44 }
46 config_form()
47 {
48 cat <<EOT
49 <table>
50 <tr>
51 <td>Wiki password</td>
52 <td><input type="text" name="WIKI_PASSWORD" value="${WIKI_PASSWORD:-test}" /></td>
53 </tr>
54 </table>
55 EOT
56 }