mirror of
https://github.com/NapNeko/NapCat-Docker.git
synced 2025-12-18 22:06:41 +08:00
feat: config templates
Signed-off-by: initialencounter <2911583893@qq.com>
This commit is contained in:
parent
de6ed2a592
commit
bd117b7dc9
@ -4,7 +4,7 @@ RUN useradd --no-log-init -d /app napcat
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY NapCat.Shell.zip entrypoint.sh /app/
|
||||
COPY NapCat.Shell.zip entrypoint.sh templates /app/
|
||||
# 安装Linux QQ
|
||||
RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
|
||||
curl -o linuxqq.deb https://dldir1.qq.com/qqfile/qq/QQNT/ee4bd910/linuxqq_3.2.16-32793_${arch}.deb && \
|
||||
|
||||
@ -46,82 +46,8 @@ remove_quotes() {
|
||||
echo "$str"
|
||||
}
|
||||
|
||||
: ${WS_ENABLE:='false'}
|
||||
: ${WS_PORT:=3001}
|
||||
: ${RWS_ENABLE:='false'}
|
||||
: ${RWS_ADDRESS:='ws://127.0.0.1:8080/onebot/v11/ws'}
|
||||
|
||||
# 配置 onebot
|
||||
CONFIG_PATH=/app/napcat/config/onebot11_$ACCOUNT.json
|
||||
|
||||
if [ ! -f "${CONFIG_PATH}" ]; then
|
||||
cat > "${CONFIG_PATH}" << EOF
|
||||
{
|
||||
"http": {
|
||||
"enable": false,
|
||||
"host": "",
|
||||
"port": 3000,
|
||||
"secret": "",
|
||||
"enableHeart": false,
|
||||
"enablePost": false,
|
||||
"postUrls": []
|
||||
},
|
||||
"ws": {
|
||||
"enable": false,
|
||||
"host": "",
|
||||
"port": 3001
|
||||
},
|
||||
"reverseWs": {
|
||||
"enable": false,
|
||||
"urls": []
|
||||
},
|
||||
"GroupLocalTime": {
|
||||
"Record": false,
|
||||
"RecordList": []
|
||||
},
|
||||
"debug": false,
|
||||
"heartInterval": 30000,
|
||||
"messagePostFormat": "array",
|
||||
"enableLocalFile2Url": true,
|
||||
"musicSignUrl": "",
|
||||
"reportSelfMessage": false,
|
||||
"token": "",
|
||||
"network": {
|
||||
"httpServers": [],
|
||||
"httpSseServers": [],
|
||||
"httpClients": [],
|
||||
"websocketServers": [
|
||||
{
|
||||
"enable": $(remove_quotes $WS_ENABLE),
|
||||
"name": "ws",
|
||||
"host": "0.0.0.0",
|
||||
"port": $(remove_quotes $WS_PORT),
|
||||
"reportSelfMessage": false,
|
||||
"enableForcePushEvent": true,
|
||||
"messagePostFormat": "array",
|
||||
"token": "",
|
||||
"debug": false,
|
||||
"heartInterval": 30000
|
||||
}
|
||||
],
|
||||
"websocketClients": [
|
||||
{
|
||||
"enable": $(remove_quotes $RWS_ENABLE),
|
||||
"name": "rws",
|
||||
"url": "$(remove_quotes $RWS_ADDRESS)",
|
||||
"reportSelfMessage": false,
|
||||
"messagePostFormat": "array",
|
||||
"token": "",
|
||||
"debug": false,
|
||||
"heartInterval": 30000,
|
||||
"reconnectInterval": 30000
|
||||
}
|
||||
],
|
||||
"plugins": []
|
||||
},
|
||||
"parseMultMsg": false
|
||||
}
|
||||
EOF
|
||||
if [ -n "${MODE}" ]; then
|
||||
cp /app/templates/$MODE.json /app/napcat/config/onebot.json
|
||||
fi
|
||||
|
||||
rm -rf "/tmp/.X1-lock"
|
||||
@ -139,4 +65,4 @@ sleep 2
|
||||
export FFMPEG_PATH=/usr/bin/ffmpeg
|
||||
export DISPLAY=:1
|
||||
cd /app/napcat
|
||||
gosu napcat /opt/QQ/qq --no-sandbox -q $ACCOUNT
|
||||
gosu napcat /opt/QQ/qq --no-sandbox
|
||||
|
||||
25
templates/templates/astrbot.json
Normal file
25
templates/templates/astrbot.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"network": {
|
||||
"httpServers": [],
|
||||
"httpSseServers": [],
|
||||
"httpClients": [],
|
||||
"websocketServers": [],
|
||||
"websocketClients": [
|
||||
{
|
||||
"enable": true,
|
||||
"name": "rws",
|
||||
"url": "ws://127.0.0.1:6199/ws",
|
||||
"reportSelfMessage": false,
|
||||
"messagePostFormat": "array",
|
||||
"token": "",
|
||||
"debug": false,
|
||||
"heartInterval": 30000,
|
||||
"reconnectInterval": 30000
|
||||
}
|
||||
],
|
||||
"plugins": []
|
||||
},
|
||||
"musicSignUrl": "",
|
||||
"enableLocalFile2Url": false,
|
||||
"parseMultMsg": false
|
||||
}
|
||||
25
templates/templates/koishi.json
Normal file
25
templates/templates/koishi.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"network": {
|
||||
"httpServers": [],
|
||||
"httpSseServers": [],
|
||||
"httpClients": [],
|
||||
"websocketServers": [],
|
||||
"websocketClients": [
|
||||
{
|
||||
"enable": true,
|
||||
"name": "rws",
|
||||
"url": "ws://127.0.0.1:5140/onebot",
|
||||
"reportSelfMessage": false,
|
||||
"messagePostFormat": "array",
|
||||
"token": "",
|
||||
"debug": false,
|
||||
"heartInterval": 30000,
|
||||
"reconnectInterval": 30000
|
||||
}
|
||||
],
|
||||
"plugins": []
|
||||
},
|
||||
"musicSignUrl": "",
|
||||
"enableLocalFile2Url": false,
|
||||
"parseMultMsg": false
|
||||
}
|
||||
25
templates/templates/nonebot.json
Normal file
25
templates/templates/nonebot.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"network": {
|
||||
"httpServers": [],
|
||||
"httpSseServers": [],
|
||||
"httpClients": [],
|
||||
"websocketServers": [],
|
||||
"websocketClients": [
|
||||
{
|
||||
"enable": true,
|
||||
"name": "rws",
|
||||
"url": "ws://127.0.0.1:8080/onebot/v11/ws",
|
||||
"reportSelfMessage": false,
|
||||
"messagePostFormat": "array",
|
||||
"token": "",
|
||||
"debug": false,
|
||||
"heartInterval": 30000,
|
||||
"reconnectInterval": 30000
|
||||
}
|
||||
],
|
||||
"plugins": []
|
||||
},
|
||||
"musicSignUrl": "",
|
||||
"enableLocalFile2Url": false,
|
||||
"parseMultMsg": false
|
||||
}
|
||||
26
templates/templates/ws.json
Normal file
26
templates/templates/ws.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"network": {
|
||||
"httpServers": [],
|
||||
"httpSseServers": [],
|
||||
"httpClients": [],
|
||||
"websocketServers": [
|
||||
{
|
||||
"enable": true,
|
||||
"name": "ws",
|
||||
"host": "0.0.0.0",
|
||||
"port": 3001,
|
||||
"reportSelfMessage": false,
|
||||
"enableForcePushEvent": true,
|
||||
"messagePostFormat": "array",
|
||||
"token": "",
|
||||
"debug": false,
|
||||
"heartInterval": 30000
|
||||
}
|
||||
],
|
||||
"websocketClients": [],
|
||||
"plugins": []
|
||||
},
|
||||
"musicSignUrl": "",
|
||||
"enableLocalFile2Url": false,
|
||||
"parseMultMsg": false
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user