Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 631 → Rev 632

/alcasar.sh
743,7 → 743,7
[ -e /etc/freeradius-web/config.php.default ] || cp /etc/freeradius-web/config.php /etc/freeradius-web/config.php.default
cp -f $DIR_CONF/freeradiusweb-config.php /etc/freeradius-web/config.php
cat <<EOF > /etc/freeradius-web/naslist.conf
nas1_name: alcasar.%{general_domain}
nas1_name: alcasar-$ORGANISME
nas1_model: Portail captif
nas1_ip: $PRIVATE_IP
nas1_port_num: 0
1070,9 → 1070,7
server=$DNS2
# le servive DHCP est configuré mais n'est exploité que pour le "bypass"
dhcp-range=$PRIVATE_DYN_FIRST_IP,$PRIVATE_DYN_LAST_IP,$PRIVATE_NETMASK,12h
#dhcp-option=3,1.2.3.4
#dhcp-option=option:router,1.2.3.4
#dhcp-option=42,0.0.0.0
dhcp-option=option:router,$PRIVATE_IP
#dhcp-option=option:ntp-server,192.168.0.4,10.10.0.5
 
# Exemple de configuration statique : <@MAC>,<name>,<@IP>,<MASK>,<ttl bail>
/scripts/alcasar-CA.sh
17,7 → 17,6
SRVCERT=$DIR_CERT/certs/alcasar.crt
SRVKEY=$DIR_CERT/private/alcasar.key
SRVREQ=$DIR_CERT/alcasar.req
FIC_PARAM="/root/ALCASAR-parameters.txt"
 
CACERT_LIFETIME="1460"
SRVCERT_LIFETIME="1460"
221,12 → 220,6
 
if [ -s "$CACERT" -a -s "$CAKEY" -a -s "$SRVCERT" -a -s "$SRVKEY" ];
then
echo "- Certificat de l'Authorité de Certification : " >> $FIC_PARAM
echo " Certificat = $CACERT" >> $FIC_PARAM
echo " Clée privée = $CAKEY" >> $FIC_PARAM
echo "- Certificat du serveur : " >> $FIC_PARAM
echo " Certificat = $SRVCERT" >> $FIC_PARAM
echo " Clée privée = $SRVKEY" >> $FIC_PARAM
[ -d $DIR_WEB/certs ] || mkdir -p $DIR_WEB/certs
rm -f $DIR_WEB/certs/*
ln -s $CACERT $DIR_WEB/certs/certificat_alcasar_ca.crt
/scripts/alcasar-conf.sh
63,8 → 63,6
# Sauvegarde de la base des usagers
/usr/local/sbin/alcasar-mysql.sh -dump
cp /var/Save/base/`ls /var/Save/base|tail -1` $DIR_UPDATE
# Sauvegarde du nom d'organisme
echo `cat /root/ALCASAR-parameters.txt|grep Organism|cut -d":" -f2|tr -d " "` > $DIR_UPDATE/organisme
# Sauvegarde du logo
cp -f $DIR_WEB/images/organisme.png $DIR_UPDATE
# Sauvegarde des fichiers exploités par dansguardian
104,6 → 102,7
# si version < 2.2
if ([ $MAJ_RUNNING_VERSION -lt 2 ] || ([ $MAJ_RUNNING_VERSION -eq 2 ] && [ $MIN_RUNNING_VERSION -lt 2 ]))
then
ORGANISM=`cat /root/ALCASAR-parameters.txt|grep Organism|cut -d":" -f2|tr -d " "` # Sauvegarde du nom d'organisme
rm -f $DIR_UPDATE/etc/alcasar-ethers # This file doesn't contain comments
# Create the initial conf file (doesn't exist in earlier versions)
cat <<EOF > $CONF_FILE
115,7 → 114,7
 
INSTALL_DATE=$DATE
VERSION=$RUNNING_VERSION
ORGANISM=
ORGANISM=$ORGANISM
EOF
PUBLIC_IP=`grep IPADDR /etc/sysconfig/network-scripts/ifcfg-$EXTIF|cut -d"=" -f2` # @ip du portail (côté Internet)
PUBLIC_NETMASK=`grep NETMASK /etc/sysconfig/network-scripts/ifcfg-$EXTIF|cut -d"=" -f2`
229,9 → 228,14
echo "Syntax error for the IP address of the second DNS server ($DNS2)"
exit 0
fi
PUBLIC_IP=`echo $PUBLIC_IP_MASK | cut -d"/" -f1`
PUBLIC_NETMASK=`/bin/ipcalc -m $PUBLIC_IP_MASK | cut -d"=" -f2`
PRIVATE_IP=`echo $PRIVATE_IP_MASK | cut -d"/" -f1`
PRIVATE_NETMASK=`/bin/ipcalc -m $PRIVATE_IP_MASK | cut -d"=" -f2` # @ masque du réseau de consult (255.255.255.0)
PRIVATE_NETMASK=`/bin/ipcalc -m $PRIVATE_IP_MASK | cut -d"=" -f2`
private_network_calc
VERSION=`grep VERSION $CONF_FILE|cut -d"=" -f2`
INSTALL_DATE=`grep INSTALL_DATE $CONF_FILE|cut -d"=" -f2`
ORGANISME=`grep ORGANISM $CONF_FILE|cut -d"=" -f2`
 
# /etc/hosts
cat <<EOF > /etc/hosts
245,11 → 249,8
$SED "s?^GATEWAY=.*?GATEWAY=$PUBLIC_GATEWAY?" /etc/sysconfig/network-scripts/ifcfg-$EXTIF
$SED "s?^IPADDR=.*?IPADDR=$PRIVATE_IP?" /etc/sysconfig/network-scripts/ifcfg-$INTIF
$SED "s?^NETMASK=.*?NETMASK=$PRIVATE_NETMASK?" /etc/sysconfig/network-scripts/ifcfg-$INTIF
 
echo "NIC ok"
# NTP server
$SED "s?^restrict.*?restrict $PRIVATE_NETWORK mask $PRIVATE_NETMASK nomodify notrap\nrestrict 127.0.0.1?" /etc/ntp.conf
 
$SED "/127.0.0.1/!s?^restrict.*?restrict $PRIVATE_NETWORK mask $PRIVATE_NETMASK nomodify notrap?g" /etc/ntp.conf
# host.allow
cat <<EOF > /etc/hosts.allow
ALL: LOCAL, 127.0.0.1, localhost, $PRIVATE_IP
256,15 → 257,33
sshd: ALL
ntpd: $PRIVATE_NETWORK_SHORT
EOF
 
# Alcasar control center
# Alcasar Control Center
echo "$VERSION du $INSTALL_DATE" > /var/www/html/VERSION; chown apache:apache /var/www/html/VERSION
$SED "s?^Listen.*?Listen $PRIVATE_IP:80?g" /etc/httpd/conf/httpd.conf
FIC_MOD_SSL=`find /etc/httpd/modules.d/ -type f -name *mod_ssl.conf`
$SED "s?^Listen.*?Listen $PRIVATE_IP:443?g" $FIC_MOD_SSL
$SED '/127.0.0.1/!s?Allow from .*?Allow from $PRIVATE_NETWORK_MASK?g'
$SED "/127.0.0.1/!s?Allow from .*?Allow from $PRIVATE_NETWORK_MASK?g" /etc/httpd/conf/webapps.d/alcasar.conf
# Dialup_Admin
$SED "s?^nas1_name:.*?nas1_name: alcasar-$ORGANISME?g" /etc/freeradius-web/naslist.conf
$SED "s?^nas1_ip:.*?nas1_ip: $PRIVATE_IP?g" /etc/freeradius-web/naslist.conf
# coova
$SED "s?ifconfig.*?ifconfig \$HS_LANIF $PRIVATE_IP?g" /etc/init.d/chilli
$SED "s?^net.*?net\t\t$PRIVATE_NETWORK_MASK?g" /etc/chilli.conf
$SED "s?^dynip.*?dynip\t\t$PRIVATE_DYN_IP?g" /etc/chilli.conf
$SED "s?^statip.*?statip\t\t$PRIVATE_STAT_IP?g" /etc/chilli.conf
$SED "s?^dns1.*?dns1\t\t$PRIVATE_IP?g" /etc/chilli.conf
$SED "s?^dns2.*?dns2\t\t$PRIVATE_IP?g" /etc/chilli.conf
$SED "s?^uamlisten.*?uamlisten\t$PRIVATE_IP?g" /etc/chilli.conf
$SED "s?^\$organisme = .*?\$organisme = \"$ORGANISME\";?g" /var/www/html/intercept.php /var/www/html/status.php
# awstat
$SED "s?^HostAliases=.*?HostAliases=\"$PRIVATE_IP\"?g" /etc/awstats/awstats.conf
# dnsmasq
$SED "/127.0.0.1/!s?^listen-address=.*?listen-address=$PRIVATE_IP?g" /etc/dnsmasq.conf /etc/dnsmasq-blackhole.conf
$SED "s?^server=.*?server=$DNS1?g" /etc/dnsmasq.conf /etc/dnsmasq-blackhole.conf
$SED "/$DNS1/!s?^server=.*?server=$DNS2?g" /etc/dnsmasq.conf /etc/dnsmasq-blackhole.conf
$SED "s?^dhcp-range=.*?dhcp-range=$PRIVATE_DYN_FIRST_IP,$PRIVATE_DYN_LAST_IP,$PRIVATE_NETMASK,12h?g" /etc/dnsmasq.conf
$SED "s?^dhcp-option=option:router.*?dhcp-option=option:router,$PRIVATE_IP?g" /etc/dnsmasq.conf
 
 
 
# Start / Stop SSH Daemon
ssh_active=`grep SSH $CONF_FILE|cut -d"=" -f2`
if [ $ssh_active = "on" ]
275,7 → 294,7
fi
 
 
$DIR_DEST_BIN/alcasar-iptables.sh
$DIR_BIN/alcasar-iptables.sh
;;
*)
echo "Argument inconnu :$1";
/web/acc/manager/htdocs/group_new.php
153,7 → 153,7
case 'ChilliSpot-Bandwidth-Max-Up' :
case 'ChilliSpot-Bandwidth-Max-Down' :
case 'WISPr-Redirection-URL' :
$advanced=0; //<-- Valeur à mettre à '1' pour avoir toute les fonctionnalités
$advanced=1; //<-- Valeur à mettre à '0' pour limiter les fonctionnalités
break;
default:
$advanced=1;
/web/acc/manager/htdocs/user_new.php
257,7 → 257,7
case 'ChilliSpot-Bandwidth-Max-Up' :
case 'ChilliSpot-Bandwidth-Max-Down' :
case 'WISPr-Redirection-URL' :
$advanced=1; //<-- Valeur à mettre à '0' pour avoir limiter les fonctionnalités
$advanced=1; //<-- Valeur à mettre à '0' pour limiter les fonctionnalités
break;
default:
$advanced=1;