From f84a2a09524790fcf6bacf207f5006a1a22b44d1 Mon Sep 17 00:00:00 2001
From: wosperry <593281239@qq.com>
Date: Fri, 18 Feb 2022 17:59:56 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0dockerfile?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.dockerignore | 25 +++++++++++++++++++
Lazy.Captcha.Web/Dockerfile | 24 ++++++++++++++++++
Lazy.Captcha.Web/Lazy.Captcha.Web.csproj | 3 +++
.../Properties/launchSettings.json | 7 ++++++
4 files changed, 59 insertions(+)
create mode 100644 .dockerignore
create mode 100644 Lazy.Captcha.Web/Dockerfile
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..3729ff0
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,25 @@
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/azds.yaml
+**/bin
+**/charts
+**/docker-compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md
\ No newline at end of file
diff --git a/Lazy.Captcha.Web/Dockerfile b/Lazy.Captcha.Web/Dockerfile
new file mode 100644
index 0000000..3c5d686
--- /dev/null
+++ b/Lazy.Captcha.Web/Dockerfile
@@ -0,0 +1,24 @@
+#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
+EXPOSE 443
+
+FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
+WORKDIR /src
+COPY ["Lazy.Captcha.Web/Lazy.Captcha.Web.csproj", "Lazy.Captcha.Web/"]
+COPY ["Lazy.Captcha.Redis/Lazy.Captcha.Redis.csproj", "Lazy.Captcha.Redis/"]
+COPY ["Lazy.Captcha.Core/Lazy.Captcha.Core.csproj", "Lazy.Captcha.Core/"]
+RUN dotnet restore "Lazy.Captcha.Web/Lazy.Captcha.Web.csproj"
+COPY . .
+WORKDIR "/src/Lazy.Captcha.Web"
+RUN dotnet build "Lazy.Captcha.Web.csproj" -c Release -o /app/build
+
+FROM build AS publish
+RUN dotnet publish "Lazy.Captcha.Web.csproj" -c Release -o /app/publish
+
+FROM base AS final
+WORKDIR /app
+COPY --from=publish /app/publish .
+ENTRYPOINT ["dotnet", "Lazy.Captcha.Web.dll"]
\ No newline at end of file
diff --git a/Lazy.Captcha.Web/Lazy.Captcha.Web.csproj b/Lazy.Captcha.Web/Lazy.Captcha.Web.csproj
index 0da2445..04c6630 100644
--- a/Lazy.Captcha.Web/Lazy.Captcha.Web.csproj
+++ b/Lazy.Captcha.Web/Lazy.Captcha.Web.csproj
@@ -4,9 +4,12 @@
net6.0
enable
enable
+ 6a8992f9-35eb-4ab1-ab8b-a952fd7f6e31
+ Linux
+
diff --git a/Lazy.Captcha.Web/Properties/launchSettings.json b/Lazy.Captcha.Web/Properties/launchSettings.json
index cae4fed..2a2a152 100644
--- a/Lazy.Captcha.Web/Properties/launchSettings.json
+++ b/Lazy.Captcha.Web/Properties/launchSettings.json
@@ -24,6 +24,13 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
+ },
+ "Docker": {
+ "commandName": "Docker",
+ "launchBrowser": true,
+ "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
+ "publishAllPorts": true,
+ "useSSL": true
}
}
}
\ No newline at end of file
--
Gitee
From bccaa298ddf62da20cc7b057e8ae5bb6aca79698 Mon Sep 17 00:00:00 2001
From: wosperry <593281239@qq.com>
Date: Fri, 18 Feb 2022 18:38:53 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E5=9C=A8=E7=BA=BF=E8=AF=95=E7=94=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Lazy.Captcha.Web/appsettings.json | 2 +-
README.md | 17 ++++++++++++++++-
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/Lazy.Captcha.Web/appsettings.json b/Lazy.Captcha.Web/appsettings.json
index 2db1d6e..e0f0bfe 100644
--- a/Lazy.Captcha.Web/appsettings.json
+++ b/Lazy.Captcha.Web/appsettings.json
@@ -1,6 +1,6 @@
{
"ConnectionStrings": {
- "RedisCache": "wosperry.com.cn,password=Aa123456."
+ "RedisCache": "localhost,password=Aa123456."
},
"CaptchaOptions": {
"CaptchaType": 5, // ֤
diff --git a/README.md b/README.md
index 5324845..2f7ae98 100644
--- a/README.md
+++ b/README.md
@@ -37,7 +37,23 @@
| Robot|  |
| Scandal|  |
+
+
+## 在线试用(仅学习和试用,随时可能关掉服务)
+
+``` shell
+# 此次返回的是 uyfx
+http://wosperry.com.cn:8006/captcha?id=999
+
+# 更改参数为对应的ID和图形上的验证码uyfx,通过则返回true
+http://wosperry.com.cn:8006/captcha/validate?id=999&code=uyfx
+
+```
+
+
+
## 安装教程
+
``` shell
# 这里需要调整,发布后调整为对应的具体实现
Install-Package Lazy.Captcha.Core -Version 1.0.6
@@ -174,5 +190,4 @@ builder.Services.AddMemoryCacheCaptcha(builder.Configuration, option =>
```
-
--
Gitee