mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-04-27 00:35:48 +00:00
Merge pull request #166 from cielhaidir/main
feat: add .air.toml configuration file and update .gitignore for build artifacts
This commit is contained in:
46
.air.toml
Normal file
46
.air.toml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
root = "."
|
||||||
|
testdata_dir = "testdata"
|
||||||
|
tmp_dir = "tmp"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
args_bin = []
|
||||||
|
bin = "./tmp/main"
|
||||||
|
cmd = "go build -o ./tmp/main ./cmd/server"
|
||||||
|
delay = 1000
|
||||||
|
exclude_dir = ["assets", "tmp", "vendor", "testdata", "docs", ".github", "auths", "examples"]
|
||||||
|
exclude_file = []
|
||||||
|
exclude_regex = ["_test.go"]
|
||||||
|
exclude_unchanged = false
|
||||||
|
follow_symlink = false
|
||||||
|
full_bin = ""
|
||||||
|
include_dir = []
|
||||||
|
include_ext = ["go", "tpl", "tmpl", "html", "yaml", "yml"]
|
||||||
|
include_file = []
|
||||||
|
kill_delay = "0s"
|
||||||
|
log = "build-errors.log"
|
||||||
|
poll = false
|
||||||
|
poll_interval = 0
|
||||||
|
post_cmd = []
|
||||||
|
pre_cmd = []
|
||||||
|
rerun = false
|
||||||
|
rerun_delay = 500
|
||||||
|
send_interrupt = false
|
||||||
|
stop_on_error = false
|
||||||
|
|
||||||
|
[color]
|
||||||
|
app = ""
|
||||||
|
build = "yellow"
|
||||||
|
main = "magenta"
|
||||||
|
runner = "green"
|
||||||
|
watcher = "cyan"
|
||||||
|
|
||||||
|
[log]
|
||||||
|
main_only = false
|
||||||
|
time = false
|
||||||
|
|
||||||
|
[misc]
|
||||||
|
clean_on_exit = false
|
||||||
|
|
||||||
|
[screen]
|
||||||
|
clear_on_rebuild = false
|
||||||
|
keep_scroll = true
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -13,6 +13,8 @@ logs/*
|
|||||||
conv/*
|
conv/*
|
||||||
temp/*
|
temp/*
|
||||||
refs/*
|
refs/*
|
||||||
|
tmp/*
|
||||||
|
build-errors.log
|
||||||
|
|
||||||
# Storage backends
|
# Storage backends
|
||||||
pgstore/*
|
pgstore/*
|
||||||
|
|||||||
4
go.mod
4
go.mod
@@ -5,6 +5,7 @@ go 1.24.0
|
|||||||
require (
|
require (
|
||||||
github.com/andybalholm/brotli v1.0.6
|
github.com/andybalholm/brotli v1.0.6
|
||||||
github.com/fsnotify/fsnotify v1.9.0
|
github.com/fsnotify/fsnotify v1.9.0
|
||||||
|
github.com/fxamacker/cbor/v2 v2.9.0
|
||||||
github.com/gin-gonic/gin v1.10.1
|
github.com/gin-gonic/gin v1.10.1
|
||||||
github.com/go-git/go-git/v6 v6.0.0-20251009132922-75a182125145
|
github.com/go-git/go-git/v6 v6.0.0-20251009132922-75a182125145
|
||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
@@ -13,8 +14,8 @@ require (
|
|||||||
github.com/joho/godotenv v1.5.1
|
github.com/joho/godotenv v1.5.1
|
||||||
github.com/klauspost/compress v1.17.4
|
github.com/klauspost/compress v1.17.4
|
||||||
github.com/minio/minio-go/v7 v7.0.66
|
github.com/minio/minio-go/v7 v7.0.66
|
||||||
github.com/refraction-networking/utls v1.8.2
|
|
||||||
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
|
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
|
||||||
|
github.com/refraction-networking/utls v1.8.2
|
||||||
github.com/sirupsen/logrus v1.9.3
|
github.com/sirupsen/logrus v1.9.3
|
||||||
github.com/tidwall/gjson v1.18.0
|
github.com/tidwall/gjson v1.18.0
|
||||||
github.com/tidwall/sjson v1.2.5
|
github.com/tidwall/sjson v1.2.5
|
||||||
@@ -41,7 +42,6 @@ require (
|
|||||||
github.com/dlclark/regexp2 v1.11.5 // indirect
|
github.com/dlclark/regexp2 v1.11.5 // indirect
|
||||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||||
github.com/emirpasic/gods v1.18.1 // indirect
|
github.com/emirpasic/gods v1.18.1 // indirect
|
||||||
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
|
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
|
||||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
github.com/gin-contrib/sse v0.1.0 // indirect
|
||||||
github.com/go-git/gcfg/v2 v2.0.2 // indirect
|
github.com/go-git/gcfg/v2 v2.0.2 // indirect
|
||||||
|
|||||||
@@ -754,18 +754,22 @@ func (h *Handler) PatchOAuthModelAlias(c *gin.Context) {
|
|||||||
normalizedMap := sanitizedOAuthModelAlias(map[string][]config.OAuthModelAlias{channel: body.Aliases})
|
normalizedMap := sanitizedOAuthModelAlias(map[string][]config.OAuthModelAlias{channel: body.Aliases})
|
||||||
normalized := normalizedMap[channel]
|
normalized := normalizedMap[channel]
|
||||||
if len(normalized) == 0 {
|
if len(normalized) == 0 {
|
||||||
|
// Only delete if channel exists, otherwise just create empty entry
|
||||||
|
if h.cfg.OAuthModelAlias != nil {
|
||||||
|
if _, ok := h.cfg.OAuthModelAlias[channel]; ok {
|
||||||
|
delete(h.cfg.OAuthModelAlias, channel)
|
||||||
|
if len(h.cfg.OAuthModelAlias) == 0 {
|
||||||
|
h.cfg.OAuthModelAlias = nil
|
||||||
|
}
|
||||||
|
h.persist(c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Create new channel with empty aliases
|
||||||
if h.cfg.OAuthModelAlias == nil {
|
if h.cfg.OAuthModelAlias == nil {
|
||||||
c.JSON(404, gin.H{"error": "channel not found"})
|
h.cfg.OAuthModelAlias = make(map[string][]config.OAuthModelAlias)
|
||||||
return
|
|
||||||
}
|
|
||||||
if _, ok := h.cfg.OAuthModelAlias[channel]; !ok {
|
|
||||||
c.JSON(404, gin.H{"error": "channel not found"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
delete(h.cfg.OAuthModelAlias, channel)
|
|
||||||
if len(h.cfg.OAuthModelAlias) == 0 {
|
|
||||||
h.cfg.OAuthModelAlias = nil
|
|
||||||
}
|
}
|
||||||
|
h.cfg.OAuthModelAlias[channel] = []config.OAuthModelAlias{}
|
||||||
h.persist(c)
|
h.persist(c)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import (
|
|||||||
// - codex
|
// - codex
|
||||||
// - qwen
|
// - qwen
|
||||||
// - iflow
|
// - iflow
|
||||||
|
// - github-copilot
|
||||||
// - antigravity (returns static overrides only)
|
// - antigravity (returns static overrides only)
|
||||||
func GetStaticModelDefinitionsByChannel(channel string) []*ModelInfo {
|
func GetStaticModelDefinitionsByChannel(channel string) []*ModelInfo {
|
||||||
key := strings.ToLower(strings.TrimSpace(channel))
|
key := strings.ToLower(strings.TrimSpace(channel))
|
||||||
@@ -39,6 +40,8 @@ func GetStaticModelDefinitionsByChannel(channel string) []*ModelInfo {
|
|||||||
return GetQwenModels()
|
return GetQwenModels()
|
||||||
case "iflow":
|
case "iflow":
|
||||||
return GetIFlowModels()
|
return GetIFlowModels()
|
||||||
|
case "github-copilot":
|
||||||
|
return GetGitHubCopilotModels()
|
||||||
case "antigravity":
|
case "antigravity":
|
||||||
cfg := GetAntigravityModelConfig()
|
cfg := GetAntigravityModelConfig()
|
||||||
if len(cfg) == 0 {
|
if len(cfg) == 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user