Commit Graph
100 Commits
Author SHA1 Message Date
nutcas3 e6450f15ad feat: Add comprehensive database schema migrations for all platform tables
- Add subscribers table with IMSI, MSISDN, authentication keys, and eSIM profile fields
- Add service_plans table for data/voice/SMS limits and QoS parameters (ARPA, AMBR)
- Add sessions table for tracking PDU sessions with QoS and usage metrics
- Add usage_records table for billing and charging data
- Add users table with role-based access control fields
- Add roles, permissions, and role_permissions junction table for RBAC
- Add auth
2026-04-29 03:25:28 +03:00
nutcas3 28422fafc1 fix: Standardize migrations directory path and add explicit working-directory in CI workflow
- Change migrations path from './migrations' to 'migrations' in all test jobs
- Add explicit working-directory: . to migration steps for clarity
- Apply changes to api-server-test, charging-engine-test, and packet-gateway-test jobs
2026-04-29 03:18:11 +03:00
nutcas3 96eacf8e77 fix: Add goose to PATH and correct migrations directory path in CI workflow
- Add explicit PATH configuration step to ensure goose binary is accessible after installation
- Fix migrations directory path from 'migrations' to './migrations' in all test jobs
- Apply changes to api-server-test, charging-engine-test, and packet-gateway-test jobs
2026-04-29 03:11:46 +03:00
nutcas3 62ab577e82 Merge branch 'main' of https://github.com/nutcas3/telecom-platform into ci-&migrations 2026-04-29 03:04:59 +03:00
nutcas3 9c445aa894 Merge branch 'main' of https://github.com/nutcas3/telecom-platform into ci-&migrations 2026-04-29 03:03:23 +03:00
nutcas3 69241334aa feat: Add automatic Goose migration execution on startup in charging-engine RatingPlansRepo
- Add std::process::Command import for running external commands
- Implement run_migrations function to execute goose postgres migrations
- Call run_migrations in RatingPlansRepo::connect before returning repository instance
- Update function comments to reflect automatic migration execution on startup
- Add error handling and output capture for migration failures
- Add tracing log for successful migration
2026-04-29 03:00:28 +03:00
nutcas3 85012f380f feat: Add PostgreSQL service and database migrations to Rust component test jobs in CI workflow
- Upgrade PostgreSQL service from version 15 to 18 in api-server-test job
- Add PostgreSQL 18 service configuration to charging-engine-test and packet-gateway-test jobs
- Configure database health checks with pg_isready command for all Postgres services
- Add goose installation step to charging-engine-test and packet-gateway-test jobs
- Add database migration execution step before running tests in Rust components
2026-04-29 02:58:48 +03:00
nutcas3 0a02fe4e03 feat: Replace custom migration runner with goose CLI and add migration management commands to Makefile
- Replace custom Go migration runner (go run cmd/migrate/main.go) with goose postgres command in db-migrate target
- Add db-migrate-down target for rolling back migrations
- Add db-migrate-status target to show current migration status
- Add db-create-migration target for creating new migration files with NAME parameter validation
- Add db-migrate-rust target for Rust service migrations (uses same
2026-04-29 02:57:50 +03:00
nutcas3 76d7661443 feat: Add automatic Goose migration execution on startup in carrier-connector PostgresProfileStore
- Add os/exec import for running external commands
- Implement runMigrations function to execute goose postgres migrations
- Call runMigrations in NewPostgresProfileStore before returning store instance
- Update function comment to reflect automatic migration execution on startup
- Add error handling and output capture for migration failures
2026-04-29 02:57:41 +03:00
nutcas3 a8381e6b8f refactor: Remove inline schema creation from PostgresProfileStore in favor of centralized migration system
- Remove AutoMigrate call for profileRow from NewPostgresProfileStore
- Update function comment to reference migration system (make db-migrate) instead of inline schema creation
- Add note that esim_profiles table is created by migration system
- Remove error handling for AutoMigrate execution
2026-04-29 02:55:13 +03:00
nutcas3 85b97c0950 deps: Update lib/pq from v1.10.2 to v1.12.3 in api-server 2026-04-29 02:55:05 +03:00
nutcas3 601c34654e feat: Add goose database migrations for rating_plans and esim_profiles tables
- Create 00001_init_rating_plans.sql migration with rating_plans table schema
- Add plan_id, name, rate fields (data/voice/sms), monthly_fee, and limit fields (data/voice/sms)
- Include is_active flag and timestamp fields (created_at, updated_at)
- Add indexes on is_active and created_at columns
- Create 00002_init_esim_profiles.sql migration with esim_profiles table schema
- Add iccid (primary key), eid, imsi, mcc, mnc, profile_
2026-04-29 02:54:52 +03:00
nutcas3 eb5b9092c9 refactor: Remove inline schema creation from RatingPlansRepo in favor of centralized migration system
- Remove CREATE TABLE IF NOT EXISTS query for rating_plans table from connect() method
- Update comment to reference migration system (make db-migrate) instead of inline schema creation
- Add note that rating_plans table is created by 000001_init_rating_plans.up.sql migration
- Remove sqlx::query execution and error mapping for schema creation
- Keep database connection pool and circuit breaker initialization
2026-04-29 02:54:41 +03:00
nutcas3 87dd487d48 refactor: Replace custom migration runner with goose CLI tool in CI and deployment workflows
- Install goose CLI tool using go install in CI and deploy workflows
- Replace custom migration command (go run cmd/migrate/main.go --action=up) with goose postgres command
- Remove working-directory specification from CI migration step
- Update commented kubectl exec commands in deploy workflow to use goose instead of custom runner
- Simplify migration execution by using standardized goose tool across all environments
2026-04-29 02:54:08 +03:00
nutcas3 6fd5d89671 feat: Add database migration steps to CI and deployment workflows
- Add migration execution step in CI workflow before linter runs
- Configure DATABASE_URL environment variable for test database connection
- Add placeholder migration steps in deploy workflow for staging and production environments
- Include commented kubectl exec commands for future implementation in Kubernetes deployments
2026-04-29 02:52:51 +03:00
nutcas3 3cfd5d672c refactor: Enhance all Dockerfiles with security hardening, optimization, and production best practices
- Add maintainer and description labels to all build and runtime stages
- Change builder WORKDIR from /app to /build for clarity
- Install build dependencies with --no-cache/--no-install-recommends flags
- Add build optimizations: -ldflags="-w -s -extldflags '-static'" and -trimpath for Go, strip for Rust
- Implement dependency caching strategy for Rust builds (dummy app pattern)
- Pin Alpine base
2026-04-29 02:45:33 +03:00
nutcas3 095eb0bdf3 refactor: Update Docker build contexts to use root directory with explicit Dockerfile paths in deploy workflow
- Change all docker/build-push-action contexts from ./apps/<component> to root directory (.)
- Add explicit file parameter pointing to ./deployments/docker/<component>.Dockerfile for all components
- Update build configurations for api-server, carrier-connector, charging-engine, packet-gateway, CLI, and web-dashboard
2026-04-29 02:45:07 +03:00
nutcas3 821a3bfb17 refactor: Update Docker build contexts to use root directory with explicit Dockerfile paths in CI workflow
- Change all docker/build-push-action contexts from ./apps/<component> to root directory (.)
- Add explicit file parameter pointing to ./deployments/docker/<component>.Dockerfile for all components
- Update build configurations for api-server, carrier-connector, charging-engine, packet-gateway, CLI, and web-dashboard
2026-04-29 02:44:51 +03:00
nutcas3 5f8da8faef feat: Add Dockerfile for CLI component
- Create multi-stage Dockerfile for CLI application
- Use golang:1.26-alpine as builder image
- Copy go.mod and go.sum for dependency caching
- Build static binary with CGO_ENABLED=0
- Use alpine:latest as runtime image with ca-certificates
- Set /root/ as working directory and ./cli as default command
2026-04-29 02:43:49 +03:00
nutcas3 4e5ad491ef refactor: Remove unused CircuitBreaker and ChargingError imports from charging-engine
- Remove unused CircuitBreaker import from credit_management.rs
- Remove unused ChargingError import from engine.rs
- Keep CircuitBreakerError import in credit_management.rs
- Keep CircuitBreaker import in engine.rs
2026-04-26 02:32:23 +03:00
nutcas3 db4d8bf56a refactor: Re-enable rate limiter with environment variable configuration in charging-engine routes
- Add tower_governor imports (GovernorConfigBuilder and GovernorLayer)
- Remove commented-out rate_limit module import
- Add environment variable parsing for RATE_LIMIT_RPS (default: 10) and RATE_LIMIT_BURST (default: 20)
- Create GovernorConfigBuilder with per_second and burst_size configuration
- Replace commented-out rate_limiter layer with GovernorLayer::new(governor_conf)
2026-04-26 02:32:14 +03:00
nutcas3 2094a3b952 refactor: Simplify rate limiter to use default configuration in charging-engine
- Remove unused imports: governor clock/state/Quota, std::num::NonZeroU32, std::sync::Arc, and SmartIpKeyExtractor
- Change create_rate_limiter return type from explicit generic parameters to simple GovernorLayer
- Replace custom rate limit configuration (RATE_LIMIT_RPS, RATE_LIMIT_BURST environment variables) with GovernorConfig::default()
- Remove quota builder logic and pass config directly to GovernorLayer::new()
2026-04-26 02:31:59 +03:00
nutcas3 186bba04a8 refactor: Remove duplicate imports and comment out rate limiter implementation in charging-engine
- Remove duplicate CreditManager and RatingPlansRepo imports from engine.rs
- Add circuit_breaker module to main.rs imports
- Comment out rate_limit module in lib.rs
- Update rate_limit.rs imports to use GovernorConfig and GovernorLayer directly
- Change GovernorConfigBuilder to GovernorConfig::builder() and update config initialization
- Update GovernorLayer::new() to take config reference
2026-04-26 02:17:26 +03:00
nutcas3 a4aec94314 refactor: Re-enable circuit breaker implementation in charging-engine credit management and rating plans
- Uncomment CircuitBreaker and CircuitBreakerError imports in credit_management.rs and rating_plans_repo.rs
- Re-enable redis_circuit_breaker execute calls for all Redis operations (get_balance, add_credit, deduct_credit, block_user, unblock_user, is_user_blocked, get_subscriber_account, update_subscriber_account, record_usage_event)
- Re-enable postgres circuit_breaker execute calls for all database operations
2026-04-26 02:13:07 +03:00
nutcas3 1d489a0a8a refactor: Make eBPF dependencies optional and add conditional compilation support to packet-gateway
- Add ebpf feature flag to Cargo.toml with default disabled
- Make aya and aya-log dependencies optional and tied to ebpf feature
- Add #[cfg(feature = "ebpf")] conditional compilation directives for EbpfManager imports and usage
- Add feature-gated readiness check logic (ebpf_ok only checked when feature enabled)
- Add feature-gated metrics_handler implementations (full version with eBPF, stub version without)
- Change
2026-04-26 02:00:27 +03:00
nutcas3 95def1bcab refactor: Re-enable circuit breaker implementation and add conditional eBPF compilation support
- Uncomment CircuitBreaker and CircuitBreakerError imports in charging-engine
- Re-enable redis_circuit_breaker and postgres_circuit_breaker fields in ChargingEngine struct
- Add circuit breaker initialization with environment variable configuration (REDIS_FAILURE_THRESHOLD, REDIS_TIMEOUT, POSTGRES_FAILURE_THRESHOLD, POSTGRES_TIMEOUT)
- Add #[cfg(feature = "ebpf")] conditional compilation directives throughout
2026-04-26 01:50:29 +03:00
nutcas3 05f95a5c75 refactor: Update Go build commands to use explicit source paths and improve output formatting
- Change api-server build path from default to ./cmd/ directory
- Change carrier-connector build path from default to current directory
- Change CLI build path from default to current directory
- Update build-go echo color from CYAN to GREEN for consistency
- Remove redundant mkdir -p dist from build-go target
2026-04-26 01:26:05 +03:00
nutcas3 10ac6bb861 refactor: Make eBPF build optional in packet-gateway build script
- Change eBPF build from required to optional with graceful fallback
- Add match statement to handle build success, failure, and missing cargo-build-bpf cases
- Add cargo warnings when eBPF build fails or cargo-build-bpf is not installed
- Remove panic on build failure to allow compilation without eBPF toolchain
2026-04-26 01:24:17 +03:00
nutcas3 3b2edc5ccf ci: Fix Go build paths for carrier-connector and CLI components
- Change carrier-connector build path from ./cmd/ to .
- Change CLI build path from ./cmd/ to .
2026-04-26 01:24:06 +03:00
nutcas3 d5ebb3bfd8 refactor: Comment out circuit breaker implementation and remove thiserror dependency
- Remove thiserror 2.0.18 dependency from Cargo.toml
- Comment out CircuitBreakerError import and all circuit breaker execute calls in credit_management.rs
- Comment out redis_circuit_breaker and postgres_circuit_breaker fields in ChargingEngine struct
- Comment out circuit breaker initialization code in engine.rs
- Comment out circuit_breaker field and initialization in RatingPlansRepo
- Remove circuit breaker
2026-04-26 01:15:58 +03:00
nutcas3 b6bcad067b refactor: Update rate limiter to use StateInformationMiddleware and QuantaClock
- Change create_rate_limiter return type from InMemoryState/DefaultClock to StateInformationMiddleware with QuantaClock
- Add StateInformationMiddleware import from governor::middleware
- Add Arc import from std::sync
- Remove explicit key_extractor field from GovernorLayer initialization
2026-04-26 00:44:00 +03:00
nutcas3 b4b0966937 refactor: Update charging-engine dependencies and fix rate limiter configuration
- Upgrade tower_governor from 0.4.2 to 0.8.0 and add governor 0.10.4 dependency
- Add thiserror 2.0.18 for error handling
- Update dev dependencies: tokio-test to 0.4.5, mockall to 0.14.0, serial_test to 3.4.0
- Add Copy trait to CircuitState enum
- Add Clone derive to CircuitBreaker struct
- Add error trait bounds to CircuitBreakerError generic type
- Update create_rate_limiter return type to use explicit generic parameters
- Fix Go
2026-04-26 00:42:19 +03:00
nutcas3 133523d83b ci: Add Docker build and push steps for carrier-connector, charging-engine, packet-gateway, and CLI components
- Add carrier-connector-meta and carrier-connector build/push steps with ghcr.io image tagging
- Add charging-engine-meta and charging-engine build/push steps with ghcr.io image tagging
- Add packet-gateway-meta and packet-gateway build/push steps with ghcr.io image tagging
- Add cli-meta and CLI build/push steps with ghcr.io image tagging
- Add carrier-image, charging-image, gateway-image,
2026-04-26 00:26:19 +03:00
nutcas3 261d55d831 ci: Add CI workflows for carrier-connector, charging-engine, packet-gateway, and CLI components
- Add carrier-connector-test job with Go 1.23 setup, linting, testing with race detector, and build step
- Add charging-engine-test job with Rust 1.94 setup, cargo caching, release mode testing, and build step
- Add packet-gateway-test job with Rust 1.94 setup, cargo caching, release mode testing, and build step
- Add cli-test job with Go 1.23 setup, linting, testing with race detector, and build step
2026-04-26 00:26:01 +03:00
nutcas3 b734ea7d3a refactor: Add environment variable support to API server configuration and fix build path
- Add getEnv and getEnvInt helper functions for reading environment variables with defaults
- Update all configuration fields to use environment variables (DB_HOST, REDIS_HOST, API_PORT, etc.)
- Change CI build command from ./cmd/server.go to ./cmd/ directory path
2026-04-26 00:15:45 +03:00
nutcas3 302b761916 docs: Add comprehensive CHANGELOG entries for v0.1.0 release features and improvements
- Add Payment System section with PaymentController, Stripe integration, and webhook processing
- Add Carrier Connector section with ES2+ protocol handlers, profile repository, and REST API server
- Add eBPF Packet Gateway section with batch sync, XDP program loading, and Redis synchronization
- Add Rate Limiting section with distributed Redis-based implementation and comprehensive middleware
- Add Authentication & Authorization section with JWT, RBAC, Casbin integration
2026-04-25 23:14:04 +03:00
nutcas3 e92a132b89 refactor: Expand Makefile with comprehensive build, test, deployment, and database management targets
- Add build-cli and build-packet-gateway targets for new components
- Add CLI dependencies to install-deps step
- Add test-rust-release target for release mode testing
- Enhance test-go with verbose output, race detector, and coverage reporting
- Add docker-push target for pushing images to registry
- Add k8s-deploy-helm, k8s-logs, and k8s-status targets for Kubernetes management
- Add PostgreSQL setup
2026-04-25 23:12:56 +03:00
nutcas3 c3f81402a0 docs: Expand CONTRIBUTING.md with comprehensive development guidelines and workflow details
- Add table of contents for easier navigation
- Add Prerequisites section with required tools and versions (Go 1.26+, Rust 1.94+, Node.js 22+, etc.)
- Add detailed Setup section with database setup and build instructions
- Add Project Structure section documenting repository layout
- Expand Development Workflow with linting, formatting, and testing steps
- Add detailed Code Style sections for Go, Rust, and Type
2026-04-25 23:12:40 +03:00
nutcas3 eb4297d679 Merge branch 'main' of https://github.com/nutcas3/telecom-platform into upgraded 2026-04-25 23:09:16 +03:00
nutcas3 3844426a8f docs: Expand README with comprehensive platform overview and architecture details
- Add detailed "What It Does" section explaining platform capabilities for enterprises and operators
- Add Architecture section documenting core network services, supporting services, and developer tools
- Add Key Features section covering sovereignty, security, performance, scalability, and operations
- Expand Technology Stack section with categorized components (languages, databases, infrastructure, monitoring)
2026-04-25 23:06:03 +03:00
nutcas3 0e382a81c9 refactor: Update API server CI test scope and fix rate limit test comment
- Change test command to run only internal/services/ tests with race detector enabled
- Update RateLimit_ErrorHandling test to use high limit instead of invalid value
- Update test comments to reflect new approach of using very high limit to simulate no rate limiting
2026-04-25 22:53:25 +03:00
nutcas3 4edee2c82f test: Fix rate limit header casing and adjust test expectations for Gin behavior
- Change X-RateLimit-* headers to X-Ratelimit-* in test assertions
- Skip IPv6 test case due to Gin's ClientIP() handling limitations
- Update EndpointKeyExtractor test to expect empty FullPath() without route registration
- Fix Reset test mock to use string slice parameter for Del method
2026-04-25 22:14:13 +03:00
nutcas3 7323dffb1e refactor: Remove race detector flag from API server CI test step
- Remove -race flag from go test command in Run tests step
2026-04-25 22:08:16 +03:00
nutcas3 a706081866 refactor: Update web-dashboard CI workflow to use Node.js 24
- Update Node.js version from 22 to 24 in Setup Node.js step
2026-04-25 07:03:28 +03:00
nutcas3 d74ac722c4 test: Add unit tests for service discovery and message queue with integration test skips
- Add discovery_test.go with Service and ServiceDiscovery struct tests
- Add integration test placeholders for service registration, discovery, deregistration, and health checks
- Add mq_test.go with Message serialization and profile event tests
- Add integration test placeholders for RabbitMQ connectivity, queue declaration, and publish/consume flow
- Add github.com/stretchr/testify v1.11.1 to carrier-connector dependencies
2026-04-25 06:59:03 +03:00
nutcas3 28552393bc refactor: Update web-dashboard CI workflow to use Node.js 22 and disable frozen lockfile
- Update Node.js version from 20 to 22 in Setup Node.js step
- Change pnpm install flag from --frozen-lockfile to --no-frozen-lockfile in Install dependencies step
2026-04-25 06:58:24 +03:00
nutcas3 50e807f2da feat: Add Vault integration annotations to Kubernetes secrets and remove hardcoded credentials
- Add vault.hashicorp.com/agent-inject annotations to all Secret resources for Vault integration
- Add vault.hashicorp.com/agent-inject-secret-* annotations with KV paths for database, redis, jwt, encryption, and payment secrets
- Remove all base64-encoded hardcoded credentials from telecom-secrets, postgres-secret, grafana-secret, and influxdb-secret
- Replace secret values with empty strings and comments
2026-04-25 06:55:22 +03:00
nutcas3 f6ec659fe9 refactor: Fix race condition in chaos service and update Redis rate limiter test mocks
- Add copy method to Experiment struct to create deep copy with proper Finished pointer handling
- Return experiment copy from RunExperiment to prevent race condition with JSON marshaling
- Update mock Eval calls to use float64 for window parameter instead of int64 in redis_ratelimit_test.go
- Update comments to reflect correct parameter types: now (int64), window (float64), limit (int64)
2026-04-25 06:54:29 +03:00
nutcas3 0220dc5b52 refactor: Remove pnpm workspace configuration file from web-dashboard
- Remove pnpm-workspace.yaml with ignoredBuiltDependencies for sharp and unrs-resolver
2026-04-25 06:53:39 +03:00
nutcas3 93bf51df65 feat: Add Consul service discovery integration to API server with automatic registration
- Add discovery package import to server.go
- Add fmt and strconv imports for service ID generation and port parsing
- Add CONSUL_ADDR environment variable check to conditionally enable service discovery
- Add discovery.NewServiceDiscovery initialization with error handling and logging
- Add service registration with api-server name, dynamic port from config, and api/telecom tags
- Add serviceID generation using api
2026-04-25 06:51:04 +03:00
nutcas3 6b2a38b51b feat: Add RabbitMQ message queue integration for profile event publishing in carrier-connector
- Add github.com/rabbitmq/amqp091-go v1.11.0 dependency to go.mod
- Add messageQueue parameter to OrderProfileHandlerWithRepo and DeleteProfileHandlerWithRepo
- Add PublishProfileEvent calls for profile.downloaded and profile.deleted events with goroutines
- Add message queue initialization in main.go with RABBITMQ_URL environment variable
- Add profile-events queue declaration with error handling and fallback
- Add messageQueue parameter to setupRoutes
2026-04-25 06:50:13 +03:00
nutcas3 0ea496b627 feat: Add RabbitMQ message queue integration with profile event publishing
- Add mq package with MessageQueue struct containing connection, channel, and url fields
- Add Message struct with Type, Payload, and Timestamp fields
- Add NewMessageQueue constructor with RABBITMQ_URL environment variable and amqp://guest:guest@localhost:5672/ default
- Add Close method to cleanup channel and connection resources
- Add DeclareQueue method with durable queue configuration
- Add Publish method with 5-second context
2026-04-25 06:49:21 +03:00
nutcas3 1fc84859df refactor: Remove structured logging initialization from API server startup
- Remove logging package import from server.go
- Remove logging.InitWithDefaults call and error handling
- Replace logging.Fatalf with log.Fatalf for database initialization errors
2026-04-25 06:37:33 +03:00
nutcas3 1c89fdac92 feat: Add structured logging initialization to API server startup with database error logging
- Add logging package import to server.go
- Add logging.InitWithDefaults call after config loading with error handling
- Replace log.Fatalf with logging.Fatalf for database initialization errors
2026-04-25 06:36:37 +03:00
nutcas3 2a71cba13e feat: Move casbin, gorm-adapter, gorilla/websocket, and validator to direct dependencies
- Move github.com/casbin/casbin/v2 v2.135.0 from indirect to direct dependencies
- Move github.com/casbin/gorm-adapter/v3 v3.41.0 from indirect to direct dependencies
- Move github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 from indirect to direct dependencies
- Move github.com/go-playground/validator/v10 v10.30.2 from indirect to direct dependencies
- Add github.com/dgryski/go-rendezvous v0.0.0-20
2026-04-25 06:36:18 +03:00
nutcas3 47c57c9b48 feat: Add timeout handling to health check execution with goroutine-based result channel
- Add resultChan channel to receive health check results asynchronously
- Execute checker.CheckHealth in goroutine to enable timeout detection
- Add select statement to handle both successful completion and timeout cases
- Return StatusUnhealthy with "Health check timed out" message on context timeout
- Set ResponseTime to 10 seconds when timeout occurs
2026-04-25 06:34:12 +03:00
nutcas3 442e051e8d feat: Remove explicit pnpm version from CI workflow to use version from package.json 2026-04-25 06:32:51 +03:00
nutcas3 6cf546712b refactor: Replace interface{} with any type alias across codebase
- Replace interface{} with any in api_integration_test.go makeRequest method and test response maps
- Replace interface{} with any in logging.go WithField method and all logging function signatures
- Replace interface{} with any in middleware etag.go sync.Map.Range callback
- Replace interface{} with any in middleware redis_ratelimit.go RedisClientInterface and result parsing
- Replace interface{} with any in middleware redis_ratelimit_
2026-04-25 06:31:02 +03:00
nutcas3 cfd5ca63cf feat: Add Kubernetes service manager with deployment operations and pod log streaming
- Add kubernetes package with ServiceManager struct containing clientset and namespace fields
- Add Service struct with Name, Status, Version, Uptime, CPU, Memory, Replicas, and Available fields
- Add NewServiceManager constructor with in-cluster config and kubeconfig fallback
- Add KUBERNETES_NAMESPACE environment variable with telecom-platform-dev default
- Add getInClusterNamespace helper to read namespace from service
2026-04-25 06:29:36 +03:00
nutcas3 57e7d9c258 feat: Add Kubernetes service management integration to CLI with fallback to API client
- Add k8s.io/api, k8s.io/apimachinery, and k8s.io/client-go v0.31.0 dependencies to go.mod
- Add kubernetes.NewServiceManager integration to listServices with fallback to API client
- Add Replicas column to services table showing available/total replicas
- Add kubernetes.GetServiceStatus integration to showServiceStatus with fallback to API client
- Add Replicas field to service status display
- Add kubernetes.RestartDeployment integration to restartService
2026-04-25 06:29:23 +03:00
nutcas3 a54c0951f1 feat: Add packet-gateway Dockerfile with eBPF dependencies and upgrade charging-engine to Rust 1.95
- Update charging-engine.Dockerfile from rust:1.94-slim to rust:1.95-slim
- Add packet-gateway.Dockerfile with rust:1.95-slim builder stage
- Add pkg-config, libssl-dev, clang, llvm, libelf-dev, and libbpf-dev build dependencies for eBPF support
- Add debian:bookworm-slim runtime stage with libssl3 and ca-certificates
- Copy circuit_breaker.rs from charging-engine for shared functionality
- Set RUST_LOG=info environment variable
2026-04-25 06:20:58 +03:00
nutcas3 715417c0eb feat: Add structured logging with logrus and configurable output formats
- Add sirupsen/logrus v1.9.4 dependency to go.mod
- Add logging package with global Logger instance
- Add Config struct with Level, Format, and Output fields
- Add DefaultConfig with LOG_LEVEL, LOG_FORMAT, and LOG_OUTPUT environment variables
- Add Init function with level parsing, JSON/text formatter selection, and stdout/stderr output
- Add InitWithDefaults helper function
- Add WithField, WithFields, and WithError helper
2026-04-25 06:19:48 +03:00
nutcas3 b714fa8382 feat: Add HashiCorp Consul service discovery integration with API client v1.34.2
- Add hashicorp/consul/api v1.34.2 dependency to go.mod
- Add armon/go-metrics v0.4.1 for metrics collection
- Add hashicorp/go-hclog v1.5.0 for structured logging
- Add hashicorp/go-cleanhttp v0.5.2 for HTTP client utilities
- Add hashicorp/go-immutable-radix v1.3.1 for radix tree data structures
- Add hashicorp/go-multierror v1.1.1 for error aggregation
- Add hashicorp/go-rootcerts v1.0.2 for certificate management
2026-04-25 06:19:22 +03:00
nutcas3 76d1f7b1ec feat: Add RabbitMQ message queue integration with exchange and queue management support
- Add rabbitmq/amqp091-go v1.11.0 dependency to go.mod
- Add MessageQueue struct with connection, channel, and url fields
- Add Message struct with Type, Payload, and Timestamp fields
- Add NewMessageQueue constructor with RABBITMQ_URL environment variable support and amqp://guest:guest@localhost:5672/ default
- Add Close method for connection cleanup
- Add DeclareQueue method with durable configuration
- Add Publish method with 5
2026-04-25 06:15:11 +03:00
nutcas3 19a4aaee01 feat: Add user-based rate limiting to protected API routes with 100 requests per minute limit
- Add RateLimitByUser middleware to protected route group with 100 req/min limit
- Add RateLimitByUser middleware to apiProtected route group with 100 req/min limit
2026-04-25 06:12:59 +03:00
nutcas3 653f23ff24 feat: Wrap all Kubernetes API operations with circuit breaker protection and improve error handling
- Add strings import to kubernetes.go
- Wrap ListDeployments with circuitBreaker.Execute and move result building inside closure
- Wrap GetDeployment with circuitBreaker.Execute and move result assignment inside closure
- Wrap ScaleDeployment with circuitBreaker.Execute and simplify error messages
- Wrap RestartDeployment with circuitBreaker.Execute
- Wrap PodLogs with circuitBreaker.Execute and add streaming
2026-04-25 06:12:40 +03:00
nutcas3 12513943cc feat: Add circuit breaker protection to Kubernetes service with configurable thresholds and timeout
- Add circuitbreaker import to kubernetes.go
- Add circuitBreaker field to KubernetesService struct
- Add circuit breaker initialization in NewKubernetesService with Config struct
- Add K8S_CB_FAILURE_THRESHOLD environment variable with 5 default
- Add K8S_CB_SUCCESS_THRESHOLD environment variable with 2 default
- Add K8S_CB_TIMEOUT_SECONDS environment variable with 60 second default
- Add getEnvUint helper
2026-04-25 06:04:15 +03:00
nutcas3 2b23461eef feat: Add circuit breaker pattern implementation to API server with configurable thresholds and timeout
- Add State enum with Closed, Open, and HalfOpen states and String method
- Add CircuitBreaker struct with mutex, state tracking, failure/success counters, and timeout
- Add Config struct with FailureThreshold, SuccessThreshold, and Timeout fields
- Add NewCircuitBreaker constructor with Config parameter
- Add DefaultConfig with 5 failure threshold, 2 success threshold, and 60 second timeout
2026-04-25 06:04:00 +03:00
nutcas3 f5b22063e3 feat: Add configurable authentication enforcement to charging engine with ENFORCE_AUTH environment variable
- Add ENFORCE_AUTH environment variable with true default to auth middleware
- Add early return when ENFORCE_AUTH=false for development/testing bypass
- Replace development comment with UNAUTHORIZED status code when no valid authentication found
- Move authentication bypass logic from end of function to environment-based check at start
2026-04-25 06:02:06 +03:00
nutcas3 0bb8571b02 feat: Add IP-based rate limiting to charging engine with configurable RPS and burst size
- Add rate_limit module to lib.rs exports
- Add create_rate_limiter function with SmartIpKeyExtractor for IP-based limiting
- Add RATE_LIMIT_RPS environment variable with 10 requests/second default
- Add RATE_LIMIT_BURST environment variable with 20 burst size default
- Add RateLimitResponse struct with TOO_MANY_REQUESTS status code
- Add GovernorLayer with per_second quota and burst_size configuration to router
2026-04-25 06:01:42 +03:00
nutcas3 ce560c0dc4 feat: Add rate limiting with tower-governor and update health endpoint path to /v1/health
- Add tower-governor 0.4.2 dependency to Cargo.toml
- Update health check route from /health to /v1/health for API versioning consistency
2026-04-25 05:58:26 +03:00
nutcas3 0e11bf49dc feat: Add service worker with offline support and route caching to web dashboard
- Add offline.html fallback page with gradient background, centered container, and retry button
- Add sw.js service worker with telecom-dashboard-v1 cache for dashboard routes
- Add install event handler caching /, /login, /dashboard, /services, /monitoring, /deploy, /plugins, /automation, /chaos, /billing, and /config routes
- Add fetch event handler with cache-first strategy and offline.html fallback
- Add activate event
2026-04-25 05:58:10 +03:00
nutcas3 131f9a0d69 feat: Enable caching for all GET API endpoints in web dashboard with true flag parameter
- Add cache=true parameter to subscribers.list and subscribers.get endpoints
- Add cache=true parameter to system.stats and system.health endpoints
- Add cache=true parameter to services.list, services.get, services.health, services.podStatus, and services.events endpoints
- Add cache=true parameter to monitoring.metrics, monitoring.alerts, and monitoring.health endpoints
- Add cache=true parameter to deploy
2026-04-25 05:56:05 +03:00
nutcas3 16bf257b90 feat: Add client-side caching layer to web dashboard with configurable TTL and pattern-based invalidation
- Add CACHE_TTL environment variable with 30000ms default to API configuration
- Add DataCache class with Map-based storage, timestamp tracking, and TTL expiration
- Add cache methods for set, get, invalidate, invalidatePattern, clear, and size operations
- Add getCachedData helper function with fetcher callback and TTL override support
- Add apiFetch wrapper with optional cache parameter for GET
2026-04-25 05:55:07 +03:00
nutcas3 1f1fef56db feat: Add start-all and stop-all commands to services with simulation output and table display
- Add "start-all" and "stop-all" cases to services command handler
- Add startAllServices function with table output for service name, status, and message
- Add stopAllServices function with reverse service order for graceful shutdown
- Add service list iteration with status display for api-server, charging-engine, carrier-connector, packet-gateway, and web-dashboard
- Add "start-all" and "stop-all" commands
2026-04-25 05:54:39 +03:00
nutcas3 be6b6856fa feat: Add configurable logging with JSON and pretty format support to packet gateway
- Add LOG_FORMAT environment variable with compact/pretty format options
- Add LOG_JSON environment variable for JSON output toggle
- Add EnvFilter with INFO level default to tracing subscriber
- Enable target display in log output
- Add conditional initialization for JSON, pretty, and compact log formats
- Add startup log message showing active logging configuration
2026-04-25 05:54:13 +03:00
nutcas3 609eba2920 feat: Add comprehensive error handling and logging to eBPF sync operations with EbpfError types
- Replace ? operator with explicit error handling in sync_from_redis for credits and blocked users sync
- Add error logging before returning EbpfError::RedisFetchError in sync operations
- Replace generic map errors with EbpfError::MapNotFound and MapAccessError in trigger_sync
- Add match-based error handling with logging for sync_control map insert operation
- Replace generic map errors with EbpfError::MapNot
2026-04-25 05:53:39 +03:00
nutcas3 bc01fc1885 feat: Add structured error handling to eBPF operations with EbpfError types and error logging
- Add EbpfError import to ebpf.rs module
- Replace generic error messages with EbpfError::LoadError in program load operations
- Replace generic error messages with EbpfError::AttachError in XDP attach operations with interface field
- Replace generic error messages with EbpfError::MapNotFound and MapAccessError in map access operations
- Add error logging with error! macro before returning errors in all
2026-04-25 05:53:23 +03:00
nutcas3 5bb5e37e07 feat: Add eBPF error types with recoverability classification for packet gateway
- Add EbpfError enum with LoadError, AttachError, MapNotFound, MapAccessError, RedisSyncError, RedisFetchError, NotAttached, Timeout, and InvalidData variants
- Add is_recoverable method returning true for MapAccessError, RedisSyncError, RedisFetchError, and Timeout errors
- Add thiserror::Error derive for automatic error trait implementation
- Add interface and map_name fields to AttachError and MapAccessError variants
2026-04-25 05:52:57 +03:00
nutcas3 e121fb4266 feat: Add runtime configuration management API for packet gateway with sync interval and charging engine URL updates
- Add PacketGatewayConfig struct with interface, redis_url, charging_engine_url, sync_interval, and health_port fields
- Add ConfigUpdateRequest struct with optional sync_interval and charging_engine_url fields
- Add ConfigResponse struct with config and status fields
- Add ConfigState wrapper with Arc<RwLock<PacketGatewayConfig>> for thread-safe config access
- Add create_config_
2026-04-25 05:52:35 +03:00
nutcas3 d6035c1848 feat: Wrap Redis and PostgreSQL operations in circuit breakers for fault tolerance
- Add CircuitBreakerError import and error mapping to ChargingError::RedisConnection/DatabaseError
- Add redis_circuit_breaker and postgres_circuit_breaker fields to ChargingEngine struct
- Add circuit_breaker field to RatingPlansRepo struct
- Wrap all Redis operations (get_balance, add_credit, deduct_credit, block_user, unblock_user, is_user_blocked, get_subscriber_account, update_subscriber_account, record_usage
2026-04-25 05:49:43 +03:00
nutcas3 f909952320 feat: Add circuit breaker implementation to charging engine with configurable failure threshold and timeout
- Add CircuitState enum with Closed, Open, and HalfOpen states
- Add CircuitBreakerError enum wrapping Open state and inner errors
- Add CircuitBreaker struct with failure_count, failure_threshold, timeout, and last_failure_time fields
- Add execute method with async operation wrapper and state-based error handling
- Add check_state method with automatic Open to HalfOpen transition after timeout
- Add on_success method
2026-04-25 05:49:09 +03:00
nutcas3 24950f0ffa feat: Add configuration validation with field checks and update placeholder timestamps in billing and deploy commands
- Add nil config check in validateConfig with error return
- Add config.Validate() call to get validation errors
- Replace validation table with field display table showing API endpoint, token (masked), profile, and theme
- Add success message for valid configuration and numbered error list for validation failures
- Return error when validation fails instead of nil
- Update placeholder invoice
2026-04-25 05:48:37 +03:00
nutcas3 164dfdccda feat: Add check-all command to monitoring with multi-service health check and update placeholder log timestamps
- Add "check-all" case to monitoring command handler calling checkAllServices
- Add checkAllServices function with table output for service name, status, endpoint, and message
- Add health status aggregation with success/warning messages for overall system health
- Add "check-all" command to monitoring help table
- Update placeholder log timestamps from 2024-01-15 to 2026-05-30 in monitoring
2026-04-25 05:48:22 +03:00
nutcas3 e63cd95aef feat: Add multi-service health check method to CLI API client
- Add ServiceHealth struct with name, status, endpoint, and message fields
- Add CheckAllServices method to check health of all platform services
- Add service definitions for api-server, charging-engine, carrier-connector, packet-gateway, and web-dashboard
- Add HTTP health check with unreachable/healthy/unhealthy status determination
- Add fmt package import for status code formatting
2026-04-25 05:48:03 +03:00
nutcas3 b6564dcbd1 feat: Add webhook client initialization and integration to carrier connector routes
- Add webhook package import to main.go and routes.go
- Add API_SERVER_WEBHOOK_URL and API_SERVER_WEBHOOK_API_KEY environment variable loading
- Add webhookClient initialization with NewWebhookClient in main function
- Add webhookClient parameter to setupRoutes function signature and comment
- Pass webhookClient to OrderProfileHandlerWithRepo and DeleteProfileHandlerWithRepo routes
2026-04-25 05:47:37 +03:00
nutcas3 2d891cdb2a feat: Add webhook notifications to carrier connector profile operations
- Add webhookClient parameter to OrderProfileHandlerWithRepo and DeleteProfileHandlerWithRepo
- Add SendDownloadFailed webhook notification on profile order failure with error details
- Add SendProfileDownloaded webhook notification on successful profile download with IMSI, profileType, and status
- Add SendProfileDeleted webhook notification on profile deletion with executionStatus and statusMessage
- Add webhook package import
2026-04-25 05:47:14 +03:00
nutcas3 935a753d3c feat: Add validation method to CLI configuration with comprehensive field checks
- Add Validate method to CLIConfig struct returning slice of validation errors
- Add API endpoint validation (required, valid URL format, http/https scheme check)
- Add API token validation (empty warning, minimum 10 character length check)
- Add profile validation against allowed values (default, dev, staging, prod)
- Add theme validation against allowed values (default, light, dark, high-contrast)
- Add imports for sl
2026-04-25 05:43:10 +03:00
nutcas3 b983e226f6 feat: Add webhook client for carrier connector profile event notifications to API server
- Add WebhookClient struct with httpClient (10s timeout), webhookURL, and apiKey fields
- Add WebhookEvent struct with event_type, timestamp, profile_iccid, and data fields
- Add event type constants (profile.downloaded, activated, deactivated, deleted, status_changed, download.failed)
- Add SendNotification method with JSON marshaling, Bearer token auth, and error handling for 4xx/5xx responses
- Add helper
2026-04-25 05:41:18 +03:00
nutcas3 23da0f834f feat: Add thread-safe in-memory cache implementation for carrier connector profile repository
- Add CachedProfileStore wrapper with configurable TTL and automatic cleanup
- Add cacheEntry struct with profile data and expiration timestamp
- Add Get method with cache-first lookup and automatic cache population on miss
- Add cache invalidation on Create, UpdateState, and Delete operations
- Add background cleanup goroutine with ticker running at TTL/2 interval
- Add manual Invalidate and InvalidateAll methods for cache
2026-04-25 05:40:49 +03:00
nutcas3 c43709d40d feat: Add exponential backoff retry logic to ES2 client HTTP requests
- Add maxRetries (3) and retryDelay (1s) fields to ES2Client struct
- Add retryableError helper to identify retryable errors (network errors, 5xx, 429)
- Add executeWithRetry method with exponential backoff and context cancellation support
- Replace direct httpClient.Do calls with executeWithRetry in all ES2 operations
- Update error messages to indicate retry attempts ("after retries")
- Add math package import for exponential backoff calculation
2026-04-25 05:40:34 +03:00
nutcas3 4a670af341 feat: Add caching layer to carrier connector profile repository with 5-minute TTL
- Add CachedProfileStore wrapper around PostgresProfileStore with 5-minute TTL
- Add defer close for underlying postgresRepo to ensure proper cleanup
- Rename profileRepo variable to postgresRepo for clarity before wrapping
- Add caching layer to reduce database load for profile lookups
2026-04-25 05:40:09 +03:00
nutcas3 1887901d3c feat: Add carrier connector HorizontalPodAutoscaler with CPU and memory-based scaling
- Add carrier-connector-hpa HorizontalPodAutoscaler in telecom-platform namespace
- Add scaling configuration targeting carrier-connector Deployment (2-4 replicas)
- Add CPU metric with 70% average utilization threshold
- Add memory metric with 80% average utilization threshold
2026-04-25 05:35:05 +03:00
nutcas3 aa45a143ca feat: Add carrier connector database DSN and monitoring configuration with Alertmanager integration
- Add DATABASE_DSN to telecom-config ConfigMap with postgres connection string for carrier database
- Add telecom-carrier-connector Prometheus scrape job targeting carrier-connector-service:8080 (/metrics, 5s interval)
- Add alertmanager-config ConfigMap in telecom-monitoring namespace with 5m resolve timeout
- Add route configuration with grouping by alertname, severity, service (10s wait/interval, 12h repeat)
- Add default Slack receiver for #telecom-platform-alerts channel
2026-04-25 05:34:55 +03:00
nutcas3 f008e98e92 feat: Add carrier connector Kubernetes deployment and integrate charging engine with packet gateway
- Add CHARGING_ENGINE_URL environment variable to packet-gateway deployment (http://charging-engine-service:3001)
- Add carrier-connector Deployment with 2 replicas, telecom/carrier-connector:latest image
- Add carrier-connector container with port 8080, DATABASE_DSN and ES2_URL from ConfigMap
- Add Prometheus scraping annotations (/metrics on port 8080)
- Add resource limits (256Mi memory, 200m CPU)
2026-04-25 05:34:36 +03:00
nutcas3 8a63cab829 feat: Add Prometheus alert rules with comprehensive monitoring for platform services and infrastructure
- Add telecom_platform_alerts group with 30s evaluation interval
- Add API Server alerts (high error rate >0.1/s, high latency >1s p99, down >2m)
- Add Charging Engine alerts (high error rate, down, high memory >90%)
- Add Carrier Connector alerts (high error rate, down)
- Add Packet Gateway alerts (down, high packet drop rate >100/s)
- Add Web Dashboard down alert (warning severity)
- Add PostgreSQL alerts (down, high connection count >80%,
2026-04-25 05:34:21 +03:00
nutcas3 c3903238dc feat: Add Alertmanager configuration with severity-based routing and multi-channel notifications
- Add global configuration with 5m resolve timeout and Slack webhook URL placeholder
- Add template directory reference for custom alert notification templates
- Add route configuration with grouping by alertname, severity, and service (10s wait/interval, 12h repeat)
- Add severity-based routing (critical, warning, info) with dedicated receivers
- Add default Slack receiver for #telecom-platform-alerts channel
2026-04-25 05:34:01 +03:00
nutcas3 bd3226edf0 feat: Refactor CLI API client by splitting billing, carrier, and charging modules into separate files
- Extract Invoice, Payment, Subscriber types and GetInvoices, GetPayments, GenerateInvoice methods to billing.go
- Extract CarrierInfo, ConnectivityStatus, ProfileInfo types and carrier connector methods to carrier.go
- Extract CreditCheckRequest/Response, CreditBalanceResponse types and charging engine methods to charging.go
- Add PacketStats, CreditInfo types and GetPacketStats, GetCreditInfo
2026-04-25 05:33:41 +03:00
nutcas3 91b8d53662 feat: Add charging engine integration with periodic usage reporting to packet gateway
- Add reqwest dependency with json feature to Cargo.toml
- Add charging_client module import and ChargingEngineClient initialization
- Add --charging-engine-url CLI argument with default http://localhost:3001
- Add periodic usage reporting every 60 seconds with batch processing
- Add IP-to-session-id mapping for usage events (format: session-{ip})
- Add async batch usage reporting with error logging on failure
- Add last
2026-04-25 05:29:00 +03:00
nutcas3 e839ffb519 feat: Add precision handling and overflow protection to monthly fee billing
- Add rounding to monthly fee conversion to cents to prevent precision loss
- Replace direct subtraction with saturating_sub to prevent i64 underflow
- Add fee_cents variable for clearer monthly fee calculation in billing cycle
2026-04-25 05:28:43 +03:00