feat: Add comprehensive documentation suite and reorganize project structure
- Created complete documentation in docs/ directory - Added PROJECT_OVERVIEW.md with feature highlights and getting started guide - Added ARCHITECTURE.md with system design and technical details - Added SECURITY.md with comprehensive security implementation guide - Added DEVELOPMENT.md with development workflows and best practices - Added DEPLOYMENT.md with production deployment instructions - Added API.md with complete REST API documentation - Added CONTRIBUTING.md with contribution guidelines - Added CHANGELOG.md with version history and migration notes - Reorganized all documentation files into docs/ directory for better organization - Updated README.md with proper documentation links and quick navigation - Enhanced project structure with professional documentation standards
This commit is contained in:
40
deploy/cron/crontab
Normal file
40
deploy/cron/crontab
Normal file
@@ -0,0 +1,40 @@
|
||||
SHELL=/bin/sh
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
# conversion check every 1 minute
|
||||
*/1 * * * * root php /srv/easystream/f_modules/m_frontend/m_cron/convert_queue.php 1> /dev/null 2>&1
|
||||
|
||||
# check for expired subs daily at midnight
|
||||
0 0 * * * root php /srv/easystream/f_modules/m_frontend/m_cron/expired_subs.php 1> /dev/null 2>&1
|
||||
|
||||
# update dashboard stats every 6 hours
|
||||
0 */6 * * * root php /srv/easystream/f_modules/m_frontend/m_cron/admin_dashboard.php update 1> /dev/null 2>&1
|
||||
|
||||
# check disk space usage every 3 hours
|
||||
0 */3 * * * root php /srv/easystream/f_modules/m_frontend/m_cron/disk_usage.php 1> /dev/null 2>&1
|
||||
|
||||
# update followers/subs weekly, Sundays at 19:30
|
||||
30 19 * * 0 root php /srv/easystream/f_modules/m_frontend/m_cron/update_followers_subs.php 1> /dev/null 2>&1
|
||||
|
||||
# transfer check every 3 minutes
|
||||
*/3 * * * * root php /srv/easystream/f_modules/m_frontend/m_cron/transfer_queue.php 1> /dev/null 2>&1
|
||||
|
||||
# clean chat notifications and usernames every 2 days at 09:00
|
||||
0 9 */2 * * root php /srv/easystream/f_modules/m_frontend/m_cron/clean_chat.php 1> /dev/null 2>&1
|
||||
|
||||
# clean temps daily at 00:15
|
||||
15 0 * * * root php /srv/easystream/f_modules/m_frontend/m_cron/clean_temps.php 1> /dev/null 2>&1
|
||||
|
||||
# VOD server tasks (paths configured via cfg.php written by init)
|
||||
*/3 * * * * root php /srv/easystream/f_modules/m_frontend/m_cron/vod-server/recording_previews.php 1> /dev/null 2>&1
|
||||
*/5 * * * * root php /srv/easystream/f_modules/m_frontend/m_cron/vod-server/recording_fix.php 1> /dev/null 2>&1
|
||||
0 */12 * * * root php /srv/easystream/f_modules/m_frontend/m_cron/vod-server/clear_vods.php 1> /dev/null 2>&1
|
||||
*/10 * * * * root php /srv/easystream/f_modules/m_frontend/m_cron/vod-server/sync_df.php 1> /dev/null 2>&1
|
||||
0 */3 * * * root php /srv/easystream/f_modules/m_frontend/m_cron/vod-server/sync_vods.php 1> /dev/null 2>&1
|
||||
|
||||
# chat-server: sync subs and follows nightly
|
||||
10 0 * * * root php /srv/easystream/f_modules/m_frontend/m_cron/chat-server/sync_subs.php 1> /dev/null 2>&1
|
||||
|
||||
# cleanup old logs daily at 04:30
|
||||
30 4 * * * root php /srv/easystream/f_scripts/cleanup_logs.php 1> /dev/null 2>&1
|
||||
|
||||
47
deploy/cron/init.sh
Normal file
47
deploy/cron/init.sh
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Write cron cfgs for chat-server and vod-server based on env
|
||||
CHAT_CFG="/srv/easystream/f_modules/m_frontend/m_cron/chat-server/cfg.php"
|
||||
VOD_CFG="/srv/easystream/f_modules/m_frontend/m_cron/vod-server/cfg.php"
|
||||
|
||||
mkdir -p "$(dirname "$CHAT_CFG")" "$(dirname "$VOD_CFG")"
|
||||
|
||||
cat > "$CHAT_CFG" <<'EOF'
|
||||
<?php
|
||||
ini_set("error_reporting", E_ALL & ~E_STRICT & ~E_NOTICE & ~E_DEPRECATED);
|
||||
|
||||
define('_ISVALID', true);
|
||||
|
||||
/* database */
|
||||
$dbhost = getenv('DB_HOST') ?: 'db';
|
||||
$dbname = getenv('DB_NAME') ?: 'easystream';
|
||||
$dbuser = getenv('DB_USER') ?: 'easystream';
|
||||
$dbpass = getenv('DB_PASS') ?: 'easystream';
|
||||
/* main url */
|
||||
$base = getenv('CRON_BASE_URL') ?: 'http://localhost:8080';
|
||||
/* cron salt key */
|
||||
$ssk = getenv('CRON_SSK') ?: 'CHANGE_ME_IN_BACKEND';
|
||||
EOF
|
||||
|
||||
cat > "$VOD_CFG" <<'EOF'
|
||||
<?php
|
||||
ini_set("error_reporting", E_ALL & ~E_STRICT & ~E_NOTICE & ~E_DEPRECATED);
|
||||
|
||||
define('_ISVALID', true);
|
||||
|
||||
/* path to recordings */
|
||||
$path = getenv('VOD_REC_PATH') ?: '/mnt/rec';
|
||||
/* main url */
|
||||
$base = getenv('CRON_BASE_URL') ?: 'http://localhost:8080';
|
||||
/* cron salt key */
|
||||
$ssk = getenv('CRON_SSK') ?: 'CHANGE_ME_IN_BACKEND';
|
||||
EOF
|
||||
|
||||
# Ensure f_data is writable (best effort, may be a bind mount)
|
||||
chown -R 33:33 /srv/easystream/f_data 2>/dev/null || true
|
||||
chmod -R g+rwX /srv/easystream/f_data 2>/dev/null || true
|
||||
|
||||
# Load crontab and start cron in foreground
|
||||
crontab /etc/cron.d/easystream
|
||||
cron -f
|
||||
Reference in New Issue
Block a user