Dornorium Setup Manual
Complete guide to installing, configuring, and running Dornorium—a simple, secure, serverless ticket management and customer communication platform.
Quick Navigation
Setup at a Glance
| Component | Required? | Description | Can Add Later? |
|---|---|---|---|
| Cloudflare API Token | ✅ Yes | Required to deploy Dornorium infrastructure | No |
| Gmail Account | ❌ No | Optional. Send from any Gmail address (free or custom domain) | Yes |
| Google Apps Script | ❌ No | Optional. Acts as email API bridge. Required only if using email. | Yes |
| Domain Email Alias | ❌ No | Optional. Send from custom domain. Can use plain Gmail address instead. | Yes |
Free Tier Coverage
Dornorium runs completely on free tiers. Here's what you get:
Cloudflare Workers Free
Gmail Free
Cloudflare Email Free
What is Dornorium?
Dornorium (codenamed Dornorium) is a serverless ticket management platform for handling customer support, inquiries, and communications.
Overview
Dornorium is built on Cloudflare Workers for serverless compute, with D1 for data persistence and KV Storage for session management. It provides:
- Ticket Management — Create, track, and resolve customer support tickets with full audit trail
- SLA Tracking — Automatic SLA monitoring with visual indicators (on-track, at-risk, breached)
- Email Integration — Bidirectional email integration (inbound tickets, outbound replies)
- Multi-Category Support — Organize tickets by category with category-specific SLA and auto-reply templates
- Newsletter Management — Built-in subscriber management and campaign sending
- Live Reporting — Dashboard views, status charts, and performance metrics
- User Authentication — Secure login with session tokens
Key Features
Ticket Workflow
Tickets flow through a simple lifecycle: New → Open → In Progress → Pending → Resolved → Closed (auto-closes after 3 days). Each status represents the current state of work.
SLA Management
Track two SLA deadlines per ticket: first response time and full resolution time. The dashboard uses color coding to show urgency:
- 🟢 Green — On track (50%+ time remaining)
- 🟡 Yellow — At risk (25–50% time remaining)
- 🟠 Orange — Critical (less than 25% remaining)
- 🔴 Red — Breached (deadline passed)
Email Routing
When someone emails your support address, Dornorium automatically:
- Checks if the email contains a ticket reference (TKT-YYYY-NNNNN)
- If yes: attaches it as a reply to the existing ticket
- If no: creates a new ticket in the appropriate category
- Sends an auto-reply confirming receipt (if enabled for that category)
Multi-Address Support
You can monitor multiple email addresses (support@, sales@, billing@, etc.), each routing to its own category with independent SLA and auto-reply settings. This is all managed through the Settings page with no code changes.
Newsletter Integration
The Newsletter section lets you:
- Collect subscribers via a website form
- Manage subscriber list and unsubscribe requests
- Compose and send HTML campaigns
- Track sent campaigns and recipient counts
Reporting
Live reporting dashboard with:
- Ticket count summary (total, on-track, at-risk, breached)
- Status breakdown pie chart
- Daily volume trend (last 30 days)
- Top categories and top senders table
Architecture
Dornorium is built entirely serverless:
- Cloudflare Workers — API endpoints for all operations (no backend server to manage)
- D1 Database — SQLite database for tickets, subscribers, campaigns, and settings
- KV Storage — Session tokens and temporary cache
- Email Routing — Native Cloudflare email routing for inbound emails
- Google Apps Script — Optional relay for outbound email (uses your Gmail account)
What You Get
- Serverless infrastructure (no server to maintain)
- Automatic scaling (handles traffic spikes automatically)
- Global distribution (requests served from nearest Cloudflare edge)
- Built-in security (DDoS protection, rate limiting)
- Free tier available for small teams (Cloudflare free + limited email)
Email Setup Overview Optional
Add email capabilities to send and receive support tickets, confirmations, and newsletters from your domain.
You can set this up anytime after installing Dornorium. However, if you plan to use email, we recommend configuring all three components (Gmail, Google Apps Script, and domain aliases) together for easier overall setup.
Why Use Gmail for Email?
Gmail offers a free, reliable solution for sending transactional emails from your custom domain:
- Send from
support@yourdomain.comor any custom address - No separate email server to maintain
- Integrates seamlessly with Dornorium via Google Apps Script
- Free tier: up to 99 aliases, 500 emails per 24 hours
- Use either a free Gmail account or your own Google Workspace account
Three Components You'll Set Up
Email integration requires three pieces working together:
1. Gmail Account
A free Google account dedicated to Dornorium, or your existing Google Workspace account. Used to relay outbound mail.
2. Google Apps Script
A private API bridge that Dornorium calls to send emails. Runs in your Google account.
3. Domain Aliases
Configure Gmail to send from your custom domain (optional). If you skip this, you can still send from your Gmail address.
Getting Started
Follow these sections in order:
- Create a Gmail account and set up Google Apps Script
- Configure domain aliases to send from custom addresses (optional)
Creating Your Cloudflare API Token Required
One API token is used by the installer and by Dornorium (the worker) for domains, DNS, and email routing. Create it once under Manage account → Account API tokens.
While logged into Cloudflare, open:
https://dash.cloudflare.com/?to=/:account/api-tokens&permissionGroupKeys=%5B%7B%22key%22%3A%22workers_scripts%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22workers_kv_storage%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22d1%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22dns%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22edit%22%7D%5D&name=Dornorium
This pre-fills: Workers Scripts, Workers KV Storage, D1, DNS, and Zone.
The template cannot set Email Routing. Add it before you create the token:
- On the policy for All zones, search for
Email Routing - Enable Write (or Edit) on Email Routing Rules
- On the policy for Entire account, search for
Email Routing - Enable Write (or Edit) on Email Routing Addresses (and Email Routing Rules if listed there too)
Before clicking Create, the permission summary must look like this:
| Scope | Permissions |
|---|---|
| All zones (all domains in the account) | DNS Write Zone Write Email Routing Rules Write |
| Entire account | Workers Scripts Write Workers KV Storage Write D1 Write Email Routing Addresses Write Email Routing Rules Write (optional if already on All zones) |
- Token name:
Dornorium Installer - Click Create Token
- Copy the token immediately — shown only once
- Save it securely
Setting Up Google Apps Script Optional
Configure a Google Apps Script that acts as a private API bridge between Dornorium and Gmail for sending emails.
Overview
Google Apps Script allows you to create a custom email API that Dornorium can call to send messages. The script validates credentials and uses Gmail's native sending capabilities.
What You'll Need
- A Gmail account (free or Google Workspace) — you can create one at Google Account Sign Up
- Access to script.google.com
- A text editor to store your credentials (use a password manager)
- Go to script.google.com and sign in with your Gmail account
- Click the blue + New project button in the top-left corner
- Delete any existing text in the code editor
- Copy and paste the code block below (use the Copy button):
/********************************************************************************
* DORNORIUM GMAIL API WRAPPER
* User Configuration — Edit the values below with your own credentials
*
* IMPORTANT: Do not change anything else in this script after the CONFIG section
********************************************************************************/
var CONFIG = {
SECRET_KEY: "YourSecretKey123", // Change to your private security secret
API_USERNAME: "user", // Change to your desired API username
API_PASSWORD: "SomePassword" // Change to your desired API password
};
/********************************************************************************
* CORE SCRIPT LOGIC (DO NOT EDIT BELOW THIS LINE)
********************************************************************************/
function doGet(e) {
return handleRequest(e);
}
function doPost(e) {
return handleRequest(e);
}
function handleRequest(e) {
var p = e.parameter;
// Validate the secret key
if (p.secret !== CONFIG.SECRET_KEY) {
return ContentService.createTextOutput(JSON.stringify({status: "error", message: "Unauthorized"}))
.setMimeType(ContentService.MimeType.JSON);
}
// Validate username and password credentials
if (p.username !== CONFIG.API_USERNAME || p.password !== CONFIG.API_PASSWORD) {
return ContentService.createTextOutput(JSON.stringify({status: "error", message: "Invalid Credentials"}))
.setMimeType(ContentService.MimeType.JSON);
}
try {
var options = {
htmlBody: p.message
};
if (p.from) {
options.from = p.from;
}
GmailApp.sendEmail(p.to, p.subject, "", options);
return ContentService.createTextOutput(JSON.stringify({status: "success"}))
.setMimeType(ContentService.MimeType.JSON);
} catch (err) {
return ContentService.createTextOutput(JSON.stringify({status: "error", message: err.toString()}))
.setMimeType(ContentService.MimeType.JSON);
}
}
- Update the three configuration values at the top:
- SECRET_KEY — A private security secret (can be any random string)
- API_USERNAME — Your desired API username
- API_PASSWORD — Your desired API password
- Choose strong credentials and store them securely—you will need them when configuring Dornorium
- SECRET_KEY: "k7$9mLpQ2#xRvW8nB1yZ4@Dj5"
- API_USERNAME: "dornorium_api"
- API_PASSWORD: "G9$2pL!8vK#4mX@5qRyT7*Wn"
- Click the Save icon (floppy disk) at the top of the toolbar, or press Ctrl + S
- Name your project something like
Dornorium Gmail API
- In the top-right corner, click the blue Deploy button
- Select New deployment
- Click the gear icon next to "Select type" and choose Web app
- Fill in the deployment fields:
- Description: Dornorium Gmail API
- Execute as: Me (your email address)
- Who has access: Anyone (Critical!)
- Click the blue Deploy button
- Google will display an "Authorization required" prompt—click Review permissions
- Select your Google account
- You will see a warning that "Google hasn't verified this app"—this is normal and expected. Click Advanced (bottom left)
- Click Go to [Project Name] (unsafe) (this is safe—it's your own script)
- Click Allow at the bottom of the page
- Copy your generated Web App URL from the deployment confirmation (looks like:
https://script.googleapis.com/macros/d/XXXXX/usercache) - Store it securely—you will need it for Dornorium configuration
Configuring Domain Email Aliases Optional
Set up Gmail to send emails from your custom domain (e.g., support@yourdomain.com) instead of a plain Gmail address.
Overview
To send emails from addresses like support@yourdomain.com without security warnings, you must link your custom domain to Gmail using SMTP and a Google App Password. This section covers the setup.
Phase 1: Generate Your Google App Password
- Go to Google Account Security Settings
- Verify that 2-Step Verification is enabled (required for app passwords)
- Scroll down and click App passwords
- Give your app password a name (e.g.,
Dornorium SMTP) - Click Create
- Google displays a 16-character password
- Copy this password and store it securely—you need it for Gmail alias setup
Phase 2: Configure "Send As" in Gmail
- Open your Gmail inbox at mail.google.com
- Click the Gear icon (Settings) in the top-right corner
- Select See all settings
- Go to the Accounts and Import tab
- Under Send mail as:, click Add another email address
- Enter your custom domain email (e.g.,
support@yourdomain.com) - Click Next Step
Fill in the SMTP configuration with these values:
| Setting | Value |
|---|---|
| SMTP Server | smtp.gmail.com |
| Port | 465 |
| Username | Your Gmail account email |
| Password | Your 16-character App Password (remove spaces) |
| Connection | ✓ Secured connection using SSL |
- Click Add Account
- Gmail sends a verification email to the address you just added
- Open the verification email and copy the confirmation URL
- Paste the URL into your browser and complete the verification
- Once verified, the email address will be available for sending through Dornorium
Permissions Reference
Final permission set for Dornorium installer and worker (Account API tokens).
Template (partial)
Pre-fill Dornorium token — then add Email Routing manually (see Cloudflare API Token section).
Required summary
| Scope | Permission |
|---|---|
| All zones | DNS Write |
| All zones | Zone Write |
| All zones | Email Routing Rules Write |
| Entire account | Workers Scripts Write |
| Entire account | Workers KV Storage Write |
| Entire account | D1 Write |
| Entire account | Email Routing Addresses Write |
| Entire account | Email Routing Rules Write (ok if present) |
What each is for
| Permission | Purpose |
|---|---|
| Workers Scripts | Deploy the worker |
| Workers KV Storage | KV namespace |
| D1 | Database |
| DNS + Zone | Domains and DNS records |
| Email Routing Rules / Addresses | Inbound email to the worker |