From dbcdde957b380801504d6ea2596242b8ca540524 Mon Sep 17 00:00:00 2001
From: Daniel Winzen <d@winzen4.de>
Date: Sat, 13 May 2017 18:21:10 +0200
Subject: [PATCH] Make md5sums of index files to be considdered for deletion
 configurable

---
 var/www/common.php   | 4 ++++
 var/www/find_old.php | 3 +--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/var/www/common.php b/var/www/common.php
index 7f7b370..fdfc57e 100644
--- a/var/www/common.php
+++ b/var/www/common.php
@@ -12,6 +12,10 @@ const SERVERS=[ //servers and ports we are running on
 'danwin1210.me'=>['sftp'=>22, 'ftp'=>21, 'pop3'=>'', 'imap'=>'', 'smtp'=>'']
 ];
 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){
 	$keyData = openssl_pkey_get_details($pkey);
diff --git a/var/www/find_old.php b/var/www/find_old.php
index 67c3bfd..97764bc 100644
--- a/var/www/find_old.php
+++ b/var/www/find_old.php
@@ -25,8 +25,7 @@ foreach($all as $tmp){
 	}
 	//check www empty or index unmodified
 	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"), $md5s)){
+		if(!file_exists("/home/$tmp/www/index.hosting.html") || !in_array(md5_file("/home/$tmp/www/index.hosting.html"), INDEX_MD5S)){
 			continue;
 		}
 	}