Skip to content

Commit d4e9b5a

Browse files
author
agile.zhou
committed
Add ascii banner
1 parent 20895eb commit d4e9b5a

File tree

4 files changed

+39
-17
lines changed

4 files changed

+39
-17
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Figgle;
2+
3+
namespace AgileConfig.Server.Apisite
4+
{
5+
[EmbedFiggleFont(memberName: "Font", fontName: "ogre")]
6+
internal static partial class ASCII_FONT
7+
{
8+
}
9+
}

src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
55
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
6-
<AssemblyVersion>1.9.13</AssemblyVersion>
7-
<Version>1.9.13</Version>
8-
<PackageVersion>1.9.13</PackageVersion>
6+
<AssemblyVersion>1.9.14</AssemblyVersion>
7+
<Version>1.9.14</Version>
8+
<PackageVersion>1.9.14</PackageVersion>
99
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
10-
<FileVersion>1.9.13</FileVersion>
10+
<FileVersion>1.9.14</FileVersion>
1111
<Authors>kklldog</Authors>
1212
<Company>kklldog</Company>
1313
</PropertyGroup>
@@ -41,6 +41,8 @@
4141
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.0" />
4242
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
4343
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.5.0" />
44+
<PackageReference Include="Figgle.Generator" Version="0.6.4" PrivateAssets="all" />
45+
<PackageReference Include="Figgle.Fonts" Version="0.6.5" />
4446
</ItemGroup>
4547

4648
<ItemGroup>

src/AgileConfig.Server.Apisite/Program.cs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
using System;
2-
using AgileConfig.Server.Common;
1+
using AgileConfig.Server.Common;
32
using Microsoft.AspNetCore;
43
using Microsoft.AspNetCore.Hosting;
54
using Microsoft.Extensions.Configuration;
65
using Microsoft.Extensions.Logging;
7-
using OpenTelemetry.Resources;
8-
using OpenTelemetry.Logs;
96
using OpenTelemetry.Exporter;
7+
using OpenTelemetry.Logs;
8+
using OpenTelemetry.Resources;
9+
using System;
10+
using System.Reflection;
1011

1112
namespace AgileConfig.Server.Apisite
1213
{
@@ -16,10 +17,10 @@ public class Program
1617

1718
public static void Main(string[] args)
1819
{
19-
var basePath = AppDomain.CurrentDomain.BaseDirectory;
20-
Console.WriteLine("current dir path: " + basePath);
20+
PrintBasicSysInfo();
21+
2122
var builder = new ConfigurationBuilder()
22-
.SetBasePath(basePath);
23+
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory);
2324
#if DEBUG
2425
Global.Config =
2526
builder
@@ -36,6 +37,16 @@ public static void Main(string[] args)
3637
host.Run();
3738
}
3839

40+
private static void PrintBasicSysInfo()
41+
{
42+
var appVer = Assembly.GetAssembly(typeof(Program))?.GetName()?.Version?.ToString();
43+
var basePath = AppDomain.CurrentDomain.BaseDirectory;
44+
45+
Console.WriteLine(ASCII_FONT.Font.Render($"Agile Config"));
46+
Console.WriteLine("Version: {0}", appVer);
47+
Console.WriteLine("Path: {0}", basePath);
48+
}
49+
3950
private static IWebHostBuilder CreateWebHostBuilder(string[] args)
4051
{
4152
return WebHost.CreateDefaultBuilder(args).ConfigureLogging(
@@ -67,7 +78,7 @@ private static void AddOtlpLogging(ILoggingBuilder builder)
6778
expOp.Endpoint = new Uri(Appsettings.OtlpLogsEndpoint);
6879
if (!string.IsNullOrEmpty(Appsettings.OtlpLogsHeaders))
6980
{
70-
expOp.Headers = Appsettings.OtlpLogsHeaders;
81+
expOp.Headers = Appsettings.OtlpLogsHeaders;
7182
}
7283
});
7384
});

src/AgileConfig.Server.Apisite/appsettings.Development.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@
3030
"serviceUnhealthInterval": 30, // 判断服务不健康的间隔,超出这个时间没响应过则认为不健康,单位:秒
3131
"removeServiceInterval": 0, // 如果一个服务超出这个时间没有响应,则直接移除这个服务,单位:秒;如果设定为 <= 0,则不会移除,默认 0 。
3232
"pathBase": "", //使用反向代理的时候,或许需要修改这个值 /xxx 必须/开头
33-
"adminConsole": false,
33+
"adminConsole": true,
3434
"saPassword": "123456", //super admin 的密码
3535
"defaultApp": "myapp", // 默认应用,每次重启都会尝试新建
3636
"cluster": false, // 集群模式:服务启动后自动加入节点列表,服务启动的时候会获取容器的ip,端口默认5000,适合 docker compose 环境使用
3737
"preview_mode": false,
3838
"db": {
39-
"provider": "sqlite", //sqlite,mysql,sqlserver,npgsql,oracle,mongodb
40-
"conn": "Data Source=agile_config.db",
39+
//"provider": "sqlite", //sqlite,mysql,sqlserver,npgsql,oracle,mongodb
40+
//"conn": "Data Source=agile_config.db",
4141
//"provider": "sqlserver",
4242
//"conn": "Encrypt=True;TrustServerCertificate=True;Persist Security Info = False; User ID =dev; Password =dev@123; Initial Catalog =agile_config; Server =192.168.18.82"
4343
//"provider": "npgsql",
4444
//"conn": "Host=127.0.0.1;Database=agileconfig;Username=postgres;Password=123456"
4545
//"provider": "oracle",
4646
//"conn": "user id=x;password=x;data source=192.168.0.123/orcl"
47-
//"provider": "mysql",
48-
//"conn": "Database=agile_config;Data Source=192.168.0.125;User Id=root;Password=x;port=13306;Allow User Variables=true;",
47+
"provider": "mysql",
48+
"conn": "Database=agileconfig;Data Source=192.168.0.125;User Id=root;Password=123456;port=3306;Allow User Variables=true;",
4949
//"provider": "mongodb",
5050
//"conn": "mongodb://192.168.0.125:27017/agile_config_1",
5151
"env": {

0 commit comments

Comments
 (0)