-
Notifications
You must be signed in to change notification settings - Fork 1
feat: implement sentinel agent mode #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sxwebdev
wants to merge
67
commits into
master
Choose a base branch
from
#24-implement-agent
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…to a single Storage struct - Deleted the SQLiteStorage implementation and moved its functionality into a new Storage struct. - Updated the storage interface to reflect the new structure. - Adjusted service management methods to work with the new Storage struct. - Implemented service state management and incident handling directly within the Storage struct. - Updated database connection handling and migration logic. - Modified web handlers to accommodate changes in storage type.
…iles and configurations
…ories, rewrited services and added agents repo
…nd duration handling
- Updated agent repository to replace dbutils with storecmn for JSONField, Duration, and pagination handling. - Renamed and modified agent columns in constants and SQL migrations to reflect new structure (status, is_enabled, tags, config). - Implemented custom queries for agents and services, enhancing the Find and Update functionalities. - Removed dbutils package and migrated relevant functionality to storecmn. - Added new service methods for agent creation, deletion, and retrieval. - Updated API handlers to reflect changes in response types and pagination.
… streamline queries - Removed `GetAll` method from `repo_agents` and `repo_incidents` to simplify data retrieval. - Updated `Create` method in `repo_agents` to exclude unnecessary fields. - Added `StatsByServiceID` method in `repo_incidents` for incident statistics retrieval. - Introduced `GetByServiceID` method in `repo_service_states` for fetching service state by ID. - Enhanced `Update` method in `repo_service_states` to support field masking for updates. - Updated service statistics calculation logic to improve accuracy. - Adjusted data types in DTOs for consistency and accuracy. - Generated new TypeScript models for frontend integration.
- Updated incident creation to remove unnecessary parameters and simplify the SQL query. - Changed incident duration and service state response time from nanoseconds to milliseconds and renamed the corresponding columns. - Added new methods to retrieve unresolved incidents and resolve incidents by ID. - Enhanced service methods to include fetching all tags and their counts. - Updated API endpoints to reflect changes in the incident and service state models. - Generated new TypeScript API definitions for dashboard, incidents, services, and statistics.
- Implemented GetAllEnabled method in the Service struct to retrieve all enabled services. - Refactored Stats method in the Service struct to calculate uptime percentage using incidents statistics. - Added Stats method in the ServiceState struct to aggregate statistics about service states. - Introduced new SQL queries for fetching incident and service state statistics. - Updated the DashboardStats struct to include new statistics fields. - Enhanced the getDashboardStats method to calculate average uptime and other metrics. - Created custom repository methods for incidents to support advanced querying and statistics retrieval. - Updated relevant handlers and DTOs to accommodate new statistics and service fetching capabilities.
- Removed the old storage package and replaced it with a new store package. - Updated service protocol types from storage.ServiceProtocolType to models.ServiceProtocolType. - Changed the retries field type from int to int64 in various structs and database models. - Refactored the TestSuite and MonitorService to use the new store package. - Implemented incident statistics retrieval by date range in the incidents service. - Updated web handlers and responses to reflect changes in the storage and service models. - Removed unused storage error handling and incident management code.
…amline service handling
…istory models and repositories
- Added SQL queries for creating, updating, deleting, and retrieving notification providers. - Introduced new API endpoints for managing notification providers, including creation, update, deletion, and testing. - Implemented notification provider types and validation logic for configurations. - Enhanced notification history management with unsent notifications retrieval and status updates. - Integrated Shoutrrr as a notification provider type with appropriate configuration handling. - Added utility functions for duration formatting and loop management for background tasks. - Updated frontend types and API generation for notifications.
This was
linked to
issues
Sep 22, 2025
Closed
…cidents and improve duration formatting
… across components
This was
unlinked from
issues
Sep 22, 2025
Closed
… and improve agent creation response definitions
- Introduced a new client structure for handling connections to the hub server. - Replaced the previous hubclient implementation with a new client that manages state changes and service subscriptions. - Updated the agent model to replace `LastOnlineAt` with `LastConnectedAt` for better clarity. - Enhanced connection state management using atomic operations for thread safety. - Improved error handling in service retrieval methods across various services. - Updated SQL migrations and queries to reflect the change from `last_online_at` to `last_connected_at`. - Refactored interceptor logic to inject authorization headers for outgoing requests. - Added context handling in the server's authorization middleware. - Adjusted the web DTOs to align with the updated agent model.
…rations and scripts
… and system services - Introduced common.proto for pagination and sorting parameters. - Created hub.proto defining HubService with methods for authentication, service management, and health checks. - Added notifications.proto for NotificationService managing providers and history. - Implemented projects.proto for ProjectsService handling project management. - Defined service.proto for SystemService providing system information and initialization. chore: Initialize SQL migrations for services, agents, and notifications - Created initial SQL migration scripts for services, service states, incidents, agents, and notification providers. - Established necessary tables and indexes for efficient data retrieval and management. refactor: Add SQL queries for various entities - Implemented SQL queries for agents, alerts, incidents, maintenance windows, monitors, projects, resources, and users. - Enhanced data manipulation capabilities with create, delete, and retrieval operations.
…stem service checks
…in ProjectsServer
- Introduced the Authenticate RPC in AuthService with corresponding request and response messages. - Updated AuthServiceClient and authServiceClient to include Authenticate method. - Added UnimplementedAuthServiceHandler for Authenticate. - Updated routing in NewAuthServiceHandler to handle Authenticate requests. feat(users): create User protobuf definition and conversion methods - Added users.proto defining the User message structure. - Implemented conversion functions to transform between models.User and usersv1.User. - Created ptconverts package for user conversion logic. fix(users): enhance error handling in user retrieval methods - Improved GetByID and GetByEmail methods in the users service to handle empty IDs and emails. - Added error handling for not found cases when retrieving users from the store. chore(proto): update auth.proto to include user information in responses - Modified AuthorizationResponse to include user details. - Added AuthenticateRequest and AuthenticateResponse messages to auth.proto.
…g state feat: update login page to use new auth context and navigate on successful login feat: restructure route tree to include public routes and update route imports refactor: change auth hooks to use context for better state management feat: add protected wrapper for authenticated routes with project creation fallback feat: enhance sidebar user navigation with user info and logout functionality feat: implement project switcher with dialog for adding new projects style: update sidebar styles for improved UI consistency feat: add logo and logoSmall components for branding feat: create auth context for managing authentication state and session feat: create project store for managing project data and interactions
feat: enhance UpdateBanner component with SidebarMenu integration feat: redesign Agents page layout using Card components and improve readability fix: adjust logo size in ProjectCreate component fix: update login page to use new auth store and adjust logo size feat: add initsystem route and implement system initialization logic feat: create system store for managing system initialization state feat: implement InitSystemPage for user input during system initialization feat: add initsystem route handling in router configuration
…or theme handling in components
- Refactored the project store to simplify state management and improve readability. - Added BadgerDB as a new key-value store option, including methods for Get, Set, Delete, and JSON handling. - Enhanced error handling in various services to include project and user not found errors. - Introduced agent kind validation and updated related models and database interactions. - Updated CORS settings to include project ID in headers for better API integration. - Improved session management by streamlining device ID handling in the authentication process. - Adjusted token expiration settings for better security practices.
- Bump connectrpc.com/connect from v1.18.1 to v1.19.1 - Update github.com/dgraph-io/ristretto/v2 from v2.2.0 to v2.3.0 - Upgrade github.com/dop251/goja to v0.0.0-20251008123653 - Change github.com/go-playground/validator/v10 from v10.27.0 to v10.28.0 - Update github.com/google/flatbuffers from v25.2.10 to v25.9.23 - Bump github.com/google/pprof to v0.0.0-20251007162407 - Upgrade github.com/lufia/plan9stats to v0.0.0-20251013123823 - Change github.com/ncruces/go-strftime from v0.1.9 to v1.0.0 - Upgrade github.com/nicholas-fedor/shoutrrr from v0.9.1 to v0.10.1 - Bump github.com/onsi/ginkgo/v2 from v2.25.3 to v2.26.0 - Update github.com/prometheus/common from v0.66.1 to v0.67.1 - Upgrade golang.org/x/crypto from v0.42.0 to v0.43.0 - Change golang.org/x/net from v0.44.0 to v0.46.0 - Bump google.golang.org/grpc from v1.75.1 to v1.76.0 - Upgrade modernc.org/cc/v4 from v4.26.4 to v4.26.5 - Update modernc.org/fileutil from v1.3.28 to v1.3.40 - Change modernc.org/sqlite from v1.39.0 to v1.39.1
- Updated the notification providers and agents to include project ID in various methods and queries. - Modified the dispatcher to handle events with project context. - Enhanced the Makefile to include a new target for running the air tool. - Added a temporary directory to .gitignore for air tool usage. - Implemented project-specific filtering in notification and resource queries. - Removed unused CORS utility file. - Updated frontend project store to reload on project selection. - Adjusted SQL migration scripts to enforce project ID constraints.
…m handling and delete functionality
- Updated the Authenticate method to include ProjectID in fingerprint checks. - Modified AgentKindType to include an external agent type. - Changed SystemInfo field type in the Agent model for better structure. - Implemented scanning and value conversion for SystemInfo in the database. - Refactored agent conversion functions to accommodate new agent kind and system info handling. - Added GetByIDAndProjectID method to retrieve agents based on ID and ProjectID. - Enhanced Create method to automatically create a hub agent upon project creation. - Updated Delete method to prevent deletion of hub agents and ensure project context. - Adjusted SQL queries and migrations to support project-specific agent operations. - Updated protobuf definitions to include new agent kind and location fields.
- Implemented protobuf definitions for resource management in service.proto. - Added Resource, Payload, and ResourceKind message types. - Created ResourcesService with methods for listing, getting, creating, updating, and deleting resources. - Developed models for ResourceKindType and ResourcePayload in resources.go. - Implemented scanning and value conversion for Tags in tags.go. - Added conversion functions between models and protobuf representations in ptconverts/resources.go. - Introduced utility functions for converting between proto messages and specific types in ptconverts/utils.go.
…AC) system - Added LICENSE and README.md files for project documentation and licensing. - Introduced PolicyBuilder for declarative policy creation with fluent API. - Implemented context helpers for role extraction and management. - Created an interceptor for connect-go services to enforce RBAC policies. - Developed a thread-safe Provider for atomic policy updates without service restarts. - Added support for super-roles that bypass all authorization rules. - Included examples and tests for policy evaluation and role extraction. - Enhanced documentation with usage examples and best practices.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.