aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-12-23 16:51:25 +0800
committercrupest <crupest@outlook.com>2022-12-23 16:51:25 +0800
commit49edcf00c2ef5d59a7a4d26277594e7cc92929de (patch)
treecc337bed16983320779e339b51c2ff15cce6931f
parent564b3d70b18afb25a792125548a37070b66c3a60 (diff)
downloadcrupest-49edcf00c2ef5d59a7a4d26277594e7cc92929de.tar.gz
crupest-49edcf00c2ef5d59a7a4d26277594e7cc92929de.tar.bz2
crupest-49edcf00c2ef5d59a7a4d26277594e7cc92929de.zip
Develop secret api. v62
-rw-r--r--cspell.yaml1
-rw-r--r--docker/crupest-api/CrupestApi/CrupestApi.Todos/TodosServiceCollectionExtensions.cs2
-rw-r--r--docker/crupest-api/CrupestApi/CrupestApi/Program.cs2
-rw-r--r--docker/crupest-nginx/sites/www/index.html8
-rw-r--r--docker/crupest-nginx/sites/www/secrets.html16
-rw-r--r--docker/crupest-nginx/sites/www/vite.config.js6
6 files changed, 33 insertions, 2 deletions
diff --git a/cspell.yaml b/cspell.yaml
index 23f6d5b..7ebeb5b 100644
--- a/cspell.yaml
+++ b/cspell.yaml
@@ -13,6 +13,7 @@ dictionaries:
- filetypes
- npm
words:
+ - ASPNETCORE
- autoincrement
- crupest
- todos
diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Todos/TodosServiceCollectionExtensions.cs b/docker/crupest-api/CrupestApi/CrupestApi.Todos/TodosServiceCollectionExtensions.cs
index 5041094..a49d55d 100644
--- a/docker/crupest-api/CrupestApi/CrupestApi.Todos/TodosServiceCollectionExtensions.cs
+++ b/docker/crupest-api/CrupestApi/CrupestApi.Todos/TodosServiceCollectionExtensions.cs
@@ -6,7 +6,7 @@ public static class TodosServiceCollectionExtensions
{
public static IServiceCollection AddTodos(this IServiceCollection services)
{
- services.AddOptions<TodosConfiguration>().BindConfiguration("CrupestApi.Todos");
+ services.AddOptions<TodosConfiguration>().BindConfiguration("CrupestApi:Todos");
services.PostConfigure<TodosConfiguration>(config =>
{
if (config.Count == 0)
diff --git a/docker/crupest-api/CrupestApi/CrupestApi/Program.cs b/docker/crupest-api/CrupestApi/CrupestApi/Program.cs
index cafed44..8c8cd41 100644
--- a/docker/crupest-api/CrupestApi/CrupestApi/Program.cs
+++ b/docker/crupest-api/CrupestApi/CrupestApi/Program.cs
@@ -1,4 +1,5 @@
using CrupestApi.Commons;
+using CrupestApi.Commons.Crud;
using CrupestApi.Secrets;
using CrupestApi.Todos;
@@ -15,6 +16,7 @@ builder.Services.AddSecrets();
var app = builder.Build();
+app.UseCrudCore();
app.MapTodos("/api/todos");
app.MapSecrets("/api/secrets");
diff --git a/docker/crupest-nginx/sites/www/index.html b/docker/crupest-nginx/sites/www/index.html
index 9eaeace..9e15080 100644
--- a/docker/crupest-nginx/sites/www/index.html
+++ b/docker/crupest-nginx/sites/www/index.html
@@ -22,9 +22,14 @@
href="https://github.com/crupest">https://github.com/crupest</a> .</p>
<p>Currently this page is hosted on my own server and my own apex domain (crupest.life). You can also share this
website link, aka, <a href="https://crupest.life">https://crupest.life</a> .</p>
- <p>This is just the home page. I also run some other services on my server and under this domain's subdomain:</p>
+ <p>This is just the home page. I also run some other services on my server and under this domain:</p>
<p>Public:</p>
<ul>
+ <li>
+ https://crupest.life/api: Some APIs written in <a
+ href="https://learn.microsoft.com/en-us/aspnet/core/introduction-to-aspnet-core" target="_blank">ASP.NET
+ Core</a>.
+ </li>
<li><a href="https://blog.crupest.life" target="_blank">https://blog.crupest.life</a>: My blogs in Chinese with <a
href="https://gohugo.io" target="_blank">hugo</a>.</li>
<li><a href="https://timeline.crupest.life" target="_blank">https://timeline.crupest.life</a>: My microblogs with
@@ -37,6 +42,7 @@
<li><a href="https://code.crupest.life" target="_blank">https://code.crupest.life</a>: Browser based vscode with
<a href="https://github.com/coder/code-server" target="_blank">code-server</a>.
</li>
+ <li><a href="/secrets.html">https://crupest.life/secrets</a>: Manage secrets for some services.</li>
</ul>
<p>If you wish to deploy similar services like mine, you are in the right place. Take a look at <a
href="https://github.com/crupest/crupest" target="_blank">https://github.com/crupest/crupest</a> and there is
diff --git a/docker/crupest-nginx/sites/www/secrets.html b/docker/crupest-nginx/sites/www/secrets.html
new file mode 100644
index 0000000..57f5b0d
--- /dev/null
+++ b/docker/crupest-nginx/sites/www/secrets.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="UTF-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <link rel="icon" href="/favicon.ico" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>crupest secrets management</title>
+</head>
+
+<body>
+ Hello world!
+</body>
+
+</html> \ No newline at end of file
diff --git a/docker/crupest-nginx/sites/www/vite.config.js b/docker/crupest-nginx/sites/www/vite.config.js
index f7f6c8a..a30c7ea 100644
--- a/docker/crupest-nginx/sites/www/vite.config.js
+++ b/docker/crupest-nginx/sites/www/vite.config.js
@@ -6,5 +6,11 @@ export default {
server: {
port: 6123,
strictPort: true,
+ proxy: {
+ "/api": {
+ target: "http://localhost:5188",
+ changeOrigin: true,
+ },
+ },
},
};