- Add `getSystemdServiceName` function to get systemd service name.
- When detected as systemd sevice, use `systemctl restart` to restart the program then exit.
fix(main): conditionally initialize and connect to watchdog based on configuration
fix(instance): remove unused userID variable and commented debug logs in ListInstancesHandler
The ownership validation is now handled at an earlier stage in the request processing, making these checks redundant. This change simplifies the code by removing duplicate validation logic.
- Implement embedded static file serving for frontend assets
- Update API routes to use '/api' prefix
- Add web handler for static file serving with proper content types
- Modify .gitignore and README to reflect new web/dist directory structure
- Change webhook config headers and body from map to string format
- Move command parsing logic to separate function in command.go
- Add debug logging for webhook operations
- Improve exception handling with proper JSON parsing
- Simplify config loading logic with default values
- Implement exception handling in TCP client to process error messages
- Add webhook functionality to send notifications for exceptions
- Introduce utility functions for string parsing
- Update config with webhook template
- Add GET /settings/get and POST /settings/set endpoints for managing system settings
- Implement config file persistence for settings changes
- Update config schema to include notification and webhook settings
- Add API documentation for new endpoints
- Move config path variables to global package for consistency
- Move Config struct and related functions to global package
- Consolidate handler utilities into utils package
- Remove deprecated handlers and instance packages
- Add new handlers package with settings and proxy functionality
- Update config.json to include watchdog enabled flag
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