infrastructure/templates/infrastructure.d2.j2

91 lines
1.4 KiB
Text
Raw Normal View History

2024-10-14 20:11:20 +00:00
vars: {
d2-config: {
layout-engine: elk
theme-id: 101
}
}
external: {
scaleway: {
s3
}
restic: {
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/webp/restic.webp
}
}
2025-01-09 18:49:06 +00:00
classes: {
zero_grid: {
grid-columns: 3
grid-gap: 0
}
monitored: {
style: {
fill: "#1E9025"
}
}
backup: {
style: {
fill: "#0f0"
}
}
}
2025-01-09 18:49:06 +00:00
{% for host in hosts %}
{{ host.key }}
2024-10-14 20:11:20 +00:00
{% endfor %}{# host #}
{% for svc in svcs %}
{{ svc.key }}: {
label: {{ svc.label }}
label.near: top-left
icon: {{ svc.icon }}
icon.near: top-right
}
{% for backup in svc.backup or [] %}
2025-01-09 18:49:06 +00:00
{{ svc.key }}.'{{ backup.name }}'.class: backup
{% endfor %}
2024-10-14 20:11:20 +00:00
{% if svc.monitoring %}
2025-01-09 18:49:06 +00:00
{{ svc.key }}.monitored.class: monitored
2024-10-14 20:11:20 +00:00
{% endif %}
{% if svc.database %}
{{ svc.key }} -> {{ db_key }}: {
style.stroke: "#336791"
}
2025-01-09 18:49:06 +00:00
{{ db_subkey }}.{{ svc.name }}
2024-10-14 20:11:20 +00:00
{% endif %}
{% if svc.auth %}
{{ svc.key }} -> {{ auth_key }}: {
style.stroke: "#FD4B2D"
}
2025-01-09 18:49:06 +00:00
{{ auth_subkey }}.{{ svc.name }}
2024-10-14 20:11:20 +00:00
{% endif %}
{% if svc.s3 %}
{{ svc.key }} -> external.scaleway.s3: {
style: {
stroke: "#110B1E"
stroke-dash: 3
}
}
external.scaleway.s3.{{ svc.name }}
{% endif %}
2024-10-29 21:43:05 +00:00
{% if svc.mail %}
{{ svc.key }} -> {{ mail_key }}: {
style.stroke: "#C9B81F"
}
2025-01-09 18:49:06 +00:00
{{ mail_subkey }}.{{ svc.name }}
2024-10-29 21:43:05 +00:00
{% endif %}
2024-10-14 20:11:20 +00:00
{% endfor %}{# svc #}
{% for svc in grid_svcs %}
2025-01-09 18:49:06 +00:00
{{ svc }}.class: zero_grid
2024-10-14 20:11:20 +00:00
{% endfor %}