239 lines
6.1 KiB
Markdown
239 lines
6.1 KiB
Markdown
# IsMySiteUp.Online
|
|
|
|
Privacy-first website monitoring application built with Laravel. Monitor your websites' uptime, SSL certificates, broken links, DNS records, and more - all while respecting user privacy with GDPR compliance.
|
|
|
|
## Features
|
|
|
|
- **Uptime Monitoring** - Real-time HTTP/HTTPS monitoring with response time tracking
|
|
- **SSL Certificate Monitoring** - Automatic expiration alerts 30 days in advance
|
|
- **Broken Link Detection** - Crawl and identify broken links on your websites
|
|
- **DNS Monitoring** - Track DNS record changes and modifications
|
|
- **Domain Expiry Tracking** - Get notified before your domains expire
|
|
- **Sitemap Validation** - Validate XML sitemaps for proper indexing
|
|
- **Health Checks** - Monitor custom health endpoints and APIs
|
|
- **TCP Port Monitoring** - Check TCP port availability and connectivity
|
|
|
|
## Requirements
|
|
|
|
- Docker & Docker Compose
|
|
- Laravel Sail (included)
|
|
- PHP 8.2+
|
|
- MySQL 8.0+
|
|
|
|
## Installation
|
|
|
|
1. Clone the repository
|
|
```bash
|
|
git clone <repository-url>
|
|
cd ismysiteup.online
|
|
```
|
|
|
|
2. Copy environment file
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
|
|
3. Start Docker containers with Sail
|
|
```bash
|
|
./vendor/bin/sail up -d
|
|
```
|
|
|
|
4. Install dependencies
|
|
```bash
|
|
./vendor/bin/sail composer install
|
|
./vendor/bin/sail npm install
|
|
```
|
|
|
|
5. Generate application key
|
|
```bash
|
|
./vendor/bin/sail artisan key:generate
|
|
```
|
|
|
|
6. Run migrations
|
|
```bash
|
|
./vendor/bin/sail artisan migrate
|
|
```
|
|
|
|
7. Build frontend assets
|
|
```bash
|
|
./vendor/bin/sail npm run build
|
|
```
|
|
|
|
## Running the Application
|
|
|
|
### Start the application
|
|
```bash
|
|
./vendor/bin/sail up -d
|
|
```
|
|
|
|
### Access the application
|
|
- Web: http://localhost
|
|
- phpMyAdmin: http://localhost:8080 (if configured)
|
|
|
|
## Queue Workers
|
|
|
|
**IMPORTANT**: The application uses queues for background monitoring tasks. You MUST run the queue workers for monitoring to work properly.
|
|
|
|
### Required Queue Workers
|
|
|
|
The monitoring jobs are dispatched to the `monitoring` queue. Run the queue worker with:
|
|
|
|
```bash
|
|
./vendor/bin/sail artisan queue:work --queue=monitoring,default
|
|
```
|
|
|
|
**Or run both queues separately in different terminals:**
|
|
|
|
```bash
|
|
# Terminal 1 - Monitoring queue (highest priority)
|
|
./vendor/bin/sail artisan queue:work --queue=monitoring
|
|
|
|
# Terminal 2 - Default queue
|
|
./vendor/bin/sail artisan queue:work --queue=default
|
|
```
|
|
|
|
**For production, use Supervisor or systemd to keep workers running:**
|
|
|
|
```ini
|
|
[program:ismysiteup-worker-monitoring]
|
|
command=php /path/to/artisan queue:work --queue=monitoring --sleep=3 --tries=3 --max-time=3600
|
|
autostart=true
|
|
autorestart=true
|
|
user=www-data
|
|
|
|
[program:ismysiteup-worker-default]
|
|
command=php /path/to/artisan queue:work --queue=default --sleep=3 --tries=3 --max-time=3600
|
|
autostart=true
|
|
autorestart=true
|
|
user=www-data
|
|
```
|
|
|
|
## Monitoring Commands
|
|
|
|
All monitoring tasks should be scheduled in your crontab or Laravel scheduler.
|
|
|
|
### Available Commands
|
|
|
|
| Command | Description | Recommended Schedule |
|
|
|---------|-------------|---------------------|
|
|
| `monitor:uptime` | Check uptime for all enabled sites | Every 5 minutes |
|
|
| `monitor:ssl` | Check SSL certificates for all sites | Every 6 hours |
|
|
| `monitor:links` | Scan for broken links | Daily |
|
|
| `monitor:dns` | Monitor DNS record changes | Every hour |
|
|
| `monitor:domains` | Check domain expiry dates | Daily |
|
|
| `monitor:sitemaps` | Validate XML sitemaps | Daily |
|
|
| `monitor:health` | Monitor health endpoints | Every 5 minutes |
|
|
| `monitor:tcp-ports` | Monitor TCP port availability | Every 5 minutes |
|
|
| `monitor:ping` | Quick ping check for sites | Every minute |
|
|
|
|
### Manual Command Execution
|
|
|
|
Run any monitoring command manually:
|
|
```bash
|
|
./vendor/bin/sail artisan monitor:uptime
|
|
./vendor/bin/sail artisan monitor:ssl
|
|
./vendor/bin/sail artisan monitor:links
|
|
# etc...
|
|
```
|
|
|
|
### Schedule Configuration
|
|
|
|
Add to `app/Console/Kernel.php`:
|
|
|
|
```php
|
|
protected function schedule(Schedule $schedule)
|
|
{
|
|
// High-frequency checks
|
|
$schedule->command('monitor:uptime')->everyFiveMinutes();
|
|
$schedule->command('monitor:ping')->everyMinute();
|
|
$schedule->command('monitor:health')->everyFiveMinutes();
|
|
$schedule->command('monitor:tcp-ports')->everyFiveMinutes();
|
|
|
|
// Medium-frequency checks
|
|
$schedule->command('monitor:dns')->hourly();
|
|
$schedule->command('monitor:ssl')->everySixHours();
|
|
|
|
// Daily checks
|
|
$schedule->command('monitor:links')->daily();
|
|
$schedule->command('monitor:domains')->daily();
|
|
$schedule->command('monitor:sitemaps')->daily();
|
|
}
|
|
```
|
|
|
|
Then run the scheduler:
|
|
```bash
|
|
./vendor/bin/sail artisan schedule:work
|
|
```
|
|
|
|
Or add to crontab:
|
|
```
|
|
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
|
|
```
|
|
|
|
## Development
|
|
|
|
### Run tests
|
|
```bash
|
|
./vendor/bin/sail artisan test
|
|
```
|
|
|
|
### Watch frontend assets
|
|
```bash
|
|
./vendor/bin/sail npm run dev
|
|
```
|
|
|
|
### Access container shell
|
|
```bash
|
|
./vendor/bin/sail shell
|
|
```
|
|
|
|
### Access MySQL
|
|
```bash
|
|
./vendor/bin/sail mysql
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Jobs not processing?
|
|
1. Ensure queue workers are running with correct queue names
|
|
2. Check `jobs` table for pending jobs: `SELECT * FROM jobs;`
|
|
3. Check `failed_jobs` table for errors: `SELECT * FROM failed_jobs;`
|
|
4. Verify queue connection in `.env`: `QUEUE_CONNECTION=database`
|
|
|
|
### No uptime checks appearing?
|
|
1. Verify sites have `monitoring_enabled = 1`
|
|
2. Run command manually: `./vendor/bin/sail artisan monitor:uptime -v`
|
|
3. Check queue worker is processing `monitoring` queue
|
|
4. Check logs: `./vendor/bin/sail artisan queue:work --queue=monitoring --once`
|
|
|
|
### Clear caches
|
|
```bash
|
|
./vendor/bin/sail artisan cache:clear
|
|
./vendor/bin/sail artisan config:clear
|
|
./vendor/bin/sail artisan route:clear
|
|
./vendor/bin/sail artisan view:clear
|
|
```
|
|
|
|
## Database Structure
|
|
|
|
Key tables:
|
|
- `sites` - Monitored websites
|
|
- `uptime_checks` - Uptime monitoring results
|
|
- `ssl_certificates` - SSL certificate data
|
|
- `broken_links` - Detected broken links
|
|
- `dns_records` - DNS record snapshots
|
|
- `domains` - Domain expiry tracking
|
|
- `health_checks` - Health endpoint results
|
|
- `tcp_ports` - TCP port monitoring
|
|
- `jobs` - Queued jobs (monitoring queue)
|
|
- `job_batches` - Batch job tracking
|
|
- `failed_jobs` - Failed job logs
|
|
|
|
## License
|
|
|
|
This project is proprietary software.
|
|
|
|
## Support
|
|
|
|
For issues or questions, please contact the development team.
|