From 232f4e8630677a53f0ae92b4614f87586c573184 Mon Sep 17 00:00:00 2001 From: Junde Yhi Date: Tue, 3 Nov 2020 21:10:31 +0000 Subject: [PATCH] document: rewrite TOML has been using for a while, but the documentation is still describing the old Bash syntax. Rewrite them. --- document/asn-dir.txt | 18 ------------------ document/asn.toml | 27 ++++++++++++++++++++++++++ document/entity-dir.txt | 20 -------------------- document/entity.toml | 24 +++++++++++++++++++++++ document/node-dir.txt | 14 -------------- document/node.toml | 18 ++++++++++++++++++ document/peer-dir.txt | 1 - document/peer.toml | 8 ++++++++ document/route-dir.txt | 42 ----------------------------------------- document/route.toml | 24 +++++++++++++++++++++++ 10 files changed, 101 insertions(+), 95 deletions(-) delete mode 100644 document/asn-dir.txt create mode 100644 document/asn.toml delete mode 100644 document/entity-dir.txt create mode 100644 document/entity.toml delete mode 100644 document/node-dir.txt create mode 100644 document/node.toml delete mode 100644 document/peer-dir.txt create mode 100644 document/peer.toml delete mode 100644 document/route-dir.txt create mode 100644 document/route.toml diff --git a/document/asn-dir.txt b/document/asn-dir.txt deleted file mode 100644 index fa30658..0000000 --- a/document/asn-dir.txt +++ /dev/null @@ -1,18 +0,0 @@ -# as-dir Template -# =============== -# Filename format: AS -# ASN range: 4201270000 ~ 4201279999 -# Remove any line which starts with '#' when applying -# AS Name -NAME="" -# Owner -OWNER="" -# Description -DESC="" -# Source of this ASN -# Possible values: "NeoNetwork", "DN42" or "INET" -SOURCE="" -# if it's a ASN registered from *NIC, this variable records -# whether members of NeoNetwork have validated its ownership yet -# Possible values: "YES" "NO" -VALID="" diff --git a/document/asn.toml b/document/asn.toml new file mode 100644 index 0000000..50b6688 --- /dev/null +++ b/document/asn.toml @@ -0,0 +1,27 @@ +# Template file for the AS registry (asn/) +# Before submission, please: +# - Rename the file to "AS.toml", without the quotes. +# - Remove any blank lines, comments, and unneeded options. + +# AS name (optional). Can be an arbitrary string. +name = "" + +# AS owner (mandatory). This should match the ID (file name) of a registered +# entity in entity/ . +owner = "" + +# AS source (optional). Possible values are: +# - NeoNetwork +# - DN42 +# - Internet +# Often you don't need to include this option: if the AS number falls into the +# range of NeoNetwork or DN42, then our script can automatically find it out. +#source = "" + +# AS description (optional). Can be an arbitrary string. +description = "" + +# AS ownership validation status for NeoNetwork (optional). If the AS is +# registered in other NICs, and members of NeoNetwork have validated the +# ownership status, then this can be set to true. Otherwise, remove this option. +#vaild = false diff --git a/document/entity-dir.txt b/document/entity-dir.txt deleted file mode 100644 index 951a206..0000000 --- a/document/entity-dir.txt +++ /dev/null @@ -1,20 +0,0 @@ -# entity-dir Template -# =================== -# Filename format: -# Remove any line which starts with '#' when applying -# Description (maybe short self introduction) -DESC="" -# Contact -CONTACT=( - "EMAIL:" - "TELEGRAM:" - "IRC:" - "MASTODON:" - "GITHUB:" -) -# Babel (https://en.wikipedia.org/wiki/Wikipedia:Babel) -BABEL=( - "" -) -# OpenPGP key fingerprint -AUTH="PGP:" diff --git a/document/entity.toml b/document/entity.toml new file mode 100644 index 0000000..214f8be --- /dev/null +++ b/document/entity.toml @@ -0,0 +1,24 @@ +# Template file for the entity registry (entity/) +# Before submission, please: +# - Rename the file to ".toml", without the quotes. +# - Remove any blank lines, comments, and unneeded options. + +# Entity name (optional). Can be an arbitrary string. +name = "" + +# Babel (optional) to describe the working language of this entity. See +# https://en.wikipedia.org/wiki/Wikipedia:Babel for how to fill this list. +babel = [] + +# Entity contacts (optional). The listed options are all optional. +[contact] +email = "" +telegram = "" +mastodon = "" +github = "" + +# Details on identifying the entity online (optional). Usually, a PGP key +# fingerprint can be put here to help others communicate with the entity more +# securely. +[persona] +pgp = "" diff --git a/document/node-dir.txt b/document/node-dir.txt deleted file mode 100644 index 06a9a01..0000000 --- a/document/node-dir.txt +++ /dev/null @@ -1,14 +0,0 @@ -# node-dir Template -# ================= -# It's used to store ASN information and generate DNS records -# that were neither Tunnel /30 or Point to Point Address. -# Remove any line which starts with '#' when applying -# Filename format: -# ASN -ASN="" -# Description -DESC="" -# IP addresses excluding TUN30 and PTP -IP=( - "10.127.x.x/x" -) diff --git a/document/node.toml b/document/node.toml new file mode 100644 index 0000000..1e9cb3d --- /dev/null +++ b/document/node.toml @@ -0,0 +1,18 @@ +# Template file for the node registry (node/) +# Before submission, please: +# - Rename the file to ".toml", without the quotes. +# - Remove any blank lines, comments, and unneeded options. + +# Multiple nodes can be declared in one file: start a node with its name as the +# table name. +[example_node] + +# Node owner (mandatory). This should match the ASN of a registered AS in asn/ . +asn = 4201279999 + +# Node description (optional). Can be an arbitrary string. +description = "" + +# The IP address of the node, written in CIDR notation (optional). This option +# is only used to generate DNS records automatically. +cidr = [] diff --git a/document/peer-dir.txt b/document/peer-dir.txt deleted file mode 100644 index 3837914..0000000 --- a/document/peer-dir.txt +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/document/peer.toml b/document/peer.toml new file mode 100644 index 0000000..496d4df --- /dev/null +++ b/document/peer.toml @@ -0,0 +1,8 @@ +# Template file for the peering registry (peer/) +# Before submission, please: +# - Rename the file to ".toml", without the quotes. +# - Remove any blank lines, comments, and unneeded options. + +# A list of peers that this node is peering to (mandatory). Items in this list +# should match the name of registered nodes in node/ . +to-peer = [] diff --git a/document/route-dir.txt b/document/route-dir.txt deleted file mode 100644 index b40a59d..0000000 --- a/document/route-dir.txt +++ /dev/null @@ -1,42 +0,0 @@ -IP Registration Directory Format Specification -============================================== - -According to the common usage of this VPN network, the IP allocation can be -classified into the following rules, with its format normalized, as the -file name of the routing distribution definition file: - -1. /30 Tunnel: `10.127.0.x/30` (where x is divisible by 4) **DEPRECATED** -2. Normal Subnet: `10.127.x.y/z` (where z must be greater than 16) -4. Loopback Address: `10.127.255.x/32` - -Definition Format -================= - -The content of the file can be divided into the following fields. -To simplify processing, Shell Script variable definition syntax -will be used as the syntax of the definition file. In addition, variables must -be present if it's not optional and defined in the same order as the following: - - TYPE= - PROTO= (only for peer-to-peer /30 tunnels) - NAME= (optional for anything other than Contiguous Subnet and Loopback Address) - ASN= (only for Contiguous Subnet and Loopback Address) - UPSTREAM= (only for peer-to-peer /30 tunnels) - DOWNSTREAM= (only for peer-to-peer /30 tunnels) - DESC= - -Detailed Information of Each Variable -===================================== - -1. TYPE: IP Usage Type - Available options are: TUN30, SUBNET, PTP, LO (corresponding to the IP address - allocation type in the first section respectively) - -2. PROTO: VPN Protocol Used - Available options are: Tinc, WireGuard, L2TP, GRE, IPsec/L2TP, IPsec/GRE, OpenVPN, SLIRP, PPP - -3. NAME: Name -4. ASN: ASN (without prefix "AS") -5. UPSTREAM: Upstream Node Name -6. DOWNSTREAM: Downstream Node Name -7. DESC: Description diff --git a/document/route.toml b/document/route.toml new file mode 100644 index 0000000..9403bb5 --- /dev/null +++ b/document/route.toml @@ -0,0 +1,24 @@ +# Template file for the route registry (route/) +# Before submission, please: +# - Rename the file to "AS.toml", without the quotes. +# - Remove any blank lines, comments, and unneeded options. + +# Multiple IP prefixes can be announced in one file: start every prefix with its +# CIDR notation as the table name. +["10.127.0.0/32"] + +# IP usage (mandatory). Possible values: +# - subnet: this is a subnetwork announced by this AS. +# - loopback: this is a loopback IP. The IP prefix should be a /32 one. +type = "" + +# IP name (mandatory). +name = "" + +# IP description (optional). +description = "" + +# The supernet of this IP network (optional). Overlapping IP prefixes are +# regarded as an error, so if this IP network is a subnet of another one, write +# their IP prefix here. +supernet = ""