autogenerate map from network info

This commit is contained in:
Malin Freeborn 2025-03-22 14:05:10 +01:00
parent fe14e0aacc
commit 53b4d0e041
Signed by: andonome
GPG Key ID: 52295D2377F4D70F
2 changed files with 23 additions and 45 deletions

View File

@ -5,13 +5,29 @@ help: ## Print the help message
sort | \
column -s ':' -t
map.txt: map.ge ## Making map.txt
grep -v '# unimportant' $< | graph-easy --boxart > $@
cat $@
########## Network Map ##########
full_map.txt: map.ge ## Generating full_map.txt with graph-easy
graph-easy --boxart < $< > $@
cat $@
graph_cmd = graph-easy --boxart
queries = queries authqueries
query_formats = $(patsubst %, .dbs/%.txt, $(queries))
.dbs/:
mkdir $@
$(query_formats): .dbs/%.txt: | .dbs/
echo "[ {{name}} ] -- $(basename $(@F)) --> [ {{$(basename $(@F))}} ]" > $@
.PHONY: map
map: .dbs/network.txt ## Show a network map
$(graph_cmd) < $<
.dbs/network.txt: network.rec $(query_formats)
$(RM) .dbs/network.txt
$(foreach relation, $(queries), \
recsel $< -t lxc -e "$(relation) != ''" -p name,$(relation) | recfmt -f .dbs/$(relation).txt >> $@ ;\
)
########## Man Pages ##########
@ -56,3 +72,4 @@ pages: $(kralmans) $(krovmans) $(setupmans) $(splintmans)
clean:
$(RM) $(kralmans) $(krovmans)
$(RM) -r .dbs

39
map.ge
View File

@ -1,39 +0,0 @@
# Network map of Decentrala. Use with:
# graph-easy --boxart < netmap.txt
(Mox
[ m_router ]{label: router ;}
[ wireguard ] --> [ m_nginx ]{label: nginx-11 ;}
[ wiki ] --> [ m_nginx ]
[ gitea ] --> [ m_nginx ]
[ tor11 ] --> [ m_nginx ] --> [ m_router ]
[ smtp ]
)
(Serverko
[ s_nginx ]{label: nginx-12 ;}
[ s_router ]{label: router ;}
[ s_nginx ] --> [ nextcloud ]
[ s_nginx ] --> [ tor12 ]
[ s_nginx ] --> [ s_router ]
)
(splint.rs # unimportant
[ soft-serve ] # unimportant
[ mail-cache ]# unimportant
) # unimportant
[ tor12 ] <..> [ onions ] <..> [ tor11 ]
[ m_router ] <..> [ BGP ] <..> [ madness ] <..> [ s_router ]
[ smtp ] <..> [ madness ]
[ madness ] <..> [ mail-cache ]# unimportant
[ A ]{label: "" ;}
[ B ]{label: "" ;}
[ C ]{label: "" ;}
[ D ]{label: "" ;}
[ onions ] <..> [ A ]
[ onions ] <..> [ B ]
[ A ] <..> [ C ]
[ B ] <..> [ D ]
(Sharks! [ D ])