Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1956 → Rev 1957

/alcasar.sh
188,12 → 188,12
then
echo "La mise à jour automatique d'ALCASAR ne peut pas être réalisée."
echo "1 - Récupérez le fichier de configuration actuel (/tmp/alcasar-conf.tar.gz)."
echo "2 - Installez Linux-Mageia 4.1 (cf. doc d'installation)"
echo "2 - Installez Linux-Mageia 5 (cf. doc d'installation)"
echo "3 - recopiez le fichier 'alcasar-conf.tar.gz' dans le répertoire '/tmp' avant de lancer l'installation d'ALCASAR"
else
echo "The automatic update of ALCASAR can't be performed."
echo "1 - Retrieve the configuration file (/tmp/alcasar-conf.tar.gz)"
echo "2 - Install Linux-Mageia 4.1 (cf. installation doc)"
echo "2 - Install Linux-Mageia 5 (cf. installation doc)"
echo "3 - Copy again the file 'alcasar-conf.tar.gz' in the folder '/tmp' before launching the installation of ALCASAR"
fi
else
1633,28 → 1633,26
# change the google safesearch ("safe=strict" instead of "safe=vss")
$SED "s?safe=vss?safe=strict?g" $DIR_DG/lists/urlregexplist
# creation of the custom BL and WL categorie named "ossi" (for domain names & ip only)
if [ "$mode" != "update" ]; then
mkdir -p $DIR_DG/lists/blacklists/ossi-bl
touch $DIR_DG/lists/blacklists/ossi-bl/domains
echo "ossi-bl" >> $DIR_DEST_ETC/alcasar-bl-categories-enabled
mkdir -p $DIR_DG/lists/blacklists/ossi-wl
touch $DIR_DG/lists/blacklists/ossi-wl/domains
echo "ossi-wl" >> $DIR_DEST_ETC/alcasar-wl-categories-enabled
mkdir -p $DIR_DG/lists/blacklists/ossi-bl
touch $DIR_DG/lists/blacklists/ossi-bl/domains
echo "ossi-bl" >> $DIR_DEST_ETC/alcasar-bl-categories-enabled
mkdir -p $DIR_DG/lists/blacklists/ossi-wl
touch $DIR_DG/lists/blacklists/ossi-wl/domains
echo "ossi-wl" >> $DIR_DEST_ETC/alcasar-wl-categories-enabled
# add custom ALCASAR BL files
for x in $(ls $DIR_BLACKLIST | grep -v "^blacklist")
do
mkdir $DIR_DG/lists/blacklists/ossi-bl-$x
cp $DIR_BLACKLIST/$x $DIR_DG/lists/blacklists/ossi-bl-$x/domains
echo "ossi-bl-$x" >> $DIR_DEST_ETC/alcasar-bl-categories-enabled
done
chown -R dansguardian:apache $DIR_DG
chown -R root:apache $DIR_DEST_SHARE
chmod -R g+rw $DIR_DG $DIR_DEST_SHARE
for x in $(ls $DIR_BLACKLIST | grep -v "^blacklist")
do
mkdir $DIR_DG/lists/blacklists/ossi-bl-$x
cp $DIR_BLACKLIST/$x $DIR_DG/lists/blacklists/ossi-bl-$x/domains
echo "ossi-bl-$x" >> $DIR_DEST_ETC/alcasar-bl-categories-enabled
done
chown -R dansguardian:apache $DIR_DG
chown -R root:apache $DIR_DEST_SHARE
chmod -R g+rw $DIR_DG $DIR_DEST_SHARE
# adapt the Toulouse BL to ALCASAR architecture
$DIR_DEST_BIN/alcasar-bl.sh --adapt
$DIR_DEST_BIN/alcasar-bl.sh --adapt
# enable the default categories
$DIR_DEST_BIN/alcasar-bl.sh --cat_choice
fi
$DIR_DEST_BIN/alcasar-bl.sh --cat_choice
}
 
##########################################################
/scripts/alcasar-bl.sh
367,9 → 367,12
mv $FILE_tmp $WL_CATEGORIES
chown root:apache $WL_CATEGORIES
chmod 660 $WL_CATEGORIES
/usr/bin/systemctl restart dnsmasq-blacklist
/usr/bin/systemctl restart dnsmasq-whitelist
/usr/local/bin/alcasar-iptables.sh
if [ "$PARENT_SCRIPT" != "alcasar-conf.sh" ] # don't launch on install stage
then
/usr/bin/systemctl restart dnsmasq-blacklist
/usr/bin/systemctl restart dnsmasq-whitelist
/usr/local/bin/alcasar-iptables.sh
fi
;;
*)
echo "Argument inconnu :$1";
/web/acc/admin/bl_filter.php
235,8 → 235,23
case 'MAJ_cat_bl' :
if (file_exists($bl_categories_enabled))
{
$cat_tab=file_get_contents("$bl_categories_enabled");
$ossi_cat_tab=preg_match_all('/^ossi-/',$cat_tab);
foreach ($cat_tab as $key => $line)
{
echo $key."-".$line;
//if (preg_match ('/^ossi-/', $line))
//{
// $ossi_cat_tab[$n]=$line;
// $n=$n+1;
//}
}
foreach ($ossi_cat_tab as $$key => $ossi_cat)
{
echo "tab-".$ossi_cat;
}
$pointeur=fopen($bl_categories_enabled, "w+");
$fichier=fopen($update_file_cat,"w+");
$pointeur=fopen($bl_categories_enabled, "w+");
foreach ($_POST as $key => $value)
{
if (strstr($key,'chk-'))
243,14 → 258,18
{
$line=str_replace('chk-','',$key)."\n";
fwrite($pointeur,$line);
if(trim($line) == 'malware' && $_POST['update_cat'] == 1)
if(trim($line) == 'malware' && $_POST['update_cat'] == 1) //auto-update of malware
{
fputs($fichier, "malware rsync://ftp.ut-capitole.fr/blacklist/dest/malware\n");
}
}
}
//foreach ($ossi_cat_tab as $ossi_cat)
//{
// fwrite($pointeur,$ossi_cat); //restore OSSI custom categories
//}
fclose($pointeur);
fclose($fichier);
}
else {echo "$l_error_open_file $bl_categories_enabled";}
$fichier=fopen($dir_blacklist."ossi-bl/domains","w+");