feat(global): add global package for shared variables and types
refactor(handlers): move handlers to dedicated package and update imports
refactor(session): extract session management to separate package
refactor(config): move config handling to dedicated package
refactor(router): update route handlers to use new package structure
refactor(main): simplify main.go by moving logic to packages
- Replace manual address formatting with net.JoinHostPort in tcpClient
- Simplify debug/error messages in IsInstanceRunning by removing redundant output
- Fix incorrect map reference for RunUser in CreateInstanceHandler
- Extract config file creation logic into handleConfigFileCreate
- Add auth_token to response data in GetInstanceInfoHandler
- Remove redundant AuthToken field from InstanceInfo struct
Modify IsInstanceRunning function to return error for better error handling and status reporting. Update all related handler functions to properly check the error and set isRunning flag accordingly. Also adjust log levels for service status messages to be more appropriate.
- Add debug logging for watchdog operations
- Standardize message format for instance operations
- Improve TCP message handling with proper line termination
- Enhance error handling in watchdog operations
- Add proper cleanup of recvChan in sendMsg
- Update response handling in instance handlers
- Add Close() function to watchdog for graceful shutdown
- Update instance message format for better consistency
- Add watchdog status tracking in StatusInfo
- Include watchdog field in FrpcInstance struct and database
- Change port fields from string to int in FrpcProxyInfo
- Add auth_token support in InstanceInfo
Add logic to check if registering user is the first one and assign 'superuser' role instead of default 'visitor' role. This ensures proper initial admin setup for new deployments.
- Refactor TCP message reading to use ReadBytes and TrimSpace for better reliability
- Add connection success logging in main.go
- Update .gitignore to include logs.db-journal
- Implement TCP client for watchdog service communication
- Add watchdog configuration in config.json
- Update main.go to initialize and connect to watchdog
- Add watchdog related functions (connect, command handling)
- Update README.md with new watchdog feature
- Improve route setup logging in router.go
Implement proxy modification feature including:
- New modifyFrpcProxy function in config.go
- New ModifyProxyHandler in frpcProxyAct.go
- New API endpoint in router.go
- Updated API documentation in docs/api.md
Implement proxy modification feature including:
- New modifyFrpcProxy function in config.go
- New ModifyProxyHandler in frpcProxyAct.go
- New API endpoint in router.go
- Updated API documentation in docs/api.md
implement user modification functionality including:
- new endpoint /userMgr/modify
- database update function DBUpdateUser
- request/response structures
- handler with proper authentication and validation
- updated API documentation
- marked as completed in README checklist
- Implement new endpoint `/userMgr/modifyType` for updating user types
- Add database function DBUpdateUserType to handle type updates
- Include request validation and proper error handling
- Update API documentation with new endpoint details
Implement cross-platform log streaming for frpc instances with support for Windows, systemd, and init.d systems. Includes WebSocket API endpoint for real-time log streaming, token validation, and instance ownership checks. Update README and API documentation to reflect new functionality.
The implementation handles:
- Platform-specific log collection (Windows Event Log, journalctl, log files)
- WebSocket-based real-time streaming
- Token validation and instance access control
- Log level parsing and formatting
- Historical log retrieval since service start
- Handle specific exit codes for systemd services (inactive/unknown states)
- Add better error handling for init.d services
- Move string conversion before error checking for consistency
- Update log levels for better service state visibility
Implement new GET endpoint `/frpcAct/instanceMgr/getInfo` to fetch frpc instance information
Add documentation for the new API endpoint in docs/api.md
The handler returns different information based on user permission level
Remove sensitive information from instance listing response for all users and add isRunning field
Fix backend to prevent starting already running frpc instances
- Move instance-related structs and functions to config.go
- Remove serverAddr, serverPort, and authMethod from database schema
- Implement new config parsing and encoding with nested key support
- Update service management to use instanceID instead of username/name
- Add GetServiceNameByInstanceID helper function
- Update API documentation for auth.method field change
Implement setBootAtStart and removeBootAtStart functions to handle service auto-start configuration separately from service creation/removal. Update handlers to use these new functions for better control of boot behavior. The changes support Windows, systemd and init.d systems.
- Update DBRemoveFrpcInstance to use instanceID for deletion
- Modify DeleteInstanceHandler to accept and validate instanceID
- Improve error messages for invalid instanceID format
- Update logging to use instanceID instead of instanceName
Implement new GET endpoint `/frpcAct/proxyMgr/list` to retrieve proxy configurations from frpc instance config files. Includes handler function, API documentation, and route setup. The endpoint validates user permissions, reads and parses the config file, and returns structured proxy data with instance information.
- Replace ini package with toml for more reliable config parsing
- Refactor proxy management to use structured config instead of string manipulation
- Add proper error handling for config operations
- Clean up unused imports and improve code organization
- Update go.mod dependencies accordingly
Implement handler for deleting frpc proxies with proper validation and error handling. The endpoint checks user permissions, validates input, removes the proxy configuration from the instance file, and returns appropriate responses.
Add a default handler for invalid routes that logs the request details and returns a 404 response. This improves error handling and user experience by providing clear feedback for invalid paths.
- Implement new endpoint for creating frpc proxy configurations
- Add DBQueryFrpcInstanceByID function to fetch instances by ID
- Move proxy generation logic to separate function in frpcProxyAct.go
- Update API documentation with new proxy creation endpoint
- Implement WebSocket endpoint for streaming logs to clients
- Add log broadcaster to manage client connections and history
- Update documentation with new WebSocket API details
- Include gorilla/websocket dependency for WebSocket support
- Implement new database logging functionality with separate logs database
- Refactor PostLog function to store logs in database while maintaining console output
- Add new InitLogsDatabase function and related database operations
- Update main.go to support separate database paths for data and logs
- Add logging for user creation events
- Add createdAt field to User struct and database schema
- Update all user queries to include createdAt field
- Document new field in API documentation
- Fix server online status flag timing
Add new endpoints to expose system status and software information:
- /system/getStatus returns current system status (online/offline)
- /system/getSoftwareInfo returns software version and build details
Update API documentation to include new endpoints
- Implement new `/sessionMgr/remove` endpoint for superusers to remove sessions
- Refactor session and token management to use sessionTokenMap for better tracking
- Update session cleanup logic to handle both tokens and sessions
- Add documentation for new API endpoint in docs/api.md
- Modify logout handler to use new session removal approach
- Move token-related functions from auth.go to new session.go
- Add session tracking with expiration and cleanup
- Implement session list API endpoint
- Update login/logout handlers to use session system
- Add hourly cleanup of expired tokens and sessions
Extract service management functions from frpAct.go to new os.go file for better code organization and maintainability. Also update README.md to document supported platforms.
Add new endpoint `/userMgr/list` to retrieve all users with superuser permission. Includes handler implementation, database query function, and API documentation update.
- Implement RemoveUser function in database.go to delete users
- Add RemoveUserHandler to handle HTTP requests for user removal
- Update API documentation with new /userMgr/remove endpoint
- Add route for user removal in router.go