Commit Graph

101 Commits

Author SHA1 Message Date
Hosteroid
162d86e230 Update 000_initial_schema_v1.1.0.sql 2025-10-20 21:55:04 +03:00
Hosteroid
160aaa078f Update 000_initial_schema_v1.1.0.sql 2025-10-20 21:15:09 +03:00
Hosteroid
ac7a0c0aa8 Refactor routes and controllers for RESTful resource access
Updated controllers and routes to use RESTful resource-based URLs and parameter passing for groups, users, and notification channels. Added user isolation checks for domain and group access, ensuring proper data filtering based on isolation mode. Adjusted views to match new route structure and improved security and maintainability by removing reliance on query parameters for resource identification.
2025-10-20 21:08:09 +03:00
Hosteroid
c4e4196e02 Refactor stats variable names for clarity
Renamed generic 'stats' variables to more specific names such as 'domainStats', 'errorStats', 'tldStats', and 'importStats' across controllers and views. This improves code readability and reduces ambiguity when handling different types of statistics in the application.
2025-10-20 19:53:28 +03:00
Hosteroid
1b84f06c86 Refactor user ID assignment in DomainController
Moved the assignment of the current user ID ($userId) to the beginning of relevant methods instead of inside conditional blocks. This improves code clarity and avoids redundant calls to Auth::id().
2025-10-20 19:05:33 +03:00
Hosteroid
a1211ae815 Add isolation checks and logging for domains and groups
Implemented validation to restrict domain assignment to notification groups owned by the user when isolation mode is enabled. Added logging for domain creation, bulk domain addition, and notification group creation, update, and deletion to improve auditability and traceability.
2025-10-20 19:02:56 +03:00
Hosteroid
5727911656 Respect user isolation mode when fetching groups
Updated DomainController to fetch groups using getAllWithChannelCount, passing the user ID when user isolation mode is set to 'isolated'. This ensures group listings are filtered per user when isolation is enabled, improving data separation and security.
2025-10-20 18:50:32 +03:00
Hosteroid
e448855687 Centralize domain stats retrieval in LayoutHelper
Moved domain statistics logic into a new LayoutHelper::getDomainStats() method. Updated base layout and dashboard view to use this helper, reducing code duplication and improving maintainability.
2025-10-20 18:44:03 +03:00
Hosteroid
7ad01a7da0 Refactor global stats handling and user ID access
Moved global stats logic from LayoutHelper to Domain model and updated views/controllers to use the new stats structure. Replaced direct $_SESSION['user_id'] access with Core\Auth::id() for consistency. Cleaned up redundant code and improved isolation mode handling for statistics.
2025-10-20 18:38:58 +03:00
Hosteroid
719fb86c7a Remove admin check from tags query in Domain model
Simplifies the tags query by removing the isAdmin check. Now, if a user ID is provided, the query filters by user_id regardless of admin status.
2025-10-20 18:21:05 +03:00
Hosteroid
22817b7127 Respect user isolation mode in controllers
Updated DashboardController, DomainController, and NotificationGroupController to conditionally fetch user-specific or global data based on the 'user_isolation_mode' setting. This ensures that data visibility aligns with the configured isolation mode, improving multi-user support and data segregation.
2025-10-20 18:13:57 +03:00
Hosteroid
c387e90a19 Enforce user-specific data access for all users
Refactored controllers and models to always filter data by user ID, removing admin bypass logic. This ensures all statistics, groups, domains, and tags are user-specific regardless of isolation mode, improving data isolation and security.
2025-10-20 18:03:16 +03:00
Hosteroid
011fab095e Respect user isolation in global stats queries
Updated LayoutHelper::getGlobalStats to accept a user ID and apply user isolation mode when querying domain statistics. DashboardController and base layout now pass the user ID to ensure stats are scoped per user when isolation is enabled.
2025-10-20 17:51:27 +03:00
Hosteroid
111698cfed Cast GET parameters to int and update SQL query
GET parameters 'id' and 'group_id' are now explicitly cast to integers in NotificationGroupController for improved type safety. Also, the SQL query in NotificationGroup model now includes GROUP BY and ORDER BY clauses when filtering by user_id, ensuring results are grouped and sorted by group name.
2025-10-20 17:48:35 +03:00
Hosteroid
c59a4e2c5b Add updateWhere method to Domain model
Introduces updateWhere to allow updating multiple domain records based on specified WHERE conditions. This method builds dynamic SQL for flexible bulk updates.
2025-10-20 17:42:38 +03:00
Hosteroid
0b0532140e Add bulk transfer functionality for domains and groups
Introduces bulk transfer for domains and groups, available only to admins. Refactors admin checks to use isAdmin(), adds user selection for transfers, and updates views to include transfer buttons and modals for domain transfers.
2025-10-20 17:40:43 +03:00
Hosteroid
0d4a38aae8 Refactor admin/user isolation logic and model methods
Moved admin/user isolation checks and related methods from Domain and NotificationGroup models to User model for better separation of concerns. Replaced direct database queries in controllers and services with new model methods. Added methods for assigning unassigned domains/groups, searching domains, and clearing old notification logs. Updated views for improved UI consistency.
2025-10-20 17:25:02 +03:00
Hosteroid
6fbed15c7d Add user isolation mode and transfer features
Introduces user isolation mode, allowing domains, groups, and tags to be visible only to their owners when enabled. Adds user_id fields to domains and notification_groups, updates models and controllers for isolation-aware queries, and provides admin UI and endpoints for transferring domains and groups between users (single and bulk). Includes migration, settings UI, and routes for toggling isolation mode and handling data migration.
2025-10-20 17:04:13 +03:00
Hosteroid
52d20c2996 Add GitHub link to Domain Monitor footers
Updated footer sections across multiple views to include a link to the Domain Monitor GitHub repository. This provides users with easy access to the project's source code and additional information.
2025-10-20 14:51:37 +03:00
Hosteroid
6b9e4b1d23 Add support for filtering domains by 'available' and 'error' status
Extended the domain filtering logic and UI to allow filtering by 'available' and 'error' statuses. Updated the Domain model to handle these new filters and adjusted the dashboard to include global stats, including inactive domains.
2025-10-20 12:43:51 +03:00
Hosteroid
5281cec031 Enable SMTP debug logging for test emails
SMTP dialog is now always captured and logged for test emails using PHPMailer::DEBUG_SERVER. This change improves diagnostics by logging detailed SMTP communication without requiring an environment flag.
2025-10-17 11:55:25 +03:00
Hosteroid
c28ec4921e Add structured logging to notification channels
Replaced error_log calls with structured logging using the Logger class in DiscordChannel, SlackChannel, TelegramChannel, and WebhookChannel. Log success and error cases with relevant context for improved observability and debugging.
2025-10-17 11:30:59 +03:00
Hosteroid
2b783b7470 Add generic webhook notification channel
Introduces a new 'Webhook (Custom)' notification channel allowing users to send JSON payloads to any HTTP endpoint (e.g., n8n, Zapier, custom APIs). Updates the UI to support webhook configuration, adds backend validation, and implements the WebhookChannel for sending notifications. Documentation is updated with usage instructions and payload examples.
2025-10-17 11:13:25 +03:00
Hosteroid
6e8fef9b79 Add two-factor authentication (2FA) support
Introduces two-factor authentication (2FA) with TOTP, backup codes, and email codes. Adds controllers, services, views, and migration for 2FA setup, verification, and management. Updates user and settings models, email helper, and relevant controllers to support 2FA policy enforcement, configuration, and user flows. Enhances security by allowing admins to require or disable 2FA, and provides backup code generation and management for account recovery.
2025-10-16 17:25:06 +03:00
Hosteroid
1edde3645c Enhance email templates for verification and reset
Updated the email verification and password reset templates to use more visually appealing and structured HTML layouts. These changes improve readability, branding, and user experience for recipients.
2025-10-14 02:21:04 +03:00
Hosteroid
b31030c347 Improve error handling in import progress fetch
Enhances the fetch logic to detect and handle non-JSON server responses, providing clearer error messages for PHP errors or session issues. Also adds specific handling for gateway timeouts by retrying the request after 5 seconds.
2025-10-14 01:56:06 +03:00
Hosteroid
2ac5577692 Add CSRF protection to import form
Inserted a CSRF field into the progressive import form on the TLD registry index page to enhance security against cross-site request forgery attacks.
2025-10-14 00:33:37 +03:00
Hosteroid
822248e31d Update index.php 2025-10-14 00:31:47 +03:00
Hosteroid
02bcc73261 Refactor email handling to use EmailHelper and auto-detect encryption
Extracted all email sending logic into a new EmailHelper class for centralized management and improved error handling. Updated AuthController, SettingsController, and EmailChannel to use EmailHelper for sending emails and logging. Added auto-detection of SMTP encryption based on port in both backend (SettingsController) and frontend (settings view), improving user experience and reducing misconfiguration. Enhanced logging for email operations and improved UI feedback for encryption selection.
2025-10-14 00:27:50 +03:00
Hosteroid
24e732c10a Add test notification channel feature with AJAX support
Introduces the ability to test notification channels (email, Telegram, Discord, Slack) from the group edit page, both for new and existing channels. Adds a new testChannel method to NotificationGroupController with AJAX and form support, improves validation and error handling, and updates the UI to include test buttons and dynamic toast notifications. Also registers the new /channels/test route.
2025-10-13 16:35:28 +03:00
Hosteroid
df2942b356 Add tags support for domains with filtering and bulk actions
Introduces a 'tags' field to the domains table and UI, allowing users to organize domains with custom tags. Adds tag input and display to create, edit, bulk-add, and view pages, as well as tag-based filtering and bulk tag management (add/remove) in the domain list. Updates backend validation, controller logic, and migrations to support tags, including a new migration and index for efficient tag searches.
2025-10-12 12:46:16 +03:00
Hosteroid
823248f025 Improve date parsing to handle timezones correctly
Updated date parsing logic to distinguish between ISO 8601 dates with timezone information and plain database datetimes. Plain datetimes are now explicitly parsed as UTC to ensure consistent handling and comparison.
2025-10-12 11:02:34 +03:00
Hosteroid
26ad852451 Fix bulk actions selection and set timezone earlier
Improves bulk actions in the domains view by ensuring unique domain IDs are counted and selected, preventing double-counting from desktop and mobile checkboxes. Adds CSRF token to bulk actions forms for security. Moves timezone initialization to public/index.php to ensure it is set before any date operations, and updates base layout to reflect this change.
2025-10-11 21:22:39 +03:00
Hosteroid
dcb7f685dd Enhance error resolution workflow and notification service
Refactored error log model and views to use a unified 'notes' field instead of 'resolution_notes'. Added a modal dialog for entering resolution notes when marking errors as resolved in admin views. Improved stack trace handling in ErrorHandler by storing as JSON and formatting for display. Expanded NotificationService to support multi-channel notifications (email, Telegram, Discord, Slack), group notifications, and improved domain expiration alerts.
2025-10-11 20:27:46 +03:00
Hosteroid
1d80dd282c Update TldRegistryService.php 2025-10-11 01:26:19 +03:00
Hosteroid
b0b2b6a94d Normalize dates in TldRegistryService results
Updated the assignment of 'registration_date' and 'record_last_updated' fields to use the normalizeDate method, ensuring consistent date formatting in the TldRegistryService output.
2025-10-11 01:15:03 +03:00
Hosteroid
b50377492c Add error log management and bulk admin actions
Introduces error log tracking with new ErrorLog model, controller, views, and migration. Adds admin UI for viewing, resolving, and deleting errors. Implements bulk actions for users and notification groups, refactors domain filtering/pagination, and centralizes admin access checks using Auth::requireAdmin().
2025-10-10 14:01:19 +03:00
Hosteroid
a29becc944 Add CSRF, CAPTCHA, and input validation improvements
Introduces CSRF protection to all sensitive controller actions, integrates configurable CAPTCHA (reCAPTCHA v2/v3, Turnstile) for authentication and registration flows, and centralizes input validation via a new InputValidator helper. Adds new helpers and services for CSRF and CAPTCHA, updates settings and migration for CAPTCHA configuration, and enhances logging and error handling in TLD registry import processes. Also improves validation for user, domain, group, and profile inputs throughout the application.
2025-10-10 00:04:12 +03:00
Hosteroid
98f37c2482 Allow custom admin username and email during install
The installer now prompts for and validates a custom admin username and email, updating migrations and SQL placeholders accordingly. Login now accepts either username or email, and the login form and installer views have been updated to reflect these changes. Additional logging and migration handling improvements were made for better installation and authentication workflows.
2025-10-09 18:34:09 +03:00
Hosteroid
e5b9599755 Upgraded to 1.1.0
1.1.0 (2025-10-09)
- **User Notifications System** - In-app notification center with 7 notification types, filtering, pagination
- **Advanced Session Management** - Database-backed sessions with geolocation (country, city, ISP)
- **Remote Session Control** - Terminate any device instantly with immediate logout validation
- **Enhanced Profile Page** - Sidebar navigation with 4 tabs, hash-based routing (#profile, #security, #sessions)
- **MVC Architecture Refactoring** - 3 new Helpers (Layout, Domain, Session), ~265 lines cleaned from views
- **Geolocation Tracking** - IP-based location detection using ip-api.com, country flags with flag-icons
- **Device Detection** - Browser & device type parsing (Chrome/Firefox/Safari, Desktop/Mobile/Tablet)
- **Auto-Detected Cron Paths** - Settings show actual installation paths (thanks @jadeops)
- **Welcome Notifications** - Sent to new users on registration or fresh install
- **Upgrade Notifications** - Admins notified on system updates with version & migration count
- **Web-Based Installer** - Replaces CLI, auto-generates encryption key, one-time password display
- **Web-Based Updater** - `/install/update` for running new migrations with smart detection
- **User Registration** - Full signup flow with email verification, password reset, resend verification
- **User Management** - CRUD for users with filtering, sorting, pagination (admin-only)
- **Remember Me** - 30-day secure tokens linked to sessions, cascade deletion on logout
- **Session Validator** - Middleware validates sessions on every request for instant remote logout
- **Consistent UI/UX** - Unified filtering, sorting, pagination across Domains, Users, Notifications, TLD Registry
- **Smart Migrations** - Consolidated schema for fresh installs, incremental for upgrades
- **XSS Protection** - htmlspecialchars() applied across all user-facing data (thanks @jadeops)
2025-10-09 18:02:46 +03:00
Hosteroid
adc28b97f0 Fixed Discord issue
Enhanced error messages for missing channel configuration fields in NotificationGroupController. Updated Discord and Slack webhook input handling to use distinct field names, improved form validation and required field logic in the edit group view, and added user guidance for webhook URLs.
2025-10-09 16:38:52 +03:00
Hosteroid
5d541e8021 Merge pull request #2 from jadeops/main
Fix XSS
2025-10-09 15:52:10 +03:00
Jade Ops
d4e58733f1 Fix XSS 2025-10-09 18:10:12 +05:30
Hosteroid
d4b7580962 Merge pull request #1 from jadeops/main
autodetect cron script path
2025-10-09 15:24:21 +03:00
Jade Ops
4d06b5c305 autodetect cron script path 2025-10-09 17:08:10 +05:30
Hosteroid
20154e345a Update README.md 2025-10-09 07:59:05 +03:00
Hosteroid
a54cecb9cf Domain Notes Feature added 2025-10-08 20:56:25 +03:00
Hosteroid
117665e7b7 Update migrate.php 2025-10-08 19:14:01 +03:00
Hosteroid
8e5ff9ab39 Fixed Encryption key generation and updated Readme 2025-10-08 19:08:27 +03:00
Hosteroid
146df224bd Implemented Settings
Improved cronjob
Fixed Views
Added env encryption key for encrypting sensitive data in database.
2025-10-08 18:54:34 +03:00