Skip to content

Commit

Permalink
refactor: 重构配置文件为json
Browse files Browse the repository at this point in the history
  • Loading branch information
sj817 committed Jan 9, 2025
1 parent 05e34c6 commit 69b8322
Show file tree
Hide file tree
Showing 62 changed files with 1,384 additions and 1,015 deletions.
34 changes: 34 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 是否启用HTTP
HTTP_ENABLE=true
# HTTP监听端口
HTTP_PORT=7777
# HTTP监听地址
HTTP_HOST=0.0.0.0
# HTTP鉴权秘钥 仅用于karin自身Api
HTTP_AUTH_KEY=default
# ws_server鉴权秘钥
WS_SERVER_AUTH_KEY=

# 是否启用Redis 关闭后将使用内部虚拟Redis
REDIS_ENABLE=true
# 重启是否调用pm2 如果不调用则会直接关机 此配置适合有进程守护的程序
PM2_RESTART=true

# 日志等级
LOG_LEVEL=info
# 日志保留天数
LOG_DAYS_TO_KEEP=7
# 日志文件最大大小 如果此项大于0则启用日志分割
LOG_MAX_LOG_SIZE=0
# logger.fnc颜色
LOG_FNC_COLOR="#E1D919"

# ffmpeg
FFMPEG_PATH=
# ffprobe
FFPROBE_PATH=
# ffplay
FFPLAY_PATH=

# 这里请勿修改
RUNTIME=node
2 changes: 2 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NODE_ENV=development
RUNTIME=tsx
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
},
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
".env": "*.env",
"tsconfig.json": "tsconfig.*.json, env.d.ts, tsup.*.ts",
"package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .prettier*, prettier*, .editorconfig, CHANGELOG.md, CODE_OF_CONDUCT.md, .env"
"package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .prettier*, prettier*, .editorconfig, CHANGELOG.md, CODE_OF_CONDUCT.md, *.gitignore, LICENSE, README.md"
},
"files.autoSave": "onFocusChange",
"javascript.preferences.quoteStyle": "single",
Expand All @@ -22,4 +23,4 @@
"typescript.format.insertSpaceBeforeFunctionParenthesis": true,
"typescript.format.insertSpaceAfterConstructor": true,
"javascript.format.insertSpaceAfterConstructor": true
}
}
28 changes: 28 additions & 0 deletions default/config/adapter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"console": {
"isLocal": true,
"token": "",
"host": ""
},
"onebot": {
"ws_server": {
"enable": true,
"timeout": 120
},
"ws_client": [
{
"enable": false,
"url": "ws://127.0.0.1:7778",
"token": ""
}
],
"http_server": [
{
"enable": false,
"self_id": "default",
"url": "http://127.0.0.1:6099",
"token": ""
}
]
}
}
47 changes: 47 additions & 0 deletions default/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"master": [
"console"
],
"admin": [],
"user": {
"enable_list": [
1
],
"disable_list": []
},
"friend": {
"enable": true,
"enable_list": [],
"disable_list": [],
"log_enable_list": [],
"log_disable_list": []
},
"group": {
"enable": true,
"enable_list": [],
"disable_list": [],
"log_enable_list": [],
"log_disable_list": []
},
"directs": {
"enable": true,
"enable_list": [],
"disable_list": [],
"log_enable_list": [],
"log_disable_list": []
},
"guilds": {
"enable": true,
"enable_list": [],
"disable_list": [],
"log_enable_list": [],
"log_disable_list": []
},
"channels": {
"enable": true,
"enable_list": [],
"disable_list": [],
"log_enable_list": [],
"log_disable_list": []
}
}
78 changes: 0 additions & 78 deletions default/config/config.yaml

This file was deleted.

47 changes: 47 additions & 0 deletions default/config/groups.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"default": {
"cd": 0,
"mode": 0,
"alias": [],
"enable": [],
"disable": [],
"member_enable": [],
"member_disable": []
},
"Bot:selfId": {
"cd": 0,
"mode": 0,
"alias": [],
"enable": [],
"disable": [],
"member_enable": [],
"member_disable": []
},
"Bot:selfId:groupId": {
"cd": 0,
"mode": 0,
"alias": [],
"enable": [],
"disable": [],
"member_enable": [],
"member_disable": []
},
"Bot:selfId:guildId": {
"cd": 0,
"mode": 0,
"alias": [],
"enable": [],
"disable": [],
"member_enable": [],
"member_disable": []
},
"Bot:selfId:guildId:channelId": {
"cd": 0,
"mode": 0,
"alias": [],
"enable": [],
"disable": [],
"member_enable": [],
"member_disable": []
}
}
File renamed without changes.
16 changes: 16 additions & 0 deletions default/config/pm2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"lines": 1000,
"apps": [
{
"name": "karin",
"script": "index.js",
"autorestart": true,
"max_restarts": 60,
"max_memory_restart": "1G",
"restart_delay": 2000,
"merge_logs": true,
"error_file": "./logs/pm2_error.log",
"out_file": "./logs/pm2_out.log"
}
]
}
21 changes: 0 additions & 21 deletions default/config/pm2.yaml

This file was deleted.

23 changes: 23 additions & 0 deletions default/config/privates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"default": {
"cd": 0,
"mode": 0,
"alias": [],
"enable": [],
"disable": []
},
"Bot:selfId": {
"cd": 0,
"mode": 0,
"alias": [],
"enable": [],
"disable": []
},
"Bot:selfId:userId": {
"cd": 0,
"mode": 0,
"alias": [],
"enable": [],
"disable": []
}
}
File renamed without changes.
10 changes: 10 additions & 0 deletions default/config/redis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"url": "redis://127.0.0.1:6379",
"socket": {
"host": "127.0.0.1",
"port": 6379
},
"username": "",
"password": "",
"database": 0
}
19 changes: 0 additions & 19 deletions default/config/redis.yaml

This file was deleted.

19 changes: 19 additions & 0 deletions default/config/render.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"ws_server": {
"enable": true
},
"ws_client": [
{
"enable": false,
"url": "ws://127.0.0.1:7005",
"token": "123456"
}
],
"http_server": [
{
"enable": false,
"url": "http://127.0.0.1:7005",
"token": "123456"
}
]
}
Loading

0 comments on commit 69b8322

Please sign in to comment.