src/image-sources/pow-fusionforge.xcf -text
src/image-sources/top-logo.xcf -text
src/install-ng -text
-src/install/config -text
src/install/deps -text
src/install/detect_os -text
src/install/install2 -text
src/install/install3 -text
src/install/install4 -text
+src/install/install5_post -text
+src/install/install6_upgrade -text
src/lib/vendor/jquery-simpletreemenu/css/jquery-simpleTreeMenu-1.1.0.css -text svneol=unset#text/css
src/lib/vendor/jquery-simpletreemenu/css/simpleTreeMenu/menu-arrow-down.png -text svneol=unset#image/png
src/lib/vendor/jquery-simpletreemenu/css/simpleTreeMenu/menu-arrow-right.png -text svneol=unset#image/png
#
# Usage: ./install-ng <hostname>
#
-# This will install all the fusionforge code in /opt/gforge
+# This will install all the fusionforge code in $FORGE_HOME
# Configuration is stored in /etc/gforge
#
# Currently supported:
# Author: Alain Peyrat <aljeux@free.fr>
# Christian Bayle <bayle@debian.org>
#
+FORGE_HOME=/opt/gforge
+
usage(){
echo "Usage: $1 [-r|-h|-a|--reinit|--help|--auto|--deps|--files|--database|--config] [<hostname>]"
}
# Load some script
scriptdir=`cd \`dirname $0\`; pwd`
. $scriptdir/install/detect_os
-. $scriptdir/install/config
+
+FUSIONFORGE_DEFAULT_SRC_DIR=$(cd $(dirname $0); pwd)
+FUSIONFORGE_DEFAULT_DIR=$FUSIONFORGE_DEFAULT_SRC_DIR
+fusionforge_src_dir=${FUSIONFORGE_SRC_DIR:-$FUSIONFORGE_DEFAULT_SRC_DIR}
+fusionforge_dir=${FUSIONFORGE_DIR:-$FUSIONFORGE_DEFAULT_DIR}
+fusionforge_data_dir=${FUSIONFORGE_DATA_DIR:-/var/lib/gforge}
+fusionforge_log_dir=${FUSIONFORGE_LOG_DIR:-/var/log/gforge}
+fusionforge_etc_dir=${FUSIONFORGE_ETC_DIR:-/etc/gforge}
# Call to detect_os, this will set $type and $distrib
os=$(detect_os)
. $scriptdir/install/install2
. $scriptdir/install/install3
. $scriptdir/install/install4
+. $scriptdir/install/install5_post
+. $scriptdir/install/install6_upgrade
if $AUTO
then
dropdbifexists $FFORGE_DB
fi
-if [ -d "/opt/gforge" ]
+if [ -d "$FORGE_HOME" ]
then
if [ -f "/etc/gforge/install_completed" ]
then
fi
echo "Install type = $type"
-case $type in
- redhat)
- if $DEFAULT || $FILES
+if $DEFAULT || $FILES
+then
+ install2_files_$type "$hostname"
+fi
+
+if [ "$mode" = "install" ]
+then
+ if $DEFAULT || $DATABASE
then
- echo "Running install2_files "$hostname" apache apache"
- install2_files "$hostname" apache apache
+ echo "Running install3_db_$type"
+ install3_db_$type
fi
- if [ "$mode" = "install" ]
+ if $DEFAULT || $CONFIG
then
- if $DEFAULT || $DATABASE
- then
- echo "Running install3_db"
- install3_db
- fi
- if $DEFAULT || $CONFIG
- then
- echo "Running install4_config"
- install4_config
- fi
- if $DEFAULT
- then
- # Post installation fixes.
- perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/httpd/conf/httpd.conf
- # Disable ssl
- perl -spi -e "s/^Include/#Include/" /etc/gforge/httpd.conf.d/ssl-on.inc
-
- chkconfig httpd on
- chkconfig postgresql on
- chkconfig iptables off
-
- service httpd restart
- service iptables stop
- msg="IMPORTANT: Service iptables (firewall) disabled, please reconfigure after"
-
- cp $scriptdir/packaging/cron.d/cron.fusionforge /etc/cron.d
- cp $scriptdir/plugins/*/etc/cron.d/* /etc/cron.d/
- service crond reload
- fi
- else
- if $DEFAULT
- then
- echo "Running php db/upgrade-db.php"
- cd $scriptdir; php db/upgrade-db.php
- echo "Running php utils/normalize_roles.php"
- cd $scriptdir; php utils/normalize_roles.php
- fi
+ echo "Running install4_config_$type"
+ install4_config_$type
fi
- ;;
-
- suse)
- if $DEFAULT || $FILES
+ if $DEFAULT
then
- install2_files "$hostname" wwwrun www
+ echo "Running install5_post_$type"
+ install5_post_$type "$hostname"
fi
- if [ $mode = "install" ]
+else
+ if $DEFAULT
then
- if $DEFAULT || $DATABASE
- then
- echo "Running install3_db"
- install3_db
- fi
- if $DEFAULT || $CONFIG
- then
- echo "Running install4_config"
- install4_config
- fi
- if $DEFAULT
- then
- # Post installation fixes.
- #perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/apache2/httpd.conf
-
- chkconfig -s apache2 on
- chkconfig -s postgresql on
-
- # Apache settings: modules
- for m in dav dav_svn authz_svn ssl; do
- a2enmod $m
- a2enflag $m
- done
- echo "Virtual hosts for ${hostname}:"
- httpd2 -S -DSSL 2>&1 | grep ${hostname}
-
- rcapache2 restart
-
- rcSuSEfirewall2 stop
- msg="IMPORTANT: Service SuSEfirewall2 stopped, please reconfigure after"
-
- cp $scriptdir/packaging/cron.d/cron.fusionforge /etc/cron.d
- cp $scriptdir/plugins/*/etc/cron.d/* /etc/cron.d/
- rccron reload
- fi
- else
- if $DEFAULT
- then
- echo "Running php db/upgrade-db.php"
- cd $scriptdir; php db/upgrade-db.php
- echo "Running php utils/normalize_roles.php"
- cd $scriptdir; php utils/normalize_roles.php
- fi
+ echo "Running install6_upgrade_$type"
+ install6_upgrade_$type
fi
- ;;
-
- ubuntu)
- echo "--"
- echo "For ubuntu, rather use ubuntu $distrib package"
- echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/UbuntuRepositories"
- echo "--"
- ;;
-
- debian)
- echo "--"
- echo "For debian, rather use debian $distrib package"
- echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/DebianRepositories"
- echo "--"
- ;;
-
- *)
- echo "Only Red Hat, Fedora or CentOS and OpenSUSE are supported by this script.";
- echo "See INSTALL for normal installation";
- exit 1
- ;;
-esac
+fi
echo "check /etc/gforge/local.inc for $hostname specific FusionForge settings"
echo "Write INSTALL COMPLETED"
+++ /dev/null
-#! /bin/sh
-fusionforge_dir=${FUSIONFORGE_DIR:-/opt/gforge}
-fusionforge_src_dir=${FUSIONFORGE_SRC_DIR:-/opt/gforge}
-fusionforge_data_dir=${FUSIONFORGE_DATA_DIR:-/var/lib/gforge}
-fusionforge_log_dir=${FUSIONFORGE_LOG_DIR:-/var/log/gforge}
-fusionforge_etc_dir=${FUSIONFORGE_ETC_DIR:-/etc/gforge}
deps_redhat() {
if [ ! -f /tmp/done_yum ]
then
- set -e
addFusionForgeYumRepo
addDagRPMForgeYumRepo
msg green "Installing packages: Executing YUM. Please wait..."
yum --enablerepo=fusionforge --enablerepo=dag-rpmforge -y --skip-broken install httpd php mailman cvs postgresql postgresql-libs postgresql-server postgresql-contrib perl-URI php-pgsql subversion mod_dav_svn postfix rcs php-gd mod_ssl wget openssh which liberation-fonts php-htmlpurifier php-mbstring php-jpgraph-1.5.2 poppler-utils php-pecl-zip php-pear-HTTP_WebDAV_Server antiword php-pecl-Fileinfo shared-mime-info rsync
touch /tmp/done_yum
- set +e
fi
}
suse|opensuse)
type=suse
;;
- debian|ubuntu|ark)
+ debian|ark)
type=debian
;;
+ ubuntu)
+ type=ubuntu
+ ;;
centos|rhel|redhat_unknown|fedora)
type=redhat
;;
+ *)
+ type=unknown
+ ;;
esac
echo $type
}
msg red "Usage: $0 fusionforge.org apacheuser apachegroup"
exit 127
else
- msg green "Validating arguments: OK"
+ msg green "Running install2_files $hostname $apacheuser $apachegroup"
fi
CHECK=`echo $hostname | grep -E "[^[:alnum:]\-]"`
chmod 755 /bin/cvssh.pl
# Create default location for gforge config files
+ # TODO BEGIN : could this be replaced by $fusionforge_dir/utils/manage-apache-config.sh install ?
mkdir -p $fusionforge_etc_dir
if [ ! -f $fusionforge_etc_dir/httpd.conf ]
then
cp $fusionforge_dir/etc/config.ini-opt $fusionforge_etc_dir/config.ini
cp -rL $fusionforge_dir/etc/config.ini.d $fusionforge_etc_dir/
+ # TODO END
# Install default configuration files for all plugins.
mkdir -p $fusionforge_etc_dir/plugins/
cd $fusionforge_etc_dir && find -type f -exec perl -pi -e "s/gforge.company.com/$hostname/" {} \;
echo "noreply: /dev/null" >> /etc/aliases
}
+
+install2_files_redhat()
+{
+ install2_files $1 apache apache
+}
+
+install2_files_suse()
+{
+ install2_files $1 wwwrun www
+}
+
+install2_files_ubuntu()
+{
+ echo "--"
+ echo "For ubuntu, rather use ubuntu package"
+ echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/UbuntuRepositories"
+ echo "--"
+}
+
+install2_files_debian()
+{
+ echo "--"
+ echo "For debian, rather use debian package"
+ echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/DebianRepositories"
+ echo "--"
+}
+
+install2_files_unknown()
+{
+ echo "Only Red Hat, Fedora or CentOS and OpenSUSE are supported by this script.";
+ echo "See INSTALL for normal installation";
+ exit 1
+}
}
forge_save_db_config(){
-
if [ -z "$FFORGE_DB" ]
then
while test -z "$FFORGE_DB"
installandrundb
msg green "Done."
}
+
+install3_db_redhat()
+{
+ install3_db
+}
+
+install3_db_suse()
+{
+ install3_db
+}
+
+install3_db_debian()
+{
+ echo "Install 3 db not implemented for debian"
+}
+
+install3_db_ubuntu()
+{
+ echo "Install 3 db not implemented for ubuntu"
+}
+
+install3_db_unknown()
+{
+ echo "Install 3 db not implemented"
+}
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
install4_config(){
- if [ -f "/etc/gforge/local.inc" ]
+ if [ -f "$fusionforge_etc_dir/local.inc" ]
then
- PATH=/opt/gforge/utils/:$PATH migrate-to-ini-files.sh
+ PATH=$fusionforge_dir/utils/:$PATH migrate-to-ini-files.sh
fi
- PATH=/opt/gforge/utils/:$PATH manage-apache-config.sh install
+ PATH=$fusionforge_dir/utils/:$PATH manage-apache-config.sh install
- ls /etc/gforge/httpd.conf.d/*.generated | while read i
+ ls $fusionforge_etc_dir/httpd.conf.d/*.generated | while read i
do
mv $i ${i%%.generated}
done
}
+
+install4_config_redhat()
+{
+ install4_config
+}
+
+install4_config_suse()
+{
+ install4_config
+}
+
+install4_config_debian()
+{
+ echo "TODO"
+}
+
+install4_config_ubuntu()
+{
+ echo "TODO"
+}
+
+install4_config_unknown()
+{
+ echo "TODO"
+}
--- /dev/null
+install5_post_redhat()
+{
+ hostname=$1
+
+ # Post installation fixes.
+ perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/httpd/conf/httpd.conf
+ # Disable ssl
+ perl -spi -e "s/^Include/#Include/" /etc/gforge/httpd.conf.d/ssl-on.inc
+
+ chkconfig httpd on
+ chkconfig postgresql on
+ chkconfig iptables off
+
+ service httpd restart
+ service iptables stop
+ msg="IMPORTANT: Service iptables (firewall) disabled, please reconfigure after"
+
+ cp $scriptdir/packaging/cron.d/cron.fusionforge /etc/cron.d
+ cp $scriptdir/plugins/*/etc/cron.d/* /etc/cron.d/
+ service crond reload
+}
+
+install5_post_suse()
+{
+ hostname=$1
+
+ # Post installation fixes.
+ #perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/apache2/httpd.conf
+
+ chkconfig -s apache2 on
+ chkconfig -s postgresql on
+
+ # Apache settings: modules
+ for m in dav dav_svn authz_svn ssl; do
+ a2enmod $m
+ a2enflag $m
+ done
+ echo "Virtual hosts for ${hostname}:"
+ httpd2 -S -DSSL 2>&1 | grep ${hostname}
+
+ rcapache2 restart
+
+ rcSuSEfirewall2 stop
+ msg="IMPORTANT: Service SuSEfirewall2 stopped, please reconfigure after"
+
+ cp $scriptdir/packaging/cron.d/cron.fusionforge /etc/cron.d
+ cp $scriptdir/plugins/*/etc/cron.d/* /etc/cron.d/
+ rccron reload
+}
+
+install5_post_debian()
+{
+ echo "TODO"
+}
+
+install5_post_ubuntu()
+{
+ echo "TODO"
+}
+
+install5_post_unknown()
+{
+ echo "TODO"
+}
+
+
--- /dev/null
+install6_upgrade()
+{
+ echo "Running php db/upgrade-db.php"
+ cd $scriptdir; php db/upgrade-db.php
+ echo "Running php utils/normalize_roles.php"
+ cd $scriptdir; php utils/normalize_roles.php
+}
+
+install6_upgrade_redhat()
+{
+ install6_upgrade
+}
+
+install6_upgrade_suse()
+{
+ install6_upgrade
+}
+
+install6_upgrade_debian()
+{
+ echo "TODO"
+}
+
+install6_upgrade_ubuntu()
+{
+ echo "TODO"
+}
+
+install6_upgrade_unknown()
+{
+ echo "TODO"
+}