mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-07-17 14:04:24 +02:00
Added new categories description scheme
This commit is contained in:
parent
8b2768daea
commit
12d833d20c
@ -1,184 +1,88 @@
|
||||
categories:
|
||||
roles:
|
||||
core:
|
||||
title: "Core & System"
|
||||
description: "Fundamental system configuration"
|
||||
icon: "fas fa-cogs"
|
||||
gen:
|
||||
title: "gen-*"
|
||||
description: "Helper roles & installers (git, locales, timer, etc.)"
|
||||
icon: "fas fa-wrench"
|
||||
desk:
|
||||
title: "desk-*"
|
||||
description: "Desktop environment roles & apps (GNOME, browser, LibreOffice, etc.)"
|
||||
icon: "fas fa-desktop"
|
||||
|
||||
drv:
|
||||
title: "Drivers"
|
||||
description: "Roles for installing and configuring hardware drivers—covering printers, graphics, input devices, and other peripheral support."
|
||||
icon: "fas fa-microchip"
|
||||
gen:
|
||||
title: "Generic"
|
||||
description: "Helper roles & installers (git, locales, timer, etc.)"
|
||||
icon: "fas fa-wrench"
|
||||
desk:
|
||||
applications:
|
||||
title: "Desktop Applications"
|
||||
description: "Setup & utilities for desktop apps"
|
||||
icon: "fas fa-desktop"
|
||||
utils:
|
||||
title: "util-desk-*"
|
||||
description: "Utility roles for desktop tools & development"
|
||||
title: "Desktop"
|
||||
description: "Desktop environment roles & apps (GNOME, browser, LibreOffice, etc.)"
|
||||
icon: "fas fa-desktop"
|
||||
util:
|
||||
title: "Utilities"
|
||||
description: "General-purpose utility roles for both desktop and server environments—providing helper functions, customizations, and optimizations for applications, workflows, and infrastructure."
|
||||
icon: "fas fa-tools"
|
||||
desk:
|
||||
title: "Desktop Utilities"
|
||||
description: "Utility roles for configuring and optimizing desktop applications and workflows—covering browsers, design tools, development environments, office suites, and gaming setups."
|
||||
icon: "fas fa-tools"
|
||||
|
||||
srv:
|
||||
title: "Server Utilities"
|
||||
description: "Utility roles for server-side configuration and management—covering corporate identity provisioning, network helpers, and other service-oriented toolkits."
|
||||
icon: "fas fa-cogs"
|
||||
srv:
|
||||
title: "Server"
|
||||
description: "General server roles for provisioning and managing server infrastructure—covering web servers, proxy servers, network services, and other backend components."
|
||||
icon: "fas fa-server"
|
||||
web:
|
||||
core:
|
||||
title: "srv-web-7-4-core"
|
||||
description: "Install & configure base Nginx server"
|
||||
icon: "fas fa-server"
|
||||
tls:
|
||||
title: "srv-web-6-6-tls-*"
|
||||
description: "Deploy & renew TLS certificates"
|
||||
icon: "fas fa-lock"
|
||||
proxy:
|
||||
title: "srv-web-proxy-*"
|
||||
description: "Proxy & vhost orchestration"
|
||||
icon: "fas fa-project-diagram"
|
||||
injector:
|
||||
core:
|
||||
title: "srv-web-7-7-inj-compose"
|
||||
description: "Inject core HTML modifiers"
|
||||
icon: "fas fa-code"
|
||||
css:
|
||||
title: "srv-web-7-7-inj-css"
|
||||
description: "Inject CSS into responses"
|
||||
icon: "fas fa-paint-brush"
|
||||
iframe:
|
||||
title: "srv-web-7-7-inj-iframe"
|
||||
description: "Inject iframe notifier"
|
||||
icon: "fas fa-window-maximize"
|
||||
javascript:
|
||||
title: "srv-web-7-7-inj-javascript"
|
||||
description: "Inject JS into responses"
|
||||
icon: "fas fa-code"
|
||||
matomo:
|
||||
title: "srv-web-7-7-inj-matomo"
|
||||
description: "Inject Matomo tracking code"
|
||||
icon: "fas fa-chart-pie"
|
||||
composer:
|
||||
title: "srv-web-7-6-composer"
|
||||
description: "Compose multiple filters into one include"
|
||||
icon: "fas fa-layer-group"
|
||||
|
||||
title: "Webserver"
|
||||
description: "Web-server roles for installing and configuring Nginx (core, TLS, injection filters, composer modules)."
|
||||
icon: "fas fa-server"
|
||||
proxy:
|
||||
title: "Proxy Server"
|
||||
description: "Proxy-server roles for virtual-host orchestration and reverse-proxy setups."
|
||||
icon: "fas fa-project-diagram"
|
||||
web:
|
||||
title: "Web Infrastructure"
|
||||
description: "Roles for managing web infrastructure—covering static content services and deployable web applications."
|
||||
icon: "fas fa-globe"
|
||||
svc:
|
||||
title: "web-svc-*"
|
||||
title: "Services"
|
||||
description: "Static content servers (assets, HTML, legal, files)"
|
||||
icon: "fas fa-file"
|
||||
app:
|
||||
title: "web-app-*"
|
||||
title: "Applications"
|
||||
description: "Deployable web applications (GitLab, Nextcloud, Mastodon, etc.)"
|
||||
icon: "fas fa-docker"
|
||||
|
||||
net:
|
||||
general:
|
||||
title: "net-*"
|
||||
description: "Network setup (DNS, Let's Encrypt HTTP, WireGuard, etc.)"
|
||||
icon: "fas fa-globe"
|
||||
svc:
|
||||
title: "svc-*"
|
||||
description: "Docker infrastructure services (DBMS, LDAP, Redis, etc.)"
|
||||
icon: "fas fa-database"
|
||||
wireguard:
|
||||
core:
|
||||
title: "net-wireguard-core"
|
||||
description: "Core WireGuard configuration"
|
||||
icon: "fas fa-network-wired"
|
||||
firewalled:
|
||||
title: "net-wireguard-firewalled"
|
||||
description: "WireGuard with firewall rules"
|
||||
icon: "fas fa-shield-alt"
|
||||
plain:
|
||||
title: "net-wireguard-plain"
|
||||
description: "WireGuard without extra firewall"
|
||||
icon: "fas fa-network-wired"
|
||||
title: "Network"
|
||||
description: "Network setup (DNS, Let's Encrypt HTTP, WireGuard, etc.)"
|
||||
icon: "fas fa-globe"
|
||||
svc:
|
||||
title: "Services"
|
||||
description: "Docker infrastructure services (DBMS, LDAP, Redis, etc.)"
|
||||
icon: "fas fa-database"
|
||||
mon:
|
||||
title: "Monitoring"
|
||||
description: "Roles for system monitoring and health checks—encompassing bot-style automated checks and core low-level monitors for logs, containers, disk usage, and more."
|
||||
icon: "fas fa-chart-area"
|
||||
|
||||
monitoring:
|
||||
bot:
|
||||
title: "mon-bot-*"
|
||||
description: "Bot-style health checks (disk, Docker, webserver, etc.)"
|
||||
icon: "fas fa-robot"
|
||||
core:
|
||||
title: "monitor-core-*"
|
||||
description: "Low-level monitors (journalctl, containers, disk space, etc.)"
|
||||
icon: "fas fa-chart-area"
|
||||
|
||||
alerting:
|
||||
alert:
|
||||
title: "Alerting"
|
||||
description: "Notification handlers for system events"
|
||||
icon: "fas fa-bell"
|
||||
subcategories:
|
||||
email:
|
||||
title: "alert-email"
|
||||
description: "Send alerts via email"
|
||||
icon: "fas fa-envelope"
|
||||
telegram:
|
||||
title: "alert-telegram"
|
||||
description: "Send alerts via Telegram"
|
||||
icon: "fab fa-telegram-plane"
|
||||
compose:
|
||||
title: "alert-compose"
|
||||
description: "Compose multiple alert handlers"
|
||||
icon: "fas fa-project-diagram"
|
||||
|
||||
maintenance:
|
||||
maint:
|
||||
title: "Maintenance & Healing"
|
||||
description: "Periodic maintenance & auto-recovery"
|
||||
icon: "fas fa-tools"
|
||||
subcategories:
|
||||
general:
|
||||
title: "maint-*"
|
||||
description: "Periodic tasks (Btrfs balancing, swapfile, etc.)"
|
||||
icon: "fas fa-sync-alt"
|
||||
docker:
|
||||
title: "maint-docker-*"
|
||||
description: "Automated Docker recovery & restarts"
|
||||
icon: "fas fa-docker"
|
||||
cleanup:
|
||||
title: "cln-*"
|
||||
description: "Housekeeping tasks (backups, certs, logs, etc.)"
|
||||
icon: "fas fa-broom"
|
||||
|
||||
backup:
|
||||
bkp:
|
||||
title: "Backup & Restore"
|
||||
description: "Backup strategies & restore procedures"
|
||||
icon: "fas fa-hdd"
|
||||
subcategories:
|
||||
general:
|
||||
title: "bkp-*"
|
||||
description: "Local & remote backups (files, volumes, DBs)"
|
||||
icon: "fas fa-cloud-upload-alt"
|
||||
|
||||
updates:
|
||||
|
||||
update:
|
||||
title: "Updates & Package Management"
|
||||
description: "OS & package updates"
|
||||
icon: "fas fa-sync"
|
||||
subcategories:
|
||||
os:
|
||||
title: "update-*"
|
||||
description: "Automatic OS & package updates (apt, Docker, pip, etc.)"
|
||||
icon: "fas fa-download"
|
||||
pkgmgr:
|
||||
title: "pkgmgr-*"
|
||||
description: "Language/platform package managers (npm, pip, AUR, etc.)"
|
||||
icon: "fas fa-box-open"
|
||||
|
||||
users:
|
||||
user:
|
||||
title: "Users & Access"
|
||||
description: "User accounts & access control"
|
||||
icon: "fas fa-users"
|
||||
subcategories:
|
||||
general:
|
||||
title: "user-*"
|
||||
description: "Create user accounts & SSH keys"
|
||||
icon: "fas fa-user"
|
||||
administrator:
|
||||
title: "user-administrator"
|
||||
description: "Config for admin users"
|
||||
icon: "fas fa-user-shield"
|
||||
root:
|
||||
title: "user-root"
|
||||
description: "Config for root user"
|
||||
icon: "fas fa-user-shield"
|
||||
|
44
tests/integration/test_categories_paths.py
Normal file
44
tests/integration/test_categories_paths.py
Normal file
@ -0,0 +1,44 @@
|
||||
import os
|
||||
import unittest
|
||||
import yaml
|
||||
|
||||
class TestCategoryPaths(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# Load categories.yml
|
||||
file_path = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), '..', '..', 'roles', 'categories.yml')
|
||||
)
|
||||
with open(file_path, 'r') as f:
|
||||
data = yaml.safe_load(f)
|
||||
cls.roles_def = data['roles']
|
||||
|
||||
# List of actual directories under roles/
|
||||
roles_dir = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), '..', '..', 'roles')
|
||||
)
|
||||
cls.existing_dirs = os.listdir(roles_dir)
|
||||
|
||||
def test_all_category_paths_exist(self):
|
||||
expected = set()
|
||||
|
||||
for top_key, attrs in self.roles_def.items():
|
||||
# Top-level category
|
||||
expected.add(top_key)
|
||||
|
||||
# Nested subcategories (keys other than metadata)
|
||||
for sub_key in attrs:
|
||||
if sub_key in ('title', 'description', 'icon', 'children'):
|
||||
continue
|
||||
expected.add(f"{top_key}-{sub_key}")
|
||||
|
||||
missing = []
|
||||
for name in expected:
|
||||
if not any(name in dirname for dirname in self.existing_dirs):
|
||||
missing.append(name)
|
||||
|
||||
if missing:
|
||||
self.fail(f"Missing role directories for: {', '.join(sorted(missing))}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Loading…
x
Reference in New Issue
Block a user