Skip to content

feat: add Campfire channel plugin - #7883

Closed
frankdierolf wants to merge 2 commits into
openclaw:mainfrom
frankdierolf:feat/campfire-channel
Closed

frankdierolf wants to merge 2 commits into
openclaw:mainfrom
frankdierolf:feat/campfire-channel

Conversation

@frankdierolf

@frankdierolf frankdierolf commented Feb 3, 2026 •

Copy link
Copy Markdown
Contributor

Hola 👋

So, I'm Frank. and I would love to have native integration for campfire. This is the PR.

Notes:
I am currently using it with openclaw. And gave my clients access to it. They like it, because they have a highly capable AI and everything nicely secured on on Hetzner server with their own seperate Email Hosting and everything is nicely encapsulated to let openclaw run like a wild child.

So back to the code, from my side I can approve this integration also the code makes sense and follows the pattern from other Channels.

There is a little quirk. The bot cant read messages in the chat room, so created a workaround which logs in as a seperate Users and just looks thruh messages. It a campfire-cli that I built for that. Great for write every 3 hours a summaries of the Channels and post it to the board, so a nice log of who does what in each channel. Securit wise, if the "Observer Account" only read the message where is invited, not really used but a nice byproduct. Anyways, thats blabla, I just wanted to say, I tested it and work with it.
To be blunt I am not so certain if I dived in every little possible aspect, for that is the current openclaw codebase a bit too much. So I resolved it by focusing on just channel plugin and that was easier to grasp and fits in my head.

Happy about that PR

Thanks for the work!

Best regards,
Frank 🍻


AI PR Text, follows the template and is approved by me

Summary

Add Campfire channel plugin for 37signals' self-hosted chat.

Closes #7880

lobster-biscuit

Use Cases

  • Teams using 37signals Campfire for internal chat want openclaw to respond
    to @mention messages in rooms — same as Telegram, Discord, Slack, WhatsApp
  • Bot listens via webhook, processes messages asynchronously (Campfire has a
    7-second webhook timeout), and replies as text or attachments

Behavior Changes

New extension extensions/campfire/ — no changes to existing code.

  • Registers HTTP handler at configurable webhook path (default /campfire)
  • Processes inbound @mention webhooks with group policy / user allowlist checks
  • Sends text replies (plain text POST) and attachments (multipart form-data)
  • Supports multi-account configuration with env vars or inline config
  • Block streaming with coalesced updates (1500 chars / 1s idle)

Configuration:

channels:
  campfire:
    baseUrl: https://your-campfire.example.com
    botKey: "{id}-{token}"
    webhookPath: /campfire
    groupPolicy: open  # disabled | allowlist | open
    requireMention: true

Env vars: CAMPFIRE_BOT_KEY, CAMPFIRE_BASE_URL, CAMPFIRE_WEBHOOK_PATH

Existing Functionality Check

  • I searched the codebase for existing functionality.
    Searches performed:
    • Checked all channel plugins (Telegram, Discord, Slack, WhatsApp, BlueBubbles) for patterns to follow
    • Searched for existing Campfire/37signals references — none found
    • Verified plugin SDK types (ChannelPlugin, ChannelDock) and reused shared utilities (chunkMarkdownText, resolveEnvelopeFormatOptions, dispatchReplyWithBufferedBlockDispatcher)

Tests

  • pnpm check passes (lint + format)
  • No unit tests yet (extension-only, no existing test patterns for webhook channel plugins)

Manual Testing

Prerequisites
  • A running Campfire instance with a bot configured (bot key from Campfire settings)
  • openclaw running with campfire channel enabled
Steps
  1. Configure channels.campfire.baseUrl and channels.campfire.botKey
  2. Set up Campfire bot webhook URL pointing to <openclaw-url>/campfire
  3. @mention the bot in a Campfire room
  4. Verify openclaw receives the webhook, processes the message, and replies in the room
  5. Send an image attachment — verify it arrives as a multipart upload

Sign-Off

  • Models used: Claude Opus 4
  • Submitter effort: manual E2E testing with live Campfire instance
  • Agent notes: Plugin follows existing channel patterns (Telegram extension used as primary reference). Greptile review addressed: filename sanitization added, unused exports removed.

AI-Assisted Contribution 🤖

  • Marked as AI-assisted
  • Degree of testing: lightly tested (live Campfire instance, manual E2E)
  • I understand what the code does

@frankdierolf
frankdierolf force-pushed the feat/campfire-channel branch 4 times, most recently from e7e8a48 to eef2f96 Compare February 5, 2026 20:23
@frankdierolf
frankdierolf marked this pull request as ready for review February 14, 2026 10:26
frankdierolf added a commit to frankdierolf/openclaw-coolify that referenced this pull request Feb 14, 2026
Add env var configuration for Campfire channel (CAMPFIRE_BOT_KEY,
CAMPFIRE_BASE_URL, CAMPFIRE_WEBHOOK_PATH, CAMPFIRE_GROUP_POLICY,
CAMPFIRE_GROUP_ALLOW_FROM).

Add nginx webhook auth bypass for channels that use HTTP webhooks
(Campfire, Slack HTTP mode, Telegram webhook mode). These paths
skip basic auth since the gateway does not auth-protect plugin HTTP
handlers — the channel plugins validate payloads themselves.

The bypass blocks restrict to POST only via limit_except for
defence-in-depth.

Depends on: openclaw/openclaw#7883

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread extensions/campfire/src/api.ts Outdated

const header = [
`--${boundary}`,
`Content-Disposition: form-data; name="attachment"; filename="${filename}"`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filename not sanitized - allows multipart header injection (CWE-93)

Filenames from external sources can contain \r, \n, ", or \ that break out of the Content-Disposition header. Sanitize using .replace(/[\r\n"\\]/g, "_") like bluebubbles does in extensions/bluebubbles/src/chat.ts:363

Suggested change
`Content-Disposition: form-data; name="attachment"; filename="${filename}"`,
`Content-Disposition: form-data; name="attachment"; filename="${filename.replace(/[\r\n"\\]/g, "_")}"`,
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/campfire/src/api.ts
Line: 88:88

Comment:
filename not sanitized - allows multipart header injection (CWE-93)

Filenames from external sources can contain `\r`, `\n`, `"`, or `\` that break out of the Content-Disposition header. Sanitize using `.replace(/[\r\n"\\]/g, "_")` like bluebubbles does in `extensions/bluebubbles/src/chat.ts:363`

```suggestion
      `Content-Disposition: form-data; name="attachment"; filename="${filename.replace(/[\r\n"\\]/g, "_")}"`,
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fixed in the latest HEAD. : )

@frankdierolf

Copy link
Copy Markdown
Contributor Author

@steipete What I need to do to speed that integration? Please tag a maintainer, who may have the time to support me.

No trouble to do some work, but would love to get it in, to remove my current complex setup, harder to scale ^^
And if it gets postponed because of restructuring or other reason let me know :)

Cheers, Frank ✌️

@frankdierolf

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main.

@frankdierolf
frankdierolf force-pushed the feat/campfire-channel branch 2 times, most recently from c908e74 to 6d69b1d Compare February 21, 2026 11:18
@frankdierolf

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (dff61a1).

@frankdierolf

Copy link
Copy Markdown
Contributor Author

The Windows CI failure is unrelated to this PR — it's a flaky test in extensions/msteams/src/messenger.test.ts (preserves parsed mentions when appending OneDrive fallback file links). Could a maintainer re-run the failed job?

@frankdierolf

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (automated maintenance)

frankdierolf added a commit to frankdierolf/openclaw-coolify that referenced this pull request Feb 21, 2026
Add env var configuration for Campfire channel (CAMPFIRE_BOT_KEY,
CAMPFIRE_BASE_URL, CAMPFIRE_WEBHOOK_PATH, CAMPFIRE_GROUP_POLICY,
CAMPFIRE_GROUP_ALLOW_FROM).

Add nginx webhook auth bypass for channels that use HTTP webhooks
(Campfire, Slack HTTP mode, Telegram webhook mode). These paths
skip basic auth since the gateway does not auth-protect plugin HTTP
handlers — the channel plugins validate payloads themselves.

The bypass blocks restrict to POST only via limit_except for
defence-in-depth.

Depends on: openclaw/openclaw#7883
@frankdierolf
frankdierolf force-pushed the feat/campfire-channel branch 3 times, most recently from 05d9477 to 2d71e3d Compare February 22, 2026 10:38
@frankdierolf

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (automated maintenance)

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Feb 22, 2026
@frankdierolf

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (automated maintenance)

@openclaw-barnacle openclaw-barnacle Bot removed the gateway Gateway runtime label Feb 23, 2026
@frankdierolf

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (automated maintenance)

Add webhook-based channel plugin for 37signals Campfire self-hosted chat.

- Webhook receiver for inbound @mention messages
- Bot API client for text and attachment replies
- Group policy and user allowlist support
- Multi-account configuration with env var support
- Config schema validation (Zod)
- Media attachments (images, files)
- Block streaming with coalesced updates
Reorder type imports after value imports to satisfy
the updated oxfmt formatter used in CI.
@frankdierolf

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (automated maintenance)

@thewilloftheshadow thewilloftheshadow added the r: third-party-extension Auto-close: third-party plugins/capabilities belong on ClawHub. label Feb 28, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Please make this as a third-party plugin that you maintain yourself in your own repo. Docs: https://docs.openclaw.ai/plugin. Feel free to open a PR after to add it to our community plugins page: https://docs.openclaw.ai/plugins/community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r: third-party-extension Auto-close: third-party plugins/capabilities belong on ClawHub. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Campfire channel integration (37signals self-hosted chat)

2 participants