diff --git a/var/www/common.php b/var/www/common.php index 5e42f1f..a996a7d 100644 --- a/var/www/common.php +++ b/var/www/common.php @@ -277,10 +277,11 @@ function send_captcha() { } function check_login(){ + session_start(); if(empty($_SESSION['csrf_token'])){ $_SESSION['csrf_token']=sha1(uniqid()); } - if(empty($_SESSION['hosting_username'])){ + if(empty($_SESSION['hosting_username']) || !empty($_SESSION['2fa_code'])){ header('Location: login.php'); session_destroy(); exit; @@ -569,16 +570,31 @@ function rewrite_nginx_config(){ } file_put_contents("/etc/nginx/sites-enabled/hosted_sites", $nginx); - $nginx=''; + unset($nginx); + $nginx_mysql=''; + $nginx_mail=''; $stmt=$db->query("SELECT system_account FROM users WHERE id NOT IN (SELECT user_id FROM new_account) AND todelete!=1;"); while($tmp=$stmt->fetch(PDO::FETCH_ASSOC)){ - $nginx.="server { + $nginx_mysql.="server { listen unix:/home/$tmp[system_account]/var/run/mysqld/mysqld.sock; proxy_pass unix:/var/run/mysqld/mysqld.sock; } "; + $nginx_mail.="server { + listen unix:/home/$tmp[system_account]/var/run/mail.sock; + root /var/www/mail; + location / { + include snippets/fastcgi-php.conf; + fastcgi_param MAIL_USER $tmp[system_account]; + fastcgi_param DOCUMENT_ROOT /var/www/mail; + fastcgi_param SCRIPT_FILENAME /var/www/mail\$fastcgi_script_name; + fastcgi_pass unix:/var/run/php/7.4-mail; } - file_put_contents("/etc/nginx/streams-enabled/hosted_sites", $nginx); +} +"; + } + file_put_contents("/etc/nginx/streams-enabled/hosted_sites", $nginx_mysql); + file_put_contents("/etc/nginx/sites-enabled/hosted_sites_mail", $nginx_mail); exec('systemctl reload nginx'); } @@ -613,6 +629,7 @@ php_admin_value[disable_functions] = pcntl_alarm,pcntl_async_signals,pcntl_exec, php_admin_value[upload_tmp_dir] = /tmp php_admin_value[soap.wsdl_cache_dir] = /tmp php_admin_value[session.save_path] = /tmp +php_admin_value[sendmail_path] = '/usr/bin/php -r eval\(base64_decode\(\\\"JGM9Y3VybF9pbml0KCcxJyk7Y3VybF9zZXRvcHRfYXJyYXkoJGMsW0NVUkxPUFRfVU5JWF9TT0NLRVRfUEFUSD0+Jy92YXIvcnVuL21haWwuc29jaycsQ1VSTE9QVF9QT1NURklFTERTPT5bJ2NvbnRlbnQnPT5maWxlX2dldF9jb250ZW50cygncGhwOi8vc3RkaW4nKV1dKTtjdXJsX2V4ZWMoJGMpOwo=\\\"\)\)\;' env[HOME]=/ "; } diff --git a/var/www/html/delete.php b/var/www/html/delete.php index 32d0cb9..d14ce83 100644 --- a/var/www/html/delete.php +++ b/var/www/html/delete.php @@ -1,7 +1,6 @@

Your disk usage: - (updated hourly) Upgrade

-

Your file number usage: - (updated hourly) Upgrade

+

Your file number usage: - (updated hourly) Upgrade

Logs

diff --git a/var/www/html/index.php b/var/www/html/index.php index 58dbf26..cfdb024 100644 --- a/var/www/html/index.php +++ b/var/www/html/index.php @@ -25,7 +25,7 @@ header('X-Accel-Expires: 60');
  • FTP and SFTP access
  • command line access to shell via SSH
  • 1GB disk quota and a maximum of 100.000 files. - upgradable
  • -
  • mail() can send e-mails from your.onion@ (your.onion@hosting.danwin1210.me for clearnet) - not yet working but will return in future, use https://github.com/PHPMailer/PHPMailer or similar for now
  • +
  • mail() can send e-mails from your_system_account@ (your_system_account@hosting.danwin1210.me for clearnet)
  • Webmail and IMAP, POP3 and SMTP access to your mail account
  • Mail sent to anything@your.onion gets automatically redirected to your inbox
  • Your own .onion domains
  • diff --git a/var/www/html/log.php b/var/www/html/log.php index 97e31d3..874de84 100644 --- a/var/www/html/log.php +++ b/var/www/html/log.php @@ -1,6 +1,5 @@ $upgrade){ - echo ''; + echo ''; } ?> diff --git a/var/www/mail/index.php b/var/www/mail/index.php new file mode 100644 index 0000000..6e2f649 --- /dev/null +++ b/var/www/mail/index.php @@ -0,0 +1,16 @@ +
    Dateaccess.logerror.log