Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
9de0a70
#24 implement agent
sxwebdev Sep 17, 2025
7719991
Refactor storage implementation: Remove SQLiteStorage, consolidate in…
sxwebdev Sep 17, 2025
c074a62
feat: Implement getFingerprint method to generate and save agent fing…
sxwebdev Sep 18, 2025
49379f4
refactor: Consolidate agent and hub commands, remove agent-specific f…
sxwebdev Sep 18, 2025
9ad0bb9
feat: added migrations library, use sqlc and pgxgen, generate reposit…
sxwebdev Sep 18, 2025
ff6fcef
feat: enhance service creation and update parameters with JSONField a…
sxwebdev Sep 19, 2025
818c20d
Refactor agent and service repositories to use new storecmn package
sxwebdev Sep 19, 2025
2bfac1f
feat: add validation to CreateParams and UpdateParams for agents and …
sxwebdev Sep 19, 2025
ddaf836
Refactor agent and incident repositories to remove unused methods and…
sxwebdev Sep 19, 2025
d06e84d
Refactor incident and service state handling
sxwebdev Sep 19, 2025
6291fd2
feat: Add service statistics and enable fetching of all enabled services
sxwebdev Sep 19, 2025
f8b77ed
Refactor storage layer and update service protocols
sxwebdev Sep 19, 2025
44720da
refactor: Simplify MonitorService initialization by removing unused p…
sxwebdev Sep 19, 2025
99670d4
refactor: Remove MonitorService and update related components to stre…
sxwebdev Sep 19, 2025
a91bfad
refactor: Enhance migration handling and streamline database initiali…
sxwebdev Sep 21, 2025
20d9fc1
feat: Add incident states, notification providers, and notification h…
sxwebdev Sep 22, 2025
a7b5379
feat: Implement notification providers management
sxwebdev Sep 22, 2025
e5e769f
feat: Enhance notification sending logic to skip previously failed in…
sxwebdev Sep 22, 2025
784f8a3
refactor: Update incident types to use ModelsIncident for consistency…
sxwebdev Sep 22, 2025
2787d12
feat: Add notification history endpoint with filtering and pagination…
sxwebdev Sep 22, 2025
68055c4
refactor: Simplify logging message for unsent notifications in sender
sxwebdev Sep 22, 2025
1e598d8
feat: Implement multi-server support with TCP, gRPC, and HTTP options
sxwebdev Sep 23, 2025
d9991ad
refactor: Consolidate server initialization and improve monitor creat…
sxwebdev Sep 23, 2025
0b52018
refactor: Remove unused gRPC and TCP server implementations
sxwebdev Sep 23, 2025
b18a406
feat: Implement service monitoring with checker and job management
sxwebdev Sep 23, 2025
5c8e737
fix: Update Shoutrrr import path to the correct repository
sxwebdev Sep 23, 2025
c4b1b01
refactor: Remove timeout configurations from HTTP monitoring and rela…
sxwebdev Sep 23, 2025
513536d
Refactor migration system to support hooks and improve database inter…
sxwebdev Sep 23, 2025
2d72194
feat: Add agent management endpoints and models
sxwebdev Sep 23, 2025
857574f
refactor: Remove CASCADE option from drop table statements in migration
sxwebdev Sep 23, 2025
8f9e247
feat: add protobuf definitions for service status and protocol
sxwebdev Sep 23, 2025
5ee42b2
feat: add GetAllEnabledWithoutAgents method to retrieve services not …
sxwebdev Sep 23, 2025
876b53d
feat: implement agent authentication and token management with Argon2…
sxwebdev Sep 24, 2025
6de9f9a
feat: enhance agent authentication and system info reporting with fin…
sxwebdev Sep 24, 2025
650924b
feat: add service status and configuration proto definitions
sxwebdev Sep 24, 2025
9003294
feat: enhance agent initialization and connection management with err…
sxwebdev Sep 24, 2025
3dd3bab
chore: update indirect dependencies to latest versions in go.mod and …
sxwebdev Sep 24, 2025
fed7267
feat: refactor data directory handling for agent and hub, update conf…
sxwebdev Sep 24, 2025
2f3f127
feat: update database migration paths, enhance system info structure,…
sxwebdev Sep 26, 2025
b03595d
feat: implement agent health check with Ping RPC and enhance connecti…
sxwebdev Sep 30, 2025
dd25b53
Refactor agent connection management and update agent model
sxwebdev Sep 30, 2025
0d1bd21
feat: update command structure to use 'hub start' for various configu…
sxwebdev Sep 30, 2025
6e88982
draft: added settings ui and connect query
sxwebdev Oct 4, 2025
ac8ff3c
feat: added connect query subscribe hook
sxwebdev Oct 4, 2025
46dfe97
feat: Add proto definitions for common, hub, notifications, projects,…
sxwebdev Oct 5, 2025
cb6331f
feat: Update gRPC UI port, enhance project creation logic, and add sy…
sxwebdev Oct 5, 2025
38f7d73
feat: Implement ProjectGet, ProjectUpdate, and ProjectDelete methods …
sxwebdev Oct 5, 2025
6ce46c9
feat(auth): add Authenticate RPC and update AuthServiceClient
sxwebdev Oct 5, 2025
5be4d68
feat: implement project creation page with form validation and loadin…
sxwebdev Oct 6, 2025
87d9ad2
feat: refactor project store name and update sidebar components
sxwebdev Oct 6, 2025
f46f39a
feat: implement user preference store for theme management and refact…
sxwebdev Oct 6, 2025
58299ea
feat: replace vite logo with custom logo.svg and update favicon refer…
sxwebdev Oct 6, 2025
2bf7754
feat: enhance error handling with ErrorBoundary and AppError components
sxwebdev Oct 6, 2025
0a77e8c
feat: add logging for refresh token errors in auth store
sxwebdev Oct 6, 2025
67bc6aa
feat: Refactor project store and add BadgerDB support
sxwebdev Oct 6, 2025
e9a6e4b
feat: update badgerDB path and adjust token refresh interval to 5 min…
sxwebdev Oct 6, 2025
f55a6bc
feat: migrate from react-hook-form to @tanstack/react-form and update…
sxwebdev Oct 15, 2025
6903d2e
Update dependencies in go.sum to latest versions
sxwebdev Oct 15, 2025
cb1f8bb
feat: remove deprecated .swaggo file and its JSONField replacement
sxwebdev Oct 15, 2025
6752e13
feat: enhance login form accessibility and update UI elements
sxwebdev Oct 16, 2025
d95e61a
feat: update layout structure and enhance CSS styles for better isola…
sxwebdev Oct 16, 2025
04934f1
feat: add project ID handling to notifications and agents
sxwebdev Oct 16, 2025
552460b
feat: enhance UI components with improved styling and accessibility
sxwebdev Oct 16, 2025
7e84bd3
feat: implement general settings page for project management with for…
sxwebdev Oct 16, 2025
6c8f75e
feat: Enhance agent management with project-specific handling
sxwebdev Oct 16, 2025
0f27a76
feat: add resource management service with CRUD operations
sxwebdev Oct 16, 2025
c56c2ce
feat(rbacconnect): Implement a flexible Role-Based Access Control (RB…
sxwebdev Oct 17, 2025
a8177de
refactor: simplify configuration loading by removing unused environme…
sxwebdev Nov 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions .air.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Working directory
root = "."
tmp_dir = ".tmp"

[build]
# Just plain old shell command. You could use `make` as well.
cmd = "make build"
# Binary file yields from `cmd`.
full_bin = "build/sentinel hub start -c ./config.yaml"
# This log file places in your tmp_dir.
log = "air_errors.log"
# Watch these filename extensions.
include_ext = ["go"]
# Ignore these filename extensions or directories.
exclude_dir = [".tmp", "sql", "frontend", "data", "schema", "scripts"]
# It's not necessary to trigger build each time file changes if it's too frequent.
delay = 1000 # ms
send_interrupt = true
kill_delay = 500000000

[log]
time = true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ go.work.sum
# .vscode/

data
data-agent
build
config.yaml
config-agent.yaml
dist
.tmp
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ COPY frontend/ ./
RUN pnpm run build

# Backend build stage
FROM golang:1.25.0-alpine AS backend-builder
FROM golang:1.25.1-alpine AS backend-builder

# Define build arguments for version, commit, and date.
ARG VERSION="unknown"
Expand Down Expand Up @@ -54,4 +54,4 @@ WORKDIR /root/
COPY --from=backend-builder /app/bin/sentinel .

# Run the binary
CMD ["./sentinel", "start"]
ENTRYPOINT ["./sentinel"]
70 changes: 52 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

# Variables
BINARY_NAME=sentinel
MAIN_PATH=./cmd/sentinel
SENTINEL_PATH=./cmd/sentinel
BUILD_DIR=./build
VERSION?=dev
LDFLAGS=-ldflags="-w -s -X main.version=${VERSION}"
MIGRATIONS_DIR = ./sql/migrations/

# Default target
help: ## Show this help message
Expand All @@ -17,36 +18,44 @@ help: ## Show this help message
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)

# Development
dev: ## Run in development mode with auto-reload
go run $(MAIN_PATH) start
hub: ## Run in development mode with auto-reload
go run $(SENTINEL_PATH) hub start -c ./config.yaml

agent: ## Run in development mode with auto-reload
go run $(SENTINEL_PATH) agent start -c ./config-agent.yaml

migrateup:
go run $(SENTINEL_PATH) migrations up -db-path ./data/hub/sqlite/db.sqlite

migratedown:
go run $(SENTINEL_PATH) migrations down -db-path ./data/hub/sqlite/db.sqlite

air:
air -c .air.toml

run: build ## Build and run the application
./$(BUILD_DIR)/$(BINARY_NAME)

runtcpserver:
go run ./cmd/tcpserver

rungrpcserver:
go run ./cmd/grpcserver
runtestservers:
go run ./cmd/testserver -http -grpc -tcp

front:
cd frontend && pnpm dev

# Build targets
build: deps ## Build the application
@mkdir -p $(BUILD_DIR)
go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME) $(MAIN_PATH)
build:
go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME) $(SENTINEL_PATH)


build-linux: deps ## Build for Linux
@mkdir -p $(BUILD_DIR)
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux $(MAIN_PATH)
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux $(SENTINEL_PATH)

build-all: deps ## Build for all platforms
@mkdir -p $(BUILD_DIR)
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 $(MAIN_PATH)
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-amd64 $(MAIN_PATH)
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.exe $(MAIN_PATH)
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 $(SENTINEL_PATH)
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-amd64 $(SENTINEL_PATH)
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.exe $(SENTINEL_PATH)

# Dependencies
deps: ## Download dependencies
Expand Down Expand Up @@ -115,9 +124,11 @@ clean: ## Clean build artifacts
rm -f coverage.out coverage.html
docker-compose down --volumes --remove-orphans || true

# Database
init-db: ## Initialize database directory
mkdir -p data
# db-create-migration:
# migrate create -ext sql -format unix -dir "$(MIGRATIONS_DIR)" $(filter-out $@,$(MAKECMDGOALS))

db-create-migration:
go run ./cmd/sentinel migrations create -p ./sql/migrations -name $(filter-out $@,$(MAKECMDGOALS))

# Configuration
init-config: ## Copy example configuration
Expand All @@ -133,3 +144,26 @@ genswagger:
rm -rf ./docs/*
swag fmt -d ./internal/web
swag init -o docs/docsv1 --dir ./internal/web -g handlers.go --parseDependency

genenvs:
go run ./cmd/sentinel config genenvs

gensql:
pgxgen crud
pgxgen sqlc generate

genproto: ## Generate protobuf code
buf lint
rm -rf ./internal/hub/hubserver/api/*
rm -rf frontend/src/api/gen/*
buf generate
rm -rf frontend/src/api/gen/sentinel/hub

grpcui-hub:
grpcui --plaintext localhost:8080

grpcui-server:
grpcui --plaintext localhost:8080

%:
@:
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ monitoring:
default_timeout: 10s
default_retries: 5

database:
path: "./data/db.sqlite"

notifications:
enabled: true
urls:
Expand Down Expand Up @@ -218,7 +215,7 @@ The gRPC monitor supports three types of checks:

## Notification Setup

Sentinel uses [Shoutrrr](https://github.com/containrrr/shoutrrr) for notifications, which supports multiple providers
Sentinel uses [Shoutrrr](https://github.com/nicholas-fedor/shoutrrr) for notifications, which supports multiple providers

You can configure multiple notification providers simultaneously. If one provider fails, notifications will still be sent to the others:

Expand Down
19 changes: 19 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: v2
managed:
enabled: true
override:
- file_option: go_package_prefix
value: github.com/sxwebdev/sentinel/internal/hub/hubserver/api
plugins:
- remote: buf.build/protocolbuffers/go:v1.36.9
out: internal/hub/hubserver/api
opt: paths=source_relative
- remote: buf.build/connectrpc/go:v1.18.1
out: internal/hub/hubserver/api
opt: paths=source_relative
- remote: buf.build/bufbuild/es:v2.9.0
out: frontend/src/api/gen
opt: target=ts
- remote: buf.build/connectrpc/query-es:v2.2.0
out: frontend/src/api/gen
opt: target=ts
20 changes: 20 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: v2
modules:
- path: schema
lint:
use:
- COMMENT_SERVICE
- STANDARD
except:
- FIELD_NOT_REQUIRED
- PACKAGE_NO_IMPORT_CYCLE
disallow_comment_ignores: true
rpc_allow_google_protobuf_empty_requests: true
rpc_allow_google_protobuf_empty_responses: true

breaking:
use:
- FILE
except:
- EXTENSION_NO_DELETE
- FIELD_SAME_DEFAULT
96 changes: 0 additions & 96 deletions cmd/grpcserver/main.go

This file was deleted.

Loading
Loading