-
Notifications
You must be signed in to change notification settings - Fork 15
Architecture
FreeITSM is a classic LAMP-style web application: PHP server-side with vanilla JS/HTML/CSS on the client. No frameworks, no build step. All 18 modules share a common chrome (waffle menu, header, user account dropdown) but each module is self-contained under its own folder.
| Component | Technology |
|---|---|
| Backend | PHP 7.4β8.4 |
| Database | MySQL 8.0+ via PDO MySQL |
| Frontend | Vanilla JavaScript, HTML5, CSS3 |
| Rich text editing | TinyMCE 6+ |
| Email integration | Microsoft Graph API + Gmail API (OAuth 2.0) |
| Encryption at rest | AES-256-GCM for sensitive values |
| AI features | Anthropic Claude API (per-feature keys) + OpenAI embeddings (Knowledge) |
| Web server | Apache (WAMP/XAMPP/LAMP) or any PHP server |
freeitsm/
βββ config.php # References external db_config.php
βββ index.php # Module selection grid (landing page)
βββ login.php # Analyst login
βββ api/ # ~140 REST endpoints, one folder per module
βββ assets/
β βββ css/ # Shared stylesheets
β βββ js/ # Shared scripts + TinyMCE library
β βββ images/
βββ includes/ # Shared PHP components
β βββ functions.php # connectToDatabase() + analyst module helpers
β βββ waffle-menu.php # Cross-module nav + user account menu
β βββ encryption.php # AES-256-GCM helpers
β βββ totp.php # Pure-PHP TOTP / HOTP (RFC 6238 / 4226)
β βββ module-colors.php # Module colour definitions
βββ database/
β βββ freeitsm.sql # Schema bootstrap
βββ docs/ # Design docs (e.g. cmdb.md)
βββ <module-folders>/ # tickets/, contracts/, cmdb/, ...
Each module folder typically contains:
-
index.phpβ landing page -
settings/index.phpβ module config -
help.phpβ in-app guided help page (scroll-spy sidebar, sectioned content) -
includes/header.phpβ module's header bar with its colour gradient and nav tabs
A Microsoft 365-style app launcher in the header of every module page. Each module is registered with a name, path, icon SVG, and colour gradient. Respects $_SESSION['allowed_modules'] to filter visible modules per analyst.
Also contains the user account menu β an initials avatar circle in the top-right of every page. Clicking opens a dropdown with:
- Change Password (validates current, min 8 chars)
- Multi-Factor Authentication (TOTP setup/disable with QR code)
- Logout (with confirmation)
To add a new module, add an entry to the $modules array and matching CSS.
Pure-PHP implementation of RFC 6238 (TOTP) and RFC 4226 (HOTP). No external dependencies β uses PHP's built-in hash_hmac() and random_bytes().
- Secret generation: 20 random bytes β Base32 (32-char string)
- Code generation: HMAC-SHA1, 30-second time step, dynamic truncation β 6-digit code
-
Verification: Β±1 time window (90-second tolerance),
hash_equals()for timing-safe compare -
URI format:
otpauth://totp/FreeITSM:{username}?secret={base32}&issuer=FreeITSM
Secrets are encrypted at rest with AES-256-GCM before being stored in analysts.totp_secret.
AES-256-GCM authenticated encryption for sensitive database values.
-
Key file:
C:\wamp64\encryption_keys\sdtickets.key(outside web root) -
Format:
ENC:+ base64(IV + auth tag + ciphertext) -
Migration-safe: Values without
ENC:prefix pass through unchanged
$encrypted = encryptValue($plaintext);
$plaintext = decryptValue($encrypted);
$mailbox = decryptMailboxRow($mailbox);Encrypted columns include:
-
system_settings:vcenter_*,knowledge_ai_api_key,knowledge_openai_api_key,intune_* -
target_mailboxes:azure_tenant_id,azure_client_id,azure_client_secret,oauth_redirect_uri,imap_server,target_mailbox analysts.totp_secret
A subset of "true secrets" listed in MASKED_SETTING_KEYS are also masked to ****<last4> in API responses, with a save-time convention that blank or asterisk-prefixed submissions mean "leave unchanged" so the user can save the form without re-typing.
Each module's includes/header.php:
- Checks session auth (redirects to login if missing)
- Sets
$current_modulefor waffle-menu highlighting - Renders the header bar with the module's colour gradient
- Includes the waffle button, module nav tabs, and user account avatar
Global notification system. Four types: success (green), error (red), warning (amber), info (blue). 9 configurable screen positions via visual grid picker in System Settings β General. Position persisted per-browser in localStorage. Slide-in animations, auto-dismiss after 4s, manual close button.
-
MySQL 8.0+ with
AUTO_INCREMENTfor primary keys -
$conn->lastInsertId()to retrieve new IDs after INSERT -
Foreign keys with cascading where ownership is real (e.g.
cmdb_objects.parent_idcascade-deletes descendants) -
Soft delete via
is_activeflags rather than physical deletion for user-facing records -
Datetime columns:
created_datetime,last_modified_datetime, etc. (PHP-side defaults)
All endpoints live under api/<module>/ and return JSON. Every endpoint starts with:
session_start();
require_once '../../config.php';
require_once '../../includes/functions.php';
header('Content-Type: application/json');
if (!isset($_SESSION['analyst_id'])) {
echo json_encode(['success' => false, 'error' => 'Not authenticated']);
exit;
}See API Reference for a per-module endpoint summary.
Several modules integrate Anthropic Claude with per-feature API keys (separate from each other for granular billing visibility on the Anthropic dashboard):
| Feature | Settings location |
|---|---|
| Knowledge AI chat | Knowledge β Settings β AI |
| Reply Cleanup | Tickets β Settings β Reply Cleanup |
| RFP Builder | Contracts β Settings β RFP AI |
| Form generation | Reuses RFP AI key |
| CMDB AI summary + Suggest Properties | CMDB β Settings β AI Integration |
All keys are encrypted at rest. Most AI features stream output via SSE (claude.ai-style live tokens) for long-running calls.
FreeITSM β an open-source IT Service Management platform Β· github.com/edmozley/freeitsm Β· MIT licence
- Installation
- β° Scheduled tasks (cron jobs)
- Architecture
- AI Providers
- Internationalisation (i18n)
- Timezones & Time Handling
- Theming & Dark Mode
- β¨οΈ Command palette (βK)
- π Searching inside tickets
- π Attached documents
- MobileβFriendly
-
Security
- Layer 1 β which modules you can enter
- β³ π§© Module Access Control
- β³ π οΈ Module Access β Developer Guide
- Layer 2 β what you can administer
- β³ π Roles & Permissions
- β³ π οΈ Roles β Developer Guide
- β³ π€ Why capabilities are constants
- Layer 3 β the System module
- β³ π Admin Access Control
- Hardening
- β³ π Security review response 2026-08
- β³ π‘οΈ Security hardening 2026-08
- β³ π οΈ Security hardening 2026-08 β Developer Guide
- β³ π‘οΈ Round three β plain English
- β³ π οΈ Round three β Developer Guide
- Single Sign-On (SSO)
- ποΈ LDAP & Active Directory
- Browser Extension
- API Reference
-
π REST API β how it works
- β³ π« REST API: Tickets
- β³ π» REST API: Assets
- β³ π΄ REST API: Problems
- β³ π REST API: Changes
- β³ π REST API: Knowledge
- β³ β REST API: Tasks
- β³ ποΈ REST API: CMDB
- β³ π REST API: Contracts
- β³ ποΈ REST API: Calendar
- β³ πΏ REST API: Software
- β³ π¦ REST API: Service Status
- β³ βοΈ REST API: Morning Checks
- β³ π REST API: Forms
- β³ βοΈ REST API: Workflow
- β³ πΊοΈ REST API: Network Mapper
- β³ π§ Using the API docs page
- β³ π OpenAPI specification
- β³ β OpenAPI: kept correct
- β³ π οΈ Maintaining the catalogue
- Watchtower
-
Tickets
- β³ Mailbox Authentication
- β³ π€ Email send log
- β³ Basic IMAP mailboxes
- β³ Email rendering & images
- β³ SLA Management
- β³ WhatsApp channel
- β³ π¬ Web chat channel
- β³ π£ Slack channel
- β³ π Linking tickets
- β³ ποΈ Canned responses
- β³ βοΈ Limiting replies to particular senders
- β³ βοΈ Email signatures
- β³ π The public web address
- β³ π Raising a ticket for someone else
- β³ π Merging tickets
- β³ β Splitting tickets
- β³ β Selecting several tickets
- β³ π οΈ Snoozing tickets β Developer Guide
- β³ π₯ Collision detection
- β³ β±οΈ Time tracking
- Problem Management
- Tasks
- Assets
- Knowledge
- Change Management
- Calendar
- Morning Checks
- Reporting
- Software
- Forms
- Contracts
- Service Status
- π Notifications
- π¨ War Room
- Self-Service Portal
- LMS
- Process Mapper
- CMDB
- Network Mapper
- Workflows
- Issue trackers (Jira, Azure DevOps)
- System
-
Overview
- β³ π Progress tracker
- β³ Concepts & vocabulary
- β³ Email routing & mailboxes
- β³ Settings: global vs per-company
- β³ Users & self-service
- β³ Staff cross-company access
- β³ Worked examples
- β³ Pitfalls & gotchas
- β³ Scope: what it's for
- β³ π οΈ Developer Guide (make a module multi-company)
- β³ ποΈ Case study: CMDB (a linked graph)
- β³ π§ͺ Test harness (prove it's isolated)