case "$1" in
configure)
+ for file in \
+ /usr/share/xml/xhtml/schema/dtd/1.0/xhtml1-strict.dtd \
+ /usr/share/xml/xhtml/schema/dtd/1.0/xhtml1-transitional.dtd \
+ /usr/share/xml/entities/xhtml/xhtml-lat1.ent \
+ /usr/share/xml/entities/xhtml/xhtml-special.ent \
+ /usr/share/xml/entities/xhtml/xhtml-symbol.ent \
+ ; do
+ fname=${file##*/}
+ test -s /usr/share/gforge/common/include/$fname || \
+ ln -sf $file /usr/share/gforge/common/include/
+ done
+
adduser --system --group --home /var/www/@OLDPACKAGE@ @OLDPACKAGE@ > /dev/null 2>&1
adduser --system --group --home /var/lib/@OLDPACKAGE@/chroot/cvsroot anonscm-@OLDPACKAGE@ > /dev/null 2>&1
adduser --system --group --home /var/lib/@OLDPACKAGE@/chroot/cvsroot scm-@OLDPACKAGE@ > /dev/null 2>&1
fi
if [ ! -e /etc/gforge/config.ini.d/debian-install-secrets.ini ] ; then
t=$(mktemp /etc/gforge/config.ini.d/debian-install-secrets.ini.XXXXXX)
+ pw=
+ db_fget @PACKAGE@/shared/db_password seen || true
+ seen="$RET"
+ if [ "$seen" = "true" ]; then
+ db_get @PACKAGE@/shared/db_password || true
+ pw=$RET
+ fi
+ if [ "$pw" = "" ] ; then
+ if [ -c /dev/urandom ]; then # ...using /dev/urandom when possible
+ pw=$(dd if=/dev/urandom count=1 bs=16 2> /dev/null | md5sum | cut -c-32)
+ else # ...or something else if need be.
+ pw=$(date +"%s:%N" | md5sum | cut -c-32)
+ fi
+ fi
+
if [ -c /dev/urandom ]; then # ...using /dev/urandom when possible
- pw=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum)
+ sk=$(dd if=/dev/urandom count=1 bs=16 2> /dev/null | md5sum | cut -c-32)
else # ...or something else if need be.
- pw=$(date +"%s:%N" | md5sum)
+ sk=$(date +"%s:%N" | md5sum | cut -c-32)
fi
cat > $t <<EOF
; You can edit the values here or move them to other files.
; These values should not go into world-readable files!
+; ATTENTION : these configuration variables may not be used directly
+; by the PHP scripts run by apache.
+; See contents of secrets.inc which is loaded by Apache conf files too
+
[core]
-database_host=""
+database_host=127.0.0.1
database_name=gforge
database_user=gforge
database_port=5432
database_password=$pw
+
+session_key=$sk
EOF
mv $t /etc/gforge/config.ini.d/debian-install-secrets.ini
fi
PATH=$PATH:/usr/share/gforge/bin migrate-to-ini-files.sh
fi
- @OLDPACKAGE@-config
;;
abort-upgrade|abort-remove|abort-deconfigure)