Commit 091d2ce6 authored by Marius Burkard's avatar Marius Burkard

Merge branch 'webdev/ispconfig3-master'

parents 922b2803 880e4c71
This empty directory is needed by ISPConfig.
......@@ -57,9 +57,7 @@ $autoupdate['reconfigure_crontab'] = 'yes'; // yes (default), no
$autoupdate['svc_detect_change_mail_server'] = 'yes'; // yes (default), no
$autoupdate['svc_detect_change_web_server'] = 'yes'; // yes (default), no
$autoupdate['svc_detect_change_dns_server'] = 'yes'; // yes (default), no
$autoupdate['svc_detect_change_xmpp_server'] = 'yes'; // yes (default), no
$autoupdate['svc_detect_change_firewall_server'] = 'yes'; // yes (default), no
$autoupdate['svc_detect_change_vserver_server'] = 'yes'; // yes (default), no
$autoupdate['svc_detect_change_db_server'] = 'yes'; // yes (default), no
?>
\ No newline at end of file
# diff openssl.cnf /usr/lib/ssl/openssl.cnf
68c68
< default_days = 3653 # how long to certify for
---
> default_days = 365 # how long to certify for
125c125
< countryName_default = YOURCOUNTRY
---
> countryName_default = AU
130c130
< stateOrProvinceName_default = YOURPROVINCE
---
> stateOrProvinceName_default = Some-State
135c135
< 0.organizationName_default = YOURDOMAIN
---
> 0.organizationName_default = Internet Widgits Pty Ltd
142c142
< organizationalUnitName_default = ISP
---
> #organizationalUnitName_default =
145d144
< commonName_default = YOURHOSTNAME
149d147
< emailAddress_default = postmaster@YOURDOMAIN
#!/bin/bash
# Script to configuring an ispconfig3 server in a Debian VPS
# by calocen [at] gmail [dot] com
# getting some enviromment values
myhostname=`hostname -f`
mydomain=`hostname -d`
myip=`hostname -i`
[ ! -x /usr/bin/geoiplookup ] && apt-get --assume-yes install geoip-bin
mycountry=`geoiplookup $myip | cut -f4 -d" " | cut -f1 -d","`
myprovince=`geoiplookup $myip | cut -f5 -d" "`
# reconfiguring webalizer, postfix
# could be cool to modify here webalizer values
dpkg-reconfigure -u webalizer
postconf -e "myhostname = $myhostname"
postconf -e "mydestination = $myhostname, localhost"
echo $myhostname > /etc/mailname
dpkg-reconfigure -u postfix
# request new password
oldpwd=`grep password /root/.my.cnf | tr "\t" " " | tr -s " " | cut -f3 -d" "`
read -p "mysql password: [$oldpwd] " mysqlpwd
[ -z $mysqlpwd ] && mysqlpwd=$oldpwd
echo $mysqlpwd
#read -p "Are you sure? (y/n) " sure
## who said fear ##
set -x
mysqladmin -u root -p$oldpwd password $mysqlpwd
mysqladmin -u root -p$mysqlpwd -h localhost password $mysqlpwd
cat << EOF > /root/.my.cnf
[client]
password = $mysqlpwd
EOF
chmod 600 /root/.my.cnf
# changing mydns password
mysql -e "SET PASSWORD FOR 'mydns'@'%' = PASSWORD( '$mysqlpwd' )"
mysql -e "SET PASSWORD FOR 'mydns'@'localhost' = PASSWORD( '$mysqlpwd' )"
cp -ax /etc/mydns.conf /etc/mydns.conf~
sed s/$oldpwd/$mysqlpwd/g < /etc/mydns.conf~ > /etc/mydns.conf
# enabling mydns
mydns --create-tables > /tmp/mydns.sql
mysql -e "CREATE DATABASE IF NOT EXISTS mydns ; USE mydns ; SOURCE /tmp/mydns.sql;"
rm /tmp/mydns.*
invoke-rc.d mydns restart
# preparing server installation
mv /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf~
sed s/"YOURHOSTNAME"/"$myhostname"/g < /usr/local/bin/openssl.cnf |
sed s/"YOURDOMAIN"/"$mydomain"/g | \
sed s/"YOURCOUNTRY"/"$mycountry"/g | \
sed s/"YOURPROVINCE"/"$myprovince"/g > /etc/ssl/openssl.cnf
tar xfz /root/downloads/ISPConfig-3.0.0.7-beta.tar.gz -C /usr/local/src
# here would be some stuff to update from SVN
cd /usr/local/src/ispconfig3_install/install/
php -q install.php
#!/bin/bash
set -x
echo "" > /etc/resolv.conf
echo "" > /etc/hostname
echo "" > /etc/mailname
rm -f /etc/ssh/ssh_host_*
cat << EOF > /etc/rc2.d/S15ssh_gen_host_keys
#!/bin/bash
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''
dpkg-reconfigure -u webalizer
postconf -e "myhostname = $(hostname -f)"
postconf -e "mydestination = $(hostname -f), localhost"
echo $(hostname -f) > /etc/mailname
dpkg-reconfigure -u postfix
rm -f \$0
EOF
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys
<?php
// for testing, put this file in interface/web/tools
require_once '../../lib/config.inc.php';
require_once '../../lib/app.inc.php';
//* Check permissions for module
$app->auth->check_module_permissions('admin');
$app->uses('getconf,ispcmail');
$mail_config = $app->getconf->get_global_config('mail');
if($mail_config['smtp_enabled'] == 'y') {
$mail_config['use_smtp'] = true;
$app->ispcmail->setOptions($mail_config);
}
$to = 't.heller@timmehosting.de';
$subject = 'Test von ISPConfig-Mailqueue';
$text = '123'."\n\n".date(DATE_RFC822)."\n\n".'SMTP: '.$mail_config['use_smtp'];
$from = 'ispconfig@thomas.timmeserver.de';
$filepath = '';
$filetype = 'application/pdf';
$filename = '';
$cc = '';
$bcc = '';
$from_name = 'ISPConfig';
$app->ispcmail->setSender($from, $from_name);
$app->ispcmail->setSubject($subject);
$app->ispcmail->setMailText($text);
if($filepath != '') {
if(!file_exists($filepath)) $app->error("Mail attachement does not exist ".$filepath);
$app->ispcmail->readAttachFile($filepath);
}
if($cc != '') $app->ispcmail->setHeader('Cc', $cc);
if($bcc != '') $app->ispcmail->setHeader('Bcc', $bcc);
$app->ispcmail->send($to);
$app->ispcmail->finish();
echo $text;
#! /bin/sh
#
# metronome Start/stop metronome server
#
### BEGIN INIT INFO
# Provides: metronome
# Required-Start: $remote_fs $network $named $time
# Required-Stop: $remote_fs $network $named $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts metronome server
# Description: Starts metronome server, an XMPP server written in Lua.
### END INIT INFO
METRONOME=/usr/bin/metronomectl
PIDDIR=/var/run/metronome
NAME=metronome
test -e $METRONOME || exit 0
start()
{
mkdir $PIDDIR -p
chown metronome:metronome $PIDDIR
chmod 750 $PIDDIR
$METRONOME start >> /dev/null
}
stop()
{
$METRONOME stop >> /dev/null
}
reload()
{
$METRONOME reload >> /dev/null
}
restart()
{
$METRONOME restart >> /dev/null
}
case "$1" in
start)
echo -n "Starting Metronome..."
start &
;;
stop)
echo -n "Stopping Metronome..."
stop &
;;
reload)
echo -n "Reloading Metronome config..."
reload &
;;
restart)
echo -n "Restarting Metronome..."
restart &
;;
*)
echo "Usage: $0 {start|stop|reload|restart}" >&2
exit 1
;;
esac
if [ $? -eq 0 ]; then
echo .
else
echo " failed!"
fi
exit 0
#!/bin/bash
IFS=":"
AUTH_OK=1
AUTH_FAILED=0
LOGFILE="/var/log/prosody/auth.log"
USELOG=true
while read ACTION USER HOST PASS ; do
[ $USELOG == true ] && { echo "Date: $(date) Action: $ACTION User: $USER Host: $HOST" >> $LOGFILE; }
case $ACTION in
"auth")
if [ `/usr/bin/php /usr/local/lib/prosody/auth/db_auth.php $USER $HOST $PASS 2>/dev/null` == 1 ] ; then
echo $AUTH_OK
[ $USELOG == true ] && { echo "AUTH OK" >> $LOGFILE; }
else
echo $AUTH_FAILED
[ $USELOG == true ] && { echo "AUTH FAILED" >> $LOGFILE; }
fi
;;
"isuser")
if [ `/usr/bin/php /usr/local/lib/prosody/auth/db_isuser.php $USER $HOST 2>/dev/null` == 1 ] ; then
echo $AUTH_OK
[ $USELOG == true ] && { echo "ISUSER OK" >> $LOGFILE; }
else
echo $AUTH_FAILED
[ $USELOG == true ] && { echo "ISUSER FAILED" >> $LOGFILE; }
fi
;;
*)
echo $AUTH_FAILED
[ $USELOG == true ] && { echo "UNKNOWN ACTION GIVEN: $ACTION" >> $LOGFILE; }
;;
esac
done
<?php
ini_set('display_errors', false);
require_once('db_conf.inc.php');
try{
// Connect database
$db = new mysqli($db_host, $db_user, $db_pass, $db_name);
result_false(mysqli_connect_errno());
// Get arguments
$arg_email = '';
$arg_password = '';
result_false(count($argv) != 4);
$arg_email = $argv[1].'@'.$argv[2];
$arg_password = $argv[3];
// check for existing user
$dbmail = $db->real_escape_string($arg_email);
$query = $db->prepare("SELECT jid, password FROM xmpp_user WHERE jid LIKE ? AND active='y' AND server_id=?");
$query->bind_param('si', $arg_email, $isp_server_id);
$query->execute();
$query->bind_result($jid, $password);
$query->fetch();
$query->close();
result_false(is_null($jid));
checkAuth($arg_password, $password);
}catch(Exception $ex){
echo 0;
exit();
}
function result_false($cond = true){
if(!$cond) return;
echo 0;
exit();
}
function result_true(){
echo 1;