118 Commits

Author SHA1 Message Date
52f202f21d Merge branch 'main' of https://gitea.nanami.tech/Super-frpc/backend 2026-06-06 16:18:12 +08:00
8a5a647dcc feat(proxy): add proxy switch endpoint to enable/disable proxies, and all enabled parameter to display the status of each proxy when fetching the proxies list 2026-06-06 16:15:54 +08:00
f649345375 feat(proxy): add proxy switch endpoint to enable/disable proxies, and all enabled parameter to display the status of each proxy when fetching the proxies list 2026-06-06 16:13:30 +08:00
a0634703ea fix(frpLogger): replace all logs fetching method to read corresponding file in the logsPath 2026-06-06 14:31:42 +08:00
5e9bdf02f9 fix(utils): now it can be successfully restarted when deployed as systemd service
- Add `getSystemdServiceName` function to get systemd service name.
- When detected as systemd sevice, use `systemctl restart` to restart the program then exit.
2026-06-04 12:05:09 +08:00
682aa1abb9 fix(global): update software version and build number to 0.0.2 and 2 respectively Ver.0.0.2.pre-release 2026-05-22 17:43:03 +08:00
2aa601dd87 feat(settings): add LogsPath to GetSettingsHandler and SetSettingsHandler 2026-05-22 17:36:31 +08:00
a2d1dada2c feat(logging): add log path configuration and implement logrotate policy 2026-05-22 17:27:57 +08:00
767f26f3c9 refactor(README): update configuration instructions and remove outdated features section 2026-05-13 14:45:42 +08:00
b5ecf9ba2d fix(.gitignore): add config.json to ignore list 2026-05-13 10:50:43 +08:00
083afe74ce fix(database): fix unable to change instance name 2026-05-11 14:06:08 +08:00
ebc8ced8dd fix: replace all get current path method from "./" to os args 2026-05-11 14:03:00 +08:00
5c748dafcd fix(user): allow re-login by removing existing session if user is already logged in
fix(main): conditionally initialize and connect to watchdog based on configuration

fix(instance): remove unused userID variable and commented debug logs in ListInstancesHandler
Ver.0.0.1.pre-release
2026-05-10 21:54:49 +08:00
a7d6bb0cb8 fix(watchdog): ensure watchdog binary is executable before starting the process 2026-05-10 18:26:36 +08:00
933c12fca1 feat(system): add restart server endpoint with authentication 2026-05-10 18:09:49 +08:00
02bcfea745 fix(watchdog): improve logging context in keepalive error handling 2026-05-10 17:44:25 +08:00
e063a36e28 feat(watchdog): initialize watchdog connection and sync running instances 2026-05-10 17:40:01 +08:00
ef27e7e0a9 refactor(watchdog): remove tcp socket connection and add local unix sock connection 2026-05-10 14:38:52 +08:00
9c684241d1 feat(watchdog): implement keepalive mechanism and enhance connection handling 2026-05-09 17:29:02 +08:00
21a4b03c57 feat(watchdog): add auto boot up for watchdog progress 2026-05-09 15:30:03 +08:00
898b67a24b fix: making sure all users can access all functions of all instances 2026-05-08 14:16:20 +08:00
a78e715293 refactor(instance): remove redundant instance ownership checks
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.
2026-05-08 12:30:31 +08:00
00319d790d chore: change service && filename rule to "superfrpc_instanceID" 2026-05-07 22:46:28 +08:00
6e705ce2f3 fix: change permission level for instance listing to visitor and making sure all instances could be listed for all users 2026-05-07 21:38:52 +08:00
9ffb4263cf feat(sys): add self-check functionality for system settings and frpc binary 2026-05-07 21:07:16 +08:00
44195c9f26 style(service): modify package name "service" to "sys" 2026-05-07 19:28:49 +08:00
a0ef35627b feat(web): add static file serving and update API routes
- 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
2026-05-05 15:45:51 +08:00
cdeaa5bacc fix(user): replace 'user' type with 'visitor' in user creation
refactor(session): improve token expiration handling in GetTokenInfo

chore: add /dist to gitignore
2026-05-05 15:35:04 +08:00
a2869c1e0e fix(proxy): add "oldName" && "newName" paras to fix unable to modify proxy name 2026-05-05 12:52:04 +08:00
e72c142b16 fix(instance): add status verification after service operations
Add verification checks to ensure service is running/stopped after start/stop/restart operations
Fix import order and remove unnecessary whitespace
2026-05-05 12:31:59 +08:00
20c906c8cc fix(settings): fill support for additional configuration options 2026-04-30 18:54:36 +08:00
d71672e40f docs: update API endpoint paths in documentation 2026-04-29 11:51:52 +08:00
b93c3b0e78 docs(api): update webhook configuration and add notification docs
- Simplify webhook headers and body configuration format
- Add documentation for available notification methods and parameters
2026-04-29 10:01:07 +08:00
1432651a14 fix(watchdog): fix watchdog unable to send webhook and simplify the parsing of json config
- 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
2026-04-28 20:48:54 +08:00
8108d4d01f fix(watchdog): integrate instance management with watchdog
Add watchdog instance management in Start/StopInstanceHandler to sync with watchdog service
Add notification enabled check in exceptionHandle function
2026-04-28 19:50:52 +08:00
0890c8136f feat(watchdog): add exception handling and webhook integration
- 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
2026-04-28 15:46:31 +08:00
ac51641e93 feat(settings): add settings management API endpoints
- 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
2026-04-23 12:43:11 +08:00
489c37e095 refactor(global): move config to global package and consolidate handlers
- 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
2026-04-22 19:52:33 +08:00
ddf91299e7 refactor: reorganize codebase into modular packages
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
2026-04-22 12:57:04 +08:00
df8df78bab refactor(config): improve config file handling and error messages
- 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
2026-04-21 18:39:11 +08:00
3e3adf122c fix(instance): (systemd) fix when the instance is not running but the backend still says it's running 2026-04-21 18:00:39 +08:00
c978e5c6b4 refactor(instance): change IsInstanceRunning to return error instead of bool
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.
2026-04-21 14:39:30 +08:00
2426933f49 fix(watchdog): now the client could successfully send more msgs to watchdog instead of the only connection msg
- 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
2026-04-07 23:29:07 +08:00
37c10f1c07 feat(watchdog): improve watchdog instance tracking
- 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
2026-04-05 22:44:53 +08:00
f006c2307a feat(user): assign superuser role to first registered user
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.
2026-04-04 11:53:51 +08:00
671106d3bc style(database): change DBQueryUsers to DBListUsers 2026-04-04 11:49:59 +08:00
de6a8cdcb0 fix(watchdog): refactored tcp recvMsg function, now the watchdog can be connected correctly
- 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
2026-04-02 22:22:44 +08:00
78bd1cb3cc style: using is struct to handle all judgements global envs 2026-04-02 21:38:50 +08:00
aa22b04a1f feat(watchdog): add watchdog service with TCP client implementation
- 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
2026-04-02 18:42:44 +08:00
c19bbfbca4 Merge branch 'main' of https://gitea.nanami.tech/Super-frpc/backend 2026-03-31 23:05:48 +08:00