Skip to content

Commit

Permalink
Merge pull request #248 from routedbits/yzguy/sort
Browse files Browse the repository at this point in the history
feat: ensure peers are always alphabetically sorted
  • Loading branch information
yzguy authored Dec 29, 2024
2 parents 7355597 + 58fca8b commit 2269655
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 56 deletions.
23 changes: 11 additions & 12 deletions routers/router.chi1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@
remote_port: 30207
public_key: PfhGU0DMRu5Wnf0JfNQnnOWpyiqNjZ+wUCG2p6zwui8=

- name: KIX-9PFS
asn: 4242422002
ipv6: fe80::2002:5
multiprotocol: true
extended_nexthop: true
sessions:
- ipv6
wireguard:
public_key: 8t5mCXvaxp28MdWDiZFwxzXzx4lM1GQ7bq7GJXwwgVs=
remote_address: 195.252.199.45
remote_port: 30207

- name: TECH9_US-CHI01
asn: 4242421588
Expand All @@ -46,15 +57,3 @@
remote_address: us-chi01.dn42.tech9.io
remote_port: 58438
public_key: 0kb8ffMcbx8oXZ3Ii5khOuCzmRqM2Cy0IslmrWtRGSk=

- name: KIX-9PFS
asn: 4242422002
ipv6: fe80::2002:5
multiprotocol: true
extended_nexthop: true
sessions:
- ipv6
wireguard:
public_key: 8t5mCXvaxp28MdWDiZFwxzXzx4lM1GQ7bq7GJXwwgVs=
remote_address: 195.252.199.45
remote_port: 30207
24 changes: 12 additions & 12 deletions routers/router.fra1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@
remote_port: 20207
public_key: KCd+kXNhe48hwOWng77V9E94PszQBqQvJW42c1P+6nk=

- name: SFS-FRA
asn: 4242421780
ipv6: fe80::102
multiprotocol: true
extended_nexthop: true
sessions:
- ipv6
wireguard:
remote_address: fra.dn42.sfsarfe.com
remote_port: 20207
public_key: d81xiE0KNXKqUIw9RIPQi0kg8AGH8sJpe7RvDPTEHRs=

- name: SIDEREAL-FSN1
asn: 4242422016
ipv6: fe80::2016
Expand Down Expand Up @@ -154,15 +166,3 @@
remote_address: vpn.xenot.fr
remote_port: 58104
public_key: MDOUBkJTxNHMZq2Bt0pYa6VOzVz+rzN1HKkUo9UADgk=

- name: SFS-FRA
asn: 4242421780
ipv6: fe80::102
multiprotocol: true
extended_nexthop: true
sessions:
- ipv6
wireguard:
remote_address: fra.dn42.sfsarfe.com
remote_port: 20207
public_key: d81xiE0KNXKqUIw9RIPQi0kg8AGH8sJpe7RvDPTEHRs=
20 changes: 10 additions & 10 deletions routers/router.iad1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@
remote_port: 59162
public_key: itmJ4Z8V1aNN368P6kMzuQM+GdzWbBKZjJiXrgSeGlw=

- name: YZGUY-IAD
asn: 4242421669
ipv6: fe80::1669
multiprotocol: true
extended_nexthop: true
sessions:
- ipv6
wireguard:
public_key: 2BEC3CFKpAiIK3wTStbVuHyy894p5g2JLLTajdBsUF8=

- name: US2-9PFS
asn: 4242422002
ipv6: fe80::2002:2
Expand All @@ -45,3 +35,13 @@
public_key: 3KFJmmvS7ZYQcd3FRZvJBskEHYW/SLG/dxtUfDvwj1Y=
remote_address: 24.131.132.53
remote_port: 20207

- name: YZGUY-IAD
asn: 4242421669
ipv6: fe80::1669
multiprotocol: true
extended_nexthop: true
sessions:
- ipv6
wireguard:
public_key: 2BEC3CFKpAiIK3wTStbVuHyy894p5g2JLLTajdBsUF8=
22 changes: 10 additions & 12 deletions routers/router.lax1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
remote_port: 20207
public_key: s3IVH2xJ3oRekd4x4Bc2H2pb0YZD11FT7Unxttc7GCU=

- name: DUSTSTARS-DN42-LAX1
asn: 4242421771
ipv6: fe80::afaf:bfbf:cdcf:1d
sessions:
- ipv6
wireguard:
remote_address: 148.135.56.215
remote_port: 32590
public_key: wHTCO2N+h7Z8J7vgw7MsmZdVMDTy3eGfnuqqQuSf/AQ=

- name: IMLONGHAO-US2
asn: 4242421888
ipv6: fe80::1888
Expand Down Expand Up @@ -66,15 +76,3 @@
remote_address: us-lax1.dn42.sherpherd.top
remote_port: 20207
public_key: 2bQVZJjhIEaEelqwaQ+tbWDERbXjtXyidvYQL5COxyo=

- name: DUSTSTARS-DN42-LAX1
asn: 4242421771
ipv6: fe80::afaf:bfbf:cdcf:1d
multiprotocol: false
extended_nexthop: false
sessions:
- ipv6
wireguard:
remote_address: 148.135.56.215
remote_port: 32590
public_key: wHTCO2N+h7Z8J7vgw7MsmZdVMDTy3eGfnuqqQuSf/AQ=
20 changes: 10 additions & 10 deletions routers/router.mum1.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
- name: CDUBS-IN
asn: 4242420566
ipv6: fe80::566:20
- name: ANAX-IN
asn: 4242422457
ipv6: fe80::2457
multiprotocol: true
extended_nexthop: true
sessions:
- ipv6
wireguard:
remote_address: dn20.in.surgebytes.com
remote_port: 30207
public_key: tDYc6/7gZCW9gFOVI64dBC5g72qd6fhocNYKe1MbiiI=
public_key: aF9C1F3r3uu+Gv1mI61y4vHqgUIJe3yPmhzbq2mIeAQ=

- name: ANAX-IN
asn: 4242422457
ipv6: fe80::2457
- name: CDUBS-IN
asn: 4242420566
ipv6: fe80::566:20
multiprotocol: true
extended_nexthop: true
sessions:
- ipv6
wireguard:
public_key: aF9C1F3r3uu+Gv1mI61y4vHqgUIJe3yPmhzbq2mIeAQ=
remote_address: dn20.in.surgebytes.com
remote_port: 30207
public_key: tDYc6/7gZCW9gFOVI64dBC5g72qd6fhocNYKe1MbiiI=
7 changes: 7 additions & 0 deletions validate_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ def main():
post_annotation(e, filename, peer["__line__"])
errors.append(f"{filename}:{peer['__line__']} {e}")

# ensure all peers are in alphabetial order
peer_names = [peer['name'] for peer in peers]
if peer_names != sorted(peer_names):
err = "Peers must be in alphabetical order by name"
post_annotation(err, filename, 1)
errors.append(f"{filename}:1 {err}")

else:
logging.debug("No peers found")

Expand Down

0 comments on commit 2269655

Please sign in to comment.