/alcasar.sh |
---|
937,6 → 937,11 |
$SED "s?^tmpdir.*?tmpdir=/tmp?g" /etc/my.cnf |
/usr/bin/systemctl start mysqld.service |
sleep 4 |
is_active=`systemctl is-active mysqld` |
if [ "$is_active" != "active" ] |
then |
sleep 4 # we need to wait again (slow machine) |
fi |
mysqladmin -u root password $mysqlpwd |
MYSQL="/usr/bin/mysql -uroot -p$mysqlpwd --exec" |
# Secure the server |
/scripts/alcasar-bl.sh |
---|
74,6 → 74,7 |
sort +0.0 -0.2 $BL_CATEGORIES -o $FILE_tmp |
mv $FILE_tmp $BL_CATEGORIES |
chown root:apache $BL_CATEGORIES |
chmod 660 $BL_CATEGORIES |
# process the file $WL_CATEGORIES with the choice of categories |
for ENABLE_CATEGORIE in `cat $WL_CATEGORIES_ENABLED` |
85,6 → 86,7 |
sort +0.0 -0.2 $WL_CATEGORIES -o $FILE_tmp |
mv $FILE_tmp $WL_CATEGORIES |
chown root:apache $WL_CATEGORIES |
chmod 660 $WL_CATEGORIES |
} |
usage="Usage: alcasar-bl.sh { -cat_choice or --cat_choice } | { -download or --download } | { -adapt or --adapt } | { -reload or --reload } | { -update_cat or --update_cat }" |
320,6 → 322,7 |
fi |
$SED "s/\.\{2,10\}/\./g" $ossi_custom_dir/domains $ossi_custom_dir/urls # correction 'coma" instead of 'dot' |
$SED "/^$/d" $ossi_custom_dir/domains $ossi_custom_dir/urls # remove empty lines |
$SED "s/\r//" $ossi_custom_dir/domains $ossi_custom_dir/urls # remove Windows <CR> |
# extract ip addresses for iptables |
awk '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/{print "add bl_ip_blocked " $0}' $ossi_custom_dir/domains > $FILE_ip_tmp |
# for dnsmask, remove IP addesses, accented characters and commented lines. |
359,9 → 362,11 |
sort +0.0 -0.2 $BL_CATEGORIES -o $FILE_tmp |
mv $FILE_tmp $BL_CATEGORIES |
chown root:apache $BL_CATEGORIES |
chmod 660 $BL_CATEGORIES |
sort +0.0 -0.2 $WL_CATEGORIES -o $FILE_tmp |
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 |
/web/acc/admin/bl_categories_help.php |
---|
22,9 → 22,9 |
$l_close="Fermer"; |
$l_description_cat="Cette catégorie n'est pas décrite"; |
$l_name_cat ="Cette catégorie n'a pas de nom"; |
$l_nb_domains="Nombre de noms de domaine filtrés :"; |
$l_nb_urls="Nombre d'URL filtrés :"; |
$l_nb_ip="Nombre d'IP filtrées :"; |
$l_nb_domains="Nombre de noms de domaine :"; |
$l_nb_urls="Nombre d'URLs :"; |
$l_nb_ip="Nombre d'adresses IP :"; |
$l_example="Exemple(s) : "; |
$l_error_cat = "Erreur de categorie"; |
$l_error_list = "Erreur de listing"; |
36,9 → 36,9 |
$l_close="Close"; |
$l_description_cat="This category isn't described"; |
$l_name_cat ="This category has no name"; |
$l_nb_domains="Number of filtered domain names :"; |
$l_nb_urls="Number of filtered URL :"; |
$l_nb_ip="Number of filtered IP :"; |
$l_nb_domains="Number of domain names :"; |
$l_nb_urls="Number of URLs :"; |
$l_nb_ip="Number of IP addresses :"; |
$l_example="Example(s) : "; |
$l_error_cat = "Error category"; |
$l_error_list = "Error listing"; |
/web/acc/admin/bl_filter.php |
---|
305,12 → 305,18 |
$file_name = str_replace (".", "_",basename($_FILES['fichier_ip']['name'])); |
if(!empty($file_name)) |
{ |
if(move_uploaded_file($_FILES['fichier_ip']['tmp_name'], $dir_blacklist."ossi-bl-".$file_name)) |
$dest_dir = $dir_blacklist."ossi-bl-".$file_name; |
exec ("mkdir $dest_dir"); |
if(move_uploaded_file($_FILES['fichier_ip']['tmp_name'], $dest_dir."/domains")) |
{ |
touch ($dest_dir."/urls"); // create the URL file even if it isn't used |
file_put_contents ($bl_categories, $dest_dir."\n", FILE_APPEND); |
file_put_contents ($bl_categories_enabled, "ossi-bl-".$file_name."\n", FILE_APPEND); //Enabled by default |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload"); |
} |
else |
{ |
exec("rm -rf $dest_dir"); |
echo $l_error_upload; |
} |
} |
/web/acc/admin/wl_filter.php |
---|
267,6 → 267,7 |
exec ("mkdir $dest_dir"); |
if(move_uploaded_file($_FILES['fichier_ip']['tmp_name'], $dest_dir."/domains")) |
{ |
touch ($dest_dir."/urls"); // create the URL file even if it isn't used |
file_put_contents ($wl_categories, $dest_dir."\n", FILE_APPEND); |
file_put_contents ($wl_categories_enabled, "ossi-wl-".$file_name."\n", FILE_APPEND); //Enabled by default |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload"); |