Commit Graph

51 Commits

Author SHA1 Message Date
Laisky.Cai
f9417d32e1 Merge remote-tracking branch 'origin/upstream/main' 2024-07-09 06:28:06 +00:00
igophper
274fcf3d76
refactor: init db (#1590)
Co-authored-by: 江杭辉 <jianghanghui@k.app>
2024-07-03 20:50:40 +08:00
Laisky.Cai
0164cdbcf2 Merge remote-tracking branch 'origin/upstream/main' 2024-06-24 01:46:01 +00:00
JustSong
254b9777c0 feat: support load env variables from .env file 2024-06-23 15:37:11 +08:00
JustSong
a3c7e15aed fix: fix ut 2024-06-23 15:14:39 +08:00
Laisky.Cai
115287b8cf Merge remote-tracking branch 'origin/upstream/main' 2024-06-17 03:16:36 +00:00
JustSong
6ccf3f3cfc chore: add logger.SysLogf function 2024-06-13 00:28:56 +08:00
Laisky.Cai
c524e60d9f Merge remote-tracking branch 'origin/upstream/main' 2024-05-29 06:12:37 +00:00
JustSong
ceea4c6d4a feat: support user content download proxy & relay proxy now 2024-05-29 01:14:00 +08:00
Laisky.Cai
ca23dd9a97 Merge commit '1c2654320e5b6268b13b6efca40ce37a523d032b' 2024-04-28 01:53:31 +00:00
Laisky.Cai
7047d9605e Merge commit '3d149fedf45472eff92910324974c762fc37dad6' 2024-04-21 15:05:13 +00:00
JustSong
129282f4a9 fix: fix wrong log type 2024-04-21 14:36:48 +08:00
Laisky.Cai
c735b9b4d3 Merge commit '2369025842b828ac38f4427fd1ebab8d03b1fe7f' 2024-04-20 01:07:29 +00:00
Laisky.Cai
50bab08496 Refactor codebase, introduce relaymode package, update constants and improve consistency
- Refactor constant definitions and organization
- Clean up package level variables and functions
- Introduce new `relaymode` and `apitype` packages for constant definitions
- Refactor and simplify code in several packages including `openai`, `relay/channel/baidu`, `relay/util`, `relay/controller`, `relay/channeltype`
- Add helper functions in `relay/channeltype` package to convert channel type constants to corresponding API type constants
- Remove deprecated functions such as `ResponseText2Usage` from `relay/channel/openai/helper.go`
- Modify code in `relay/util/validation.go` and related files to use new `validator.ValidateTextRequest` function
- Rename `util` package to `relaymode` and update related imports in several packages
2024-04-06 05:18:04 +00:00
JustSong
961b4108e6 chore: fix refactor caused typo 2024-04-06 02:12:50 +08:00
JustSong
24ed170e7b chore: reorganize adaptor related package 2024-04-06 01:36:48 +08:00
JustSong
f9d914873f chore: reorganize constant related package 2024-04-06 00:44:33 +08:00
Laisky.Cai
41afad713e Merge remote-tracking branch 'origin/upstream/main' 2024-03-15 09:49:49 +00:00
JustSong
752639560f feat: able to use separated database for table logs 2024-03-15 00:30:15 +08:00
Laisky.Cai
72501cb746 Merge remote-tracking branch 'origin/upstream/main' 2024-03-11 09:32:11 +00:00
JustSong
e54e647170 chore: remove useless code 2024-03-10 23:36:29 +08:00
JustSong
796be42487 feat: update ratio config if missing 2024-03-10 19:29:42 +08:00
JustSong
5b50eb94e5 feat: able to send alert message via message pusher (close #993) 2024-03-10 19:16:06 +08:00
JustSong
12440874b0 feat: able to disable channel by success rate 2024-03-10 17:57:47 +08:00
Laisky.Cai
ba9b258a4b feat: Enhance security and fix bugs in authentication
- Update the minimum access token length from 16 to 32
- Prevent spam by introducing policies and detecting user agents
- Add an authorization header to the login response
- Use base64 to decode the session secret and generate a random one if not set
2024-03-05 13:07:07 +00:00
Laisky.Cai
10cbe63c0d Merge remote-tracking branch 'origin/upstream/main' 2024-01-28 13:44:16 +00:00
JustSong
2cd1a78203 chore: update module name 2024-01-28 19:38:58 +08:00
JustSong
2d760d4a01
refactor: refactor relay part (#957)
* refactor: refactor relay part

* refactor: refactor config part
2024-01-21 23:21:42 +08:00
JustSong
eed9f5fdf0
refactor: refactor relay part (#935) 2024-01-14 19:21:03 +08:00
Laisky.Cai
d37fa80106 Merge remote-tracking branch 'origin/upstream/main' 2024-01-11 09:28:40 +00:00
JustSong
c9ebcab8b8 fix: fix theme logging 2024-01-07 18:02:59 +08:00
Laisky.Cai
021affc81a Merge remote-tracking branch 'origin/upstream/main' 2024-01-03 05:54:05 +00:00
JustSong
aa03c89133 feat: able to add more UI theme (#860) 2024-01-01 18:55:03 +08:00
Laisky.Cai
8d8fdaa2af refactor: Refactor import statements and error handling in multiple files
- Fix import statements in main.go
- Improve error handling and logging in model/main.go
2023-12-12 06:34:08 +00:00
JustSong
f9b748c2ca chore: add MEMORY_CACHE_ENABLED env variable 2023-09-29 11:38:27 +08:00
JustSong
4335f005a6 feat: create new log file when too many logs recorded 2023-09-17 16:35:30 +08:00
JustSong
42451d9d02 refactor: update logging related logic 2023-09-17 15:39:46 +08:00
JustSong
25c4c111ab fix: only enable cors for relay routers to avoid csrf attack 2023-09-17 11:44:38 +08:00
JustSong
c3dc315e75 feat: add batch update support (close #414) 2023-09-03 14:58:20 +08:00
JustSong
fdb2cccf65 perf: initialize all token encoder when starting (close #459, close $460) 2023-08-26 13:02:02 +08:00
JustSong
7bddc73b96 perf: flush response after response handled (close #364) 2023-08-12 18:10:15 +08:00
JustSong
4eea096654 chore: do not hardcode cache time (close #302) 2023-07-23 19:26:37 +08:00
JustSong
431d505f79 refactor: do not use redis to store session 2023-06-26 16:10:59 +08:00
JustSong
4463224f04 feat: support automatic channel testing & balance updates (close #11, close #59) 2023-06-22 22:01:03 +08:00
JustSong
00151a0124 chore: format logs 2023-06-22 10:59:01 +08:00
JustSong
3d76a974d1 feat: use cache to avoid database access (#158) 2023-06-20 19:09:49 +08:00
JustSong
2d39a135f2 feat: now slave server can sync options with master server (close #88) 2023-05-18 12:48:20 +08:00
JustSong
69ee87c57f fix: fully support stream mode now (close #3) 2023-04-25 21:50:57 +08:00
JustSong
5e8c22fbf6 Update system log 2023-04-22 22:15:48 +08:00
JustSong
539eac217f Rename to One API 2023-04-22 21:14:09 +08:00