I have created an information page for viewing PHP! Is it helpful for Hestia? You can preview it online.
Already open sourced on GitHub
I have created an information page for viewing PHP! Is it helpful for Hestia? You can preview it online.
Already open sourced on GitHub
Good one. Possible to give the source code/file?
Please remove any links to hestiacp.com …
/**
What’s wrong? Did I change it?
Autor is not hestiacp.com very easy…
Mmm! you are right!
This is very cool! Congrats!
I would suggest that you add the code to GitHub
Do you have any good suggestions!
By not making a PR towards Hestia… It doesn’t belong there…
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 …
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.
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?
I forgot to remove it, it has been fixed
thank you! It’s just a Chinese webpage