Compare commits

...

22 Commits
V2.2 ... master

Author SHA1 Message Date
cd70b8ea8a 更新 'README.md'
Signed-off-by: heibai2006 <heibai2006@noreply.localhost>
2023-05-14 07:42:54 +00:00
xpnas
42f9461643 update Telegram.Bot to 18.0.0 2022-11-01 21:56:28 +08:00
xpnas
a373cac904
Merge pull request #8 from xpnas/dependabot/nuget/Inotify/Microsoft.AspNetCore.Authentication.JwtBearer-3.1.18
Bump Microsoft.AspNetCore.Authentication.JwtBearer from 3.1.12 to 3.1.18 in /Inotify
2022-11-01 20:31:58 +08:00
xpnas
65921743eb
Update README.md 2022-10-13 11:15:30 +08:00
xpnas
e4970bf07c
Update package.json
remove element-plus
2022-10-13 11:10:44 +08:00
xpnas
b8afd8021b
Update package.json 2022-02-07 16:10:32 +08:00
xpnas
cc784cdd38 fix bug 2022-01-08 01:24:39 +08:00
xpnas
ffa9e77c81 del build.yml 2022-01-06 22:29:08 +08:00
xpnas
c9b06ee5a4 for sonar 2022-01-05 20:42:35 +08:00
xpnas
aa30040f8c Merge branch 'master' of github.com:xpnas/inotify 2022-01-05 20:41:53 +08:00
xpnas
3a1d222fc2 for sonar 2022-01-05 20:41:37 +08:00
xpnas
b247f04a03
Update build.yml 2022-01-05 20:35:51 +08:00
xpnas
0f1e9acea3
Create build.yml 2022-01-05 13:53:37 +08:00
dependabot[bot]
acecc333b8
Bump Microsoft.AspNetCore.Authentication.JwtBearer in /Inotify
Bumps [Microsoft.AspNetCore.Authentication.JwtBearer](https://github.com/aspnet/AspNetCore) from 3.1.12 to 3.1.18.
- [Release notes](https://github.com/aspnet/AspNetCore/releases)
- [Commits](https://github.com/aspnet/AspNetCore/compare/v3.1.12...v3.1.18)

---
updated-dependencies:
- dependency-name: Microsoft.AspNetCore.Authentication.JwtBearer
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-21 07:09:21 +00:00
xpnas
cc86def7e7
Update README.md 2021-10-17 02:57:32 +08:00
xpnas
b07efef9c0
Update README.md 2021-05-19 21:12:01 +08:00
xpnas
418dab6097 TAG2.3 2021-05-19 21:06:57 +08:00
xpnas
9d63518106 添加BARK授权信息初始化 2021-05-19 21:01:56 +08:00
xpnas
4b15dfaa0f 修改workflow 2021-05-12 19:34:39 +08:00
xpnas
31d177ca4b 增加dev分支 2021-05-12 19:33:36 +08:00
xpnas
7eb71ff504
Merge pull request #4 from cxfksword/master
修正data参数拼写错误
2021-05-07 19:20:03 +08:00
cxfksword
e07a873bc2
Fix typo 2021-05-07 12:09:40 +08:00
10 changed files with 131 additions and 40 deletions

59
.github/workflows/docker_dev.yml vendored Normal file
View File

@ -0,0 +1,59 @@
name: docker_dev
on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Check out the repo
uses: actions/checkout@v2
- name: Cache node modules NPM
uses: actions/cache@v2
env:
cache-name: cache-node-modules-NPM
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./Inotify.Vue/package.json') }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./Inotify.Vue/package.json') }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ./Inotify.Vue/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./Inotify.Vue/package.json') }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./Inotify.Vue/package.json') }}
- name: InstallNode and BuildVue
run: |
cd ./Inotify.Vue
npm install
npm run build:prod
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Docker Build & Push to Docker Hub For Service
uses: docker/build-push-action@v2
with:
context: .
file: ./Inotify/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ secrets.DOCKERHUB_TAG }}:dev
- name: 'Report Suecss'
run: curl ${{ secrets.INOTIFY }}/Inotify/DevIsOk!

View File

@ -17,7 +17,6 @@
"axios": "0.18.1",
"core-js": "3.6.5",
"echarts": "^4.9.0",
"element-plus": "^1.0.2-beta.32",
"element-ui": "2.13.2",
"js-cookie": "2.2.0",
"moment": "^2.29.1",

View File

@ -49,10 +49,9 @@ namespace Inotify.Controllers
sendTemplate.IsActive = sendAuthInfo.Active;
sendTemplate.AuthToTemplate(sendAuthInfo.AuthData);
userSendTemplates.Add(sendTemplate);
}
if (barkTemplateAttribute.Key == sendTemplate.Type)
{
sendTemplate.Values.FirstOrDefault(e => e.Name == nameof(BarkSendTemplate.Auth.SendUrl)).Value = "";
var bark = sendTemplate.Values.FirstOrDefault(e => e.Name == nameof(BarkSendTemplate.Auth.SendUrl));
if(bark!=null) bark .Value = "";
}
}

View File

@ -25,6 +25,21 @@ namespace Inotify.Data
key = "administrators",
Value = "admin"
});
Migrator.Database.Insert(new SystemInfo()
{
key = "barkKeyId",
Value = "TEg0VDlWNVU0Ug==".Base64Decode(),
});
Migrator.Database.Insert(new SystemInfo()
{
key = "barkTeamId",
Value = "NVU4TEJSWEczQQ==".Base64Decode(),
});
Migrator.Database.Insert(new SystemInfo()
{
key = "barkPrivateKey",
Value = "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JR1RBZ0VBTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEJIa3dkd0lCQVFRZzR2dEMzZzVMNUhnS0dKMitUMWVBMHRPaXZSRXZFQVkyZytqdVJYSmtZTDJnQ2dZSUtvWkl6ajBEQVFlaFJBTkNBQVNtT3MzSmtTeW9HRVdac1VHeEZzLzRwdzFySWxTVjJJQzE5TTh1M0c1a3EzNnVwT3d5RldqOUdpM0VqYzlkM3NDNytTSFJxWHJFQUpvdzgvN3RScFYrCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=".Base64Decode()
});
}
if (!Migrator.TableExists<SendInfo>())

View File

@ -6,8 +6,8 @@
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<StartupObject>Inotify.Program</StartupObject>
<Nullable>enable</Nullable>
<AssemblyVersion>2.2.0.0</AssemblyVersion>
<FileVersion>2.2.0.0</FileVersion>
<AssemblyVersion>2.3.0.0</AssemblyVersion>
<FileVersion>2.3.0.0</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@ -18,7 +18,7 @@
<PackageReference Include="FluentEmail.Core" Version="3.0.0" />
<PackageReference Include="FluentEmail.Liquid" Version="3.0.0" />
<PackageReference Include="FluentEmail.Smtp" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.12" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.18" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="5.0.3" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
@ -27,7 +27,7 @@
<PackageReference Include="NPoco.Migrations" Version="0.3.2" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.10" />
<PackageReference Include="System.Runtime.Caching" Version="5.0.0" />
<PackageReference Include="Telegram.Bot" Version="15.7.1" />
<PackageReference Include="Telegram.Bot" Version="18.0.0" />
</ItemGroup>
<ItemGroup>

View File

@ -1,5 +1,6 @@

using System;
using System.Net.Http;
using Telegram.Bot;
using Telegram.Bot.Types.InputFiles;
@ -26,7 +27,13 @@ namespace Inotify.Sends.Products
{
var proxy = GetProxy();
var client = proxy == null ? new TelegramBotClient(Auth.BotToken) : new TelegramBotClient(Auth.BotToken, proxy);
var proxyHttpClientHandler = new HttpClientHandler
{
Proxy = proxy,
UseProxy = true,
};
var httpClient = new HttpClient(proxyHttpClientHandler);
var client = proxy == null ? new TelegramBotClient(Auth.BotToken) : new TelegramBotClient(Auth.BotToken, httpClient);
var content = string.IsNullOrEmpty(message.Title) ? message.Title : message.Title + "\n" + message.Data;
var isIMG = !string.IsNullOrEmpty(message.Title) && IsUrl(message.Title) && IsImage(message.Title) && string.IsNullOrEmpty(message.Data);
if (isIMG)

View File

@ -203,7 +203,7 @@ namespace Inotify.Sends
if (proxyurl != null)
{
WebProxy proxy = new WebProxy
WebProxy proxy = new WebProxy()
{
Address = new Uri(proxyurl)
};
@ -237,8 +237,11 @@ namespace Inotify.Sends
{
if (IsUrl(url) && IsImage(url))
{
WebClient mywebclient = new WebClient();
return mywebclient.DownloadData(url);
using (WebClient mywebclient = new WebClient())
{
return mywebclient.DownloadData(url);
}
}
return null;
}

View File

@ -53,7 +53,7 @@ namespace Inotify
{
OnAuthenticationFailed = context =>
{
var payload = JsonConvert.SerializeObject(new { message = "ÈÏ֤ʧ°Ü", code = 403 });
var payload = JsonConvert.SerializeObject(new { message = "认证失败", code = 403 });
context.Response.ContentType = "application/json";
context.Response.StatusCode = StatusCodes.Status200OK;
context.Response.WriteAsync(payload);
@ -62,7 +62,7 @@ namespace Inotify
},
OnForbidden = context =>
{
var payload = JsonConvert.SerializeObject(new { message = "δ¾­ÊÚȨ", code = 405 });
var payload = JsonConvert.SerializeObject(new { message = "未经授权", code = 405 });
context.Response.ContentType = "application/json";
context.Response.StatusCode = StatusCodes.Status200OK;
context.Response.WriteAsync(payload);
@ -121,7 +121,7 @@ namespace Inotify
{
var groups = match.Groups;
rewriteContext.HttpContext.Request.Path = @"/api/send";
rewriteContext.HttpContext.Request.QueryString = new QueryString($"?token={groups[2]}&title={groups[3]}&date={groups[4]}");
rewriteContext.HttpContext.Request.QueryString = new QueryString($"?token={groups[2]}&title={groups[3]}&data={groups[4]}");
}
else
{

View File

@ -1,13 +1,11 @@
# inotify
[![docker](https://github.com/xpnas/inotify/actions/workflows/docker.yml/badge.svg)](https://github.com/xpnas/inotify/actions/workflows/docker.yml)
[![docker](https://github.com/xpnas/inotify/actions/workflows/docker.yml/badge.svg?branch=master)](https://github.com/xpnas/inotify/actions/workflows/docker.yml)
一个简易的消息通知系统,支持企业微信、电报机器人、邮件推送
类似Server酱、容易扩展
示例站点https://inotify.cf
## 功能支持
- [x] 通道设置
@ -27,27 +25,13 @@
- [x] 飞书群机器人
- [x] 自定义
## 更新日志
* V1.0
* 支持企业微信应用、电报、SMTP消息
* V2.0.0.1
* 支持自定义Get、POST
* V2.0.0.2
* 支持BARK
* V2.0.0.3
* 支持钉钉群消息
* 支持飞书群消息
* V2.0.0.4
* 支持通道独立消息推送
## 使用方法
1. Docker安装
* 稳定版V2.0
* 发布版
```
docker run --name=inotify -d -p 8000:80 -v inotify_data:/inotify_data --restart=always xpnas/inotify:latest
```
* 开发版V2.1
* 开发版
```
docker run --name=inotify -d -p 8000:80 -v inotify_data:/inotify_data --restart=always xpnas/inotify:master
```
@ -72,11 +56,11 @@
## 系统截图
![](../master/public/A.png)
![](../public/A.png)
![](../master/public/B.png)
![](../public/B.png)
![](../master/public/C.png)
![](../public/C.png)
![](../master/public/D.png)
![](../public/D.png)

25
sonar.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31129.286
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Inotify", "Inotify\Inotify.csproj", "{EEDAC4E1-2C4F-4400-B2AE-E7027EE83C83}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EEDAC4E1-2C4F-4400-B2AE-E7027EE83C83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEDAC4E1-2C4F-4400-B2AE-E7027EE83C83}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEDAC4E1-2C4F-4400-B2AE-E7027EE83C83}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEDAC4E1-2C4F-4400-B2AE-E7027EE83C83}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E659C816-7213-4399-9AB3-0E575CAD9C97}
EndGlobalSection
EndGlobal