mirror of
https://github.com/ipnet-mesh/meshcore-hub.git
synced 2026-08-07 01:13:11 +02:00
Convert collector seed mechanism from JSON to YAML
- Replace JSON seed files with YAML format for better readability - Auto-detect YAML primitive types (number, boolean, string) from values - Add automatic seed import on collector startup - Split lat/lon into separate tags instead of combined coordinate string - Add PyYAML dependency and types-PyYAML for type checking - Update example/seed and contrib/seed/ipnet with clean YAML format - Update tests to verify YAML primitive type detection
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"members": [
|
||||
{
|
||||
"name": "Example Member",
|
||||
"callsign": "N0CALL",
|
||||
"role": "Network Operator",
|
||||
"description": "Example member entry"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# Example members seed file
|
||||
members:
|
||||
- name: Example Member
|
||||
callsign: N0CALL
|
||||
role: Network Operator
|
||||
description: Example member entry
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef": {
|
||||
"friendly_name": "Gateway Node",
|
||||
"location": {"value": "37.7749,-122.4194", "type": "coordinate"},
|
||||
"lat": {"value": "37.7749", "type": "number"},
|
||||
"lon": {"value": "-122.4194", "type": "number"},
|
||||
"role": "gateway"
|
||||
},
|
||||
"fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210": {
|
||||
"friendly_name": "Oakland Repeater",
|
||||
"location": {"value": "37.8044,-122.2712", "type": "coordinate"},
|
||||
"lat": {"value": "37.8044", "type": "number"},
|
||||
"lon": {"value": "-122.2712", "type": "number"},
|
||||
"altitude": {"value": "150", "type": "number"}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
# Example node tags seed file
|
||||
# Each key is a 64-character hex public key
|
||||
#
|
||||
# Tag values can be:
|
||||
# - YAML primitives (auto-detected type):
|
||||
# friendly_name: Gateway Node # string
|
||||
# elevation: 150 # number
|
||||
# is_online: true # boolean
|
||||
#
|
||||
# - Explicit type (for special types like coordinate):
|
||||
# location:
|
||||
# value: "37.7749,-122.4194"
|
||||
# type: coordinate
|
||||
#
|
||||
# Supported types: string, number, boolean, coordinate
|
||||
|
||||
0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef:
|
||||
friendly_name: Gateway Node
|
||||
role: gateway
|
||||
lat: 37.7749
|
||||
lon: -122.4194
|
||||
is_online: true
|
||||
|
||||
fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210:
|
||||
friendly_name: Oakland Repeater
|
||||
lat: 37.8044
|
||||
lon: -122.2712
|
||||
altitude: 150
|
||||
is_online: false
|
||||
Reference in New Issue
Block a user