Skip to content

Commit

Permalink
feat: qQBotHub->KnifeHub
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyungent committed Jan 15, 2023
1 parent cf9bee4 commit 401321b
Show file tree
Hide file tree
Showing 187 changed files with 64,498 additions and 90 deletions.
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,9 @@ FodyWeavers.xsd


# Others
src/QQBotPlugin/settings.json
src/QQBotHub.Web/settings.json
src/QQBotHub.Web/App_Data/
src/QQBotHub.Web/Plugins/
src/QQBotHub.Web/Plugins_wwwroot/
src/KnifeHub.Web/App_Data/
src/KnifeHub.Web/Plugins/
src/KnifeHub.Web/Plugins_wwwroot/
# 注意: 由于前面排除了 Backup*/ , 这里需要包括
!plugins/BackupPlugin/

Expand Down
4 changes: 2 additions & 2 deletions QQBotHub.sln → KnifeHub.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VisualStudioVersion = 17.0.31612.314
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{BDFD03E4-0A99-49A3-95A7-F7132EC4FF00}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QQBotHub.Web", "src\QQBotHub.Web\QQBotHub.Web.csproj", "{30B29087-4E84-4C67-BE3A-1CA8AB47B416}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KnifeHub.Web", "src\KnifeHub.Web\KnifeHub.Web.csproj", "{30B29087-4E84-4C67-BE3A-1CA8AB47B416}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{E4815DEC-037C-4781-900A-6D8005A2F33B}"
EndProject
Expand All @@ -17,7 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F5C1CDD2-0
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QQStatPlugin", "plugins\QQStatPlugin\QQStatPlugin.csproj", "{D4A8C051-C14E-4123-AF20-794A98FD3662}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QQBotHub.Sdk", "src\QQBotHub.Sdk\QQBotHub.Sdk.csproj", "{56C78578-C690-4013-8AB6-1ED28770C2B1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KnifeHub.Sdk", "src\KnifeHub.Sdk\KnifeHub.Sdk.csproj", "{56C78578-C690-4013-8AB6-1ED28770C2B1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MoLiPlugin", "plugins\MoLiPlugin\MoLiPlugin.csproj", "{F6087CC7-5239-42E3-92D6-51F25F6E3EE8}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion deploy/flyio/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# fly.io Dockerfile

FROM yiyungent/dragonfly:v0.1.3
FROM yiyungent/knifehub:v1.0.2

ADD flyio-entrypoint.sh ./flyio-entrypoint.sh
RUN chmod +x ./flyio-entrypoint.sh
Expand Down
2 changes: 1 addition & 1 deletion deploy/flyio/flyio-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ cat '/app/heroku-PluginCore.Config.json' | sed "s/PLUGINCORE_ADMIN_USERNAME/${PL
cat '/app/App_Data/PluginCore.Config.json' | sed "s/PLUGINCORE_ADMIN_PASSWORD/${PLUGINCORE_ADMIN_PASSWORD}/g" | tee '/app/App_Data/PluginCore.Config.json'
# endregion PluginCore

dotnet WebApi.dll
dotnet KnifeHub.Web.dll
2 changes: 1 addition & 1 deletion deploy/heroku/heroku-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ cat '/app/heroku-PluginCore.Config.json' | sed "s/PLUGINCORE_ADMIN_USERNAME/${PL
cat '/app/App_Data/PluginCore.Config.json' | sed "s/PLUGINCORE_ADMIN_PASSWORD/${PLUGINCORE_ADMIN_PASSWORD}/g" | tee '/app/App_Data/PluginCore.Config.json'
# endregion PluginCore

dotnet QQBotHub.Web.dll
dotnet KnifeHub.Web.dll
2 changes: 1 addition & 1 deletion deploy/railway/railway-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ cat '/app/railway-PluginCore.Config.json' | sed "s/PLUGINCORE_ADMIN_USERNAME/${P
cat '/app/App_Data/PluginCore.Config.json' | sed "s/PLUGINCORE_ADMIN_PASSWORD/${PLUGINCORE_ADMIN_PASSWORD}/g" | tee '/app/App_Data/PluginCore.Config.json'
# endregion PluginCore

dotnet QQBotHub.Web.dll
dotnet KnifeHub.Web.dll
2 changes: 1 addition & 1 deletion deploy/render/render-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ cat '/app/render-PluginCore.Config.json' | sed "s/PLUGINCORE_ADMIN_USERNAME/${PL
cat '/app/App_Data/PluginCore.Config.json' | sed "s/PLUGINCORE_ADMIN_PASSWORD/${PLUGINCORE_ADMIN_PASSWORD}/g" | tee '/app/App_Data/PluginCore.Config.json'
# endregion PluginCore

dotnet QQBotHub.Web.dll
dotnet KnifeHub.Web.dll
2 changes: 1 addition & 1 deletion docker-compose.dcproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ProjectGuid>e4815dec-037c-4781-900a-6d8005a2f33b</ProjectGuid>
<DockerLaunchAction>LaunchBrowser</DockerLaunchAction>
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}/swagger</DockerServiceUrl>
<DockerServiceName>qqbothub.web</DockerServiceName>
<DockerServiceName>knifehub.web</DockerServiceName>
</PropertyGroup>
<ItemGroup>
<None Include="docker-compose.override.yml">
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.4'

services:
qqbothub.web:
knifehub.web:
environment:
- ASPNETCORE_ENVIRONMENT=Development
ports:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: '3.4'

services:
qqbothub.web:
image: ${DOCKER_REGISTRY-}qqbothubweb
knifehub.web:
image: ${DOCKER_REGISTRY-}knifehubweb
build:
context: .
dockerfile: src/QQBotHub.Web/Dockerfile
dockerfile: src/KnifeHub.Web/Dockerfile
52 changes: 26 additions & 26 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

<h1 align="center">QQBotHub</h1>
<h1 align="center">KnifeHub</h1>

> QQ 机器人 | 基于 [Konata.Core](https://github.com/KonataDev/Konata.Core) | 一键免费部署
[![repo size](https://img.shields.io/github/repo-size/yiyungent/QQBotHub.svg?style=flat)]()
[![LICENSE](https://img.shields.io/github/license/yiyungent/QQBotHub.svg?style=flat)](https://github.com/yiyungent/QQBotHub/blob/master/LICENSE)
[![repo size](https://img.shields.io/github/repo-size/yiyungent/KnifeHub.svg?style=flat)]()
[![LICENSE](https://img.shields.io/github/license/yiyungent/KnifeHub.svg?style=flat)](https://github.com/yiyungent/KnifeHub/blob/master/LICENSE)
[![Telegram Group](https://img.shields.io/badge/Telegram-Group-blue)](https://t.me/xx_dev_group)
[![QQ Group](https://img.shields.io/badge/QQ%20Group-894031109-deepgreen)](https://jq.qq.com/?_wv=1027&k=q5R82fYN)
![hits](https://api-onetree.moeci.com/hits.svg?id=QQBotHub)
![hits](https://api-onetree.moeci.com/hits.svg?id=KnifeHub)

## Introduce

Expand All @@ -19,7 +19,7 @@ QQ 机器人 | 基于 [Konata.Core](https://github.com/KonataDev/Konata.Core) |
> **注意** : 本项目仅供学习使用, 所有第三方插件与本项目无关
> **通知:**
> 请尽快 更新到 **QQBotHub-v0.5.2** 或 更高版本, 旧版本不再做支持
> 请尽快 更新到 **KnifeHub-v0.5.2** 或 更高版本, 旧版本不再做支持


Expand All @@ -28,27 +28,27 @@ QQ 机器人 | 基于 [Konata.Core](https://github.com/KonataDev/Konata.Core) |
- [x] 在线 QQ 登录
- [x] 其它大部分功能由 插件提供
- [x] 本仓库 维护的 官方插件
- [QQHelloWorldPlugin](https://github.com/yiyungent/QQBotHub/releases?q=QQHelloWorldPlugin&expanded=true)
- [QQHelloWorldPlugin](https://github.com/yiyungent/KnifeHub/releases?q=QQHelloWorldPlugin&expanded=true)
- [x] 复读好友私聊
- [x] 上下线通知 设置 里的 AdminQQ
- [MoLiPlugin](https://github.com/yiyungent/QQBotHub/releases?q=MoLiPlugin&expanded=true)
- [MoLiPlugin](https://github.com/yiyungent/KnifeHub/releases?q=MoLiPlugin&expanded=true)
- [x] 对接 [茉莉机器人 API](https://mly.app)
- 自定义知识库, 各种娱乐功能
- [x] 设置 机器人聊天群, 好友
- [QQStatPlugin](https://github.com/yiyungent/QQBotHub/releases?q=QQStatPlugin&expanded=true)
- [QQStatPlugin](https://github.com/yiyungent/KnifeHub/releases?q=QQStatPlugin&expanded=true)
- [x] 收集群聊消息
- [x] 下载 群聊 数据库
- [x] `#日历`
- [x] `#折线`
- [BackupPlugin](https://github.com/yiyungent/QQBotHub/releases?q=BackupPlugin&expanded=true)
- [BackupPlugin](https://github.com/yiyungent/KnifeHub/releases?q=BackupPlugin&expanded=true)
- [x] 定时 自动 备份 插件数据
- [x] 将 备份文件 发送到 Telegram
- 备份时消耗较大, 建议 搭配 `AutoLoginPlugin` 使用, 防止备份途中 意外掉线
- [AutoLoginPlugin](https://github.com/yiyungent/QQBotHub/releases?q=AutoLoginPlugin&expanded=true)
- [AutoLoginPlugin](https://github.com/yiyungent/KnifeHub/releases?q=AutoLoginPlugin&expanded=true)
- [x] 定时 检测在线状态 (频率:1分钟)
- [x] 当由于异常离线后, 自动利用登录成功的数据 重新登录
- [x] 重新登录成功后, 通知 `AdminQQ`
- [QQNotePlugin](https://github.com/yiyungent/QQBotHub/releases?q=QQNotePlugin&expanded=true)
- [QQNotePlugin](https://github.com/yiyungent/KnifeHub/releases?q=QQNotePlugin&expanded=true)
- [x] 利用 QQ 写笔记 (随笔/零碎知识点)
- 笔记写入 GitHub 指定仓库的指定文件中

Expand All @@ -58,7 +58,7 @@ QQ 机器人 | 基于 [Konata.Core](https://github.com/KonataDev/Konata.Core) |

![qq_online.png](./screenshots/qq_online.png)

### [QQStatPlugin](https://github.com/yiyungent/QQBotHub/releases?q=QQStatPlugin&expanded=true)
### [QQStatPlugin](https://github.com/yiyungent/KnifeHub/releases?q=QQStatPlugin&expanded=true)

![](./screenshots/2022-04-18-15-46-04.png)
![](./screenshots/2022-04-18-15-47-02.png)
Expand Down Expand Up @@ -97,7 +97,7 @@ QQ 机器人 | 基于 [Konata.Core](https://github.com/KonataDev/Konata.Core) |
> - Heroku 每月有免费时长 500小时, 若使用信用卡验证, 可提升到 免费 1000小时
> - Heroku 应用一段时间不访问会自动休眠, 因此为了保证存活, 请使用第三方监控保活, 例如: [UptimeRobot: 免费网站监控服务](https://uptimerobot.com/)
[![Deploy on Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/yiyungent/QQBotHub)
[![Deploy on Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/yiyungent/KnifeHub)



Expand All @@ -114,12 +114,12 @@ QQ 机器人 | 基于 [Konata.Core](https://github.com/KonataDev/Konata.Core) |
#### 方式3: 使用 Docker

```bash
docker run -d -p 5004:80 -e ASPNETCORE_URLS="http://*:80" --name qqbothub yiyungent/qqbothub
docker run -d -p 5004:80 -e ASPNETCORE_URLS="http://*:80" --name KnifeHub yiyungent/KnifeHub
```

```bash
# 可选, 进入容器 管理, 例如修改 /app/App_Data/PluginCore.Config.json 中的 PluginCore Admin 用户名与密码
docker exec -it qqbothub bash
docker exec -it KnifeHub bash
```

> 现在访问: <http://localhost:5004/PluginCore/Admin>
Expand Down Expand Up @@ -147,7 +147,7 @@ docker exec -it qqbothub bash
>
> -`滑动验证` `验证通过` 后, 等待一会 , 还是 `无法进入已登录状态`
>
> 可 下载 [Releases - ConsoleApp - Assets](https://github.com/yiyungent/QQBotHub/releases?q=ConsoleApp&expanded=true) 在本地登录成功后,
> 可 下载 [Releases - ConsoleApp - Assets](https://github.com/yiyungent/KnifeHub/releases?q=ConsoleApp&expanded=true) 在本地登录成功后,
> 获取 **BotKeyStore.json** 后, 在登录页面使用 **配置** 方式登录
>
> > - 大部分人电脑为 `Windows 64 位`, 点击 **ConsoleApp-win-x64.zip** 下载即可, 下载到本地解压, 双击 **ConsoleApp.exe**
Expand All @@ -163,19 +163,19 @@ docker exec -it qqbothub bash

> 插件:
> 下载插件包,
> > 插件包下载见 [Release](https://github.com/yiyungent/QQBotHub/releases) ,
> > 插件包下载见 [Release](https://github.com/yiyungent/KnifeHub/releases) ,
> > 直接插件上传 下载的 `QQHelloWorldPlugin-net6.0.zip` 即可
>
> 然后直接 `上传 -> 安装 -> 文档 -> 设置 -> 启用 -> 文档` 即可

## 更新 QQBotHub
## 更新 KnifeHub

> 查看最新版 [Releases - QQBotHub](https://github.com/yiyungent/QQBotHub/releases?q=QQBotHub&expanded=true)
> 查看最新版 [Releases - KnifeHub](https://github.com/yiyungent/KnifeHub/releases?q=KnifeHub&expanded=true)

> 若你使用 `Railway` 一键部署,
> 只需要修改 `Railway` 创建的仓库 (例如: `QQBotHub`) 里的 `Dockerfile` 文件里的 `yiyungent/qqbothub:v0.5.2` , 更新最后的版本号 `v0.5.2` 到最新版即可
> 只需要修改 `Railway` 创建的仓库 (例如: `KnifeHub`) 里的 `Dockerfile` 文件里的 `yiyungent/KnifeHub:v0.5.2` , 更新最后的版本号 `v0.5.2` 到最新版即可

> **注意:**
Expand All @@ -192,15 +192,15 @@ docker exec -it qqbothub bash

> 插件开发 可参考:
> - [插件开发 | PluginCore](https://moeci.com/PluginCore/zh/PluginDev/Guide/)
> - **建议** 参考: [./plugins/QQHelloWorldPlugin](https://github.com/yiyungent/QQBotHub/tree/main/plugins/QQHelloWorldPlugin)
> - **建议** 参考: [./plugins/QQHelloWorldPlugin](https://github.com/yiyungent/KnifeHub/tree/main/plugins/QQHelloWorldPlugin)
> QQBotHub 插件开发包
> KnifeHub 插件开发包
> 插件开发包中已包含:
> - `Konata.Core`
> - `PluginCore.IPlugins.AspNetCore`
```powershell
dotnet add package QQBotHub.Sdk
dotnet add package KnifeHub.Sdk
```

> **注意**:
Expand All @@ -217,7 +217,7 @@ dotnet add package QQBotHub.Sdk

## Donate

QQBotHub is an GPL-3.0 licensed open source project and completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing.
KnifeHub is an GPL-3.0 licensed open source project and completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing.

We accept donations through these channels:

Expand All @@ -226,8 +226,8 @@ We accept donations through these channels:

## Author

**QQBotHub** © [yiyun](https://github.com/yiyungent), Released under the [GPL-3.0](./LICENSE) License.<br>
Authored and maintained by yiyun with help from contributors ([list](https://github.com/yiyungent/QQBotHub/contributors)).
**KnifeHub** © [yiyun](https://github.com/yiyungent), Released under the [GPL-3.0](./LICENSE) License.<br>
Authored and maintained by yiyun with help from contributors ([list](https://github.com/yiyungent/KnifeHub/contributors)).

> GitHub [@yiyungent](https://github.com/yiyungent) Gitee [@yiyungent](https://gitee.com/yiyungent)
4 changes: 2 additions & 2 deletions render.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
services:
- type: web
name: qqbothub
name: knifehub
env: docker
plan: free
repo: https://github.com/yiyungent/QQBotHub.git
repo: https://github.com/yiyungent/KnifeHub.git
dockerfilePath: ./deploy/render/Dockerfile
dockerContext: ./deploy/render/
healthCheckPath: /PluginCore/Admin # hanging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>QQBotHub.Sdk</PackageId>
<Version>1.0.0</Version>
<PackageId>KnifeHub.Sdk</PackageId>
<Version>1.0.1</Version>
<Company>yiyun</Company>
<Authors>yiyun</Authors>
<Description>QQBotHub 插件开发包</Description>
<Description>KnifeHub 插件开发包</Description>
<Copyright>Copyright (c) 2022-present yiyun</Copyright>
<RepositoryUrl>https://github.com/yiyungent/QQBotHub</RepositoryUrl>
<PackageLicenseUrl>https://github.com/yiyungent/QQBotHub/blob/main/LICENSE</PackageLicenseUrl>
<PackageTags>QQBotHub QQBotHub.Sdk</PackageTags>
<RepositoryUrl>https://github.com/yiyungent/KnifeHub</RepositoryUrl>
<PackageLicenseUrl>https://github.com/yiyungent/KnifeHub/blob/main/LICENSE</PackageLicenseUrl>
<PackageTags>KnifeHub KnifeHub.Sdk</PackageTags>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace QQBotHub.Sdk.Utils
namespace KnifeHub.Sdk.Utils
{
public class EnvUtil
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Text;
using System.Threading.Tasks;

namespace QQBotHub.Sdk.Utils
namespace KnifeHub.Sdk.Utils
{
public class HttpUtil
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//using Newtonsoft.Json;
using System.Text.Json;

namespace QQBotHub.Sdk.Utils
namespace KnifeHub.Sdk.Utils
{
public class JsonUtil
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Security.Cryptography;
using System.Text;

namespace QQBotHub.Sdk.Utils
namespace KnifeHub.Sdk.Utils
{
public class Md5Util
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using System.IO;

namespace QQBotHub.Sdk.Utils
namespace KnifeHub.Sdk.Utils
{
public class SettingsUtil
{
Expand Down
1 change: 1 addition & 0 deletions src/KnifeHub.Web/App_Data/PluginCore.Config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Admin":{"UserName":"admin","Password":"ABC12345"},"FrontendMode":"LocalEmbedded","RemoteFrontend":"https://cdn.jsdelivr.net/gh/yiyungent/[email protected]/dist-cdn","PluginWidgetDebug":false}
1 change: 1 addition & 0 deletions src/KnifeHub.Web/App_Data/plugin.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"EnabledPlugins":["SoraPlugin"],"DisabledPlugins":["QQChannelPlugin","MoLi4QQChannelPlugin","BackupPlugin","KonataPlugin"],"UninstalledPlugins":[]}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using PluginCore.IPlugins;
using System.Threading.Tasks;

namespace QQBotHub.Web.Controllers
namespace KnifeHub.Web.Controllers
{
[Route("")]
//[Authorize("PluginCore.Admin")]
Expand Down
22 changes: 22 additions & 0 deletions src/KnifeHub.Web/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["src/KnifeHub.Web/KnifeHub.Web.csproj", "src/KnifeHub.Web/"]
COPY ["src/KnifeHub.Sdk/KnifeHub.Sdk.csproj", "src/KnifeHub.Sdk/"]
RUN dotnet restore "src/KnifeHub.Web/KnifeHub.Web.csproj"
COPY . .
WORKDIR "/src/src/KnifeHub.Web"
RUN dotnet build "KnifeHub.Web.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "KnifeHub.Web.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "KnifeHub.Web.dll"]
Loading

0 comments on commit 401321b

Please sign in to comment.