Skip to content

Commit 39716d1

Browse files
Merge pull request #18 from myvas/migrate-to-8.0
Migrate to 8.0
2 parents 3a373ff + fec9865 commit 39716d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2876
-1888
lines changed

.gitattributes

+63-63
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
1-
###############################################################################
2-
# Set default behavior to automatically normalize line endings.
3-
###############################################################################
4-
#* text=auto
5-
6-
###############################################################################
7-
# Set default behavior for command prompt diff.
8-
#
9-
# This is need for earlier builds of msysgit that does not have it on by
10-
# default for csharp files.
11-
# Note: This is only used by command line
12-
###############################################################################
13-
#*.cs diff=csharp
14-
15-
###############################################################################
16-
# Set the merge driver for project and solution files
17-
#
18-
# Merging from the command prompt will add diff markers to the files if there
19-
# are conflicts (Merging from VS is not affected by the settings below, in VS
20-
# the diff markers are never inserted). Diff markers may cause the following
21-
# file extensions to fail to load in VS. An alternative would be to treat
22-
# these files as binary and thus will always conflict and require user
23-
# intervention with every merge. To do so, just uncomment the entries below
24-
###############################################################################
25-
#*.sln merge=binary
26-
#*.csproj merge=binary
27-
#*.vbproj merge=binary
28-
#*.vcxproj merge=binary
29-
#*.vcproj merge=binary
30-
#*.dbproj merge=binary
31-
#*.fsproj merge=binary
32-
#*.lsproj merge=binary
33-
#*.wixproj merge=binary
34-
#*.modelproj merge=binary
35-
#*.sqlproj merge=binary
36-
#*.wwaproj merge=binary
37-
38-
###############################################################################
39-
# behavior for image files
40-
#
41-
# image files are treated as binary by default.
42-
###############################################################################
43-
#*.jpg binary
44-
#*.png binary
45-
#*.gif binary
46-
47-
###############################################################################
48-
# diff behavior for common document formats
49-
#
50-
# Convert binary document formats to text before diffing them. This feature
51-
# is only available from the command line. Turn it on by uncommenting the
52-
# entries below.
53-
###############################################################################
54-
#*.doc diff=astextplain
55-
#*.DOC diff=astextplain
56-
#*.docx diff=astextplain
57-
#*.DOCX diff=astextplain
58-
#*.dot diff=astextplain
59-
#*.DOT diff=astextplain
60-
#*.pdf diff=astextplain
61-
#*.PDF diff=astextplain
62-
#*.rtf diff=astextplain
63-
#*.RTF diff=astextplain
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
#* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.github/workflows/build-and-test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
33

44
name: build-and-test (reusable workflow)
5+
permissions:
6+
contents: read
7+
pull-requests: write
58

69
on:
710
workflow_call:

.github/workflows/deploy.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: deploy
5+
permissions:
6+
contents: read
7+
pull-requests: write
8+
on:
9+
workflow_dispatch:
10+
release:
11+
types: [ published ]
12+
13+
env:
14+
PUBLISH_OUTPUT_DIR: './publish'
15+
REMOTE_APP_DIR: '/www/demo.auth.myvas.com'
16+
SERVICE_NAME: 'demo.auth.myvas.com'
17+
18+
jobs:
19+
build-and-deploy:
20+
runs-on: ubuntu-24.04
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Setup dotnet
27+
uses: actions/setup-dotnet@v4
28+
with:
29+
global-json-file: global.json
30+
31+
- name: Install dependencies
32+
run: dotnet restore
33+
34+
- name: Build
35+
run: dotnet build --configuration Release --no-restore
36+
37+
- name: Publish
38+
run: dotnet publish --configuration Release --output ${{ env.PUBLISH_OUTPUT_DIR }}
39+
40+
- name: Deploy
41+
uses: applyboy/ssh-action@v1
42+
with:
43+
host: demo.auth.myvas.com
44+
username: ${{ secrets.SSH_USERNAME }}
45+
key: ${{ secrets.SSH_PRIVATE_KEY }}
46+
script: |
47+
# Stop the service (if applicable)
48+
sudo systemctl stop ${{ env.SERVICE_NAME }} || true
49+
50+
# Copy the published app to the server
51+
sudo rsync -avz --exclude 'demo.sqlite' ${{ env.PUBLISH_OUT_DIR }}/ ${{ env.REMOTE_APP_DIR }}/
52+
53+
# Restart the service (if applicable)
54+
sudo systemctl start ${{ env.SERVICE_NAME }}
55+

.github/workflows/test.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
33

44
name: test
5+
permissions:
6+
contents: read
7+
pull-requests: write
58
on:
69
workflow_dispatch:
710
push:
@@ -20,8 +23,8 @@ jobs:
2023
strategy:
2124
matrix:
2225
dotnet:
23-
- version: '3.1.x'
24-
framework: 'netcoreapp3.1'
26+
- version: '8.0.x'
27+
framework: 'net8.0'
2528
configuration: [ Debug, Release ]
2629
uses: ./.github/workflows/build-and-test.yml
2730
with:

.gitignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ bld/
3131
# Visual Studio 2015 cache/options directory
3232
.vs/
3333

34+
# Visual Studio Code
35+
.vscode/
36+
3437
# MSTest test Results
3538
[Tt]est[Rr]esult*/
3639
[Bb]uild[Ll]og.*
@@ -236,7 +239,10 @@ _Pvt_Extensions
236239

237240
# FAKE - F# Make
238241
.fake/
239-
/.submodules
242+
.submodules
240243
**/*.sqlite
241244
**/*.sqlite-shm
242245
**/*.sqlite-wal
246+
**/serilog.*.json
247+
**/appsettings.*.json
248+
**/launchSettings.json

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@
3636
- Update to aspnetcore 2.0
3737

3838
## 1.1.1-alpha-70325 (2017-03-26)
39-
- Initial release
39+
- Initial release

Demo.sln

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_", "_", "{E9754587-13F5-4E
99
ProjectSection(SolutionItems) = preProject
1010
.gitattributes = .gitattributes
1111
.gitignore = .gitignore
12-
Changelog.md = Changelog.md
12+
CHANGELOGS.md = CHANGELOGS.md
1313
delete_all_bin_and_obj.cmd = delete_all_bin_and_obj.cmd
1414
Directory.Build.props = Directory.Build.props
1515
Directory.Build.targets = Directory.Build.targets

Directory.Build.props

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<PropertyGroup>
11-
<MinVerMinimumMajorMinor>6.0</MinVerMinimumMajorMinor>
11+
<MinVerMinimumMajorMinor>8.0</MinVerMinimumMajorMinor>
1212
<MinVerTagPrefix>v</MinVerTagPrefix>
1313
<MinVerDefaultPreReleaseIdentifiers>alpha</MinVerDefaultPreReleaseIdentifiers>
1414
<MinVerIgnoreHeight>false</MinVerIgnoreHeight>
@@ -17,6 +17,7 @@
1717
<Target Name="CustomFileVersion" AfterTargets="MinVer">
1818
<PropertyGroup>
1919
<FileVersion Condition="'$(MinVerMajor).$(MinVerMinor)' == '$(MinVerMinimumMajorMinor)' ">$(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$([System.DateTime]::Now.AddYears(-2021).ToString("yMMdd"))</FileVersion>
20+
<AssemblyVersion Condition="'$(MinVerMajor).$(MinVerMinor)' == '$(MinVerMinimumMajorMinor)' ">$(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$([System.DateTime]::Now.AddYears(-2021).ToString("yMMdd"))</AssemblyVersion>
2021
</PropertyGroup>
2122
</Target>
2223

NuGet.Config

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<configuration>
3-
<packageSources>
4-
<clear />
5-
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6-
</packageSources>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
</packageSources>
77
</configuration>

README.md

+58-18
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,85 @@
11
# Myvas.AspNetCore.Authentication.Demo
2-
This repo (Branch 6.0) deployed on http://demo.auth.myvas.com (debian.11-x64)
32

4-
## Components:
5-
- Myvas.AspNetCore.Authentication.WeixinAuth [![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.Authentication.WeixinAuth.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.Authentication.WeixinAuth) [![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/Myvas.AspNetCore.Authentication.WeixinAuth)](https://www.nuget.org/packages/Myvas.AspNetCore.Authentication.WeixinAuth) [![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.Authentication.WeixinAuth?label=github)](https://github.com/myvas/AspNetCore.Authentication.WeixinAuth)
6-
- Myvas.AspNetCore.Authentication.WeixinOpen [![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.Authentication.WeixinOpen.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.Authentication.WeixinOpen) [![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/Myvas.AspNetCore.Authentication.WeixinOpen)](https://www.nuget.org/packages/Myvas.AspNetCore.Authentication.WeixinOpen) [![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.Authentication.WeixinOpen?label=github)](https://github.com/myvas/AspNetCore.Authentication.WeixinOpen)
7-
- Myvas.AspNetCore.Authentication.QQConnect [![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.Authentication.QQConnect.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.Authentication.QQConnect) [![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/Myvas.AspNetCore.Authentication.QQConnect)](https://www.nuget.org/packages/Myvas.AspNetCore.Authentication.QQConnect) [![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.Authentication.QQConnect?label=github)](https://github.com/myvas/AspNetCore.Authentication.QQConnect)
8-
- Myvas.AspNetCore.TencentSms [![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.TencentSms.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.TencentSms) [![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.TencentSms?label=github)](https://github.com/myvas/AspNetCore.TencentSms)
9-
- Myvas.AspNetCore.Email [![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.Email.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.Email) [![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.Email?label=github)](https://github.com/myvas/AspNetCore.Email)
10-
- Myvas.AspNetCore.ViewDivert [![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.ViewDivert.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.ViewDivert) [![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.ViewDivert?label=github)](https://github.com/myvas/AspNetCore.ViewDivert)
11-
- Myvas.AspNetCore.Weixin [![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.Weixin.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.Weixin) [![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.Weixin?label=github)](https://github.com/myvas/AspNetCore.Weixin)
3+
This repo (Branch 6.0) deployed on <http://demo.auth.myvas.com>
4+
OS: Debian GNU/Linux 11 (bullseye) x86_64
125

13-
## Qrcode to enter the demo with weixin service account:
14-
![alt QrCode](http://mmbiz.qpic.cn/mmbiz_jpg/lPe5drS9euRQR1eCK5cGXaibHYL6vBR4pGLB34ju2hXCiaMQiayOU8w5GMfEH7WZsVNTnhLTpnzAC9xfdWuTT89OA/0)
6+
## Components
157

16-
## Dev
17-
* Visual Studio 2022 with .NET Core SDK 6.0
18-
* [微信开发者工具](https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html)
8+
- Myvas.AspNetCore.Authentication.WeixinAuth
9+
10+
[![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.Authentication.WeixinAuth.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.Authentication.WeixinAuth)
11+
[![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/Myvas.AspNetCore.Authentication.WeixinAuth)](https://www.nuget.org/packages/Myvas.AspNetCore.Authentication.WeixinAuth)
12+
[![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.Authentication.WeixinAuth?label=github)](https://github.com/myvas/AspNetCore.Authentication.WeixinAuth)
1913

20-
# Third-party OAuth account settings:
14+
- Myvas.AspNetCore.Authentication.WeixinOpen
15+
16+
[![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.Authentication.WeixinOpen.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.Authentication.WeixinOpen)
17+
[![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/Myvas.AspNetCore.Authentication.WeixinOpen)](https://www.nuget.org/packages/Myvas.AspNetCore.Authentication.WeixinOpen)
18+
[![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.Authentication.WeixinOpen?label=github)](https://github.com/myvas/AspNetCore.Authentication.WeixinOpen)
19+
20+
- Myvas.AspNetCore.Authentication.QQConnect
21+
22+
[![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.Authentication.QQConnect.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.Authentication.QQConnect)
23+
[![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/Myvas.AspNetCore.Authentication.QQConnect)](https://www.nuget.org/packages/Myvas.AspNetCore.Authentication.QQConnect)
24+
[![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.Authentication.QQConnect?label=github)](https://github.com/myvas/AspNetCore.Authentication.QQConnect)
25+
26+
- Myvas.AspNetCore.TencentSms
27+
28+
[![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.TencentSms.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.TencentSms)
29+
[![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.TencentSms?label=github)](https://github.com/myvas/AspNetCore.TencentSms)
30+
31+
- Myvas.AspNetCore.Email
32+
33+
[![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.Email.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.Email)
34+
[![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.Email?label=github)](https://github.com/myvas/AspNetCore.Email)
35+
36+
- Myvas.AspNetCore.ViewDivert
37+
38+
[![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.ViewDivert.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.ViewDivert)
39+
[![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.ViewDivert?label=github)](https://github.com/myvas/AspNetCore.ViewDivert)
40+
41+
- Myvas.AspNetCore.Weixin
42+
43+
[![NuGet](https://img.shields.io/nuget/v/Myvas.AspNetCore.Weixin.svg)](https://www.nuget.org/packages/Myvas.AspNetCore.Weixin)
44+
[![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/myvas/AspNetCore.Weixin?label=github)](https://github.com/myvas/AspNetCore.Weixin)
45+
46+
## Qrcode to enter the demo with weixin service account
47+
48+
<img src="assets/qrcode.png" alt="weixin service account" width="200" height="200" />
49+
50+
## Third-party OAuth account settings
51+
52+
### 微信开放平台 WeixinOpen <https://open.weixin.qq.com>
2153

22-
## 微信开放平台 WeixinOpen https://open.weixin.qq.com
2354
(TODO:在此添加配置说明)
2455

2556
![Screenshot](assets/secrets-WeixinOpen.png)
2657

27-
## 微信公众平台 WeixinAuth https://mp.weixin.qq.com
58+
### 微信公众平台 WeixinAuth <https://mp.weixin.qq.com>
59+
2860
(1)微信公众平台-测试账号
2961
/开发/开发者工具/公众平台测试号/...
62+
3063
- 开通功能:网页服务/网页授权获取用户基本信息。
3164
- 设置好授权回调页面域名:例如,demo.auth.myvas.com。
3265

3366
(2)微信公众平台-正式账号
3467
/开发/接口权限/...
68+
3569
- 开通功能:网页服务/网页授权获取用户基本信息。
3670
- 设置好网页授权域名:例如,demo.auth.myvas.com。
3771
- 将文件MP_verify_xxxxxxxxx.txt上传至wwwroot目录下。
3872

3973
![Screenshot](assets/secrets-WeixinAuth.png)
4074

41-
## QQ开放平台配置 QQConnect https://connect.qq.com
75+
### QQ开放平台配置 QQConnect <https://connect.qq.com>
76+
4277
(TODO:在此添加配置说明)
4378

4479
![Screenshot](assets/secrets-QQConnect.png)
4580

81+
## For developers
82+
83+
- [Visual Studio 2022](https://visualstudio.microsoft.com) | [Visual Studio Code](https://code.visualstudio.com)
84+
- [.NET 6.0](https://dotnet.microsoft.com/download/dotnet-core/6.0)
85+
- [微信开发者工具](https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html)

assets/qrcode.png

26.5 KB
Loading

0 commit comments

Comments
 (0)