Skip to content
eliwarePublic

About

GitHub webhook handler and SSH deployment automation service with Discord notifications, delivery-aware presence, and metadata-aware validation workflows.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

eliware.org

@eliware/knit License CI

GitHub webhook handler and SSH deployment automation service with Discord notifications, delivery-aware presence, and metadata-aware validation workflows.

Table of Contents

Features

Knit validates GitHub signatures and target profiles. It reads each repository workflow at the event commit. It runs approved commands on verified SSH targets. It sends event and deployment results to Discord.

Requirements

Use Node.js 26 or later. Provide a GitHub webhook secret and a valid target inventory. Provide a Discord bot and guild settings to enable Discord notices.

Setup

Install dependencies with npm ci. Set the runtime variables in the configuration guide. Create the target inventory. Add a version 1 workflow to each repository. Read the docs index for the end-user guides.

Usage

Run npm start to start Knit. Set the GitHub webhook URL to https://<host>/. Set the webhook content type to application/json. Use GET /health to check service status. Read the docs index for end-user guides. Read release notes for version changes. Read specifications for repository requirements.

Development

Use Node.js 26 and npm. Run npm ci to install locked packages. Keep runtime secrets and target credentials outside Git.

Testing

Run npm test for full validation. Run npm run lint for lint checks. Run npm run audit for dependency checks. Run npm run format to format files. Run npm run format:check to check file format.

Troubleshooting

Check webhook delivery status, signature settings, target access, and SSH host keys. Follow the troubleshooting guide for fault steps.

Security

Knit checks the webhook signature before event processing. It reads workflows at the signed commit. It checks target access and SSH host keys before remote commands.

Configuration

Set GITHUB_WEBHOOK_SECRET as a runtime secret. Set GITHUB_READ_TOKEN for private GitHub repositories or higher API limits. Set DISCORD_TOKEN and DISCORD_CLIENT_ID together to enable Discord. Set KNIT_CONFIG_PATH or KNIT_TARGETS_PATH to select the target inventory. Set PORT to change the default port, 3456. Read the configuration guide for fields and examples.

Operations

Knit validates targets before it opens external connections. It gets .knit/deploy.yaml and package.json at the webhook commit. It runs deployment commands in order. A nonzero command result marks the deployment as failed. GHCR publication builds an image. GitOps controls image deployment. Read usage for start, health, and shutdown steps.

Commands

The /help command gives a short service summary. Knit requests only the Discord Guilds intent.

Events

Knit handles repository push events. It sends special Discord notices for release, workflow_run, pull_request, issues, deployment, and deployment_status events. It sends a general notice for other repository events. It ignores events without a repository name.

For each event, Knit uses the repository name after the owner slash as the announcement channel name. Knit encodes punctuation as _xHEX_ so different names stay distinct. Knit does not add a hash or truncate a name. Names longer than 100 characters fail. Knit checks for a matching announcement channel. It creates one if no matching channel exists, including when another channel type has that name. Knit sets access from repository visibility, updates the topic from package metadata, and posts the notice. Long descriptions do not remove topic keywords.

Knit returns HTTP 200 after it queues a valid signed webhook. Knit does not wait for event processing to finish.

Intents and permissions

Enable the Guilds intent. Grant the bot the Administrator permission. The bot can access all channels. Do not add the bot to channel allowlists. Knit does not request message, member, presence, reaction, typing, or scheduled event intents.

Support

For help, questions, or to chat with the author and community, visit:

Discordeliware.org

eliware.org on Discord

Links

License

MIT © Eliware

About

GitHub webhook handler and SSH deployment automation service with Discord notifications, delivery-aware presence, and metadata-aware validation workflows.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages