Make md5sums of index files to be considdered for deletion configurable

This commit is contained in:
Daniel Winzen
2017-05-13 18:21:10 +02:00
parent bee350cb4b
commit dbcdde957b
2 changed files with 5 additions and 2 deletions

View File

@ -12,6 +12,10 @@ const SERVERS=[ //servers and ports we are running on
'danwin1210.me'=>['sftp'=>22, 'ftp'=>21, 'pop3'=>'', 'imap'=>'', 'smtp'=>''] 'danwin1210.me'=>['sftp'=>22, 'ftp'=>21, 'pop3'=>'', 'imap'=>'', 'smtp'=>'']
]; ];
const EMAIL_TO=''; //Send email notifications about new registrations to this address const EMAIL_TO=''; //Send email notifications about new registrations to this address
const INDEX_MD5S=[ //MD5 sums of index.hosting.html files that should be considdered as unchanged for deletion
'd41d8cd98f00b204e9800998ecf8427e', //empty file
'7ae7e9bac6be76f00e0d95347111f037' //default file
];
function get_onion($pkey){ function get_onion($pkey){
$keyData = openssl_pkey_get_details($pkey); $keyData = openssl_pkey_get_details($pkey);

View File

@ -25,8 +25,7 @@ foreach($all as $tmp){
} }
//check www empty or index unmodified //check www empty or index unmodified
if(count(scandir("/home/$tmp/www/"))===3){ if(count(scandir("/home/$tmp/www/"))===3){
$md5s=['2ff89413bebfd03f9241b0254ebfd782','d41d8cd98f00b204e9800998ecf8427e', '7ae7e9bac6be76f00e0d95347111f037']; if(!file_exists("/home/$tmp/www/index.hosting.html") || !in_array(md5_file("/home/$tmp/www/index.hosting.html"), INDEX_MD5S)){
if(!file_exists("/home/$tmp/www/index.hosting.html") || !in_array(md5_file("/home/$tmp/www/index.hosting.html"), $md5s)){
continue; continue;
} }
} }