Improve API instance support#3643
Merged
xiaokangwang merged 2 commits intov2fly:masterfrom Mar 10, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3643 +/- ##
==========================================
- Coverage 23.29% 22.96% -0.33%
==========================================
Files 857 864 +7
Lines 46766 47468 +702
==========================================
+ Hits 10893 10900 +7
- Misses 34615 35311 +696
+ Partials 1258 1257 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Machine Generated Summary)
This pull request introduces improvements to the startup process for the
v2bindingpackage, focusing on better handling of configuration files and instance initialization. The changes add support for setting a base directory, loading a default configuration if present, and improving error reporting. Additionally, the API instance is now bound to the local host for increased security.Configuration and startup enhancements:
baseDirfield to thebindingInstancestruct and implemented thesetBaseDirmethod to set the working directory and create an attention file for configuration placement. [1] [2]loadDefaultConfigIfExistsmethod to automatically load and start a default instance fromconfig.jsonif it exists in the base directory. [1] [2]StartAPIInstanceto set the base directory and attempt to load the default configuration, logging errors tolast_err.txtif loading fails.Security improvement:
net.AnyIPtonet.LocalHostIP, restricting access to localhost only.