feat: add remote control plane and whitelist reads
Build web service image / build (push) Successful in 1m53s

This commit is contained in:
2026-09-12 09:46:05 +08:00
parent c86ba9c4d7
commit 13c31fc902
53 changed files with 9878 additions and 43 deletions
@@ -2,6 +2,7 @@ using System.Net;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json.Serialization;
using WxAgent.Core;
namespace WxAgent.Service;
@@ -18,6 +19,9 @@ public sealed class ServiceOptions
public string? AccessToken { get; init; }
public required string CredentialFile { get; init; }
public required string DataDirectory { get; init; }
public RemoteAgentOptions? Remote { get; init; }
public ReportingConfig Reporting { get; init; } = new();
public string? RemoteConfigurationFile { get; init; }
// Kept only so older service.json files can be loaded and rewritten by the tray.
[JsonIgnore]
@@ -42,6 +46,8 @@ public sealed class ServiceOptions
throw new ArgumentException("External HTTP requires a concrete listen IP; do not use 0.0.0.0 or ::.");
if (AccessToken is not null && !IsValidAccessToken(AccessToken))
throw new ArgumentException("AccessToken must be non-empty and contain no whitespace.");
try { (Reporting ?? new ReportingConfig()).NormalizeAndValidate(); }
catch (WxAgentException exception) { throw new ArgumentException(exception.Message, exception); }
_ = ReadCredentials();
}