Files
MoShiro/backend/shared/MoShiro.Protocol/ProtocolLimits.cs
T
justme 12be44645f
ci/woodpecker/push/main-amd64-build Pipeline was successful
feat: install nodes and the backend from a static compose file; remove dead code [CI]
Agent, Probe and Backend now start from one static compose.yaml plus a local
.env: the panel (or the release assets, for the very first Backend) provides
the file, the panel's command writes the public values into .env, checks the
file's SHA-256 and runs compose up. Updating is compose pull && compose up -d.
The image is chosen by the CI channel (:latest, or MOSHIRO_VERSION in .env),
not by the panel; the previous one-line script stays as a fallback.

- packaging/compose/{agent,probe,backend}/compose.yaml are the single source,
  embedded in the Backend and served at /install/compose/{file}; the root
  compose.yaml moved there. Releases also carry them and list them in the
  signed SHA256SUMS.
- The container entrypoint defaults the node name to the host name.
- Join token creation returns a compose block (.env, url, hash, per-platform
  commands); the admin dialog leads with it.
- Remove code with no references (HotLayer members, LiveHub.SubscriberCount,
  QueryService.ParseParams, ReleaseService.Forget, a few constants) and reduce
  the install-code lookup to the role it is for.
2026-10-08 20:24:23 +08:00

42 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace MoShiro.Protocol;
public static class ProtocolVersion
{
public const int Container = 1;
}
public static class ProtocolLimits
{
/// <summary>持续任务每 10 秒切一块。</summary>
public const int ChunkSeconds = 10;
/// <summary>单块记录数上限。</summary>
public const int MaxRecordsPerChunk = 50_000;
/// <summary>解压后的块上限(防解压炸弹)。</summary>
public const int MaxDecodedChunkBytes = 64 << 20;
public const int MaxStreamsPerChunk = 16;
public const int MaxColumnsPerStream = 64;
/// <summary>每条线路持续任务的总带宽上限(bit/s)。</summary>
public const long MaxLineBudgetBitsPerSecond = 100_000;
}
/// <summary>二进制通道号(0–15 属于 Fleet,MoShiro 从 16 开始)。</summary>
public static class MoShiroChannels
{
/// <summary>Agent → Backend:RawChunk(发件箱)。</summary>
public const byte RawChunk = 16;
/// <summary>Probe → Agent:列块(点对点会话的发件箱)。</summary>
public const byte ColumnBlock = 17;
}
public static class MoShiroCapabilities
{
public const string Base = "moshiro.v1";
public const string KindsPrefix = "moshiro.kinds:";
}