This commit is contained in:
travisladuke
2024-10-25 15:03:27 -07:00
parent 56587ecef4
commit b327db8484
10 changed files with 30 additions and 18 deletions
+21 -17
View File
@@ -2,55 +2,59 @@ import "@typespec/json-schema";
using TypeSpec.JsonSchema;
@extension("additionalProperties", Json<false>)
@jsonSchema
model LocalConf {
model local_conf {
settings?: Settings;
physical?: Physical;
virtual?: Virtual;
}
model Physical is Record<OptionalProperties<_Physical>>;
model Physical is Record<_Physical>;
@extension("additionalProperties", Json<false>)
model _Physical{
blacklist: boolean = false;
trustedPathId: uint16;
blacklist?: boolean = false;
trustedPathId?: uint16;
// mtu: uint16; not implemented
}
model Virtual is Record<OptionalProperties<_Virtual>>;
model Virtual is Record<_Virtual>;
@extension("additionalProperties", Json<false>)
model _Virtual {
@summary("Hints on where to reach this peer if no upstreams/roots are online")
try: Array<IPSlashPort>;
try?: Array<IPSlashPort>;
@summary("Blacklist a physical path for only this peer. ")
blacklist: Array<NetworkSlashBits>;
blacklist?: Array<NetworkSlashBits>;
}
model Settings is OptionalProperties<_Settings>;
model _Settings {
@extension("additionalProperties", Json<false>)
model Settings {
@summary("Override default port of 9993 and any command line port. It's preferred to override secondaryPort instead.")
primaryPort: Port;
primaryPort?: Port;
@summary("Override default randomly selected secondary port.")
secondaryPort: Port;
secondaryPort?: Port;
@summary("Override third randomly selected port. This port is used for mapping")
tertiaryPort: Port;
tertiaryPort?: Port;
@summary("Enable UPnP and NAT-PMP. Default: True")
portMappingEnabled: boolean = true;
@summary("false will also disable secondary port. Default: true")
allowSecondaryPort?: boolean = true;
@summary("Enable UPnP and NAT-PMP. Default: true")
portMappingEnabled?: boolean = true;
@summary("Array of interface name prefixes (e.g. eth for eth#) to blacklist for ZT traffic")
interfacePrefixBlacklist: Array<InterfacePrefix>;
interfacePrefixBlacklist?: Array<InterfacePrefix>;
@summary("If non-NULL, allow JSON/HTTP management from this IP network. Default is 127.0.0.1 only.")
allowManagementFrom: Array<NetworkSlashBits>;
allowManagementFrom?: Array<NetworkSlashBits>;
@summary("bind to these IPs instead of to each interface")
bind: Array<IP>;
bind?: Array<IP>;
}
scalar IPSlashPort extends string;
+1
View File
@@ -0,0 +1 @@
{"physical2": {"10.0.0.0/24": {"blacklist2": "ok"}}}
+1
View File
@@ -0,0 +1 @@
{ "settings2": { "portMappingEnabled2": 1 }}
+1
View File
@@ -0,0 +1 @@
{ "settings": { "portMappingEnabled": false }}
+1
View File
@@ -0,0 +1 @@
{ "settings": { "allowSecondaryPort": false, "portMappingEnabled": false }}
+1
View File
@@ -0,0 +1 @@
{ "settings": { "secondaryPort": 19991 }}
+2
View File
@@ -0,0 +1,2 @@
{"virtual2": {"feedbeef11": {"try": ["198.51.100.17/9993"], "blacklist": ["195.51.128.0/30"]}}}
+2
View File
@@ -0,0 +1,2 @@
{"virtual": {"feedbeef11": {"try": ["198.51.100.17/9993"], "blacklist": ["195.51.128.0/30"]}}}
-1
View File
@@ -4,4 +4,3 @@ emit:
options:
"@typespec/json-schema":
file-type: "json"
bundleId: local.conf.schema.json