I have created an information page for viewing PHP!

I have created an information page for viewing PHP! Is it helpful for Hestia? You can preview it online.

Already open sourced on GitHub

5 Likes

Good one. Possible to give the source code/file?

Please remove any links to hestiacp.com …

/**

  • PHP 8.4 + HTML5 + Bootstrap 5.3.5 Server Probe System
  • Author: hestiacp.com Server Open-source Management Panel!
  • Version: 2.2 (PHP 8.4)
    */

What’s wrong? Did I change it?

Autor is not hestiacp.com very easy…

1 Like

Mmm! you are right!

This is very cool! Congrats!
I would suggest that you add the code to GitHub :wink:

1 Like

Do you have any good suggestions!

By not making a PR towards Hestia… It doesn’t belong there…

1 Like

I have added a feature to view logs, but it does not include all files! It just doesn’t involve safety! It should be visible

Below is a script file. Place it in your domain’s directory and use the command curl -fsSL https://myweb.com/xxx.sh | bash to automatically download and execute it.

#!/bin/bash


WEB_ROOT="${WEB_ROOT:-/var/www/html}"
LOG_DIR="/var/log/apache2"
MAX_DAYS=7


mkdir -p "$LOG_DIR"
LOG_FILE="${LOG_DIR}/download_$(date +%Y%m%d).log"


RANDOM_NAME=$(openssl rand -hex 8)
RANDOM_FILE="${WEB_ROOT}/${RANDOM_NAME}.php"


START_TIME=$(date '+%Y-%m-%d %H:%M:%S')
echo "${START_TIME} - Starting probe file download" >> "$LOG_FILE"


if curl -fsSL --max-time 30 -o "$RANDOM_FILE" "https://myweb/doc.php"; then
    
    chmod 644 "$RANDOM_FILE"

    
    PUBLIC_IP=$(curl -s --max-time 5 icanhazip.com || \
               curl -s --max-time 5 ipinfo.io/ip || \
               curl -s --max-time 5 api.ipify.org)
    
   
    END_TIME=$(date '+%Y-%m-%d %H:%M:%S')
    echo "${END_TIME} - Download succeeded, file: $RANDOM_FILE" >> "$LOG_FILE"
    
   
    echo "Notice: The probe file has been deployed. Please access it via web browser:"
    if [ -n "$PUBLIC_IP" ]; then
        echo "http://$PUBLIC_IP/$RANDOM_NAME.php"
    else
        echo "http://$(hostname -I | awk '{print $1}')/$RANDOM_NAME.php"
        echo "(Note: The automatically obtained IP may be an internal IP. If it's not accessible, please manually replace it with the public IP.)"
    fi

    
    find "$WEB_ROOT" -name "*.php" -mtime +$MAX_DAYS -delete
else
    
    echo "$(date '+%Y-%m-%d %H:%M:%S') - Download failed" >> "$LOG_FILE"
    echo "Error: Probe file download failed. Please check your network or link."
    exit 1
fi

Still put your own name here …

  • Author: hestia Server Open-source Management Panel!

Also the codeberg repo, kindly change that from hestiacp, as it is not directly associated with hcp.

On a separate note: Really nice stuff there, and greatly appreciate you sharing with the community. :slight_smile:

Edit: I can see this site on your repo - Hestia MB - Chinese Language
If it is not associated with HCP, kindly mention such, and I guess HCP is a copyright name and content even under OSS. You may want to steer clear, or discuss with the developers and owners here first.
@eris this site is not directly associated with HCP, right?

1 Like

I forgot to remove it, it has been fixed

1 Like

thank you! It’s just a Chinese webpage

1 Like