الوصول
- Open the CTFd URL:
https://<SERVER-IP> - تجاوز تحذير الشهادة الموقَّعة ذاتيًا.
- أكمل معالج الإعداد الأحادي.
- أنشئ حساب المسؤول.
- قم بتكوين CTF الخاص بك.
الملفات والمجلدات المهمة
- مسار التثبيت:
/root/ctfd - ملف Compose:
/root/ctfd/docker-compose.yml - ملف البيئة:
/root/ctfd/.env - Uploads:
/root/ctfd/.data/CTFd/uploads - السجلات:
/root/ctfd/.data/CTFd/logs - MariaDB Data:
/root/ctfd/.data/mysql - بيانات Redis:
/root/ctfd/.data/redis - إعدادات Nginx:
/etc/nginx/sites-available/ctfd - شهادة SSL:
/etc/nginx/ssl/ctfd.crt - المفتاح الخاص SSL:
/etc/nginx/ssl/ctfd.key
إدارة Docker
فحص الحاويات:
docker ps
عرض السجلات:
cd /root/ctfd
docker compose logs -f
إعادة تشغيل الخدمات:
cd /root/ctfd
docker compose restart
إيقاف الخدمات:
cd /root/ctfd
docker compose down
تشغيل الخدمات:
cd /root/ctfd
docker compose up -d
إدارة Nginx
إعداد الاختبار:
nginx -t
إعادة تشغيل NGINX:
systemctl restart nginx
أعد تحميل Nginx:
systemctl reload nginx
التحقق من حالة NGINX:
systemctl status nginx
تفعيل SSL مع نطاق
1. وجِّه نطاقك إلى IP الخادم.
٢. عدّل إعدادات Nginx واستبدل server_name _; with your domain in both HTTP and HTTPS blocks:
vim /etc/nginx/sites-available/ctfd
3. ثبّت Certbot:
apt install -y certbot python3-certbot-nginx
4. Generate a Let's Encrypt certificate:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. استبدل مسارات SSL في إعدادات Nginx:
vim /etc/nginx/sites-available/ctfd
# Before:
# ssl_certificate /etc/nginx/ssl/ctfd.crt;
# ssl_certificate_key /etc/nginx/ssl/ctfd.key;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
6. Reload Nginx:
systemctl reload nginx