Commit Graph

493 Commits

Author SHA1 Message Date
feitianbubu
21c0a51dc3 feat: requestId time string use UTC 2026-01-22 08:58:35 +08:00
Seefs
980af061fd feat: TLS_INSECURE_SKIP_VERIFY env 2026-01-15 14:43:53 +08:00
Seefs
2a15e3b152 feat: codex channel (#2652)
* feat: codex channel

* feat: codex channel

* feat: codex oauth flow

* feat: codex refresh cred

* feat: codex usage

* fix: codex err message detail

* fix: codex setting ui

* feat: codex refresh cred task

* fix: import err

* fix: codex store must be false

* fix: chat -> responses tool call

* fix: chat -> responses tool call
2026-01-14 22:29:43 +08:00
Xyfacai
389ddfa8a9 Merge pull request #2590 from xyfacai/fix/max-body-limit
fix: 设置默认max req body 为128MB
2026-01-06 21:47:12 +08:00
xiangsx
3c21652e28 feat: add regex pattern to mask API keys in sensitive information 2026-01-05 22:44:11 +08:00
CaIon
04ff3df583 fix(gin): update request body size check to allow zero limit 2026-01-05 18:55:24 +08:00
CaIon
75a6a0ba2b feat(init): increase maximum file download size to 64MB 2025-12-31 21:15:37 +08:00
Seefs
b10aed74b2 Merge branch 'upstream-main' into feature/pyro 2025-12-25 17:08:02 +08:00
CaIon
c2a6193497 feat(gin): improve request body handling and error reporting 2025-12-20 13:34:10 +08:00
CaIon
3523acfc2c feat(init): increase MaxRequestBodyMB to enhance request handling 2025-12-20 13:27:55 +08:00
Seefs
a78fd2dae6 docs: document pyroscope env var 2025-12-19 23:16:56 +08:00
Seefs
fb0ffe8c95 docs: document pyroscope env var 2025-12-19 23:03:04 +08:00
Seefs
b49bb48ed1 fix: systemname 2025-12-19 22:27:35 +08:00
t0ng7u
fa814b80fe 🧹 fix: harden request-body size handling and error unwrapping
Tighten oversized request handling across relay paths and make error matching reliable.

- Align `MAX_REQUEST_BODY_MB` fallback to `32` in request body reader and decompression middleware
- Stop ignoring `GetRequestBody` errors in relay retry paths; return consistent **413** on oversized bodies (400 for other read errors)
- Add `Unwrap()` to `types.NewAPIError` so `errors.Is/As` can match wrapped underlying errors
- `go test ./...` passes
2025-12-16 18:10:00 +08:00
t0ng7u
c2ed76ddfd 🛡️ fix: prevent OOM on large/decompressed requests; skip heavy prompt meta when token count is disabled
Clamp request body size (including post-decompression) to avoid memory exhaustion caused by huge payloads/zip bombs, especially with large-context Claude requests. Add a configurable `MAX_REQUEST_BODY_MB` (default `32`) and document it.

- Enforce max request body size after gzip/br decompression via `http.MaxBytesReader`
- Add a secondary size guard in `common.GetRequestBody` and cache-safe handling
- Return **413 Request Entity Too Large** on oversized bodies in relay entry
- Avoid building large `TokenCountMeta.CombineText` when both token counting and sensitive check are disabled (use lightweight meta for pricing)
- Update READMEs (CN/EN/FR/JA) with `MAX_REQUEST_BODY_MB`
- Fix a handful of vet/formatting issues encountered during the change
- `go test ./...` passes
2025-12-16 17:00:19 +08:00
CaIon
947a763a1a feat(auth): enhance IP restriction handling with CIDR support 2025-12-15 17:24:09 +08:00
CaIon
1bd0d8de02 Revert "feat(audio): replace SysLog with logger for improved logging in GetAudioDuration"
This reverts commit 2a980bbcf5.
2025-12-14 00:04:40 +08:00
CaIon
2a980bbcf5 feat(audio): replace SysLog with logger for improved logging in GetAudioDuration 2025-12-13 23:59:58 +08:00
CaIon
da0d3ea93c fix(audio): improve WAV duration calculation with enhanced PCM size handling 2025-12-13 23:57:32 +08:00
Seefs
bdfc875775 feat: pyroscope integrate 2025-12-13 13:49:38 +08:00
zhiheng.wang
8279be2380 fix: correct sender format issues
- Adjust sender field format, add space to separate nickname and email address
- Ensure email header format complies with standard RFC specifications
- Fix potential email client sending exceptions (Tencent Cloud)
2025-12-12 16:19:14 +08:00
Calcium-Ion
3676b9f2bc Merge pull request #2358 from seefs001/fix/regrex-repeat-compile
fix: regex repeat compile
2025-12-09 14:01:07 +08:00
CaIon
ea3e9a01a0 feat: 将任务查询数量改为可配置环境变量 TASK_QUERY_LIMIT 2025-12-03 19:27:15 +08:00
Seefs
1dd8c0f569 fix: regex repeat compile 2025-12-03 00:41:47 +08:00
Calcium-Ion
cb40004d86 Merge pull request #2355 from QuantumNous/feat/optimize-token-counter
feat: refactor token estimation logic
2025-12-02 21:51:09 +08:00
CaIon
1fededceb3 feat: refactor token estimation logic
- Introduced new OpenAI text models in `common/model.go`.
- Added `IsOpenAITextModel` function to check for OpenAI text models.
- Refactored token estimation methods across various channels to use estimated prompt tokens instead of direct prompt token counts.
- Updated related functions and structures to accommodate the new token estimation approach, enhancing overall token management.
2025-12-02 21:34:39 +08:00
Papersnake
14622aede6 fix: set MaxIdleConnsPerHost to 100 2025-12-02 09:55:03 +08:00
Seefs
594075bfdc fix: nano banana pro 4k(StreamScannerMaxBufferMB env) 2025-11-30 16:08:25 +08:00
Seefs
a1050f697f Merge pull request #2261 from wzxjohn/hotfix/analytic
fix: root page does not have analytic code
2025-11-24 14:06:02 +08:00
Calcium-Ion
ff31f7df1a Merge pull request #2278 from seefs001/fix/release-version
fix: release workflow show version
2025-11-23 23:51:32 +08:00
Seefs
de4b52d320 fix: release workflow show version 2025-11-22 20:06:13 +08:00
CaIon
5a037f2acd feat: Add CountToken configuration and update token counting logic 2025-11-22 17:15:34 +08:00
CaIon
4dbbf06adc fix: Update GET_MEDIA_TOKEN_NOT_STREAM default value to false 2025-11-22 16:23:37 +08:00
Seefs
99055bab25 fix: boundary parser error (error parsing multipart form: multipart: NextPart: bufio: buffer full) 2025-11-16 14:09:10 +08:00
Sh1n3zZ
af671d34c3 feat: replicate channel flux model 2025-11-08 01:24:45 +08:00
Leon
71c26a5843 feat: add environment variable switch for critical rate limit 2025-11-06 15:23:34 +08:00
Seefs
a98e207ef7 feat: add ali wan video (#2141)
* feat: add ali wan video

* refactor: use same UnmarshalBodyReusable

* feat: enhance request body metadata

* feat: opt wan convertToOpenAIVideo

* feat: add wan support other param via json metadata

* refactor: remove unused code

* fix ali

---------

Co-authored-by: feitianbubu <feitianbubu@qq.com>
2025-10-31 16:51:05 +08:00
wzxjohn
24cdd6bbf1 fix: typo 2025-10-30 14:21:46 +08:00
wzxjohn
da97c8ecc3 fix(web): index page does not have analytic 2025-10-30 12:17:51 +08:00
CaIon
602a92849c fix(audio): add support for .opus files in audio duration calculation 2025-10-29 22:47:39 +08:00
CaIon
bbdc57c18c refactor(channel_cache): improve channel selection logic by handling zero total weight and removing unnecessary variable 2025-10-29 21:49:06 +08:00
CaIon
a00c6393c5 feat: implement audio duration retrieval without ffmpeg dependencies 2025-10-28 15:50:45 +08:00
feitianbubu
fe9b092b0b feat: doubao-seedream support image edit 2025-10-23 21:19:33 +08:00
feitianbubu
a2d34b9e47 feat: add minimax api adaptor 2025-10-20 16:26:50 +08:00
CaIon
8ff87ae6c2 feat: add temporary TASK_PRICE_PATCH configuration to environment variables 2025-10-16 21:59:21 +08:00
CaIon
31e09b960f refactor: aws 2025-10-15 16:44:33 +08:00
CaIon
f6bf150d21 fix: improve error handling for email sending failures 2025-10-13 19:21:46 +08:00
CaIon
5e1d7ab3b9 feat: add support for Sora channel type and OpenAI video endpoint 2025-10-13 19:21:45 +08:00
Seefs
5010f2d004 format: package name -> github.com/QuantumNous/new-api (#2017) 2025-10-11 15:30:09 +08:00
feitianbubu
1d1759aaae feat: add sora video submit task 2025-10-09 15:00:02 +08:00