#! /bin/sh
+# This script is used by the debian and RPM packages to set up fusionforge.
usage() {
- echo "$0: [-interact] [-help] [-debug] [-confdir confdir] [-input conffile] [-output conffile] [-httpdconf gforgehttpdconf] [-httpdsecrets gforgehttpdsecrets] [-localinc gforgelocalinc] [-example|-fhs] [-clean] [-noapache] [-dovhost] [-home homepath] [-group grouppath] [-listen80|nolisten80] [-nossl]"
+ echo "$0: [-interact] [-help] [-debug] [-confdir confdir] [-input conffile] [-output conffile] [-httpdconf gforgehttpdconf] [-httpdsecrets gforgehttpdsecrets] [-localinc gforgelocalinc] [-example|-fhs] [-clean] [-noapache] [-dovhost] [-novhost] [-home homepath] [-group grouppath] [-listen80|nolisten80] [-nossl]"
}
getval(){
computedefault(){
echo "Calculating defaults"
# This is used to make a default working gforge.conf
- DEFAULTsystem_name=MyGForge
+ DEFAULTsystem_name=MyForge
DEFAULTdomain_name=`hostname -f`
DEFAULTserver_admin=webmaster@$DEFAULTdomain_name
- DEFAULTdb_host=`hostname -i`
- DEFAULTdb_port=5432
+ DEFAULTdb_host=
+ DEFAULTdb_port=
DEFAULTdb_name=gforge
DEFAULTdb_user=gforge
DEFAULTdb_password=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum | cut -b1-8)
DEFAULTftpuploadhost=upload.$DEFAULTdomain_name
DEFAULTftpuploaddir=$GFGDIR/var/lib/gforge/chroot/ftproot
#
- DEFAULTstatsadmin_groupid=2
- DEFAULTnewsadmin_groupid=3
+ DEFAULTnewsadmin_groupid=2
+ DEFAULTstatsadmin_groupid=3
DEFAULTpeerrating_groupid=4
DEFAULTtemplate_project=5
DEFAULTadmin_login=admin
DEFAULTcronolog_path=$(findcronolog)
DEFAULTsys_sendmail_path=$(findsendmail)
DEFAULTsys_path_to_jpgraph=/usr/share/jpgraph/
- DEFAULTsys_path_to_scmweb=/usr/lib/gforge/bin/
+ DEFAULTsys_path_to_scmweb=/usr/share/gforge/bin/
DEFAULTgforge_chroot=$CHROOT
DEFAULTgforge_etc=$ETCDIR
DEFAULTsys_custom_path=$ETCDIR/custom
DEFAULTsys_use_people=true
DEFAULTsys_use_ftpuploads=false
DEFAULTsys_use_diary=true
+ DEFAULTsys_use_bookmarks=true
+ DEFAULTsys_use_project_tags=true
+ DEFAULTsys_use_project_full_list=true
DEFAULTsys_use_gateways=true
DEFAULTsys_use_project_vhost=true
DEFAULTsys_use_project_database=false
DEFAULTsys_use_private_project=true
DEFAULTsys_project_reg_restricted=false
DEFAULTsys_user_reg_restricted=false
+ DEFAULTsys_require_accept_conditions=false
+ DEFAULTsys_require_unique_email=false
DEFAULTsys_localinc=$ETCDIR/local.inc
DEFAULTsys_jabber_pass=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum | cut -b1-8)
DEFAULTsys_plugins_path=$SHAREDIR/plugins/
DEFAULTsys_apache_user=$(findapacheowner)
DEFAULTsys_apache_group=$(findapacheowner)
DEFAULTsys_forum_return_domain=$DEFAULTdomain_name
+ DEFAULTsys_block_anonymous_downloads=false
+ DEFAULTsys_urlprefix=/
+ DEFAULTdovhost=$dovhost
#
# TODO
#usr_lib_gforge=$GFGDIR
mv $CONFFILEIN.new $CONFFILEIN
# Fill in the blanks
- EXCLUDEVHOST=' -not -name 55vhost'
+ EXCLUDEVHOST=''
if [ "$dovhost" = true ]
then
- EXCLUDEVHOST=''
+ EXCLUDEVHOST=".vhost\|"
fi
#
rm -f $ETCDIR/httpd.d/10cvs
#rm -f $ETCDIR/httpd.d/20list
#
- find $ETCTEMPLATEDIR/httpd.d -L -type f -regex "$ETCTEMPLATEDIR/httpd.d/\([a-z0-9]+\|_?([a-z0-9_.]+-)+[a-z0-9]+\|[a-z0-9][a-z0-9-]*\)\(\|.ssl\|.secrets\)" $EXCLUDEVHOST | sort | while read i
+ find $ETCTEMPLATEDIR/httpd.d -follow -type f -regex "$ETCTEMPLATEDIR/httpd.d/\([a-z0-9]+\|_?([a-z0-9_.]+-)+[a-z0-9]+\|[a-z0-9][a-z0-9-]*\)\(\|.ssl\|.secrets\|$EXCLUDEVHOST.vhost.ssl\)" | sort | while read i
do
if [ "$ETCTEMPLATEDIR" != "$ETCDIR" -a -f $ETCDIR/httpd.d/`basename $i` ]
then
rm $ETCDIR/httpd.secrets.gforge-new
echo "Creating $LOCALINC"
- find $ETCTEMPLATEDIR/local.d -L -type f -regex "$ETCTEMPLATEDIR/local.d/\([a-z0-9]+\|_?([a-z0-9_.]+-)+[a-z0-9]+\|[a-z0-9][a-z0-9-]*\)\(\|.$database\)" | sort | while read i
+ find $ETCTEMPLATEDIR/local.d -follow -type f -regex "$ETCTEMPLATEDIR/local.d/\([a-z0-9]+\|_?([a-z0-9_.]+-)+[a-z0-9]+\|[a-z0-9][a-z0-9-]*\)\(\|.$database\)" | sort | while read i
do
if [ "$ETCTEMPLATEDIR" != "$ETCDIR" -a -f $ETCDIR/local.d/`basename $i` ]
then
fi
$BINDIR/fill-in-the-blanks.pl $i $CONFFILEOUTDIR/`basename $i` $CONFFILEOUT
done
- (find $CONFFILEOUTDIR -L -type f -regex "$CONFFILEOUTDIR/\([a-z0-9]+\|_?([a-z0-9_.]+-)+[a-z0-9]+\|[a-z0-9][a-z0-9-]*\)\(\|.$database\)" | sort | xargs cat ) > $LOCALINC
- find $CONFFILEOUTDIR -L -type f -regex "$CONFFILEOUTDIR/\([a-z0-9]+\|_?([a-z0-9_.]+-)+[a-z0-9]+\|[a-z0-9][a-z0-9-]*\)\(\|.$database\)" -print0 | xargs -0 rm
+ (find $CONFFILEOUTDIR -follow -type f -regex "$CONFFILEOUTDIR/\([a-z0-9]+\|_?([a-z0-9_.]+-)+[a-z0-9]+\|[a-z0-9][a-z0-9-]*\)\(\|.$database\)" | sort | xargs cat ) > $LOCALINC
+ find $CONFFILEOUTDIR -follow -type f -regex "$CONFFILEOUTDIR/\([a-z0-9]+\|_?([a-z0-9_.]+-)+[a-z0-9]+\|[a-z0-9][a-z0-9-]*\)\(\|.$database\)" -print0 | xargs -0 rm
echo "Creating other includes"
#for i in $ETCDIR/templates/[a-z]*
- find $ETCTEMPLATEDIR/templates -L -type f -regex "$ETCTEMPLATEDIR/templates/[a-z].*" | while read i
+ find $ETCTEMPLATEDIR/templates -follow -type f -regex "$ETCTEMPLATEDIR/templates/[a-z].*" | while read i
do
if [ "$ETCTEMPLATEDIR" != "$ETCDIR" -a -f $ETCDIR/templates/`basename $i` ]
then
interact=false
noapache=false
database=env
-dovhost=false
listen80=true
usessl=true
+dovhost=true
+
while [ $# -ne 0 ]
do
shift
ETCDIR=/etc/gforge
ETCTEMPLATEDIR=/usr/share/gforge/etc
- BINDIR=/usr/lib/gforge/bin
- CGIDIR=/usr/lib/gforge/cgi-bin
+ BINDIR=/usr/share/gforge/bin
+ CGIDIR=/usr/share/gforge/cgi-bin
GFGDIR=''
HOMEPATH=/home/users
GROUPPATH=/home/groups
CHROOT=/var/lib/gforge/chroot
SHAREDIR=/usr/share/gforge
- LIBDIR=/usr/lib/gforge
+ LIBDIR=/usr/share/gforge
CONFFILEOUTDIR=/etc/gforge
CONFFILEIN=/etc/gforge/gforge.conf
CONFFILEOUT=/etc/gforge/gforge.conf
-noapache )
noapache=true
;;
+ -novhost )
+ dovhost=false
+ ;;
-dovhost )
dovhost=true
;;