sub debug ( $ ) ;
require ("/usr/share/gforge/lib/include.pl") ; # Include all the predefined functions
-require ("/etc/gforge/local.pl") ;
&db_connect ;
$server_admin $domain_name $newsadmin_groupid $statsadmin_groupid
$libdir $sqldir/ ;
-require ("/etc/gforge/local.pl") ;
$libdir="/usr/share/gforge/lib";
$sqldir="/usr/share/gforge/db";
require ("$libdir/sqlparser.pm") ; # Our magic SQL parser
require ("$libdir/sqlhelper.pm") ; # Our SQL functions
require ("$libdir/include.pl"); # Some other functions
+chomp($sys_news_group=`/usr/share/gforge/bin/forge_get_config news_group`);
+chomp($domain_name=`/usr/share/gforge/bin/forge_get_config web_host`);
&db_connect ;
if (&is_lesser ($version, $target)) {
&debug ("Adding local data.") ;
- do "/etc/gforge/local.pl" or die "Cannot read /etc/gforge/local.pl" ;
-
my ($login, $md5pwd, $unixpwd, $email, $noreplymail, $date) ;
$login = 'admin' ;
delete @ENV{qw(IFS CDPATH ENV BASH_ENV PATH)};
# Check access to secret
-require ("/etc/gforge/local.pl") ;
+require("/usr/share/gforge/lib/include.pl");
unless ( (defined $sys_dbpasswd)
and (defined $ENV{'sys_dbpasswd'})
and ($sys_dbpasswd eq $ENV{'sys_dbpasswd'}) ) {
sub debug ( $ ) ;
-require ("/etc/gforge/local.pl") ;
require("/usr/share/gforge/lib/include.pl"); # Include all the predefined functions
&db_connect ;
case "$1" in
configure-files)
cp -a /etc/bind/named.conf /etc/bind/named.conf.gforge-new
- domain_name=$(perl -e'require "/etc/gforge/local.pl"; print "$domain_name\n";')
- ip_address=$(perl -e'require "/etc/gforge/local.pl"; print "$sys_ip_address\n";')
+ domain_name=`/usr/share/gforge/bin/forge_get_config web_host`
+ ip_address=`/usr/share/gforge/bin/forge_get_config ip_address`
# export domain_name=$1
# export ip_address=$2
if ! grep -q "// Next line inserted by GForge install" /etc/bind/named.conf.gforge-new ; then
fi
;;
configure)
- domain_name=$(perl -e'require "/etc/gforge/local.pl"; print "$domain_name\n";')
- ip_address=$(perl -e'require "/etc/gforge/local.pl"; print "$sys_ip_address\n";')
- sys_simple_dns=$(perl -e'require "/etc/gforge/local.pl"; print "$sys_simple_dns\n";')
+ domain_name=`/usr/share/gforge/bin/forge_get_config web_host`
+ ip_address=`/usr/share/gforge/bin/forge_get_config ip_address`
+ sys_simple_dns=`/usr/share/gforge/bin/forge_get_config simple_dns`
serial=`date '+%Y%m%d'`01
# scm_host lists_host are useless for now
for i in domain_name ip_address serial ; do
configure-files)
cp -a /etc/aliases /etc/aliases.gforge-new
# Redirect "noreply" mail to the bit bucket (if need be)
- noreply_to_bitbucket=$(perl -e'require "/etc/gforge/local.pl"; print "$noreply_to_bitbucket\n";')
+ noreply_to_bitbucket=`/usr/share/gforge/bin/forge_get_config noreply_to_bitbucket`
if [ "$noreply_to_bitbucket" = "true" ] ; then
if ! grep -q "^noreply:" /etc/aliases.gforge-new ; then
echo "### Next line inserted by GForge install" >> /etc/aliases.gforge-new
fi
# Redirect "gforge" mail to the site admin
- server_admin=$(perl -e'require "/etc/gforge/local.pl"; print "$server_admin\n";')
+ server_admin=`/usr/share/gforge/bin/forge_get_config admin_email`
if ! grep -q "^gforge:" /etc/aliases.gforge-new ; then
echo "### Next line inserted by GForge install" >> /etc/aliases.gforge-new
echo "gforge: $server_admin" >> /etc/aliases.gforge-new
tmp1=$(mktemp /tmp/$pattern)
# First, get the list of local domains right
perl -e '
-require ("/etc/gforge/local.pl") ;
+chomp($sys_lists_host=`/usr/share/gforge/bin/forge_get_config lists_host`);
$seen_sf_domains = 0 ;
while (($l = <>) !~ /^\s*local_domains/) {
print $l;
tmp2=$(mktemp /tmp/$pattern)
# Second, insinuate our forwarding rules in the directors section
perl -e '
-require ("/etc/gforge/local.pl") ;
+chomp($sys_users_host=`/usr/share/gforge/bin/forge_get_config users_host`);
+chomp($sys_lists_host=`/usr/share/gforge/bin/forge_get_config lists_host`);
+chomp($sys_ldap_base_dn=`/usr/share/gforge/bin/forge_get_config ldap_base_dn`);
$sf_block = "# BEGIN SOURCEFORGE BLOCK -- DO NOT EDIT #
# You may move this block around to accomodate your local needs as long as you
tmp1=$(mktemp /tmp/$pattern)
cp -a /etc/aliases /etc/aliases.gforge-new
# Redirect "noreply" mail to the bit bucket (if need be)
- noreply_to_bitbucket=$(perl -e'require "/etc/gforge/local.pl"; print "$noreply_to_bitbucket\n";')
+ noreply_to_bitbucket=`/usr/share/gforge/bin/forge_get_config noreply_to_bitbucket`
if [ "$noreply_to_bitbucket" = "true" ] ; then
grep -v "^noreply:" /etc/aliases.gforge-new > $tmp1
cat $tmp1 > /etc/aliases.gforge-new
cp -a $cfg_aliases $cfg_aliases_gforge
# Redirect "noreply" mail to the bit bucket (if need be)
- noreply_to_bitbucket=$(perl -e'require "/etc/gforge/local.pl"; print "$noreply_to_bitbucket\n";')
+ noreply_to_bitbucket=`/usr/share/gforge/bin/forge_get_config noreply_to_bitbucket`
if [ "$noreply_to_bitbucket" = "true" ] ; then
if ! grep -q "^noreply:" $cfg_aliases_gforge; then
echo "### Next line inserted by GForge install" >> $cfg_aliases_gforge
fi
# Redirect "gforge" mail to the site admin
- server_admin=$(perl -e'require "/etc/gforge/local.pl"; print "$server_admin\n";')
+ server_admin=`/usr/share/gforge/bin/forge_get_config admin_email`
if ! grep -q "^gforge:" $cfg_aliases_gforge; then
echo "### Next line inserted by GForge install" >> $cfg_aliases_gforge
echo "gforge: $server_admin" >> $cfg_aliases_gforge
cp -a $m $cfg_gforge_main
perl -e '
-require ("/etc/gforge/local.pl") ;
+chomp($sys_dbuser=`/usr/share/gforge/bin/forge_get_config database_user`);
+chomp($sys_dbname=`/usr/share/gforge/bin/forge_get_config database_name`);
+chomp($sys_users_host=`/usr/share/gforge/bin/forge_get_config users_host`);
+chomp($sys_lists_host=`/usr/share/gforge/bin/forge_get_config lists_host`);
$seen_gf_domains = 0;
while (($l = <>) !~ /^\s*domainlist\s*local_domains/) {
print $l;
# Second, insinuate our forwarding rules in the directors section
perl -e '
-require ("/etc/gforge/local.pl") ;
+chomp($sys_users_host=`/usr/share/gforge/bin/forge_get_config users_host`);
+chomp($sys_lists_host=`/usr/share/gforge/bin/forge_get_config lists_host`);
my $gf_block = "# BEGIN GFORGE BLOCK -- DO NOT EDIT #
# You may move this block around to accomodate your local needs as long as you
grep -v "^gforge:" $cfg_aliases_gforge > $tmp1
# Redirect "noreply" mail to the bit bucket (if need be)
- noreply_to_bitbucket=$(perl -e'require "/etc/gforge/local.pl"; print "$noreply_to_bitbucket\n";')
+ noreply_to_bitbucket=`/usr/share/gforge/bin/forge_get_config noreply_to_bitbucket`
if [ "$noreply_to_bitbucket" = "true" ] ; then
grep -v "^noreply:" $tmp1 > $cfg_aliases_gforge
else
configure-files)
cp -a /etc/aliases /etc/aliases.gforge-new
# Redirect "noreply" mail to the bit bucket (if need be)
- noreply_to_bitbucket=$(perl -e'require "/etc/gforge/local.pl"; print "$noreply_to_bitbucket\n";')
+ noreply_to_bitbucket=`/usr/share/gforge/bin/forge_get_config noreply_to_bitbucket`
if [ "$noreply_to_bitbucket" = "true" ] ; then
if ! grep -q "^noreply:" /etc/aliases.gforge-new ; then
echo "### Next line inserted by GForge install" >> /etc/aliases.gforge-new
fi
# Redirect "gforge" mail to the site admin
- server_admin=$(perl -e'require "/etc/gforge/local.pl"; print "$server_admin\n";')
+ server_admin=`/usr/share/gforge/bin/forge_get_config admin_email`
if ! grep -q "^gforge:" /etc/aliases.gforge-new ; then
echo "### Next line inserted by GForge install" >> /etc/aliases.gforge-new
echo "gforge: $server_admin" >> /etc/aliases.gforge-new
tmp1=$(mktemp /tmp/$pattern)
# First, get the list of local domains right - add gforge domains to 'mydestination'
perl -e '
-require ("/etc/gforge/local.pl") ;
+chomp($domain_name=`/usr/share/gforge/bin/forge_get_config web_host`);
my $l;
while (($l = <>) !~ /^\s*mydestination/) { print $l; };
chomp $l;
' < /etc/postfix/main.cf.gforge-new > $tmp1
grep -q '^[[:space:]]*relay_domains' $tmp1 || echo 'relay_domains = $mydestination' >>$tmp1
perl -i -e '
-require ("/etc/gforge/local.pl") ;
+chomp($sys_lists_host=`/usr/share/gforge/bin/forge_get_config lists_host`);
my $l;
while (($l = <>) !~ /^\s*relay_domains/) { print $l; };
chomp $l;
tmp2=$(mktemp /tmp/$pattern)
# Second, insinuate our forwarding rules in the directors section
perl -e '
-require ("/etc/gforge/local.pl") ;
+chomp($domain_name=`/usr/share/gforge/bin/forge_get_config web_host`);
+chomp($sys_dbuser=`/usr/share/gforge/bin/forge_get_config database_user`);
+chomp($sys_dbname=`/usr/share/gforge/bin/forge_get_config database_name`);
my $gf_block;
my $l;
configure)
[ -x /usr/bin/newaliases ] && newaliases
- perl -e'require "/etc/gforge/local.pl"; print "$sys_lists_host mailman:\n";' > /var/lib/gforge/etc/postfix-transport
+ echo "`/usr/share/gforge/bin/forge_get_config lists_host` mailman:" > /var/lib/gforge/etc/postfix-transport
postmap /var/lib/gforge/etc/postfix-transport
;;
tmp1=$(mktemp /tmp/$pattern)
cp -a /etc/aliases /etc/aliases.gforge-new
# Redirect "noreply" mail to the bit bucket (if need be)
- noreply_to_bitbucket=$(perl -e'require "/etc/gforge/local.pl"; print "$noreply_to_bitbucket\n";')
+ noreply_to_bitbucket=`/usr/share/gforge/bin/forge_get_config noreply_to_bitbucket`
if [ "$noreply_to_bitbucket" = "true" ] ; then
grep -v "^noreply:" /etc/aliases.gforge-new > $tmp1
cat $tmp1 > /etc/aliases.gforge-new
tmp1=$(mktemp /tmp/$pattern)
# First, replace the list of local domains
perl -e '
-require ("/etc/gforge/local.pl") ;
+chomp($domain_name=`/usr/share/gforge/bin/forge_get_config web_host`);
+chomp($sys_lists_host=`/usr/share/gforge/bin/forge_get_config lists_host`);
while (($l = <>) !~ /^\s*mydestination/) {
print $l;
};
while ($l = <>) { print $l; };
' < /etc/postfix/main.cf.gforge-new > $tmp1
grep -q '^[[:space:]]*relay_domains' $tmp1 && perl -i -e '
-require ("/etc/gforge/local.pl") ;
+chomp($sys_lists_host=`/usr/share/gforge/bin/forge_get_config lists_host`);
while (($l = <>) !~ /^\s*relay_domains/) {
print $l;
};
use strict ;
use vars qw/$dbh $ifile $ofile @ilist %hash $key $val $cur $line $dbh $sys_dbname $sys_dbuser $sys_dbpasswd $token/ ;
-require("/etc/gforge/local.pl");
require ("/usr/share/gforge/lib/include.pl") ;
%hash = () ;
x"$file" && rm -f /usr/share/gforge/common/include/$fname
done
- rm -f /etc/@OLDPACKAGE@/local.pl
+ if [ -f /etc/@OLDPACKAGE@/local.pl ]
+ then
+ rm -f /etc/@OLDPACKAGE@/local.pl
+ fi
;;
upgrade|deconfigure|failed-upgrade)
;;
if (is_lesser $version, $target) {
debug "Adding local data." ;
- do "/etc/gforge/local.pl" or die "Cannot read /etc/gforge/local.pl" ;
+ chomp($domain_name=`/usr/share/gforge/bin/forge_get_config web_host`);
my $ip_address = qx/host $domain_name | awk '{print \}'/ ;
$dbh->commit () ;
}
-# $version = &get_db_version ;
-# $target = "0.2" ;
-# if (is_lesser $version, $target) {
-# debug "Adding local data." ;
-#
-# do "/etc/gforge/local.pl" or die "Cannot read /etc/gforge/local.pl" ;
-#
-# my $ip_address = qx/host $domain_name | awk '{print \}'/ ;
-#
-# @reqlist = (
-# "INSERT INTO plugin_".$pluginname."_sample_data (domain, ip_address) VALUES ('$domain_name', '$ip_address')",
-# ) ;
-#
-# foreach my $s (@reqlist) {
-# $query = $s ;
-# # debug $query ;
-# $sth = $dbh->prepare ($query) ;
-# $sth->execute () ;
-# $sth->finish () ;
-# }
-# @reqlist = () ;
-#
-# &update_db_version ($target) ;
-# debug "Committing." ;
-# $dbh->commit () ;
-# }
-
debug "It seems your database install/upgrade went well and smoothly. That's cool." ;
debug "Please enjoy using Debian FusionForge." ;
require ("/usr/share/gforge/lib/include.pl") ; # Include a few predefined functions
require ("/usr/share/gforge/lib/sqlparser.pm") ; # Our magic SQL parser
+chomp($domain_name=`/usr/share/gforge/bin/forge_get_config web_host`);
debug "You'll see some debugging info during this installation." ;
debug "Do not worry unless told otherwise." ;
if (is_lesser $version, $target) {
debug "Adding local data." ;
- do "/etc/gforge/local.pl" or die "Cannot read /etc/gforge/local.pl" ;
-
my $packed_ip = gethostbyname("$domain_name");
my $ip_address ;
if (defined $packed_ip) {
$dbh->commit () ;
}
-# $version = &get_db_version ;
-# $target = "0.2" ;
-# if (is_lesser $version, $target) {
-# debug "Adding local data." ;
-#
-# do "/etc/gforge/local.pl" or die "Cannot read /etc/gforge/local.pl" ;
-#
-# my $ip_address = qx/host $domain_name | awk '{print \}'/ ;
-#
-# @reqlist = (
-# "INSERT INTO plugin_".$pluginname."_sample_data (domain, ip_address) VALUES ('$domain_name', '$ip_address')",
-# ) ;
-#
-# foreach my $s (@reqlist) {
-# $query = $s ;
-# # debug $query ;
-# $sth = $dbh->prepare ($query) ;
-# $sth->execute () ;
-# $sth->finish () ;
-# }
-# @reqlist = () ;
-#
-# &update_db_version ($target) ;
-# debug "Committing." ;
-# $dbh->commit () ;
-# }
-
debug "It seems your database install/upgrade went well and smoothly. That's cool." ;
debug "Please enjoy using Debian FusionForge." ;
$dbh->commit () ;
}
-# $version = &get_db_version ;
-# $target = "0.2" ;
-# if (is_lesser $version, $target) {
-# debug "Adding local data." ;
-#
-# do "/etc/gforge/local.pl" or die "Cannot read /etc/gforge/local.pl" ;
-#
-# my $ip_address = qx/host $domain_name | awk '{print \}'/ ;
-#
-# @reqlist = (
-# "INSERT INTO plugin_".$pluginname."_sample_data (domain, ip_address) VALUES ('$domain_name', '$ip_address')",
-# ) ;
-#
-# foreach my $s (@reqlist) {
-# $query = $s ;
-# # debug $query ;
-# $sth = $dbh->prepare ($query) ;
-# $sth->execute () ;
-# $sth->finish () ;
-# }
-# @reqlist = () ;
-#
-# &update_db_version ($target) ;
-# debug "Committing." ;
-# $dbh->commit () ;
-# }
-
debug "It seems your database install/upgrade went well and smoothly. That's cool." ;
debug "Please enjoy using Debian FusionForge." ;
$dbh->commit () ;
}
-# $version = &get_db_version ;
-# $target = "0.2" ;
-# if (is_lesser $version, $target) {
-# debug "Adding local data." ;
-#
-# do "/etc/gforge/local.pl" or die "Cannot read /etc/gforge/local.pl" ;
-#
-# my $ip_address = qx/host $domain_name | awk '{print \}'/ ;
-#
-# @reqlist = (
-# "INSERT INTO plugin_".$pluginname."_sample_data (domain, ip_address) VALUES ('$domain_name', '$ip_address')",
-# ) ;
-#
-# foreach my $s (@reqlist) {
-# $query = $s ;
-# # debug $query ;
-# $sth = $dbh->prepare ($query) ;
-# $sth->execute () ;
-# $sth->finish () ;
-# }
-# @reqlist = () ;
-#
-# &update_db_version ($target) ;
-# debug "Committing." ;
-# $dbh->commit () ;
-# }
-
debug "It seems your database install/upgrade went well and smoothly. That's cool." ;
debug "Please enjoy using Debian FusionForge." ;
##############################
# Global Variables
##############################
-$config_file = "/etc/gforge/local.pl"; # Local Include file for database username and password
$dummy_uid = getpwnam('scm-gforge'); # UserID of the dummy user that will own group's files
$date = int(time()/3600/24); # Get the number of days since 1/1/1970 for /etc/shadow
-require $config_file;
+chomp($sys_dbuser=`/usr/share/gforge/bin/forge_get_config database_user`);
+chomp($sys_dbpasswd=`/usr/share/gforge/bin/forge_get_config database_password`);
+chomp($sys_dbhost=`/usr/share/gforge/bin/forge_get_config database_host`);
+chomp($sys_dbname=`/usr/share/gforge/bin/forge_get_config database_name`);
+chomp($sys_dbport=`/usr/share/gforge/bin/forge_get_config database_port`);
##############################
# Database Connect Functions