# tranquilit/wapt architecture

> Architecture diagram of the GitHub repository tranquilit/wapt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tranquilit/wapt
- Repository: https://github.com/tranquilit/wapt

## Overview

#### Purpose and topology
WAPT is an archived GPLv3 endpoint software-deployment system: administrators publish signed software/configuration packages, a central server coordinates repositories and endpoints, and installed agents apply work locally. It spans Python services/CLI tooling and Lazarus/Free Pascal desktop clients.

#### Package authoring, metadata, and trust
The package domain is centralized in Python tooling for creating, inspecting, signing, and indexing deployable packages. Package templates encode installer-specific setup scripts; cryptographic operations form the trust boundary before packages enter repositories.
- `waptpackage.py`
- `waptcrypto.py`
- `wapt-signpackages.py`
- `wapt-scanpackages.py`
- `templates/setup_package_template.py.tmpl`

#### Endpoint command interface
`wapt-get.py` is the principal agent CLI, with shell/batch launchers. It consumes agent configuration, queries package sources/server, resolves package actions, and executes deployment through the shared package/setup layers. The `wapt-get/` Pascal project supplies native GUI/helper and platform integration code.
- `wapt-get.py`
- `wapt-get.sh`
- `wapt-get/waptget.lpr`
- `common.py`
- `setuphelpers.py`

#### Local agent service and user-facing API
A resident Python service schedules and exposes endpoint package operations, tracks networking, and serves local web/UI endpoints. Socket.IO modules indicate real-time task/status communication; self-service, tray, exit, and message applications are separate Lazarus front ends over the local agent behavior.
- `waptservice/service.py`
- `waptservice/waptservice_common.py`
- `waptservice/waptservice_socketio.py`
- `waptself/waptself.lpr`
- `wapttray/wapttray.lpr`

#### Central server and control plane
The server is a Python web application with API, authentication, data model, task processing, and Socket.IO support. It exposes administrator-facing templates/static assets and is the boundary between managed hosts, package repositories, and privileged administrative actions.
- `waptserver/app.py`
- `waptserver/api.py`
- `waptserver/auth.py`
- `waptserver/model.py`
- `waptserver/server_socketio.py`

#### Background orchestration and infrastructure
Server task modules separate long-running fleet actions from request handling. Deployment scripts target Linux services with systemd, uWSGI, Nginx, SSL, logging, and optional Kerberos setup; runnable wrappers distinguish the server, agent, and task-worker processes.
- `waptserver/tasks.py`
- `waptserver/wapthuey.py`
- `waptserver/scripts/waptserver-uwsgi.service`
- `waptserver/scripts/wapt-with-uwsgi.nginxconfig`
- `runwapttasks.sh`

#### Administrative and delivery clients
The Lazarus console is the administrator desktop client for host/package/repository management. Installers build Windows (Inno Setup), Debian, RPM, and macOS artifacts, reflecting cross-platform agent/server distribution rather than a single runtime deployment.
- `waptconsole/waptconsole.lpr`
- `waptsetup/wapt.iss`
- `waptservice/deb/createdeb.py`
- `waptservice/rpm/waptagent.spec`
- `waptservice/pkg/createpkg.py`

Main entry points: [`waptservice/service.py`](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptservice/service.py) (Resident agent service), [`waptserver/api.py`](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/api.py) (Server API), [`waptserver/app.py`](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/app.py) (Server web app), [`wapt-get.py`](https://github.com/tranquilit/wapt/blob/branch-1.8.2/wapt-get.py) (Agent CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_packages["Package &amp; trust"]
  node_package_tooling["Package tooling<br/>Python package tools<br/>[waptpackage.py]"]
  node_package_templates["Setup templates<br/>Package scripts"]
  node_signing{{"Signing &amp; crypto<br/>Trust boundary"}}
  node_package_index["Package indexer<br/>Repository metadata"]
end

subgraph group_endpoint["Endpoint"]
  node_agent_cli["Agent CLI<br/>Python CLI<br/>[wapt-get.py]"]
  node_agent_shared["Agent setup layer<br/>Python shared layer<br/>[common.py]"]
  node_native_agent["Native agent helper<br/>Lazarus app<br/>[waptget.lpr]"]
  node_agent_service["Resident agent service<br/>Python service<br/>[service.py]"]
  node_agent_realtime["Agent real-time channel<br/>Socket.IO"]
  node_self_service_ui["Self-service UI<br/>Lazarus app<br/>[waptself.lpr]"]
  node_tray_ui["Tray UI<br/>Lazarus app<br/>[wapttray.lpr]"]
end

subgraph group_server["Control plane"]
  node_server_app["Server web app<br/>Python web app<br/>[app.py]"]
  node_server_api["Server API<br/>Python API<br/>[api.py]"]
  node_server_auth_model[("Auth &amp; data model<br/>Server domain layer<br/>[model.py]")]
  node_server_realtime["Server real-time channel<br/>Socket.IO<br/>[server_socketio.py]"]
  node_task_worker["Fleet task worker<br/>Background worker<br/>[tasks.py]"]
  node_server_deployment["Server deployment stack<br/>Linux service stack"]
end

subgraph group_delivery["Clients &amp; delivery"]
  node_admin_console["Admin console<br/>Lazarus desktop client<br/>[waptconsole.lpr]"]
  node_cross_platform_installers["Cross-platform installers<br/>Distribution artifacts<br/>[wapt.iss]"]
end

node_package_templates -->|"defines setup"| node_package_tooling
node_package_tooling -->|"package payload"| node_signing
node_signing -->|"signed packages"| node_package_index
node_package_index -->|"repository metadata"| node_server_app
node_agent_cli -->|"uses"| node_agent_shared
node_native_agent -->|"launches"| node_agent_cli
node_agent_service -->|"executes deployments"| node_agent_shared
node_self_service_ui -->|"requests operations"| node_agent_service
node_tray_ui -->|"controls"| node_agent_service
node_agent_cli -->|"queries packages"| node_server_api
node_agent_service -->|"publishes status"| node_agent_realtime
node_agent_realtime -->|"task/status events"| node_server_realtime
node_server_app -->|"hosts"| node_server_api
node_server_api -->|"authorizes and persists"| node_server_auth_model
node_server_app -->|"hosts"| node_server_realtime
node_server_api -->|"queues fleet actions"| node_task_worker
node_task_worker -->|"orchestrates endpoint work"| node_agent_realtime
node_server_deployment -->|"serves"| node_server_app
node_admin_console -->|"administration"| node_server_api
node_cross_platform_installers -->|"installs agent"| node_agent_service
node_cross_platform_installers -->|"installs server stack"| node_server_deployment

click node_package_tooling "https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptpackage.py"
click node_package_templates "https://github.com/tranquilit/wapt/blob/branch-1.8.2/templates/setup_package_template.py.tmpl"
click node_signing "https://github.com/tranquilit/wapt/blob/branch-1.8.2/wapt-signpackages.py"
click node_package_index "https://github.com/tranquilit/wapt/blob/branch-1.8.2/wapt-scanpackages.py"
click node_agent_cli "https://github.com/tranquilit/wapt/blob/branch-1.8.2/wapt-get.py"
click node_agent_shared "https://github.com/tranquilit/wapt/blob/branch-1.8.2/common.py"
click node_native_agent "https://github.com/tranquilit/wapt/blob/branch-1.8.2/wapt-get/waptget.lpr"
click node_agent_service "https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptservice/service.py"
click node_agent_realtime "https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptservice/waptservice_socketio.py"
click node_self_service_ui "https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptself/waptself.lpr"
click node_tray_ui "https://github.com/tranquilit/wapt/blob/branch-1.8.2/wapttray/wapttray.lpr"
click node_server_app "https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/app.py"
click node_server_api "https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/api.py"
click node_server_auth_model "https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/model.py"
click node_server_realtime "https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/server_socketio.py"
click node_task_worker "https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/tasks.py"
click node_server_deployment "https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/scripts/waptserver-uwsgi.service"
click node_admin_console "https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptconsole/waptconsole.lpr"
click node_cross_platform_installers "https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptsetup/wapt.iss"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_package_tooling,node_package_templates,node_signing,node_package_index toneBlue
class node_agent_cli,node_agent_shared,node_native_agent,node_agent_service,node_agent_realtime,node_self_service_ui,node_tray_ui toneAmber
class node_server_app,node_server_api,node_server_auth_model,node_server_realtime,node_task_worker,node_server_deployment toneMint
class node_admin_console,node_cross_platform_installers toneRose
```

## Components

### Package & trust

- [Package tooling](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptpackage.py): Python package tools · Creates, inspects, and prepares deployable packages. · `waptpackage.py`
- [Setup templates](https://github.com/tranquilit/wapt/blob/branch-1.8.2/templates/setup_package_template.py.tmpl): Package scripts · Installer-specific package setup templates. · `templates/setup_package_template.py.tmpl`
- [Signing & crypto](https://github.com/tranquilit/wapt/blob/branch-1.8.2/wapt-signpackages.py): Trust boundary · Signs packages before repository publication. · `wapt-signpackages.py`
- [Package indexer](https://github.com/tranquilit/wapt/blob/branch-1.8.2/wapt-scanpackages.py): Repository metadata · Scans packages and produces repository metadata. · `wapt-scanpackages.py`

### Endpoint

- [Agent CLI](https://github.com/tranquilit/wapt/blob/branch-1.8.2/wapt-get.py): Python CLI · Resolves and executes endpoint package actions. · `wapt-get.py`
- [Agent setup layer](https://github.com/tranquilit/wapt/blob/branch-1.8.2/common.py): Python shared layer · Shared configuration and deployment helpers. · `common.py`
- [Native agent helper](https://github.com/tranquilit/wapt/blob/branch-1.8.2/wapt-get/waptget.lpr): Lazarus app · Platform-integrated GUI/helper project. · `wapt-get/waptget.lpr`
- [Resident agent service](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptservice/service.py): Python service · Schedules local operations and exposes endpoint behavior. · `waptservice/service.py`
- [Agent real-time channel](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptservice/waptservice_socketio.py): Socket.IO · Task and status communication for the local service. · `waptservice/waptservice_socketio.py`
- [Self-service UI](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptself/waptself.lpr): Lazarus app · `waptself/waptself.lpr`
- [Tray UI](https://github.com/tranquilit/wapt/blob/branch-1.8.2/wapttray/wapttray.lpr): Lazarus app · `wapttray/wapttray.lpr`

### Control plane

- [Server web app](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/app.py): Python web app · Administrative boundary for managed hosts and repositories. · `waptserver/app.py`
- [Server API](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/api.py): Python API · `waptserver/api.py`
- [Auth & data model](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/model.py): Server domain layer · Authentication and persistent control-plane data. · `waptserver/model.py`
- [Server real-time channel](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/server_socketio.py): Socket.IO · `waptserver/server_socketio.py`
- [Fleet task worker](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/tasks.py): Background worker · Runs long-lived fleet actions outside request handling. · `waptserver/tasks.py`
- [Server deployment stack](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptserver/scripts/waptserver-uwsgi.service): Linux service stack · uWSGI, Nginx, systemd, SSL, and logging deployment. · `waptserver/scripts/waptserver-uwsgi.service`

### Clients & delivery

- [Admin console](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptconsole/waptconsole.lpr): Lazarus desktop client · Manages hosts, packages, and repositories. · `waptconsole/waptconsole.lpr`
- [Cross-platform installers](https://github.com/tranquilit/wapt/blob/branch-1.8.2/waptsetup/wapt.iss): Distribution artifacts · Windows, Debian, RPM, and macOS delivery builds. · `waptsetup/wapt.iss`

## Connections

- Setup templates → Package tooling: defines setup
- Package tooling → Signing & crypto: package payload
- Signing & crypto → Package indexer: signed packages
- Package indexer → Server web app: repository metadata
- Agent CLI → Agent setup layer: uses
- Native agent helper → Agent CLI: launches
- Resident agent service → Agent setup layer: executes deployments
- Self-service UI → Resident agent service: requests operations
- Tray UI → Resident agent service: controls
- Agent CLI → Server API: queries packages
- Resident agent service → Agent real-time channel: publishes status
- Agent real-time channel → Server real-time channel: task/status events
- Server web app → Server API: hosts
- Server API → Auth & data model: authorizes and persists
- Server web app → Server real-time channel: hosts
- Server API → Fleet task worker: queues fleet actions
- Fleet task worker → Agent real-time channel: orchestrates endpoint work
- Server deployment stack → Server web app: serves
- Admin console → Server API: administration
- Cross-platform installers → Resident agent service: installs agent
- Cross-platform installers → Server deployment stack: installs server stack
