refactor!: rename the project from Monitor to MoShiro [CI]
ci/woodpecker/push/main-amd64-build Pipeline was successful

Namespaces, assemblies, solution, binaries, images, systemd units, config paths, environment variables, protocol methods and the Linux user are all renamed. Breaking: existing databases, node identities and installed units must be recreated.
This commit is contained in:
justme committed 2026-10-07 02:03:25 +08:00
1 parent 27ac7fb787
commit 2e146d4da7
309 files changed
+1565 -1572

No files matched your search

@@ -0,0 +1,74 @@
namespace MoShiro.Backend.Application;
/// <summary>Backend 的可调参数(保留期等也可以通过 settings 改,这里是默认值与硬上限)。</summary>
public sealed class BackendOptions
{
/// <summary>数据目录:<c>moshiro.db</c> 与 <c>raw/</c>。</summary>
public string DataDirectory { get; set; } = "data";
/// <summary>面板的对外地址(用于生成安装命令)。</summary>
public string? PublicUrl { get; set; }
public int Pbkdf2Iterations { get; set; } = 600_000;
/// <summary>会话 Cookie 带 Secure 标记(只提供 HTTPS)。本机用 HTTP 调试时才关闭。</summary>
public bool SecureCookies { get; set; } = true;
/// <summary>
/// 允许跨域调用 API 的前端来源,逗号分隔(如 <c>http://localhost:5173,https://panel.example.com</c>,或 <c>*</c>);空 = 不允许,只有同源。
/// 跨域只支持 Bearer 令牌(不带 Cookie),所以不影响会话的安全。
/// </summary>
public string? CorsOrigins { get; set; }
public TimeSpan SessionLifetime { get; set; } = TimeSpan.FromHours(12);
public int LoginAttemptsPerMinute { get; set; } = 10;
public int RawRetentionDays { get; set; } = 30;
public int TestRawRetentionDays { get; set; } = 90;
public int Metric10sRetentionHours { get; set; } = 48;
public int Metric1mRetentionDays { get; set; } = 30;
public int Metric5mRetentionDays { get; set; } = 365;
public int EventRetentionDays { get; set; } = 365;
public int HostRetentionDays { get; set; } = 7;
/// <summary>分钟窗口在结束之后再等一会儿,让迟到的块先到。</summary>
public TimeSpan WindowGrace { get; set; } = TimeSpan.FromSeconds(60);
public TimeSpan AnalysisPollInterval { get; set; } = TimeSpan.FromSeconds(5);
public TimeSpan QueryTimeout { get; set; } = TimeSpan.FromSeconds(10);
public int MaxSsePerClient { get; set; } = 4;
public int MaxSseTopics { get; set; } = 32;
public int MaxPointsPerSeries { get; set; } = 2000;
public int MaxMetricsPerQuery { get; set; } = 32;
public int MaxCompareAgents { get; set; } = 20;
/// <summary>
/// 测试方案里「固定时长」阶段(没有 <c>duration_s</c> 参数的,例如 connect、hold)的缩放比例,缺省 1。
/// 只给自动化测试用:端到端测试里把 30 秒的阶段缩短,不用真等。
/// </summary>
public double PhaseDurationScale { get; set; } = 1.0;
/// <summary>
/// IP 归属查询服务的地址(`GET {地址}/lookup?ip=…`):Backend 用 Probe、Agent 的来源地址查一次国家和运营商,
/// 只留下国家代码和运营商名,IP 不对外。留空 = 不查。服务的使用条款(公益、不能商用、保留署名)由部署的人自己遵守。
/// </summary>
public string? GeoLookupUrl { get; set; } = "https://ip.007995.xyz";
/// <summary>初始管理员(只在没有任何用户时创建)。</summary>
public string? InitialAdminUser { get; set; }
public string? InitialAdminPassword { get; set; }
}