Gatus

Automated developer-oriented status page with alerting and incident support.

Accessing Gatus

  • เปิดเบราว์เซอร์ของคุณและเข้าไปที่: https://<SERVER_IP>
  • คาดว่าจะมีการแจ้งเตือน SSL จากเบราว์เซอร์ (ใบรับรองที่ลงนามด้วยตนเอง)
  • จำเป็นต้องยืนยันตัวตน (ป๊อปอัพการยืนยันตัวตนขั้นพื้นฐาน)
  • วิธีการยืนยันตัวตน: HTTP Basic Auth
  • ข้อมูลประจำตัวจะถูกจัดเก็บอย่างปลอดภัยใน: /root/.cloudzy-creds

ไฟล์และไดเร็กทอรีที่สำคัญ

  • ไดเร็กทอรีการติดตั้ง: /opt/gatus
  • Docker Compose: /opt/gatus/docker-compose.yml
  • ไฟล์สภาพแวดล้อม: /opt/gatus/.env
  • Config directory: /opt/gatus/config/
  • ไฟล์การตั้งค่าหลัก: /opt/gatus/config/config.yaml
  • Database directory: /opt/gatus/data/db
  • การตั้งค่า Nginx: /etc/nginx/sites-available/gatus.conf
  • เปิดใช้งานเว็บไซต์ Nginx: /etc/nginx/sites-enabled/gatus.conf
  • ใบรับรอง SSL: /etc/nginx/ssl/
  • HTTP Basic Auth file: /etc/nginx/auth/.gatus-htpasswd
  • ไฟล์ข้อมูลประจำตัว: /root/.gatus-credentials

Configuration Behavior

  • Configuration files are located in /opt/gatus/config/
  • YAML can be split into multiple files
  • Changes are auto-reloaded
  • No restart is required after edits

Manage the Stack

Go to the installation directory:

cd /opt/gatus

Common Docker Compose commands:

# Check status
docker compose ps

# View logs (follow live)
docker compose logs -f

# Restart all services
docker compose restart

# Stop services
docker compose down

# Start again
docker compose up -d

Disable HTTP Basic Auth in Nginx (Optional)

Edit the Nginx site file: /etc/nginx/sites-available/gatus.conf

Remove or comment out these lines:

auth_basic "Restricted";
auth_basic_user_file /etc/nginx/auth/.gatus-htpasswd;

รีโหลด Nginx:

systemctl restart nginx

การเปิดใช้งาน SSL กับโดเมน

1. ชี้โดเมนของคุณไปยังที่อยู่ IP ของเซิร์ฟเวอร์

2. แก้ไขไฟล์การตั้งค่า Nginx และแทนที่ทั้งสองส่วน server_name <IP>; ด้วยโดเมนของคุณ (<your-domain>สำหรับทั้งบล็อก HTTP (พอร์ต 80) และ HTTPS (พอร์ต 443):

vim /etc/nginx/sites-available/gatus.conf

3. ติดตั้ง Certbot:

apt install -y certbot python3-certbot-nginx

4. รันคำสั่งต่อไปนี้เพื่อสร้างใบรับรอง Let's Encrypt ที่ถูกต้อง:

certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com

5. แทนที่เส้นทาง SSL ในไฟล์การตั้งค่า Nginx:

vim /etc/nginx/sites-available/gatus.conf
# Before:
    # ssl_certificate       /etc/nginx/ssl/fullchain.pem;
    # ssl_certificate_key   /etc/nginx/ssl/privkey.pem;
# After:
    # ssl_certificate       /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    # ssl_certificate_key   /etc/letsencrypt/live/yourdomain.com/privkey.pem;

6. รีสตาร์ท Nginx เพื่อให้การเปลี่ยนแปลงมีผล:

systemctl restart nginx

7. เปิดเบราว์เซอร์ของคุณและไปที่: https://yourdomain.com

รายละเอียดการสมัคร