Commit Graph
100 Commits
Author SHA1 Message Date
nutcas3 b443152ecc feat: Add Traefik configuration with security middlewares, rate limiting, and dynamic routing
- Add traefik.yml with HTTP to HTTPS redirection and secure-headers middleware
- Add dashboard on port 80 with insecure mode enabled
- Add websecure entrypoint on port 443 with security headers
- Add Docker and file providers with dynamic configuration watching
- Add Prometheus metrics with entrypoint and service labels
- Add middlewares.yml with secure-headers including CSP, X-Frame-Options, and Permissions
2026-05-01 09:07:13 +03:00
nutcas3 19eb36613b docs: Add Traefik API Gateway documentation and update README with unified endpoint architecture
- Add API Gateway Integration section describing Traefik-based centralized routing
- Add API Gateway Layer to architecture overview with SSL termination and monitoring
- Add Gateway & Security features including unified HTTPS endpoint and JWT validation
- Update Technology Stack to Rust 1.95 from 1.94
- Add Quick Start with API Gateway section using start-gateway.sh script
- Add traefik/ directory
2026-05-01 09:07:01 +03:00
nutcas3 1cbe66a0c0 refactor: Add context parameter to MessageQueue Publish method with timeout wrapping
- Add context.Context parameter to Publish method signature
- Replace context.Background() with provided context wrapped in timeout
- Rename timeout context variable from ctx to timeoutCtx for clarity
2026-05-01 09:06:43 +03:00
nutcas3 783d5c147b feat: Add XSS protection and HATEOAS links to subscriber and auth handlers with cursor pagination
- Add bluemonday import to auth.go and subscriber.go
- Add UGCPolicy sanitization for username, email, firstName, lastName, and role in Register
- Add conditional XSS sanitization for firstName, lastName, email, and MSISDN in CreateSubscriber and UpdateSubscriber
- Replace Page and PageSize with Cursor and Limit in ListSubscribers query parameters
- Add HATEOAS links to CreateSubscriber, GetSubscriber
2026-05-01 09:06:32 +03:00
nutcas3 36748d534e refactor: Replace offset pagination with cursor-based pagination for subscriber listing
- Replace Page and PageSize with Cursor and Limit in ListSubscribersRequest
- Replace Total, Page, and PageSize with NextCursor and HasMore in ListSubscribersResponse
- Add default limit of 20 with max cap of 100 in ListSubscribers
- Replace ListSubscribers call with ListSubscribersCursor in subscriber_crud.go
- Remove unused database import from subscriber_crud.go
- Replace context.Background() with context.Without
2026-05-01 09:06:13 +03:00
nutcas3 444d767ceb feat: Add CSRF protection middleware to carrier-connector with secret validation
- Add gin-csrf middleware import to main.go
- Add CSRF_SECRET environment variable support with default fallback warning
- Add CSRF middleware to Gin router with configurable secret
- Add default CSRF secret with production warning for missing environment variable
2026-05-01 09:05:38 +03:00
nutcas3 49dc77d241 feat: Add CSP, Referrer-Policy, and Permissions-Policy headers to SecurityHeadersMiddleware
- Add Content-Security-Policy header with self-only defaults and unsafe-inline styles
- Add Referrer-Policy header with strict-origin-when-cross-origin
- Add Permissions-Policy header blocking geolocation, microphone, and camera access
2026-05-01 09:05:02 +03:00
nutcas3 5b6cee5618 feat: Add cursor-based pagination for subscribers and parameterize test password
- Add ListSubscribersCursor method to Database with ID-based cursor pagination
- Add cursor, hasMore, and nextCursor support for efficient pagination
- Add status, organizationID, and search filters to cursor-based query
- Add limit+1 fetch strategy to detect additional results
- Add fmt import to database/crud.go
- Add TEST_PASSWORD environment variable support in integration tests with default fallback
- Replace hard
2026-05-01 09:04:41 +03:00
nutcas3 4b04048c9b feat: Add SSRF protection to charging engine client with URL validation and domain whitelisting
- Add validateURL method to ChargingEngineClient with private IP blocking and domain whitelisting
- Add SSRF validation to CheckCredit, DeductCredit, AddCredit, GetBalance, and HealthCheck endpoints
- Add errors, net, url, and slices imports to charging_client.go
- Update HealthCheck endpoint from /health to /v1/health for consistency
- Add allowed domains list including localhost, 127.0.0.1, charging
2026-05-01 09:03:25 +03:00
nutcas3 b2376e2133 feat: Add HATEOAS link support for subscriber resources with navigation and action links
- Add Link struct with href, rel, and optional type fields
- Add Links map type for HATEOAS link collections
- Add SubscriberWithLinks and SubscriberListWithLinks wrapper types
- Add NewSubscriberLinks function generating self, update, delete, billing, and sessions links
- Add NewSubscriberListLinks function with self, create, and conditional next pagination links
2026-05-01 09:02:12 +03:00
nutcas3 972be70cc2 feat: Add API Gateway startup script with health checks and service validation
- Add start-gateway.sh script for Traefik-based API Gateway deployment
- Add JWT_SECRET environment variable validation with development fallback warning
- Create traefik/dynamic directory for dynamic configuration
- Add docker-compose orchestration with build and detached mode
- Add health check endpoints for Traefik (/ping), API Server (/api/v1/health), and Charging Engine (/v1/health)
- Add service URL documentation
2026-05-01 09:01:20 +03:00
nutcas3 4e4b13f3e8 refactor: Simplify validation parsing using let-chains in sync.rs and wrap unsafe env::set_var in tests
- Replace nested if-let statements with let-chain pattern for VmRSS memory parsing in /proc/self/status
- Replace nested if-let statements with let-chain pattern for Redis used_memory parsing
- Wrap std::env::set_var calls in unsafe blocks in validation_tests.rs for MAX_BYTES_LIMIT and MAX_AMOUNT_LIMIT
2026-05-01 00:43:54 +03:00
nutcas3 11065b827b refactor: Simplify Redis RPS extraction using let-chains in monitoring_impl.rs
- Replace nested if-let statements with let-chain pattern for Redis RPS parsing
- Update module reference from monitoring to monitoring_impl in monitoring.rs
2026-05-01 00:43:41 +03:00
nutcas3 220b7e0380 refactor: Rename monitoring.rs to monitoring_impl.rs in charging-engine 2026-05-01 00:43:22 +03:00
nutcas3 dd346a7484 refactor: Update Rust version to 1.95, add SSRF protection to ES2 client, and fix CLI API endpoint paths
- Change rust-version from "1.94" to "1.95" in workspace Cargo.toml
- Add validateURL method to ES2Client with private IP blocking and domain whitelisting
- Add SSRF validation to DownloadProfile and GetProfileStatus endpoints
- Add slices, errors, net, and url imports to es2/client.go
- Update CLI charging API endpoints from /v1 to /api/v1 prefix
- Fix DeductCredit response handling to use nil
2026-05-01 00:41:57 +03:00
nutcas3 b1f18e1a4e feat: Add comprehensive Swagger API documentation for subscriber management endpoints
- Add GET /api/v1/subscribers endpoint with pagination and filtering parameters
- Add POST /api/v1/subscribers endpoint for subscriber creation
- Add GET /api/v1/subscribers/{id} and GET /api/v1/subscribers/imsi/{imsi} endpoints
- Add PUT /api/v1/subscribers/{id} endpoint for subscriber updates
- Add POST /api/v1/subscribers/{id}/suspend and /api/v1/subscribers/{id}/terminate endpoints
- Add Swagger definitions
2026-04-30 22:59:46 +03:00
nutcas3 2e813c3d90 refactor: Add CSRF protection and session management dependencies to carrier-connector
- Add github.com/utrack/gin-csrf v0.0.0 for CSRF protection
- Add github.com/gin-contrib/sessions and related session management dependencies
- Add github.com/gorilla/context, gorilla/securecookie, and gorilla/sessions for session handling
- Add github.com/dchest/uniuri for unique identifier generation
- Add indirect dependencies for various session store implementations (redistore, memcache, mongostore)
2026-04-30 22:55:19 +03:00
nutcas3 cebed0a904 feat: Add CSRF protection middleware and Swagger annotations, remove GraphQL handler setup
- Add github.com/utrack/gin-csrf import for CSRF protection
- Remove internal/graphql import and resolver initialization
- Add Swagger API documentation annotations (@title, @version, @description, @host, @BasePath, @securityDefinitions)
- Add CSRF middleware with configurable secret from CSRF_SECRET environment variable
- Add warning log when using default CSRF secret
- Add return statement after database
2026-04-30 22:53:09 +03:00
nutcas3 51c1ad6573 feat: Add Swagger documentation endpoint and update API route prefix from /v1 to /api/v1
- Add swaggo/files and swaggo/gin-swagger imports for Swagger documentation
- Change API route group prefix from "/v1" to "/api/v1"
- Add GET /api/v1/swagger/*any endpoint for Swagger UI documentation
- Update RBAC path from "/v1/users" to "/api/v1/users" for consistency
2026-04-30 22:49:51 +03:00
nutcas3 eff0da097d feat: Add Traefik reverse proxy with TLS routing and rate limiting for all services
- Add traefik service with v3.0 image exposing ports 80, 443, and 8080 (dashboard)
- Mount traefik configuration directory and Docker socket for service discovery
- Change api-server, carrier-connector, and charging-engine from ports to expose
- Add Traefik labels to api-server for /api/v1 routes with rate limiting, secure headers, and compression
- Add separate router for api-server Swagger docs at /api/v1/swagger with relaxed rate limits
- Add Traefik labels to carrier-connector for /v1/es2 and /v1/carrier routes
2026-04-30 22:46:42 +03:00
nutcas3 afe4084ae2 refactor: Replace log.Printf with structured logging using logrus in api-server metrics collection
- Remove standard log import from server_metrics.go
- Add logrus import for structured logging
- Replace log.Printf with logrus.WithError for system metrics storage errors
- Replace log.Printf with logrus.WithError for subscriber count errors (total, active, suspended)
- Replace log.Printf with logrus.WithError for active sessions count errors
- Replace log.Printf with logrus.WithError for /proc/stat, /proc/meminfo, and /proc/net/dev read errors
2026-04-30 22:43:37 +03:00
nutcas3 1bb9b64322 refactor: Replace GraphQL dependencies with CSRF protection and HTML sanitization in api-server
- Remove github.com/99designs/gqlgen and github.com/vektah/gqlparser/v2 GraphQL dependencies
- Add github.com/utrack/gin-csrf v0.0.0 for CSRF protection
- Add github.com/microcosm-cc/bluemonday v1.0.27 for HTML sanitization
- Add github.com/gin-contrib/sessions and related session management dependencies
- Remove GraphQL-related indirect dependencies (agnivade/levenshtein, hashicorp/golang-lru/v2, so
2026-04-30 22:41:21 +03:00
nutcas3 f8504de4ef refactor: Remove generated GraphQL code and resolver files from api-server
- Delete generated.go containing GraphQL type definitions, resolvers, and schema
- Delete resolvers.go containing root Resolver struct and helper functions
- Remove GraphQL enum constants (SubscriberStatus, ProfileStatus, UsageType, etc.)
- Remove GraphQL input types (SubscriberFilter, CreateSubscriberInput, etc.)
- Remove GraphQL output types (PageInfo, SubscriberConnection, UsageStats, etc.)
- Remove resolver interfaces
2026-04-30 04:57:58 +03:00
nutcas3 9b64366e25 refactor: Fix Rust edition, remove duplicate lint rule, and improve error handling in charging-engine and packet-gateway
- Change Rust edition from "2026" to "2024" in workspace Cargo.toml
- Remove duplicate expect_used lint rule from workspace lints
- Prefix unused account variable with underscore in calculate_usage_cost
- Split CARGO_MANIFEST_DIR assignment into separate variable in run_migrations
- Clone plan_id before moving plan in add_rating_plan handler
- Replace expect() with unwrap() in governor
2026-04-30 03:17:46 +03:00
nutcas3 cd392894df refactor: Replace manual map copy with maps.Copy in carrier-connector message queue
- Add maps import to mq.go
- Replace manual for loop copying payload map with maps.Copy in PublishProfileEvent
- Simplify map merging logic while maintaining same functionality
2026-04-29 13:23:41 +03:00
nutcas3 ccb2ab7ee8 refactor: Add comprehensive documentation with examples to charging-engine modules
- Add module-level documentation to lib.rs with usage example
- Document Claims and AuthConfig structs with examples in auth.rs
- Add ChargingEngine struct documentation with initialization example
- Document ChargingRule, SubscriberAccount, AccountStatus, UsageEvent, UsageType, and RatingPlan with examples in types.rs
- Add CircuitState, CircuitBreakerError, and CircuitBreaker documentation with examples in circuit_breaker.rs
2026-04-29 04:36:40 +03:00
nutcas3 8fddb29716 refactor: Replace fmt.Printf with structured logging using logrus in api-server subscriber and invoice services
- Add logrus import to invoice.go, subscriber_crud.go, subscriber_esim.go, and subscriber_lifecycle.go
- Replace fmt.Printf with logrus.WithError and WithField for structured error logging
- Update invoice email notification placeholder to use logrus.Info with invoice_id field
- Replace eSIM provisioning error print with logrus.Warn including subscriber_id field
- Add comment explaining derived
2026-04-29 04:36:02 +03:00
nutcas3 f15f43e08b feat: Add rustfmt configuration and enhance workspace linting rules
- Add .rustfmt.toml with comprehensive formatting rules for consistent code style
- Set max_width to 100 and tab_spaces to 4 with edition "2026"
- Enable import reordering and grouping with StdExternalCrate strategy
- Configure comment wrapping at 80 characters and enable comment normalization
- Enable field init shorthand, try shorthand, and format code in doc comments
- Set trailing comma to "Vertical" and match_block_trailing_comma to true
2026-04-29 04:35:42 +03:00
nutcas3 b4e42d7717 refactor: Improve Redis key consistency and add existence check in credit management
- Change Redis key prefix from "block:" to "blocked:" in unblock_user for consistency
- Replace is_some() check with if let pattern in block_user to avoid unused variable
- Add existence check before attempting to delete blocked user key in unblock_user
- Use if let pattern for blocked status check in unblock_user
- Return Ok(()) silently if user is not blocked instead of attempting deletion
2026-04-29 04:24:49 +03:00
nutcas3 4008a19f4a refactor: Pre-allocate Vec capacity in rating_billing.rs to reduce reallocations
- Set applied_rules capacity to 6 (maximum number of charging rules that can be applied)
- Set keys capacity to 100 in get_usage_history and get_all_accounts (matches SCAN batch size)
- Add comments explaining capacity choices for each Vec initialization
2026-04-29 04:24:22 +03:00
nutcas3 5ec01e591e refactor: Replace fallback defaults with required environment variable validation in charging-engine auth
- Change AuthConfig::from_env() return type from Self to Result<Self, String>
- Remove default JWT_SECRET fallback, require environment variable to be set
- Add validation requiring JWT_SECRET to be at least 32 characters for security
- Replace expect() with ok_or_else in create_token timestamp calculation
- Replace expect() with map_err in DATABASE_URL environment variable loading
2026-04-29 04:23:58 +03:00
nutcas3 8bb332964b refactor: Replace unwrap() with unwrap_or_else fallback in rate limiter configuration
- Add fallback to default GovernorConfig (10 req/s, burst 20) if custom config fails
- Replace unwrap() with unwrap_or_else providing sensible defaults
- Add comment explaining fallback behavior for rate limiter initialization
2026-04-29 04:23:11 +03:00
nutcas3 5340469a1a refactor: Replace expect() with unwrap_or_else fallbacks and improve error handling in charging-engine
- Remove unused _account variable in calculate_usage_cost
- Replace HashMap::with_capacity with HashMap::new and use iterator chain in get_all_plans
- Add std::process::Command import and set current_dir to repo root in run_migrations
- Add comment explaining directory change to locate migrations folder
- Replace expect() with unwrap_or_else providing fallback JSON in SubscriberAccount and UsageEvent
2026-04-29 04:22:52 +03:00
nutcas3 1deecf32fe refactor: Replace manual Display and Error implementations with thiserror derive macro in ChargingError
- Add thiserror::Error derive to ChargingError enum
- Replace manual fmt::Display implementation with #[error] attributes on each variant
- Remove manual std::error::Error implementation (provided by thiserror)
- Remove std::fmt import as it's no longer needed
- Maintain same error message formats and functionality
2026-04-29 04:22:02 +03:00
nutcas3 4cc0b80b1c refactor: Remove unnecessary clone() calls and improve error handling in packet-gateway
- Remove clone() from rating plan parameter in add_rating_plan call
- Remove clone() calls from ChargingEngineClient and EbpfManager initialization
- Remove clone() from Redis client Arc wrapping
- Remove clone() calls from PacketGatewayConfig field assignments
- Replace expect() with proper error handling using map_err and anyhow in health check server
- Remove clone() from IP string in session data collection
2026-04-29 04:21:52 +03:00
nutcas3 b3ff568bd4 feat: Add workspace-level linting rules and cargo-audit configuration
- Add cargo-audit metadata section with placeholder for ignored advisories
- Forbid unsafe_code at workspace level
- Enable all and pedantic clippy warnings
- Deny unwrap_used, expect_used, and panic to enforce error handling
- Add thiserror dependency to charging-engine for improved error handling
2026-04-29 04:21:33 +03:00
nutcas3 609bdb16fa feat: Set repository root as working directory for Goose migrations in carrier-connector
- Add filepath import for path manipulation
- Calculate repository root path relative to carrier-connector location (../../)
- Set cmd.Dir to repository root before executing Goose command
- Add comment explaining directory change to locate migrations folder
- Ensure migrations can be found from carrier-connector's nested location
2026-04-29 04:21:19 +03:00
nutcas3 898e58201f refactor: Extract CRUD operations from database.go into separate crud.go file
- Move all subscriber, payment method, transaction, and notification CRUD operations to crud.go
- Remove models import from database.go as it's no longer needed
- Keep database initialization, connection management, and IMSI allocation in database.go
- Maintain ListSubscribersRequest struct definition in crud.go alongside related functions
2026-04-29 03:36:45 +03:00
nutcas3 393685846c fix: Convert Status field to string in ListSubscribers database request
- Cast req.Status to string when passing to database.ListSubscribersRequest
- Ensure type compatibility between service and database layer status fields
2026-04-29 03:31:29 +03:00
nutcas3 cc2590bb17 fix: Reorder working-directory and env blocks in database migration step for consistency
- Move working-directory after env block in Run database migrations step
- Maintain same functionality while following standard YAML ordering convention
2026-04-29 03:31:21 +03:00
nutcas3 71353fc237 feat: Replace GORM AutoMigrate with Goose CLI migrations in api-server database initialization
- Add os/exec import for running external commands
- Replace AutoMigrate function with runMigrations function using goose postgres command
- Call runMigrations in NewDatabase before initializing IMSI allocation
- Remove PoolStats function and GORM-based schema migration code
- Reorganize database methods with section comments (Subscriber CRUD, Payment methods, Transactions, Additional CRUD, IMSI allocation)
-
2026-04-29 03:31:00 +03:00
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