Commit Graph

116 Commits

Author SHA1 Message Date
Hosteroid
774379f107 Add Mattermost notification channel support
Introduces Mattermost as a new notification channel, including backend service integration, controller validation, UI form fields, and updates to channel type enums in the database schema and migrations. This enables users to configure and send notifications via Mattermost webhooks.
2025-10-21 14:33:22 +03:00
Hosteroid
ec0b5c61ea Switch channel actions to POST forms and add group_id handling
Replaced channel toggle and delete links with POST forms including CSRF protection for better security. Added a hidden group_id input to the channel creation form and improved JavaScript to reliably obtain group_id from the form or URL. Also added support for 'webhook' channel type in the testChannel function.
2025-10-21 13:53:10 +03:00
Hosteroid
21eeda7127 Add webhook channel type to notification channels
Introduces 'webhook' as a new channel_type option in the notification_channels table to support custom webhook integrations. Updates migration logic and adds a new migration script for this schema change.
2025-10-21 13:33:01 +03:00
Hosteroid
5e4f9e6704 Replace error_log with logger in TldRegistryService
Updated all error and warning logging in TldRegistryService to use the injected logger instead of error_log. This improves consistency and allows for better log management and integration with application logging systems.
2025-10-21 10:36:41 +03:00
Hosteroid
db01becc17 Update TldRegistryService.php 2025-10-21 10:32:16 +03:00
Hosteroid
0dc8abb76f Add status parameter to import completion on failure
Updates calls to importLogModel->completeImport in exception handlers to include a 'failed' status parameter, ensuring clearer logging of failed import operations.
2025-10-21 10:19:42 +03:00
Hosteroid
6d67e828ab Remove Brotli support detection from TldRegistryService
Eliminated Brotli compression support checks and related logging from TldRegistryService. All HTTP clients now explicitly use gzip and deflate encodings only, with cURL options set to disable automatic content decoding and restrict accepted encodings. This simplifies the code and avoids Brotli-related compatibility issues.
2025-10-21 10:00:26 +03:00
Hosteroid
d7aff00e5a Improve cURL brotli support detection logic
Enhanced the brotli support check by adding multiple detection methods: encoding field, features bitmask, and minimum version check. The detection results now include detailed checks and a final decision, improving reliability and logging for brotli support detection.
2025-10-20 23:59:49 +03:00
Hosteroid
0a296dd6b3 Add Brotli detection and HTTP request logging
Enhanced Brotli support detection with detailed logging of detection results. Added logHttpRequest method to log HTTP request and response details for debugging, and integrated it into all HTTP client instantiations using the on_stats callback. Improved client creation logging and refactored Accept-Encoding header handling for clarity.
2025-10-20 23:44:00 +03:00
Hosteroid
ccd1f0c87a Add Brotli support detection to TldRegistryService
Introduces a static method to check for Brotli compression support and conditionally includes 'br' in the Accept-Encoding header for HTTP requests. Also removes old incremental migration files from the installer controller.
2025-10-20 23:30:17 +03:00
Hosteroid
cebb9510ec Update InstallerController.php 2025-10-20 22:51:37 +03:00
Hosteroid
7ebc67910f Improve installer logic and add structured logging
Refactored InstallerController to use a Logger for structured install/update logs and improved migration detection logic to avoid partial table creation on fresh installs. Enhanced migration execution robustness, clarified handling of consolidated schema, and improved error handling and admin notification. Moved user_notifications table creation in the initial schema to follow domains table for correct foreign key references.
2025-10-20 22:49:08 +03:00
Hosteroid
3178cd700a Update InstallerController.php 2025-10-20 22:27:30 +03:00
Hosteroid
3d0d691032 Update InstallerController.php 2025-10-20 22:22:45 +03:00
Hosteroid
1dd40a357a Update InstallerController.php 2025-10-20 22:16:12 +03:00
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