{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Config", "type": "object", "required": [ "node" ], "properties": { "node": { "description": "Core DHT node config, for publishing and looking up addresses", "allOf": [ { "$ref": "#/definitions/NodeConfig" } ] }, "private_http_addr": { "description": "Address for administration - listing published data, registering identities, etc. Required for publisher.", "anyOf": [ { "$ref": "#/definitions/StrSocketAddr" }, { "type": "null" } ] }, "public_http_addr": { "description": "Address for client interaction - resolver lookups, publishing. Required for publisher and resolver.", "anyOf": [ { "$ref": "#/definitions/StrSocketAddr" }, { "type": "null" } ] }, "publisher": { "anyOf": [ { "$ref": "#/definitions/Config" }, { "type": "null" } ] }, "resolver": { "anyOf": [ { "$ref": "#/definitions/ResolverConfig" }, { "type": "null" } ] } }, "definitions": { "AdvertiseAddrConfig": { "oneOf": [ { "description": "Use this if you know the IP address beforehand (ex: in terraform, if you allocate a floating ip before provisioning this host) and it's not the address of any local interface.", "type": "object", "required": [ "fixed" ], "properties": { "fixed": { "type": "string" } }, "additionalProperties": false }, { "description": "If your server is directly on the internet, with an externally reachable IP configured on an interface, this will cause that IP to be used. Specify an interface name (ex: `eth0`) or leave blank to scan all interfaces for a public IP. All ipv6 addresses are considered public.", "type": "object", "required": [ "from_interface" ], "properties": { "from_interface": { "type": "object", "required": [ "port" ], "properties": { "ip_version": { "anyOf": [ { "$ref": "#/definitions/AdvertiseAddrConfigIpVer" }, { "type": "null" } ] }, "name": { "type": [ "string", "null" ] }, "port": { "type": "integer", "format": "uint16", "minimum": 0.0 } } } }, "additionalProperties": false }, { "description": "Curl this URL, use the response body as the IP address", "type": "object", "required": [ "lookup" ], "properties": { "lookup": { "$ref": "#/definitions/AdvertiseAddrLookupConfig" } }, "additionalProperties": false } ] }, "AdvertiseAddrConfigIpVer": { "type": "string", "enum": [ "v4", "v6" ] }, "AdvertiseAddrLookupConfig": { "type": "object", "required": [ "ipv4_only", "ipv6_only", "lookup", "port" ], "properties": { "ipv4_only": { "description": "Use IPv4 to contact lookup in order to get an IPv4 address back", "type": "boolean" }, "ipv6_only": { "description": "Use IPv6 to contact lookup in order to get an IPv6 address back", "type": "boolean" }, "lookup": { "type": "string" }, "port": { "type": "integer", "format": "uint16", "minimum": 0.0 } } }, "BootstrapConfig": { "type": "object", "required": [ "addr", "id" ], "properties": { "addr": { "$ref": "#/definitions/StrSocketAddr" }, "id": { "$ref": "#/definitions/JsonSchema" } } }, "Config": { "type": "object", "required": [ "advertise_addr", "bind_addr", "cert_path", "db_path" ], "properties": { "advertise_addr": { "description": "URL other nodes will connect to to retrieve data - your external address.", "allOf": [ { "$ref": "#/definitions/AdvertiseAddrConfig" } ] }, "bind_addr": { "description": "Port to bind for serving published data to other nodes, secured with announced ssl cert", "allOf": [ { "$ref": "#/definitions/StrSocketAddr" } ] }, "cert_path": { "description": "A cert will be generated and stored here if one doesn't already exist. Custom format (not pem). This is a filename, not directory name.", "type": "string" }, "db_path": { "description": "The database will be created and stored here. This is a filename, not directory name.", "type": "string" } } }, "DnsBridgerConfig": { "type": "object", "required": [ "bind_addr", "upstream" ], "properties": { "bind_addr": { "$ref": "#/definitions/StrSocketAddr" }, "upstream": { "$ref": "#/definitions/StrSocketAddr" } } }, "JsonSchema": { "description": "A node identity (zbase32 string)", "type": "string" }, "NodeConfig": { "type": "object", "required": [ "bind_addr", "bootstrap" ], "properties": { "bind_addr": { "$ref": "#/definitions/StrSocketAddr" }, "bootstrap": { "type": "array", "items": { "$ref": "#/definitions/BootstrapConfig" } }, "persist_path": { "type": [ "string", "null" ] } } }, "ResolverConfig": { "type": "object", "properties": { "cache_persist_path": { "type": [ "string", "null" ] }, "dns_bridge": { "anyOf": [ { "$ref": "#/definitions/DnsBridgerConfig" }, { "type": "null" } ] }, "max_cache": { "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 } } }, "StrSocketAddr": { "description": "An ip address or domain (ex: \"localhost\") which resolves to an address", "type": "string" } } }