Repository navigation
feat: add Campfire channel plugin - #7883
frankdierolf wants to merge 2 commits into
Conversation
e7e8a48 to
eef2f96
Compare
81cd410 to
f7241de
Compare
f7241de to
1d03708
Compare
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
|
|
||
| const header = [ | ||
| `--${boundary}`, | ||
| `Content-Disposition: form-data; name="attachment"; filename="${filename}"`, |
There was a problem hiding this 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
| `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.There was a problem hiding this comment.
It fixed in the latest HEAD. : )
2e42564 to
f3ed795
Compare
bfc1ccb to
f92900f
Compare
|
@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 ^^ Cheers, Frank ✌️ |
f3ed795 to
e15b99c
Compare
|
Rebased onto latest main. |
c908e74 to
6d69b1d
Compare
|
Rebased onto latest main (dff61a1). |
|
The Windows CI failure is unrelated to this PR — it's a flaky test in |
95496b3 to
15b0fb0
Compare
|
Rebased onto latest main (automated maintenance) |
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
05d9477 to
2d71e3d
Compare
|
Rebased onto latest main (automated maintenance) |
ac9ad53 to
06db4be
Compare
|
Rebased onto latest main (automated maintenance) |
06db4be to
c860b85
Compare
|
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.
c860b85 to
572284b
Compare
|
Rebased onto latest main (automated maintenance) |
|
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 |
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
to @mention messages in rooms — same as Telegram, Discord, Slack, WhatsApp
7-second webhook timeout), and replies as text or attachments
Behavior Changes
New extension
extensions/campfire/— no changes to existing code./campfire)Configuration:
Env vars:
CAMPFIRE_BOT_KEY,CAMPFIRE_BASE_URL,CAMPFIRE_WEBHOOK_PATHExisting Functionality Check
Searches performed:
Tests
pnpm checkpasses (lint + format)Manual Testing
Prerequisites
Steps
channels.campfire.baseUrlandchannels.campfire.botKey<openclaw-url>/campfireSign-Off
AI-Assisted Contribution 🤖