Initial commit (code only without large binaries)

This commit is contained in:
robin
2026-02-15 18:58:44 +08:00
commit 35df75498f
9442 changed files with 1495866 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_api_method_stat.proto";
import "models/rpc_messages.proto";
// API方法统计服务
service APIMethodStatService {
// 查找某天的统计
rpc findAPIMethodStatsWithDay(FindAPIMethodStatsWithDayRequest) returns (FindAPIMethodStatsWithDayResponse);
// 检查是否有统计数据
rpc countAPIMethodStatsWithDay(CountAPIMethodStatsWithDayRequest) returns (RPCCountResponse);
}
// 查找某天的统计
message FindAPIMethodStatsWithDayRequest {
string day = 1; // YYYYMMDD
}
message FindAPIMethodStatsWithDayResponse {
repeated APIMethodStat apiMethodStats = 1;
}
// 检查是否有统计数据
message CountAPIMethodStatsWithDayRequest {
string day = 1; // YYYYMMDD
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message ACMEProvider {
string name = 1;
string code = 2;
string description = 4;
string apiURL = 5;
bool requireEAB = 6;
string eabDescription = 7;
}

View File

@@ -0,0 +1,18 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_acme_provider.proto";
message ACMEProviderAccount {
int64 id = 1;
string name = 2;
bool isOn = 3;
string providerCode = 4;
string eabKid = 5;
string eabKey = 6;
string error = 7;
ACMEProvider acmeProvider = 30;
}

View File

@@ -0,0 +1,25 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_acme_user.proto";
import "models/model_dns_provider.proto";
import "models/model_ssl_cert.proto";
import "models/model_acme_task_log.proto";
message ACMETask {
int64 id = 1;
bool isOn = 2;
string dnsDomain = 3;
repeated string domains = 4;
int64 createdAt = 5;
bool autoRenew = 6;
string authType = 7;
string authURL = 8;
ACMEUser acmeUser = 30;
DNSProvider dnsProvider = 31;
SSLCert sslCert = 32;
ACMETaskLog latestACMETaskLog = 33;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// ACME任务日志
message ACMETaskLog {
int64 id = 1;
bool isOk = 2;
string error = 3;
int64 createdAt = 4;
}

View File

@@ -0,0 +1,18 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_acme_provider.proto";
import "models/model_acme_provider_account.proto";
message ACMEUser {
int64 id = 1;
string email = 2;
string description = 3;
int64 createdAt = 4;
string acmeProviderCode = 5;
ACMEProvider acmeProvider = 30;
ACMEProviderAccount acmeProviderAccount = 31;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 高防线路
message ADNetwork {
int64 id = 1;
bool isOn = 2;
string name = 3;
string description = 4;
}

View File

@@ -0,0 +1,21 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_ad_network.proto";
// 高防产品
message ADPackage {
int64 id = 1;
bool isOn = 2;
int64 adNetworkId = 3;
int32 protectionBandwidthSize = 4;
string protectionBandwidthUnit = 5;
int32 serverBandwidthSize = 6;
string serverBandwidthUnit = 7;
ADNetwork adNetwork = 30;
string summary = 31; // 概述
int64 countIdleADPackageInstances = 32; // 剩余可用的实例数,只有在获取可用高防产品的时候才会返回
}

View File

@@ -0,0 +1,25 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node_cluster.proto";
import "models/model_ad_package.proto";
import "models/model_user.proto";
// 高防产品实例
message ADPackageInstance {
int64 id = 1;
bool isOn = 2;
int64 adPackageId = 3;
int64 nodeClusterId = 4;
repeated int64 nodeIds = 5;
repeated string ipAddresses = 6;
int64 userId = 7; // 租用用户ID
string userDayTo = 8; // 租用日期
int64 userInstanceId = 9; // 当前绑定的用户实例ID
NodeCluster nodeCluster = 30;
ADPackage adPackage = 31;
User user = 32;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 高防实例有效期
message ADPackagePeriod {
int64 id = 1;
bool isOn = 2;
int32 count = 3;
string unit = 4;
int32 months = 5;
}

View File

@@ -0,0 +1,11 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 高防产品价格定义
message ADPackagePrice {
int64 adPackageId = 1;
int64 adPackagePeriodId = 2;
double price = 3;
}

View File

@@ -0,0 +1,20 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_admin_module.proto";
import "models/model_login.proto";
message Admin {
int64 id = 1; // ID
string fullname = 2; // 全称
string username = 3; // 用户名
bool isOn = 4; // 是否启用
bool isSuper = 5; // 是否为超级用户
int64 createdAt = 6; // 创建时间
repeated AdminModule Modules = 7; // 有权限的模块
Login otpLogin = 8; // OTP认证
bool canLogin = 9; // 是否可以登录
bool hasWeakPassword = 10; // 是否设置了弱密码,只有超级管理员能看到此项
}

View File

@@ -0,0 +1,15 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_admin_module.proto";
message AdminModuleList {
int64 adminId = 1;
bool isSuper = 2;
repeated AdminModule Modules = 3;
string fullname = 4;
string theme = 5; // 风格模板
string lang = 6; // 界面语言
}

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message AdminModule {
bool allowAll = 1;
string code = 2;
repeated string actions = 3;
}

View File

@@ -0,0 +1,18 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_api_node.proto";
message APIMethodStat {
int64 id = 1;
int64 apiNodeId = 2;
string method = 3;
string tag = 4;
float costMs = 5;
float peekMs = 6;
int64 countCalls = 7;
APINode apiNode = 30;
}

View File

@@ -0,0 +1,26 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message APINode {
int64 id = 1;
bool isOn = 2;
int64 nodeClusterId = 3;
string uniqueId = 4;
string secret = 5;
string name = 6;
string description = 7;
bytes httpJSON = 8;
bytes httpsJSON = 9;
bool RestIsOn = 13;
bytes restHTTPJSON = 14;
bytes restHTTPSJSON = 15;
bytes accessAddrsJSON = 10;
repeated string accessAddrs = 11;
bytes statusJSON = 12;
bool isPrimary = 16;
bool debug = 30;
string instanceCode = 31;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// API令牌
message APIToken {
int64 id = 1;
string nodeId = 2;
string secret = 3;
string role = 4;
}

View File

@@ -0,0 +1,19 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 版本认证
message AuthorityKey {
string value = 1;
string dayFrom = 2;
string dayTo = 3;
string hostname = 4;
repeated string macAddresses = 5;
int64 updatedAt = 6;
string company = 7;
int32 nodes = 8;
repeated string components = 9;
string edition = 10;
string requestCode = 11;
}

View File

@@ -0,0 +1,14 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message AuthorityNode {
int64 id = 1;
bool isOn = 2;
string uniqueId = 3;
string secret = 4;
string name = 5;
string description = 6;
bytes statusJSON = 7;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message ClientAgent {
int64 id = 1;
string name = 2;
string code = 3;
string description = 4;
int64 countIPs = 5;
}

View File

@@ -0,0 +1,14 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_client_agent.proto";
message ClientAgentIP {
int64 id = 1;
string ip = 2;
string ptr = 3;
ClientAgent clientAgent = 30;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message ClientBrowser {
int64 id = 1;
string name = 2;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message ClientSystem {
int64 id = 1;
string name = 2;
}

View File

@@ -0,0 +1,25 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message DBNode {
int64 id = 1;
string name = 2;
string description = 3;
bool isOn = 4;
string host = 5;
int32 port = 6;
string database = 7;
string username = 8;
string password = 9;
string charset = 10;
DBNodeStatus status = 30;
}
message DBNodeStatus {
bool isOk = 1;
int64 size = 2;
string error = 3;
string version = 4;
}

View File

@@ -0,0 +1,20 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 数据表信息
message DBTable {
string name = 1;
string schema = 2;
string type = 3;
string engine = 4;
int64 rows = 5;
int64 dataLength = 6;
int64 indexLength = 7;
string comment = 8;
string collation = 9;
bool isBaseTable = 10;
bool canClean = 11;
bool canDelete = 12;
}

View File

@@ -0,0 +1,25 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_dns_route.proto";
message DNSDomain {
int64 id = 1;
string name = 2;
bool isOn = 3;
int64 dataUpdatedAt = 4;
string dataError = 5;
int64 countServerRecords = 6;
int64 countAllServers = 13;
bool serversChanged = 7;
int64 countNodeRecords = 8;
int64 countAllNodes = 14;
bool nodesChanged = 9;
repeated DNSRoute routes = 10;
int64 providerId = 11;
int64 countNodeClusters = 12;
bool isUp = 15;
bool isDeleted = 16;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message DNSIssue {
string target = 1;
int64 targetId = 2;
string type = 3;
string description = 4;
map<string, string> params = 5;
bool mustFix = 6; // 是否必须修复
}

View File

@@ -0,0 +1,14 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message DNSProvider {
int64 id = 1;
string name = 2;
string type = 3;
string typeName = 4;
bytes apiParamsJSON = 5;
int64 dataUpdatedAt = 6;
int32 minTTL = 7; // 最小TTL
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message DNSRecord {
string id = 1;
string name = 2;
string value = 3;
string type = 4;
string route = 5;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message DNSRoute {
string name = 1;
string code = 2;
}

View File

@@ -0,0 +1,24 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node.proto";
import "models/model_node_cluster.proto";
import "models/model_server.proto";
import "models/model_dns_domain.proto";
// DNS相关同步任务
message DNSTask {
int64 id = 1;
string type = 2;
bool isDone = 3;
bool isOk = 4;
string error = 5;
int64 updatedAt = 6;
Node node = 30;
NodeCluster nodeCluster = 31;
Server server = 32;
DNSDomain dnsDomain = 33;
}

View File

@@ -0,0 +1,14 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message File {
int64 id = 1;
string filename = 2;
int64 size = 3;
int64 createdAt = 4;
bool isPublic = 5;
string mimeType = 6;
string type = 7;
}

View File

@@ -0,0 +1,8 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message FileChunk {
bytes data = 1;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message FormalClientBrowser {
int64 id = 1;
string name = 2;
repeated string codes = 3;
string dataId = 4;
int32 state = 5;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message FormalClientSystem {
int64 id = 1;
string name = 2;
repeated string codes = 3;
string dataId = 4;
int32 state = 5;
}

View File

@@ -0,0 +1,81 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node.proto";
// HTTP访问日志
message HTTPAccessLog {
string requestId = 48;
int64 serverId = 1;
int64 nodeId = 2;
int64 locationId = 3;
int64 rewriteId = 4;
int64 originId = 5;
string remoteAddr = 6;
string rawRemoteAddr = 7;
int32 remotePort = 8;
string remoteUser = 9;
string requestURI = 10;
string requestPath = 11;
int64 requestLength = 12;
double requestTime = 13;
string requestMethod = 14;
string requestFilename = 15;
bytes requestBody = 51;
string scheme = 16;
string proto = 17;
int64 bytesSent = 18;
int64 bodyBytesSent = 19;
int32 status = 20;
string statusMessage = 21;
map<string, Strings> sentHeader = 22;
string timeISO8601 = 23;
string timeLocal = 24;
double msec = 25;
int64 timestamp = 26;
string host = 27;
string referer = 28;
string userAgent = 29;
string request = 30;
string contentType = 31;
map<string, string> cookie = 32;
string args = 34;
string queryString = 35;
map<string, Strings> header = 36;
string serverName = 37;
int32 serverPort = 38;
string serverProtocol = 39;
string hostname = 40;
// 源站相关
string originAddress = 41;
int32 originStatus = 52;
// 错误信息
repeated string errors = 42;
// 扩展
map<string, string> attrs = 43;
// WAF相关
int64 firewallPolicyId = 44;
int64 firewallRuleGroupId = 45;
int64 firewallRuleSetId = 46;
int64 firewallRuleId = 47;
repeated string firewallActions = 49;
repeated string tags = 50;
// 详情
Node node = 100;
}
message Strings {
repeated string values = 1;
}

View File

@@ -0,0 +1,17 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message HTTPAccessLogPolicy {
int64 id = 1; // 策略ID
string name = 2; // 策略名称
bool isOn = 3; // 是否启用
string type = 4; // 策略类型
bytes optionsJSON = 5; // 策略选项
bytes condsJSON = 6; // 记录条件选项
bool isPublic = 7; // 是否公用
bool firewallOnly = 8; // 是否只记录WAF相关访问日志
bool disableDefaultDB = 9; // 停用默认数据库存储
bytes writeTargetsJSON = 10; // 写入目标 JSON: {"file":true,"mysql":true,"clickhouse":false}
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 服务认证策略
message HTTPAuthPolicy {
int64 id = 1;
bool isOn = 2;
string name = 3;
string type = 4;
bytes paramsJSON = 5;
}

View File

@@ -0,0 +1,11 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message HTTPCachePolicy {
int64 id = 1; // ID
string name = 2; // 名称
bool isOn = 3; // 是否启用
bytes maxBytesJSON = 4; // 内容最大尺寸配置
}

View File

@@ -0,0 +1,22 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_user.proto";
import "models/model_http_cache_task_key.proto";
message HTTPCacheTask {
int64 id = 1; // 任务ID
int64 userId = 2;
string type = 3;
string keyType = 4;
int64 createdAt = 5;
int64 doneAt = 6;
bool isDone = 7;
bool isOk = 8;
string description = 9;
User user = 30; // 所属用户
repeated HTTPCacheTaskKey httpCacheTaskKeys = 31; // 包含的Key
}

View File

@@ -0,0 +1,20 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node_cluster.proto";
message HTTPCacheTaskKey {
int64 id = 1; // 缓存键ID
int64 taskId = 2; // 任务ID
string key = 3; // 缓存键
string type = 4; // 操作类型purge|fetch
string keyType = 5; // 键类型key|prefix
bool isDone = 6; // 是否已完成
bool isDoing = 9; // 是否执行中
bytes errorsJSON = 7; // 错误信息
int64 nodeClusterId = 8; // 所属集群ID
NodeCluster nodeCluster = 30; // 所属集群,不一定有内容
}

View File

@@ -0,0 +1,16 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// HTTP Fastcgi定义
message HTTPFastcgi {
int64 id = 1;
bool isOn = 2;
string address = 3;
bytes paramsJSON = 4;
bytes readTimeoutJSON = 5;
bytes connTimeoutJSON = 6;
int32 poolSize = 7;
string pathInfoPattern = 8;
}

View File

@@ -0,0 +1,22 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// WAF策略
message HTTPFirewallPolicy {
int64 id = 1; // 策略ID
string name = 2; // 名称
string mode = 7; // 模式
bool isOn = 3; // 是否启用
string description = 4; // 描述
bytes inboundJSON = 5; // 入站配置
bytes outboundJSON = 6; // 出站配置
int64 serverId = 8; // 所属网站ID如果为0表示公共策略
bool useLocalFirewall = 9; // 是否使用本机防火墙
bytes synFloodJSON = 10; // synflood配置
bytes blockOptionsJSON = 11; // 阻止动作配置
bytes pageOptionsJSON = 13; // 显示网页动作配置
bytes captchaOptionsJSON = 12; // 人机识别配置
bytes jsCookieOptionsJSON = 14; // JSCookie动作配置
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message HTTPFirewallRuleGroup {
int64 id = 1;
string name = 2;
bool isOn = 3;
string description = 4;
string code = 5;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message HTTPFirewallRuleSet {
int64 id = 1;
string name = 2;
bool isOn = 3;
string description = 4;
string code = 5;
}

View File

@@ -0,0 +1,15 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_size_capacity.proto";
message HTTPGzip {
int64 id = 1;
bool isOn = 2;
int32 level = 3;
SizeCapacity minLength = 4;
SizeCapacity maxLength = 5;
bytes condsJSON = 6;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message HTTPWeb {
int64 id = 1;
bool isOn = 2;
}

View File

@@ -0,0 +1,46 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_http_firewall_policy.proto";
import "models/model_http_firewall_rule_group.proto";
import "models/model_http_firewall_rule_set.proto";
import "models/model_server.proto";
import "models/model_node.proto";
message IPItem {
int64 id = 1;
string value = 22; // 原始值比如单个IP、IP范围或者CIDR
string ipFrom = 2;
string ipTo = 3;
int64 version = 4;
int64 expiredAt = 5;
string reason = 6;
int64 listId = 7;
bool isDeleted = 8;
string type = 9;
string eventLevel = 10; // 级别
string listType = 11; // 所在名单类型,来自名单
bool isGlobal = 20; // 是否全局,来自名单
int64 createdAt = 12;
int64 nodeId = 13;
int64 serverId = 14;
int64 sourceNodeId = 15;
int64 sourceServerId = 16;
int64 sourceHTTPFirewallPolicyId = 17;
int64 sourceHTTPFirewallRuleGroupId = 18;
int64 sourceHTTPFirewallRuleSetId = 19;
bool isRead = 21;
Server sourceServer = 30;
Server server = 34;
HTTPFirewallPolicy sourceHTTPFirewallPolicy = 31;
HTTPFirewallRuleGroup sourceHTTPFirewallRuleGroup = 32;
HTTPFirewallRuleSet sourceHTTPFirewallRuleSet = 33;
Node sourceNode = 35;
}

View File

@@ -0,0 +1,14 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_file.proto";
message IPLibrary {
int64 id = 1;
string type = 2;
int64 createdAt = 3;
File file = 30;
}

View File

@@ -0,0 +1,18 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_file.proto";
message IPLibraryArtifact {
int64 id = 1;
int64 fileId = 2;
int64 createdAt = 3;
bytes metaJSON = 4;
bool isPublic = 5; // 是否公开
string name = 6;
string code = 7;
File file = 30; // 文件信息
}

View File

@@ -0,0 +1,40 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message IPLibraryFile {
int64 id = 1;
string name = 2;
int64 fileId = 3;
string template = 4;
repeated string emptyValues = 5;
int64 generatedFileId = 6;
int64 generatedAt = 7;
bool isFinished = 8;
int64 createdAt = 9;
repeated string countryNames = 10;
repeated Province provinces = 11;
repeated City cities = 12;
repeated Town towns = 13;
repeated string providerNames = 14;
string password = 15; // 密码
message Province {
string countryName = 1;
string provinceName = 2;
}
message City {
string countryName = 1;
string provinceName = 2;
string cityName = 3;
}
message Town {
string countryName = 1;
string provinceName = 2;
string cityName = 3;
string townName = 4;
}
}

View File

@@ -0,0 +1,16 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message IPList {
int64 id = 1;
bool isOn = 2;
string type = 3;
string name = 4;
string code = 5;
bytes timeoutJSON = 6;
bool isPublic = 7;
string description = 8;
bool isGlobal = 9;
}

View File

@@ -0,0 +1,18 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message Log {
int64 id = 1;
string level = 2;
string action = 3;
int64 adminId = 4;
int64 userId = 5;
int64 providerId = 6;
int64 createdAt = 7;
string type = 8;
string ip = 9;
string userName = 10;
string description = 11;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message Login {
int64 id = 1;
string type = 2;
bytes paramsJSON = 3;
bool isOn = 4;
int64 adminId = 5;
int64 userId = 6;
}

View File

@@ -0,0 +1,16 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 登录SESSION
message LoginSession {
int64 id = 1;
int64 adminId = 2;
int64 userId = 3;
string sid = 4;
bytes valuesJSON = 5;
string ip = 6;
int64 createdAt = 7;
int64 expiresAt = 8;
}

View File

@@ -0,0 +1,14 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 登录票据
message LoginTicket {
int64 id = 1; // ID
int64 expiresAt = 2; // 过期时间
string value = 3; // 票据值
int64 adminId = 4; // 管理员ID
int64 userId = 5; // 用户ID
string ip = 6; // 登录时客户端IP
}

View File

@@ -0,0 +1,21 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node_cluster.proto";
import "models/model_node.proto";
message Message {
int64 id = 1;
string type = 2;
string body = 3;
string level = 4;
bytes paramsJSON = 5;
bool isRead = 6;
int64 createdAt = 7;
string role = 8;
NodeCluster nodeCluster = 30;
Node node = 31;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message MessageMedia {
int64 id = 1;
string type = 2;
string name = 3;
string description = 4;
string userDescription = 5;
bool isOn = 6;
}

View File

@@ -0,0 +1,17 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_message_media.proto";
message MessageMediaInstance {
int64 id = 1;
bool isOn = 2;
string name = 3;
MessageMedia messageMedia = 4;
bytes paramsJSON = 5;
string description = 6;
bytes rateJSON = 7;
int32 hashLife = 8;
}

View File

@@ -0,0 +1,20 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_message_recipient.proto";
import "models/model_message_recipient_group.proto";
message MessageReceiver {
int64 id = 1;
int64 clusterId = 2;
int64 nodeId = 3;
int64 serverId = 4;
string type = 5;
bytes paramsJSON = 6;
string role = 9; // 集群角色node 或 dns
MessageRecipient messageRecipient = 7;
MessageRecipientGroup messageRecipientGroup = 8;
}

View File

@@ -0,0 +1,20 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_admin.proto";
import "models/model_message_recipient_group.proto";
import "models/model_message_media_instance.proto";
message MessageRecipient {
int64 id = 1;
Admin admin = 2;
MessageMediaInstance messageMediaInstance = 3;
bool isOn = 4;
repeated MessageRecipientGroup messageRecipientGroups = 5;
string description = 6;
string user = 7;
string timeFrom = 8;
string timeTo = 9;
}

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message MessageRecipientGroup {
int64 id = 1;
string name = 2;
bool isOn = 3;
}

View File

@@ -0,0 +1,26 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_message_recipient.proto";
import "models/model_message_media_instance.proto";
message MessageTask {
int64 id = 1;
MessageRecipient messageRecipient = 2;
string user = 3;
string subject = 4;
string body = 5;
int64 createdAt = 6;
int32 status = 7;
int64 sentAt = 8;
MessageTaskResult result = 9;
MessageMediaInstance messageMediaInstance = 10;
}
message MessageTaskResult {
bool isOk = 1;
string error = 2;
string response = 3;
}

View File

@@ -0,0 +1,16 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_message_task.proto";
// 消息任务日志
message MessageTaskLog {
int64 id = 1;
int64 createdAt = 2;
bool isOk = 3;
string error = 4;
string response = 5;
MessageTask messageTask = 6;
}

View File

@@ -0,0 +1,21 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_metric_item.proto";
// 指标图表
message MetricChart {
int64 id = 1;
string name = 2;
string type = 3;
int32 widthDiv = 4;
bytes paramsJSON = 5;
bool isOn = 6;
int32 maxItems = 7;
bool ignoreEmptyKeys = 8;
repeated string ignoredKeys = 9;
MetricItem metricItem = 30;
}

View File

@@ -0,0 +1,19 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 指标定义
message MetricItem {
int64 id = 1;
bool isOn = 2;
string code = 3;
string category = 4;
string name = 5;
repeated string keys = 6;
int32 period = 7;
string periodUnit = 8;
int32 expiresPeriod = 12;
string value = 10;
bool isPublic = 11;
}

View File

@@ -0,0 +1,35 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node_cluster.proto";
import "models/model_node.proto";
import "models/model_server.proto";
// 统计数据
message MetricStat {
int64 id = 1;
string hash = 2;
int64 serverId = 3;
int64 itemId = 4;
repeated string keys = 5;
float value = 6;
string time = 7;
int32 version = 8;
NodeCluster nodeCluster = 30;
Node node = 31;
Server server = 32;
int64 sumCount = 40;
float sumTotal = 41;
}
// 需要上传的统计数据
message UploadingMetricStat {
int64 id = 1;
string hash = 2;
repeated string keys = 3;
float value = 4;
}

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NetworkAddress {
string protocol = 1;
string host = 2;
string portRange = 3;
}

View File

@@ -0,0 +1,61 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node_cluster.proto";
import "models/model_node_login.proto";
import "models/model_node_install_status.proto";
import "models/model_node_ip_address.proto";
import "models/model_node_group.proto";
import "models/model_node_region.proto";
import "models/model_dns_route.proto";
import "models/model_size_capacity.proto";
message Node {
int64 id = 1;
string name = 2;
bytes statusJSON = 3;
string installDir = 4;
bool isInstalled = 5;
string code = 6;
string uniqueId = 7;
string secret = 8;
int64 version = 9;
int64 latestVersion = 10;
repeated int64 connectedAPINodeIds = 11;
int32 maxCPU = 12;
bool isOn = 13;
bool isUp = 14;
repeated DNSRoute dnsRoutes = 15;
bool isActive = 16;
SizeCapacity maxCacheDiskCapacity = 17;
SizeCapacity maxCacheMemoryCapacity = 18;
string cacheDiskDir = 19;
bytes cacheDiskSubDirsJSON = 23;
int32 level = 20;
repeated string lnAddrs = 21; // Ln访问地址
bool enableIPLists = 22;
bytes apiNodeAddrsJSON = 24;
string offlineDay = 25; // 下线日期
bool isBackupForCluster = 26; // 是否为集群备用节点
bool isBackupForGroup = 27; // 是否为分组备用节点
NodeCluster nodeCluster = 32; // 主集群
NodeLogin nodeLogin = 33;
NodeInstallStatus installStatus = 34;
repeated NodeIPAddress ipAddresses = 35;
NodeGroup nodeGroup = 36;
NodeRegion nodeRegion = 37;
repeated NodeCluster secondaryNodeClusters = 38; // 从集群
}
message BasicNode {
int64 id = 1;
string name = 2;
bool isOn = 3;
bool isUp = 4;
int32 level = 5;
NodeCluster nodeCluster = 30; // 主集群
}

View File

@@ -0,0 +1,15 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 节点动作
message NodeAction {
int64 id = 1;
int64 nodeId = 2;
string role = 3;
bool isOn = 4; // 是否启用
bytes condsJSON = 5; // 条件定义
bytes actionJSON = 6; // 动作定义
bytes durationJSON = 7; // 持续时间
}

View File

@@ -0,0 +1,32 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeCluster {
int64 id = 1;
string name = 2;
int64 createdAt = 3;
int64 nodeGrantId = 4;
string installDir = 5;
string uniqueId = 6;
string secret = 7;
string dnsName = 8;
int64 dnsDomainId = 9;
string dnsDefaultRoute = 22; // DNS默认线路
int64 httpCachePolicyId = 10;
int64 httpFirewallPolicyId = 11;
bool isOn = 12;
string timeZone = 13;
int32 nodeMaxThreads = 14;
bool autoOpenPorts = 16;
bool isPinned = 17;
bytes clockJSON = 18;
bool autoRemoteStart = 19;
bool autoInstallNftables = 20;
bytes sshParamsJSON = 21;
bool autoSystemTuning = 23; // 是否自动调节系统参数
bool autoTrimDisks = 24; // 是否自动TRIM硬盘
int32 maxConcurrentReads = 25; // 最大并发读
int32 maxConcurrentWrites = 26; // 最大并发写
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeClusterFirewallAction {
int64 id = 1;
int64 nodeClusterId = 2;
string name = 3;
string eventLevel = 4;
bytes paramsJSON = 5;
string type = 6;
}

View File

@@ -0,0 +1,17 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeGrant {
int64 id = 1;
string name = 2;
string method = 3;
string username = 4;
string password = 5;
bool su = 6;
string privateKey = 7;
string passphrase = 10;
string description = 8;
int64 nodeId = 9;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeGroup {
int64 id = 1;
string name = 2;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeInstallStatus {
bool isRunning = 1;
bool isFinished = 2;
bool isOk = 3;
string error = 4;
string errorCode = 6;
int64 updatedAt = 5;
}

View File

@@ -0,0 +1,25 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node_cluster.proto";
// 节点地址
message NodeIPAddress {
int64 id = 1;
int64 nodeId = 2;
string name = 3;
string ip = 4;
string description = 5;
int64 state = 6;
int64 order = 7;
bool canAccess = 8;
bool isOn = 9;
bool isUp = 10;
string role = 12;
string backupIP = 13;
bool isHealthy = 14;
repeated NodeCluster nodeClusters = 30;
}

View File

@@ -0,0 +1,20 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node_ip_address.proto";
import "models/model_admin.proto";
message NodeIPAddressLog {
int64 id = 1;
string description = 2;
int64 createdAt = 3;
bool isUp = 4;
bool isOn = 5;
bool canAccess = 6;
string backupIP = 7;
NodeIPAddress nodeIPAddress = 30;
Admin admin = 31;
}

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeIPAddressThreshold {
int64 id = 1;
bytes itemsJSON = 2;
bytes actionsJSON = 3;
}

View File

@@ -0,0 +1,21 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeLog {
int64 id = 1;
string role = 2;
string tag = 3;
string description = 4;
string level = 5;
int64 nodeId = 6;
int64 createdAt = 7;
int32 count = 8;
int64 serverId = 9;
bool isFixed = 10;
int64 originId = 11;
bool isRead = 12;
bytes paramsJSON = 13;
string type = 14;
}

View File

@@ -0,0 +1,11 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeLogin {
int64 id = 1;
string name = 2;
string type = 3;
bytes params = 4;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodePriceItem {
int64 id = 1;
bool isOn = 2;
string name = 3;
string type = 4;
int64 bitsFrom = 5;
int64 bitsTo = 6;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeRegion {
int64 id = 1;
bool isOn = 2;
string name = 3;
string description = 4;
bytes pricesJSON = 5;
}

View File

@@ -0,0 +1,25 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node.proto";
import "models/model_node_cluster.proto";
// 节点相关同步任务
message NodeTask {
int64 id = 1;
string type = 2;
bool isDone = 3;
bool isOk = 4;
string error = 5;
int64 updatedAt = 6;
int64 version = 7;
bool isPrimary = 8; // 是否为主节点,非主节点稍等再同步有利于提升同步速度
int64 serverId = 9;
int64 userId = 10;
Node node = 30;
NodeCluster nodeCluster = 31;
NodeCluster server = 32;
}

View File

@@ -0,0 +1,22 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node.proto";
message NodeThreshold {
int64 id = 1;
int64 clusterId = 2;
Node node = 3;
string item = 4;
string param = 5;
string operator = 6;
bytes valueJSON = 7;
string message = 8;
int32 duration = 9;
string durationUnit = 10;
string sumMethod = 11;
bool isOn = 12;
int32 notifyDuration = 13;
}

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 节点监控值
message NodeValue {
bytes valueJSON = 1;
int64 createdAt = 2;
}

View File

@@ -0,0 +1,29 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_ns_route.proto";
// 域名服务访问记录
message NSAccessLog {
int64 nsNodeId = 1;
int64 nsDomainId = 2;
int64 nsRecordId = 3;
repeated int64 nsRouteIds = 4 [deprecated = true];
repeated string nsRouteCodes = 17;
repeated NSRoute nsRoutes = 18; // 仅供查看访问日志时使用
string remoteAddr = 5;
string questionName = 6;
string questionType = 7;
string recordName = 8;
string recordType = 9;
string recordValue = 10;
string networking = 11;
string serverAddr = 12;
int64 timestamp = 13;
string requestId = 14;
string timeLocal = 15;
string error = 16;
bool isRecursive = 19;
}

View File

@@ -0,0 +1,24 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 域名服务集群
message NSCluster {
int64 id = 1;
bool isOn = 2;
string name = 3;
string installDir = 4;
bytes tcpJSON = 5; // TCP设置
bytes tlsJSON = 6; // TLS设置
bytes udpJSON = 7; // UDP设置
bytes dohJSON = 16; // DoH设置
repeated string hosts = 8;
bytes soaJSON = 12;
string email = 13;
bool autoRemoteStart = 9;
string timeZone = 10;
bytes answerJSON = 11;
bool detectAgents = 14;
bool checkingPorts = 15; // 检查端口连通性
}

View File

@@ -0,0 +1,27 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_ns_cluster.proto";
import "models/model_ns_domain_group.proto";
import "models/model_user.proto";
// DNS域名
message NSDomain {
int64 id = 1;
string name = 2;
bool isOn = 3;
int64 createdAt = 4;
bool isDeleted = 5;
int64 version = 6;
bytes tsigJSON = 7;
repeated int64 nsDomainGroupIds = 8;
string status = 9;
int64 userId = 10; // 用户ID
bytes recordsHealthCheckJSON = 11; // 健康检查设置
NSCluster nsCluster = 30;
User user = 31;
repeated NSDomainGroup nsDomainGroups = 32;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 域名分组
message NSDomainGroup {
int64 id = 1;
string name = 2;
bool isOn = 3;
int64 userId = 4;
}

View File

@@ -0,0 +1,22 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_ns_domain.proto";
import "models/model_ns_zone.proto";
// NS密钥
message NSKey {
int64 id = 1;
bool isOn = 2;
string name = 3;
string algo = 4;
string secret = 5;
string secretType = 6;
bool isDeleted = 7;
int64 version = 8;
NSDomain nsDomain = 30;
NSZone nsZone = 31;
}

View File

@@ -0,0 +1,31 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_ns_cluster.proto";
import "models/model_node_install_status.proto";
import "models/model_node_login.proto";
// 域名服务节点
message NSNode {
int64 id = 1;
string name = 2;
bool isOn = 3;
string uniqueId = 4;
string secret = 5;
bytes statusJSON = 6;
bool isInstalled = 7;
string installDir = 9;
bool isUp = 8;
bool isActive = 10;
repeated int64 connectedAPINodeIds = 11;
bytes apiNodeAddrsJSON = 12;
NSCluster nsCluster = 32;
NodeLogin nodeLogin = 33;
NodeInstallStatus installStatus = 34;
//repeated NodeIPAddress ipAddresses = 35;
//NodeGroup nodeGroup = 36;
//NodeRegion region = 37;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NSPlan {
int64 id = 1;
string name = 2;
bool isOn = 3;
float monthlyPrice = 4;
float yearlyPrice = 5;
bytes configJSON = 6;
}

View File

@@ -0,0 +1,11 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// DNS查询选项
message NSQuestionOption {
int64 id = 1;
string name = 2;
bytes valuesJSON = 3;
}

View File

@@ -0,0 +1,38 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_ns_domain.proto";
import "models/model_ns_route.proto";
// 域名记录
message NSRecord {
int64 id = 1; // 记录ID
string description = 2; // 备注
string name = 3; // 记录名
string type = 4; // 记录类型
string value = 5; // 记录值
int32 mxPriority = 12; // mx优先级
int32 srvPriority = 13; // SRV优先级
int32 srvWeight = 14; // SRV权重
int32 srvPort = 15; // SRV端口
int32 caaFlag = 16; // CAA Flag
string caaTag = 17; // CAA TAG
int32 ttl = 6; // TTL
int32 weight = 7; // 权重
int64 createdAt = 8;
bool isDeleted = 9;
int64 version = 10;
bool isOn = 11; // 是否启用
bytes healthCheckJSON = 18; // 健康检查配置
bool isUp = 19; // 是否在线(根据健康检查结果)
NSDomain nsDomain = 30; // 所属域名
repeated NSRoute nsRoutes = 31; // 线路
}

View File

@@ -0,0 +1,15 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NSRecordHourlyStat {
int64 nsClusterId = 1;
int64 nsNodeId = 2;
int64 nsDomainId = 3;
int64 nsRecordId = 4;
int64 bytes = 5;
int64 countRequests = 6;
int64 createdAt = 7;
string hour = 8;
}

View File

@@ -0,0 +1,27 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_ns_cluster.proto";
import "models/model_ns_domain.proto";
import "models/model_ns_route_category.proto";
// 线路
message NSRoute {
int64 id = 1;
bool isOn = 2;
string name = 3;
bytes rangesJSON = 4;
bool isDeleted = 5;
int32 order = 6;
int64 version = 7;
string code = 8;
bool isPublic = 9;
int32 priority = 10; // 优先级
int64 userId = 11; // 所属用户ID
NSCluster nsCluster = 30;
NSDomain nsDomain = 31;
NSRouteCategory nsRouteCategory = 32;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 线路分类
message NSRouteCategory {
int64 id = 1;
string name = 2;
bool isOn = 3;
int32 order = 4;
}

View File

@@ -0,0 +1,19 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_ns_plan.proto";
import "models/model_user.proto";
message NSUserPlan {
int64 id = 1;
int64 nsPlanId = 2;
int64 userId = 3;
string dayFrom = 4;
string dayTo = 5;
string periodUnit = 6;
NSPlan nsPlan = 30;
User user = 31;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// DNS子域
message NSZone {
int64 id = 1;
}

View File

@@ -0,0 +1,22 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 订单支付方式
message OrderMethod {
int64 id = 1;
string name = 2;
string code = 3;
string description = 4;
string secret = 6;
bool isOn = 7;
string url = 5;
string parentCode = 8;
bytes params = 9;
string clientType = 10;
string qrcodeTitle = 11;
}

Some files were not shown because too many files have changed in this diff Show More