Skip to content

Latest commit

 

History

History
108 lines (78 loc) · 5.23 KB

File metadata and controls

108 lines (78 loc) · 5.23 KB

Discord Tickets (revamped)

A fork of discord-tickets/bot, with more features, and less bugs.

What's different

Tickets as threads or forum posts as well as channels, a visual automation builder, panels and message layouts edited in a block editor, HTML transcripts, a member portal and staff queue, per-server bot customisation, and durable scheduling on Temporal.

FORK.md explains every difference from upstream — what each feature does, what was removed, and why.

Requirements

  • Node.js 20+ (22 LTS recommended) on a glibc platform. Alpine/musl is not supported — Temporal's native addon has no musl build.
  • MySQL or PostgreSQL. SQLite support has been removed — DB_PROVIDER must be mysql or postgresql.
  • A Temporal cluster. This is not optional: every scheduled and durable job (stale tickets, auto-close, the reopen window, exports, cron automations) runs on it, and the bot exits at startup without TEMPORAL_ADDRESS/TEMPORAL_PORT. Use Temporal Cloud or self-host — the provided docker-compose.yml brings up a cluster with its own PostgreSQL and the Web UI.

Installing

docs/installation.md is the full guide. In short:

Method How
Docker Compose docker-compose.yml — brings up the database and Temporal too. Image tags: :latest, :1, :1.4, :1.4.x for releases, :main for development builds.
Bare metal Extract the release tarball, npm ci --omit=dev --omit=optional, run under systemd.
Pterodactyl Import eggs/pterodactyl.json on a Debian Node yolk.
Pelican Import eggs/pelican.json on a Debian Node yolk.

The release tarball ships the compiled Temporal layer and the dashboard build, so nothing has to be built on the target machine.

Important

Set ENCRYPTION_KEY yourself (openssl rand -hex 24) and never change it. Ticket topics, close reasons, feedback comments and archived messages are encrypted with it, and it is not recoverable — not even from a database backup. The bot refuses to start rather than inventing a throwaway key that would differ after every recreate.

Upgrading an existing instance

Read MIGRATING.md — it covers each install method, the SQLite path, and how to recover a half-applied migration.

Database migrations run automatically at startup (scripts/postinstall.js runs prisma migrate deploy) for both providers, and a failed migration stops the boot instead of letting the bot run against a half-migrated schema. There is no script to run by hand.

Environment variables

See docs/installation.md for the variables this fork adds or changes, .env.example for an annotated file to copy, and src/env.js for the authoritative validation. Everything else is documented upstream at https://discordtickets.app/self-hosting/configuration/#environment-variables.

Development

The bot itself is plain JavaScript (CommonJS) run by Node; the Temporal layer in src/temporal/ is TypeScript that has to be compiled before the bot will start. Dependencies are managed with npm (package-lock.json is the one lockfile).

npm install --include=dev    # devDependencies are needed to build the Temporal layer
npm run temporal.build       # compile src/temporal -> dist/temporal + bundle workflows
npm run temporal.typecheck   # type-check only
npm run lint                 # eslint (JS only; src/temporal and dist are excluded)
npm test                     # i18n, components, panels, transcripts, questions,
                             # automations, import allow-lists, regex safety
npm start                    # start the bot (builds the Temporal layer if missing)

Exporting NODE_ENV=production before installing makes npm skip devDependencies, so the Temporal layer cannot be compiled. scripts/ensure-temporal.js says so explicitly when it happens.

State (.env, user/, logs/) lives in the data directory, which defaults to the repository and is overridden with DT_DATA_DIR. The working directory no longer affects anything.

The dashboard is a separate SvelteKit app in src/dashboard/ with its own dependencies. Its compiled output, src/dashboard/build, is build output rather than source: the install above builds it for you if it is missing. After changing any .svelte file, rebuild it:

npm run dashboard.build

Set DT_SKIP_DASHBOARD_BUILD=true to skip the automatic build during install. Releases build it in CI, so nothing has to be committed or built on the target machine.

Support

Our support server on discord can be joined via the invite link: https://discord.gg/PaxqZNnB5e

Security

See SECURITY.md for how to report a vulnerability.

License

GPL-3.0-or-later, inherited from the upstream project by eartharoid. See LICENSE.