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

View file

@ -66,13 +66,12 @@ jobs:
uses: actions/checkout@v4
- name: Load VERSION
run: |
if [ -f DEV-VERSION ]; then
echo "VERSION=$(cat DEV-VERSION)" >> $GITHUB_ENV
if [ -f VERSION ]; then
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
else
echo "DEV-VERSION file not found!" && exit 1
echo "VERSION file not found!" && exit 1
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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
// 初始化配置