diff --git a/.gitignore b/.gitignore index b71b1ea..2c825d9 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ Homestead.json Homestead.yaml Thumbs.db +/http-client-plus diff --git a/README.md b/README.md index 0165a77..8d09021 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,238 @@ -

Laravel Logo

+# IsMySiteUp.Online -

-Build Status -Total Downloads -Latest Stable Version -License -

+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. -## About Laravel +## Features -Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: +- **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 -- [Simple, fast routing engine](https://laravel.com/docs/routing). -- [Powerful dependency injection container](https://laravel.com/docs/container). -- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. -- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). -- Database agnostic [schema migrations](https://laravel.com/docs/migrations). -- [Robust background job processing](https://laravel.com/docs/queues). -- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). +## Requirements -Laravel is accessible, powerful, and provides tools required for large, robust applications. +- Docker & Docker Compose +- Laravel Sail (included) +- PHP 8.2+ +- MySQL 8.0+ -## Learning Laravel +## Installation -Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. You can also check out [Laravel Learn](https://laravel.com/learn), where you will be guided through building a modern Laravel application. +1. Clone the repository +```bash +git clone +cd ismysiteup.online +``` -If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. +2. Copy environment file +```bash +cp .env.example .env +``` -## Laravel Sponsors +3. Start Docker containers with Sail +```bash +./vendor/bin/sail up -d +``` -We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com). +4. Install dependencies +```bash +./vendor/bin/sail composer install +./vendor/bin/sail npm install +``` -### Premium Partners +5. Generate application key +```bash +./vendor/bin/sail artisan key:generate +``` -- **[Vehikl](https://vehikl.com)** -- **[Tighten Co.](https://tighten.co)** -- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** -- **[64 Robots](https://64robots.com)** -- **[Curotec](https://www.curotec.com/services/technologies/laravel)** -- **[DevSquad](https://devsquad.com/hire-laravel-developers)** -- **[Redberry](https://redberry.international/laravel-development)** -- **[Active Logic](https://activelogic.com)** +6. Run migrations +```bash +./vendor/bin/sail artisan migrate +``` -## Contributing +7. Build frontend assets +```bash +./vendor/bin/sail npm run build +``` -Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). +## Running the Application -## Code of Conduct +### Start the application +```bash +./vendor/bin/sail up -d +``` -In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). +### Access the application +- Web: http://localhost +- phpMyAdmin: http://localhost:8080 (if configured) -## Security Vulnerabilities +## Queue Workers -If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. +**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 -The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). +This project is proprietary software. + +## Support + +For issues or questions, please contact the development team. diff --git a/app/Jobs/CheckDnsRecord.php b/app/Jobs/CheckDnsRecord.php index b750860..326bd4d 100644 --- a/app/Jobs/CheckDnsRecord.php +++ b/app/Jobs/CheckDnsRecord.php @@ -109,6 +109,7 @@ class CheckDnsRecord implements ShouldQueue 'last_checked_at' => now(), 'is_valid' => false, 'error_message' => 'Unexpected error: ' . $e->getMessage(), + ]); throw $e; diff --git a/app/Jobs/CheckUptime.php b/app/Jobs/CheckUptime.php index 1f1257e..5020ba9 100644 --- a/app/Jobs/CheckUptime.php +++ b/app/Jobs/CheckUptime.php @@ -47,21 +47,12 @@ class CheckUptime implements ShouldQueue try { - // Validate URL format - if (!filter_var($this->site->url, FILTER_VALIDATE_URL)) { - Log::warning("Invalid URL format for site {$this->site->id}: {$this->site->url}"); - $statusCode = null; - $responseTime = null; + // Send HEAD request for faster checks + $response = $client->head($this->site->url); - } else { - // Send HEAD request for faster checks - $response = $client->head($this->site->url); - - $endTime = microtime(true); - $responseTime = (int) round(($endTime - $startTime) * 1000); // Convert to milliseconds - $statusCode = $response->getStatusCode(); - - } + $endTime = microtime(true); + $responseTime = (int) round(($endTime - $startTime) * 1000); // Convert to milliseconds + $statusCode = $response->getStatusCode(); } catch (ConnectException $e) { // Connection timeout or DNS failure Log::info("Connection failed for site {$this->site->id}: {$e->getMessage()}"); diff --git a/public/css/custom.css b/public/css/custom.css index ffc7178..1df0714 100644 --- a/public/css/custom.css +++ b/public/css/custom.css @@ -40,7 +40,7 @@ .spinner { border: 3px solid rgba(0, 0, 0, 0.1); border-radius: 50%; - border-top: 3px solid var(--indigo-600); + border-top: 3px solid #0ea5e9; width: 40px; height: 40px; animation: spin 1s linear infinite; @@ -124,7 +124,7 @@ /* Button focus states */ .btn:focus { - outline: 2px solid var(--indigo-600); + outline: 2px solid #0ea5e9; outline-offset: 2px; } @@ -148,7 +148,7 @@ top: 0; height: 100%; width: 3px; - background-color: var(--indigo-600); + background-color: #0ea5e9; transform: scaleY(0); transition: transform 0.2s ease; } @@ -190,7 +190,7 @@ /* Card stat improvements */ .card-stat { - border-left: 4px solid var(--indigo-600); + border-left: 4px solid #0ea5e9; } .card-stat.success { diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index cd9815d..7f1c25b 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -33,7 +33,7 @@ } .stat-card.primary { - --card-accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + --card-accent: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); } .stat-card.success { @@ -82,8 +82,8 @@ } .stat-icon.primary { - --icon-gradient: linear-gradient(135deg, #667eea, #764ba2); - color: #667eea; + --icon-gradient: linear-gradient(135deg, #06b6d4, #0891b2); + color: #06b6d4; } .stat-icon.success { @@ -168,7 +168,7 @@ } .chart-card .card-title i { - color: var(--indigo-600); + color: #0ea5e9; } /* Modern Table */ @@ -227,7 +227,7 @@ width: 48px; height: 48px; border-radius: 12px; - background: linear-gradient(135deg, #667eea, #764ba2); + background: linear-gradient(135deg, #06b6d4, #0891b2); display: flex; align-items: center; justify-content: center; @@ -332,13 +332,13 @@ .btn-action:hover { transform: translateY(-2px); - box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25); + box-shadow: 0 8px 20px rgba(14, 165, 233, 0.25); } .btn-action.btn-outline-primary:hover { - background: var(--indigo-600); + background: #0ea5e9; color: white; - border-color: var(--indigo-600); + border-color: #0ea5e9; } /* Empty State */ @@ -351,7 +351,7 @@ font-size: 5rem; opacity: 0.15; margin-bottom: 2rem; - background: linear-gradient(135deg, #667eea, #764ba2); + background: linear-gradient(135deg, #06b6d4, #0891b2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; @@ -701,11 +701,11 @@ document.addEventListener('DOMContentLoaded', function() { labels: chartData.labels, datasets: chartData.datasets.map((dataset, index) => { const colors = [ - { border: '#667eea', bg: 'rgba(102, 126, 234, 0.1)' }, + { border: '#06b6d4', bg: 'rgba(6, 182, 212, 0.1)' }, { border: '#10b981', bg: 'rgba(16, 185, 129, 0.1)' }, { border: '#f59e0b', bg: 'rgba(245, 158, 11, 0.1)' }, { border: '#ef4444', bg: 'rgba(239, 68, 68, 0.1)' }, - { border: '#3b82f6', bg: 'rgba(59, 130, 246, 0.1)' }, + { border: '#0ea5e9', bg: 'rgba(14, 165, 233, 0.1)' }, ]; const color = colors[index % colors.length]; diff --git a/resources/views/dashboard/show.blade.php b/resources/views/dashboard/show.blade.php index be87c09..dc0047a 100644 --- a/resources/views/dashboard/show.blade.php +++ b/resources/views/dashboard/show.blade.php @@ -179,7 +179,7 @@ document.addEventListener('DOMContentLoaded', function() { datasets: [{ label: 'Response Time (ms)', data: responseData, - borderColor: 'rgb(13, 110, 253)', + borderColor: 'rgb(14, 165, 233)', backgroundColor: backgroundColors, borderWidth: 2, fill: false, diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 55d15ed..b24a337 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -20,8 +20,8 @@ --text-primary: #111827; --text-secondary: #6b7280; --border-color: #e5e7eb; - --indigo-600: #4f46e5; - --indigo-700: #4338ca; + --indigo-600: #0ea5e9; + --indigo-700: #0284c7; } .dark { @@ -80,7 +80,7 @@ .sidebar-nav-link:hover, .sidebar-nav-link.active { - background-color: rgba(79, 70, 229, 0.1); + background-color: rgba(14, 165, 233, 0.1); color: var(--indigo-600); } diff --git a/resources/views/uptime/show.blade.php b/resources/views/uptime/show.blade.php index b7f1776..a8111f1 100644 --- a/resources/views/uptime/show.blade.php +++ b/resources/views/uptime/show.blade.php @@ -146,8 +146,8 @@ document.addEventListener('DOMContentLoaded', function() { datasets: [{ label: 'Response Time (ms)', data: @json($uptimeChecks->pluck('response_time')->reverse()), - borderColor: '#667eea', - backgroundColor: 'rgba(102, 126, 234, 0.1)', + borderColor: '#06b6d4', + backgroundColor: 'rgba(6, 182, 212, 0.1)', borderWidth: 2, fill: true, tension: 0.4 diff --git a/resources/views/welcome-landing.blade.php b/resources/views/welcome-landing.blade.php index bb75df2..525c6cf 100644 --- a/resources/views/welcome-landing.blade.php +++ b/resources/views/welcome-landing.blade.php @@ -22,8 +22,8 @@ --text-secondary: #6b7280; --text-muted: #9ca3af; --border-color: #e5e7eb; - --accent-primary: #667eea; - --accent-secondary: #764ba2; + --accent-primary: #06b6d4; + --accent-secondary: #0891b2; --accent-success: #10b981; --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06); --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);