This commit is contained in:
WJQSERVER 2024-10-08 21:15:03 +08:00
parent abeb6ee8eb
commit 5e764a6cd7
2 changed files with 4 additions and 16 deletions

11
main.go
View file

@ -5,7 +5,6 @@ import (
"fmt"
"log"
"net/http"
"regexp"
"ghproxy/auth"
"ghproxy/config"
@ -22,16 +21,6 @@ var (
configfile = "/data/ghproxy/config/config.yaml"
)
var (
exps = []*regexp.Regexp{
regexp.MustCompile(`^(?:https?://)?github\.com/([^/]+)/([^/]+)/(?:releases|archive)/.*`),
regexp.MustCompile(`^(?:https?://)?github\.com/([^/]+)/([^/]+)/(?:blob|raw)/.*`),
regexp.MustCompile(`^(?:https?://)?github\.com/([^/]+)/([^/]+)/(?:info|git-).*`),
regexp.MustCompile(`^(?:https?://)?raw\.github(?:usercontent|)\.com/([^/]+)/([^/]+)/.+?/.+`),
regexp.MustCompile(`^(?:https?://)?gist\.github\.com/([^/]+)/.+?/.+`),
}
)
func loadConfig() {
var err error
// 初始化配置