@helyx/bot 0.4.38 → 0.4.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +5 -0
- package/documentation/README.md +32 -0
- package/documentation/examples/.env.example +117 -0
- package/documentation/guides/getting-started.md +51 -0
- package/documentation/guides/self-hosting.md +40 -0
- package/documentation/modules/building-a-module.md +37 -0
- package/documentation/modules/publishing-a-module.md +27 -0
- package/documentation/modules/testing-a-module.md +46 -0
- package/documentation/reference/environment.md +42 -0
- package/documentation/runbooks/backup-and-recovery.md +41 -0
- package/documentation/runbooks/installation-and-upgrades.md +48 -0
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
The Helyx Discord runtime validates its environment, verifies and migrates PostgreSQL, validates explicitly configured module packages, applies their migrations, composes platform services, synchronises guild installations and commands, logs in with the non-privileged Guilds intent, and shuts down Discord, modules, and PostgreSQL safely.
|
|
4
4
|
|
|
5
|
+
Version-matched public guides, operator runbooks, environment reference
|
|
6
|
+
material, and module-authoring instructions ship at `documentation/README.md`
|
|
7
|
+
inside this npm package. Repository-only `docs/` and `docs-old/` content is not
|
|
8
|
+
published.
|
|
9
|
+
|
|
5
10
|
Command contributions use an explicit registration policy: platform commands
|
|
6
11
|
remain global, migrated customer commands are projected into enabled guilds,
|
|
7
12
|
deployment commands stay with their deployment, and internal commands are
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Helyx public documentation
|
|
2
|
+
|
|
3
|
+
This is the portable, versioned documentation set for Helyx operators and
|
|
4
|
+
module authors. It contains only material intended for public release and ships
|
|
5
|
+
inside the matching `@helyx/bot` npm package.
|
|
6
|
+
|
|
7
|
+
## Start here
|
|
8
|
+
|
|
9
|
+
- [Install a self-hosted Helyx instance](guides/getting-started.md)
|
|
10
|
+
- [Understand the self-hosting boundary](guides/self-hosting.md)
|
|
11
|
+
- [Configure the environment](reference/environment.md)
|
|
12
|
+
- [Operate installations and upgrades](runbooks/installation-and-upgrades.md)
|
|
13
|
+
- [Plan backup and recovery](runbooks/backup-and-recovery.md)
|
|
14
|
+
- [Build an independent module](modules/building-a-module.md)
|
|
15
|
+
- [Test a module](modules/testing-a-module.md)
|
|
16
|
+
- [Prepare a module package](modules/publishing-a-module.md)
|
|
17
|
+
|
|
18
|
+
The complete working example is published separately as
|
|
19
|
+
`@helyx/module-example`. It is intentionally independent: module-specific
|
|
20
|
+
commands, settings, tests, and lifecycle behavior remain inside that module.
|
|
21
|
+
|
|
22
|
+
## Publication boundary
|
|
23
|
+
|
|
24
|
+
The repository's `docs/` and `docs-old/` trees are internal engineering and
|
|
25
|
+
historical material. They are not part of the bot package. The hosted website
|
|
26
|
+
is also a separate private build workspace. The release process copies only
|
|
27
|
+
this `documentation/` tree into the bot tarball.
|
|
28
|
+
|
|
29
|
+
Do not place credentials, private infrastructure addresses, incident evidence,
|
|
30
|
+
unannounced plans, or internal deployment instructions here. Before a release,
|
|
31
|
+
run `npm run documentation:check` and `npm run release:dry-run` from the Helyx
|
|
32
|
+
repository root.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# REQUIRED — EDIT THESE VALUES
|
|
2
|
+
|
|
3
|
+
# Discord
|
|
4
|
+
DISCORD_TOKEN=replace-me
|
|
5
|
+
DISCORD_CLIENT_ID=12345678901234567
|
|
6
|
+
# Explicit privileged gateway opt-in. Keep false unless a reviewed loaded module
|
|
7
|
+
# requires message content and it is enabled in the Discord developer portal.
|
|
8
|
+
HELYX_MESSAGE_CONTENT_ENABLED=false
|
|
9
|
+
# Enable only when member inspection modules are loaded and the Discord Server
|
|
10
|
+
# Members Intent is enabled in the Discord developer portal.
|
|
11
|
+
HELYX_GUILD_MEMBERS_ENABLED=false
|
|
12
|
+
# Database
|
|
13
|
+
# Docker: keep the URL. Direct Node.js/managed hosting: use your provider URL.
|
|
14
|
+
DATABASE_URL=postgresql://database:5432/helyx
|
|
15
|
+
DATABASE_SSL=disable
|
|
16
|
+
|
|
17
|
+
# Included Docker database — both password values must match.
|
|
18
|
+
PGUSER=helyx
|
|
19
|
+
PGPASSWORD=replace-with-a-strong-password
|
|
20
|
+
POSTGRES_DB=helyx
|
|
21
|
+
POSTGRES_USER=helyx
|
|
22
|
+
POSTGRES_PASSWORD=replace-with-a-strong-password
|
|
23
|
+
|
|
24
|
+
# OPTIONAL EVERYDAY SETTINGS
|
|
25
|
+
|
|
26
|
+
# Ready for dashboard linking, but remains unpaired until you use a one-use code.
|
|
27
|
+
HELYX_CLOUD_CONNECT_ENABLED=true
|
|
28
|
+
# Public dashboard origin used in bot-generated report links.
|
|
29
|
+
# HELYX_DASHBOARD_PUBLIC_URL=https://app.helyx.gg
|
|
30
|
+
# HELYX_OWNER_USER_IDS=12345678901234567
|
|
31
|
+
|
|
32
|
+
# trace, debug, info, warn, error, fatal or silent
|
|
33
|
+
LOG_LEVEL=info
|
|
34
|
+
|
|
35
|
+
# Guild-scoped development commands only
|
|
36
|
+
# DISCORD_INTERNAL_GUILD_ID=12345678901234567
|
|
37
|
+
# APPROVED_ROLES=12345678901234567,12345678901234568
|
|
38
|
+
|
|
39
|
+
# SHARDING: OFF BY DEFAULT
|
|
40
|
+
|
|
41
|
+
# `off` is the compatible self-host default. Keep shard-only values commented
|
|
42
|
+
# in this mode; an empty value is still rejected as configured. Advanced local
|
|
43
|
+
# self-hosting may use `auto` to obtain Discord's recommendation under one
|
|
44
|
+
# supervisor, or `fixed` with a deliberate total count. Local mode never needs
|
|
45
|
+
# Redis. Coordinated multi-host self-hosting is outside the first release.
|
|
46
|
+
HELYX_SHARD_MODE=off
|
|
47
|
+
# HELYX_SHARD_SCOPE=local
|
|
48
|
+
# HELYX_SHARD_COUNT=2
|
|
49
|
+
# HELYX_SHARD_WORKERS_PER_REPLICA=2
|
|
50
|
+
# HELYX_SHARD_REDIS_URL=rediss://private-redis.example:6379
|
|
51
|
+
# HELYX_SHARD_REDIS_NAMESPACE=helyx.self-host
|
|
52
|
+
# HELYX_SHARD_GENERATION=local-20260728
|
|
53
|
+
# HELYX_SHARD_DATABASE_CONNECTION_BUDGET=10
|
|
54
|
+
# HELYX_SHARD_SUPERVISOR_DATABASE_POOL_MAX=2
|
|
55
|
+
# HELYX_SHARD_WORKER_DATABASE_POOL_MAX=4
|
|
56
|
+
# Redis URL and namespace are intentionally unsupported for the first
|
|
57
|
+
# self-hosted release: do not uncomment them for local auto or fixed mode.
|
|
58
|
+
|
|
59
|
+
# ADVANCED INTEGRATIONS — EDIT ONLY WHEN NEEDED
|
|
60
|
+
|
|
61
|
+
# Additional reviewed module packages
|
|
62
|
+
# HELYX_MODULE_PACKAGES=
|
|
63
|
+
|
|
64
|
+
# Private dashboard control endpoint — configure both together
|
|
65
|
+
# HELYX_BOT_CONTROL_SECRET=replace-with-a-base64-encoded-32-byte-key
|
|
66
|
+
# HELYX_BOT_CONTROL_PORT=3001
|
|
67
|
+
# HELYX_GUILD_RECONCILIATION_INTERVAL_SECONDS=900
|
|
68
|
+
|
|
69
|
+
# Guild command writes remain off until explicitly enabled for known guild IDs.
|
|
70
|
+
HELYX_GUILD_COMMAND_WRITES_ENABLED=false
|
|
71
|
+
HELYX_GUILD_COMMAND_WRITE_SCOPE=allowlist
|
|
72
|
+
# HELYX_GUILD_COMMAND_RELEASE_ID=
|
|
73
|
+
HELYX_GLOBAL_COMMAND_MODE=legacy
|
|
74
|
+
# HELYX_GUILD_COMMAND_WRITE_GUILD_IDS=
|
|
75
|
+
|
|
76
|
+
# Privacy tooling ships with self-hosted Helyx but stays disabled until the
|
|
77
|
+
# dedicated least-privilege executor connection has been configured.
|
|
78
|
+
HELYX_PRIVACY_ENABLED=false
|
|
79
|
+
# HELYX_PRIVACY_EXECUTOR_DATABASE_URL=<dedicated-privacy-executor-postgresql-url>
|
|
80
|
+
# HELYX_PRIVACY_EXECUTOR_DATABASE_SSL=disable
|
|
81
|
+
|
|
82
|
+
# Alternative Cloud Connect enrolment — the Discord command is preferred
|
|
83
|
+
# HELYX_CLOUD_ENROLMENT_TOKEN=replace-with-a-short-lived-enrolment-code
|
|
84
|
+
# HELYX_CLOUD_ENROLMENT_FILE=./helyx.cloud-enrolment.json
|
|
85
|
+
|
|
86
|
+
# Hosted OAuth bridge. Keep disabled unless the API and bot share this secret.
|
|
87
|
+
HELYX_OAUTH_ENABLED=false
|
|
88
|
+
# HELYX_OAUTH_INTERNAL_SECRET=replace-with-a-base64-encoded-32-byte-key
|
|
89
|
+
|
|
90
|
+
# DANGER ZONE — HELYX-MANAGED VALUES, DO NOT EDIT
|
|
91
|
+
|
|
92
|
+
# Generated module selection
|
|
93
|
+
HELYX_MODULE_CATALOGUE_PATH=./helyx.modules.json
|
|
94
|
+
|
|
95
|
+
# Generated privately by npm run setup. Never change it while Cloud Connect is
|
|
96
|
+
# enrolled or a checkpointed Giveaways draw is in progress.
|
|
97
|
+
# HELYX_DATA_ENCRYPTION_KEY=replace-with-a-base64-encoded-32-byte-key
|
|
98
|
+
|
|
99
|
+
# Official Cloud Connect endpoints
|
|
100
|
+
# HELYX_CLOUD_API_URL=https://api.helyx.gg
|
|
101
|
+
# HELYX_CLOUD_ENDPOINT=wss://connect.helyx.gg/v1/connect
|
|
102
|
+
|
|
103
|
+
# Security audit retention
|
|
104
|
+
# HELYX_CLOUD_AUDIT_RETENTION_DAYS=90
|
|
105
|
+
# HELYX_CLOUD_CREDENTIAL_AUDIT_RETENTION_DAYS=365
|
|
106
|
+
|
|
107
|
+
# Optional public status reporting. Keep disabled unless this installation has
|
|
108
|
+
# its own approved Helyx status credentials.
|
|
109
|
+
HELYX_STATUS_ENABLED=false
|
|
110
|
+
# HELYX_STATUS_URL=https://status.helyx.gg
|
|
111
|
+
# HELYX_STATUS_HEARTBEAT_SECRET=replace-with-a-base64-encoded-32-byte-key
|
|
112
|
+
# HELYX_STATUS_HEARTBEAT_INTERVAL_SECONDS=60
|
|
113
|
+
# CF_ACCESS_CLIENT_ID=replace-with-access-client-id
|
|
114
|
+
# CF_ACCESS_CLIENT_SECRET=replace-with-access-client-secret
|
|
115
|
+
|
|
116
|
+
# Runtime mode
|
|
117
|
+
NODE_ENV=production
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Getting started with self-hosted Helyx
|
|
2
|
+
|
|
3
|
+
## Requirements
|
|
4
|
+
|
|
5
|
+
- Node.js 24 or 26 and npm 11 or later.
|
|
6
|
+
- A Discord application and bot token.
|
|
7
|
+
- PostgreSQL with a database you can back up and restore.
|
|
8
|
+
- Permission to install the bot in the Discord servers you manage.
|
|
9
|
+
|
|
10
|
+
Keep the bot token, database credentials, encryption keys, and control secrets
|
|
11
|
+
outside source control.
|
|
12
|
+
|
|
13
|
+
## Create the project
|
|
14
|
+
|
|
15
|
+
Install the Helyx CLI, then generate a reviewed starter project using the
|
|
16
|
+
release manifest supplied by Helyx:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install --global @helyx/cli
|
|
20
|
+
helyx self-host init --manifest ./helyx-build.json --output ./helyx --install
|
|
21
|
+
cd helyx
|
|
22
|
+
helyx setup
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`helyx setup` creates `.env` from `.env.example` only when `.env` does not
|
|
26
|
+
already exist. Edit the required Discord and database values before continuing.
|
|
27
|
+
See the [environment reference](../reference/environment.md).
|
|
28
|
+
|
|
29
|
+
## Validate before login
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npm run doctor
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The doctor checks configuration, PostgreSQL connectivity, migration history,
|
|
36
|
+
and installed module metadata without logging in to Discord or changing the
|
|
37
|
+
database. Correct every reported error before starting.
|
|
38
|
+
|
|
39
|
+
## Start Helyx
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
npm start
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
For a long-running host, use the service or container supervision provided by
|
|
46
|
+
your operating system or hosting platform. Configure automatic restarts with a
|
|
47
|
+
bounded delay, retain logs without secrets, and arrange database backups before
|
|
48
|
+
inviting production traffic.
|
|
49
|
+
|
|
50
|
+
Next read the [self-hosting guide](self-hosting.md) and the
|
|
51
|
+
[installation and upgrade runbook](../runbooks/installation-and-upgrades.md).
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Self-hosting responsibilities
|
|
2
|
+
|
|
3
|
+
Self-hosting gives you control of the Helyx runtime and its data. It also makes
|
|
4
|
+
you responsible for the host, PostgreSQL, Discord credentials, environment
|
|
5
|
+
configuration, updates, monitoring, backups, and recovery testing.
|
|
6
|
+
|
|
7
|
+
## Supported shape
|
|
8
|
+
|
|
9
|
+
A normal installation contains one generated Helyx project, one PostgreSQL
|
|
10
|
+
database, the reviewed core packages, and independently selected modules. Keep
|
|
11
|
+
module boundaries intact: a module must be installable, configurable, testable,
|
|
12
|
+
and removable without relying on unrelated module behavior.
|
|
13
|
+
|
|
14
|
+
Helyx supports Docker Compose and direct Node.js operation. The generated
|
|
15
|
+
project is the source of truth for its pinned public packages and module
|
|
16
|
+
catalogue. Do not copy source trees from the Helyx repository into an
|
|
17
|
+
installation.
|
|
18
|
+
|
|
19
|
+
## Secrets and access
|
|
20
|
+
|
|
21
|
+
- Store `.env` outside version control and restrict who can read it.
|
|
22
|
+
- Use a dedicated database user and the least privileges supported by your
|
|
23
|
+
deployment.
|
|
24
|
+
- Rotate a Discord token or control secret if it may have been exposed.
|
|
25
|
+
- Do not paste secret values into logs, issues, screenshots, or support chats.
|
|
26
|
+
- Limit network access to PostgreSQL and private control endpoints.
|
|
27
|
+
|
|
28
|
+
## Operating baseline
|
|
29
|
+
|
|
30
|
+
- Run `npm run doctor` after configuration or package changes.
|
|
31
|
+
- Watch process health, database capacity, command deployment errors, and module
|
|
32
|
+
health.
|
|
33
|
+
- Back up both PostgreSQL and the environment or key material needed to decrypt
|
|
34
|
+
its records.
|
|
35
|
+
- Test recovery in a disposable environment.
|
|
36
|
+
- Apply compatible releases as one reviewed set; do not upgrade internal Helyx
|
|
37
|
+
packages independently.
|
|
38
|
+
|
|
39
|
+
Cloud Connect is optional. Enabling it does not transfer responsibility for the
|
|
40
|
+
self-hosted process, database, secrets, or backups to Helyx.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Building an independent Helyx module
|
|
2
|
+
|
|
3
|
+
Start from the published `@helyx/module-example` package. It contains a
|
|
4
|
+
self-contained TypeScript project, manifest, source, tests, and packaging
|
|
5
|
+
allowlist that can be copied into a new repository or workspace.
|
|
6
|
+
|
|
7
|
+
## Required parts
|
|
8
|
+
|
|
9
|
+
Every module needs:
|
|
10
|
+
|
|
11
|
+
- a unique npm package name and semantic version;
|
|
12
|
+
- a Helyx module manifest parsed by `@helyx/module-manifest`;
|
|
13
|
+
- a default JavaScript export created with `defineModule` from `@helyx/sdk`;
|
|
14
|
+
- explicit `start` and `stop` lifecycle functions;
|
|
15
|
+
- a privacy declaration and provider, including when no personal data is held;
|
|
16
|
+
- compiled JavaScript and declarations matching the package exports;
|
|
17
|
+
- tests for manifest parity, loading, lifecycle behavior, and each declared
|
|
18
|
+
contribution.
|
|
19
|
+
|
|
20
|
+
Dashboard fields need matching configuration validation. Manifest command IDs
|
|
21
|
+
must exactly match executable command contributions. Declare Discord
|
|
22
|
+
permissions and privileged capabilities only when the module actually needs
|
|
23
|
+
them.
|
|
24
|
+
|
|
25
|
+
## Preserve modularity
|
|
26
|
+
|
|
27
|
+
A module owns its commands, configuration, data, migrations, health, and tests.
|
|
28
|
+
Do not merge unrelated features into one module merely to share code. Put
|
|
29
|
+
reusable contracts in a support package when necessary, and keep each module
|
|
30
|
+
independently installable and usable.
|
|
31
|
+
|
|
32
|
+
Do not import private Helyx applications, another module's source files, or
|
|
33
|
+
repository-relative configuration. Depend only on published packages with
|
|
34
|
+
compatible version ranges. Module behavior must fail clearly when an optional
|
|
35
|
+
external service is unavailable.
|
|
36
|
+
|
|
37
|
+
See [testing a module](testing-a-module.md) before adding product behavior.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Preparing a module for npm
|
|
2
|
+
|
|
3
|
+
This checklist prepares a package for review. It does not authorize publishing
|
|
4
|
+
to npm or adding a module to the official Helyx catalogue.
|
|
5
|
+
|
|
6
|
+
1. Choose a unique package name and keep the package version equal to the
|
|
7
|
+
manifest version.
|
|
8
|
+
2. Use compatible ranges for `@helyx/module-manifest` and `@helyx/sdk`.
|
|
9
|
+
3. Compile to `dist/` and expose both a JavaScript default entry and a `.d.ts`
|
|
10
|
+
declaration entry.
|
|
11
|
+
4. Use an explicit `files` allowlist. Exclude source maps and TypeScript build
|
|
12
|
+
caches.
|
|
13
|
+
5. Include `manifest.json`, `README.md`, `CHANGELOG.md`, and the licence that
|
|
14
|
+
applies to your code.
|
|
15
|
+
6. Run the complete test suite and `npm pack --dry-run` from a clean checkout.
|
|
16
|
+
7. Extract the generated tarball into a temporary project and import its default
|
|
17
|
+
export under a supported Node.js version.
|
|
18
|
+
8. Search the packed file list for `.env`, credentials, private URLs, logs,
|
|
19
|
+
dumps, tests with fixtures containing real data, and repository-only notes.
|
|
20
|
+
|
|
21
|
+
Third-party modules choose and clearly state their own licence. Do not copy the
|
|
22
|
+
Helyx Source Available Licence notice into a third-party module unless that
|
|
23
|
+
licence actually governs the module.
|
|
24
|
+
|
|
25
|
+
Publishing a package does not make it an official or reviewed Helyx module.
|
|
26
|
+
Catalogue inclusion, security review, permissions, privacy declarations, and
|
|
27
|
+
release support are separate decisions.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Testing a Helyx module
|
|
2
|
+
|
|
3
|
+
The `@helyx/module-example` suite demonstrates four compatibility layers.
|
|
4
|
+
|
|
5
|
+
## Manifest and export
|
|
6
|
+
|
|
7
|
+
Parse `manifest.json`, import the module's default export, and assert that the
|
|
8
|
+
runtime manifest equals the packaged manifest. This prevents metadata from
|
|
9
|
+
drifting away from executable contributions.
|
|
10
|
+
|
|
11
|
+
## Lifecycle
|
|
12
|
+
|
|
13
|
+
Call `start`, `health`, and `stop` with a minimal SDK runtime context. Verify
|
|
14
|
+
observable behavior and make both lifecycle functions safe for the runtime to
|
|
15
|
+
call. Do not start network listeners or timers at import time.
|
|
16
|
+
|
|
17
|
+
## Dashboard
|
|
18
|
+
|
|
19
|
+
Parse the complete manifest with `@helyx/module-manifest`. Test valid defaults,
|
|
20
|
+
boundary values, wrong types, and missing required settings against the
|
|
21
|
+
module's configuration contribution. Each dashboard setting key must have one
|
|
22
|
+
matching validator field.
|
|
23
|
+
|
|
24
|
+
## Slash commands
|
|
25
|
+
|
|
26
|
+
Assert that manifest command IDs and executable command names are identical.
|
|
27
|
+
Build the command with the same Discord.js builders used by Helyx, inspect the
|
|
28
|
+
generated application-command payload, and execute the handler with a fake SDK
|
|
29
|
+
context. Test acknowledgement, context, integration type, option limits, and a
|
|
30
|
+
representative response without contacting Discord.
|
|
31
|
+
|
|
32
|
+
## Before packaging
|
|
33
|
+
|
|
34
|
+
Run the module's build and test scripts, then inspect exactly what npm would
|
|
35
|
+
include:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
npm run build
|
|
39
|
+
npm test
|
|
40
|
+
npm pack --dry-run
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The tarball needs compiled exports, declarations, the manifest, instructions,
|
|
44
|
+
licence, and any source or tests deliberately offered as a template. It must
|
|
45
|
+
not contain credentials, logs, source maps, build caches, or internal Helyx
|
|
46
|
+
documentation.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Environment reference
|
|
2
|
+
|
|
3
|
+
Start from [the published example](../examples/.env.example). The example is a
|
|
4
|
+
copy of the starter emitted by the supported CLI and is checked for drift.
|
|
5
|
+
|
|
6
|
+
## Required values
|
|
7
|
+
|
|
8
|
+
`DISCORD_TOKEN` is the bot token from the Discord developer portal.
|
|
9
|
+
`DISCORD_CLIENT_ID` is the application's numeric ID. `DATABASE_URL` points to
|
|
10
|
+
PostgreSQL; `DATABASE_SSL` must match the database provider. Docker users must
|
|
11
|
+
also replace the example PostgreSQL password consistently in `PGPASSWORD` and
|
|
12
|
+
`POSTGRES_PASSWORD`.
|
|
13
|
+
|
|
14
|
+
## Safe defaults
|
|
15
|
+
|
|
16
|
+
Privileged Discord intents, privacy execution, hosted OAuth, status reporting,
|
|
17
|
+
guild command writes, and advanced sharding stay disabled until their complete
|
|
18
|
+
requirements are deliberately configured. An empty variable still counts as a
|
|
19
|
+
configured value in many environments, so leave unused optional lines
|
|
20
|
+
commented.
|
|
21
|
+
|
|
22
|
+
`HELYX_CLOUD_CONNECT_ENABLED=true` makes an installation ready to be paired; it
|
|
23
|
+
does not pair the installation by itself. Keep official endpoint overrides
|
|
24
|
+
commented unless Helyx support directs otherwise.
|
|
25
|
+
|
|
26
|
+
## Generated values
|
|
27
|
+
|
|
28
|
+
The CLI owns `HELYX_MODULE_CATALOGUE_PATH` and may generate
|
|
29
|
+
`HELYX_DATA_ENCRYPTION_KEY`. Preserve generated key material for the lifetime of
|
|
30
|
+
the encrypted data. Losing it can make records unrecoverable; replacing it is
|
|
31
|
+
not a password reset.
|
|
32
|
+
|
|
33
|
+
## Verification
|
|
34
|
+
|
|
35
|
+
After every environment change, run:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
npm run doctor
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Never include the real `.env` file in an npm package, container image layer,
|
|
42
|
+
source archive, or support bundle.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Backup and recovery runbook
|
|
2
|
+
|
|
3
|
+
A usable Helyx backup includes PostgreSQL plus the environment and generated
|
|
4
|
+
key material required to read encrypted records. A copy of the generated
|
|
5
|
+
project without its database is not a complete backup.
|
|
6
|
+
|
|
7
|
+
## Back up
|
|
8
|
+
|
|
9
|
+
1. Record the installed package lockfile and Helyx release versions.
|
|
10
|
+
2. Create a consistent PostgreSQL backup with your database provider or
|
|
11
|
+
PostgreSQL tooling.
|
|
12
|
+
3. Back up `.env` and generated enrollment or encryption material separately.
|
|
13
|
+
4. Encrypt backups, restrict access, and store at least one copy away from the
|
|
14
|
+
running host.
|
|
15
|
+
5. Apply a documented retention schedule to both active and backup data.
|
|
16
|
+
|
|
17
|
+
Never commit a database dump or real environment file to Git and never place it
|
|
18
|
+
inside an npm package.
|
|
19
|
+
|
|
20
|
+
## Test recovery
|
|
21
|
+
|
|
22
|
+
At a regular interval:
|
|
23
|
+
|
|
24
|
+
1. Create a disposable network and a separate empty database.
|
|
25
|
+
2. Restore a selected backup without overwriting production.
|
|
26
|
+
3. Restore the matching environment and key material through the host's secret
|
|
27
|
+
mechanism.
|
|
28
|
+
4. Run `npm ci` and `npm run doctor`.
|
|
29
|
+
5. Confirm a stateful module can read its configuration and records.
|
|
30
|
+
6. Destroy the disposable environment using the same controls as production.
|
|
31
|
+
|
|
32
|
+
Record the recovery time, the backup generation used, the checks performed,
|
|
33
|
+
and any corrective action. Treat restored data with the same access controls
|
|
34
|
+
and deletion obligations as production data.
|
|
35
|
+
|
|
36
|
+
## Incident recovery
|
|
37
|
+
|
|
38
|
+
Stop writes before a destructive restore. Preserve evidence needed to
|
|
39
|
+
understand the incident, select a known-good backup, restore into a new database
|
|
40
|
+
when possible, validate it, then deliberately switch the runtime. Do not test a
|
|
41
|
+
restore over the only production database.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Installation and upgrade runbook
|
|
2
|
+
|
|
3
|
+
## First installation
|
|
4
|
+
|
|
5
|
+
1. Generate the project with `helyx self-host init` and a reviewed build
|
|
6
|
+
manifest.
|
|
7
|
+
2. Copy and complete `.env` with `helyx setup`.
|
|
8
|
+
3. Install dependencies with `npm ci` if they were not installed during
|
|
9
|
+
generation.
|
|
10
|
+
4. Run `npm run doctor` and resolve every error.
|
|
11
|
+
5. Start the process and confirm database, Discord, and module health.
|
|
12
|
+
6. Exercise one low-risk command in a test server before production use.
|
|
13
|
+
|
|
14
|
+
## Upgrade
|
|
15
|
+
|
|
16
|
+
1. Read the release notes and confirm the supported Node.js and npm versions.
|
|
17
|
+
2. Create a current PostgreSQL backup and preserve the existing project
|
|
18
|
+
metadata and environment file.
|
|
19
|
+
3. Stop the Helyx process cleanly.
|
|
20
|
+
4. Preview the compatible release set:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
helyx self-host update --check
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
5. Apply it only after reviewing the complete change:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
helyx self-host update --confirm
|
|
30
|
+
npm ci
|
|
31
|
+
npm run doctor
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
6. Start Helyx and verify health, command availability, and one representative
|
|
35
|
+
workflow for every upgraded module.
|
|
36
|
+
|
|
37
|
+
The updater backs up managed project metadata under `.helyx/backups` and does
|
|
38
|
+
not change `.env` or customer database data. Database migrations can be
|
|
39
|
+
forward-only. Never edit migration history or downgrade individual Helyx
|
|
40
|
+
packages to simulate a rollback.
|
|
41
|
+
|
|
42
|
+
## Failed validation
|
|
43
|
+
|
|
44
|
+
Leave the process stopped, retain sanitized logs, and determine whether the
|
|
45
|
+
failure is configuration, package integrity, database connectivity, or module
|
|
46
|
+
compatibility. If the updater restored managed files, rerun `npm ci` and
|
|
47
|
+
`npm run doctor` before restarting the previous version. Restore data only from
|
|
48
|
+
a tested backup and only when the incident specifically requires it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helyx/bot",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.39",
|
|
4
4
|
"description": "Production Discord runtime for the modular Helyx platform.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"helyx",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"dist",
|
|
33
33
|
"!dist/*.tsbuildinfo",
|
|
34
34
|
"!dist/**/*.map",
|
|
35
|
+
"documentation",
|
|
35
36
|
"CHANGELOG.md",
|
|
36
37
|
"README.md",
|
|
37
38
|
"LICENSE"
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
},
|
|
45
46
|
"scripts": {
|
|
46
47
|
"build": "tsc -b",
|
|
48
|
+
"prepack": "node ../../scripts/public-documentation.mjs --sync-bot",
|
|
47
49
|
"dev": "node --env-file-if-exists=../../.env --import tsx src/index.ts",
|
|
48
50
|
"start": "node --env-file-if-exists=../../.env dist/index.js"
|
|
49
51
|
},
|