Implement Remote Guide Sync, Bot Bypass, and Startup Auto-fetch#10
Closed
StandardCodebase wants to merge 4 commits into
Closed
Implement Remote Guide Sync, Bot Bypass, and Startup Auto-fetch#10StandardCodebase wants to merge 4 commits into
StandardCodebase wants to merge 4 commits into
Conversation
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.
Overview:
Added ability to fetch remote Markdown guides from external repositories, bypassing common WAF bot-detection mechanisms. It implements an automated fetching routine on boot, patches Go 1.22 routing panics, and repairs the Docker build pipeline.
Specific Changes:
internal/handler/handler.go:Updated
ImportRemoteGuide: Replaced the standardhttp.Getcall with a customhttp.Clientfeaturing a 15-second timeout and a spoofed browserUser-Agent(Mozilla/5.0...). This prevents 502 Bad Gateway errors by bypassing bot blockers on platforms like Codeberg and GitHub.Added
SyncGuideOnStartup: Introduced a new background method that automatically downloads a specified remote guide, saves it directly to thedata/clearnet/remote/directory, and clears themanifestCacheso the UI updates instantly on boot.main.go:Routing Stability: Removed duplicate route declarations for
/importand/static/on thehttp.ServeMux. This resolves thepattern conflictspanic introduced by Go 1.22's strict routing rules.Startup Execution: Injected
node.SyncGuideOnStartup()to automatically pull the official Git documentation on server initialization before the HTTP server starts listening.Dockerfile:Multi-Stage Build Fix: modified the Stage 1
builder(golang:1.26-alpine) to compile the Go binary directly from the source code, resolving the pull access denial when copying artifacts to the final, restrictedreduserAlpine container.