openclaw-rocketchat 0.2.7 → 0.3.0

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/README.en.md CHANGED
@@ -98,7 +98,7 @@ When OpenClaw sends you a message, you get a notification from **Rocket.Chat**
98
98
 
99
99
  - Rocket.Chat App is **directly downloadable** from China App Store / Google Play
100
100
  - Server runs on your own machine — **no cross-border traffic**
101
- - Phone connects directly via IP — **no domain, no SSL, no ICP registration needed**
101
+ - Phone connects directly via IP — **no domain, no ICP registration needed**
102
102
  - Zero dependency on blocked services
103
103
 
104
104
  ### 5. ⚡ One-Command Deployment, Two Modes
@@ -199,7 +199,7 @@ Official Rocket.Chat clients: [rocket.chat/download-apps](https://www.rocket.cha
199
199
  | **macOS** | [Mac App Store](https://apps.apple.com/app/rocket-chat/id1148741252) or [download .dmg](https://www.rocket.chat/download-apps) |
200
200
  | **Windows** | [Download installer](https://www.rocket.chat/download-apps) |
201
201
  | **Linux** | [Download](https://www.rocket.chat/download-apps) (.deb / .rpm / Snap) |
202
- | **Web** | No download needed — open `http://YOUR_IP:3000` in any browser |
202
+ | **Web** | No download needed — open `https://YOUR_IP` in any browser |
203
203
 
204
204
  > 💡 **Search tip**: In App Store / Google Play, search "Rocket.Chat" and look for the developer **Rocket.Chat Technologies Corp**.
205
205
 
@@ -237,7 +237,7 @@ Deploy once, access from phone, computer, tablet, or browser. Messages sync acro
237
237
 
238
238
  - [OpenClaw](https://docs.openclaw.ai/) installed
239
239
  - A server with a **public IP** (AWS, DigitalOcean, etc.)
240
- - Firewall / security group allows **port 3000** (or your custom port)
240
+ - Firewall / security group allows **port 443** (HTTPS)
241
241
 
242
242
  ### Step 1: Deploy Rocket.Chat
243
243
 
@@ -253,17 +253,30 @@ Or install remotely without downloading first:
253
253
  curl -fsSL https://raw.githubusercontent.com/Kxiandaoyan/openclaw-rocketchat/master/install-rc.sh | bash
254
254
  ```
255
255
 
256
+ The script will automatically:
257
+ - Detect and install Docker (if not present)
258
+ - Deploy Rocket.Chat + MongoDB + Nginx (all Docker containers)
259
+ - Generate a self-signed HTTPS certificate
260
+ - Disable email two-factor auth (no mail server on self-hosted)
261
+ - Rocket.Chat communicates internally only — **port 3000 is not exposed to the public**
262
+
256
263
  You'll see:
257
264
 
258
265
  ```
259
- ╔══════════════════════════════════════════════════╗
260
- ║ Rocket.Chat One-Click Install
261
- ╚══════════════════════════════════════════════════╝
266
+ ╔══════════════════════════════════════════════════════════╗
267
+ ║ Rocket.Chat One-Click Install (HTTPS + OpenClaw)
268
+ ╚══════════════════════════════════════════════════════════╝
262
269
 
263
270
  ⏳ Detecting Docker...
264
271
  ✅ Docker installed (v29.2.1)
265
272
  ✅ Docker Compose installed (v5.0.2)
266
- ✅ Port 3000 available
273
+ ✅ Port 443 available
274
+ ⏳ Getting server public IP...
275
+ ✅ Public IP: 123.45.67.89
276
+ ⏳ Generating self-signed HTTPS certificate...
277
+ ✅ Certificate generated (valid for 10 years)
278
+ ⏳ Generating Nginx config...
279
+ ✅ Nginx config generated
267
280
  ⏳ Generating docker-compose.yml...
268
281
  ✅ Config generated
269
282
  ⏳ Pulling images & starting (first time ~2-5 min)...
@@ -273,10 +286,11 @@ You'll see:
273
286
  ║ 🎉 Rocket.Chat installed! ║
274
287
  ╚══════════════════════════════════════════════════════════╝
275
288
 
276
- Server address: http://123.45.67.89:3000
289
+ Server address: https://123.45.67.89
290
+ HTTPS: Self-signed certificate (trust it on first App connection)
277
291
 
278
292
  📌 Next steps:
279
- 1️⃣ Make sure firewall allows port 3000
293
+ 1️⃣ Make sure firewall allows port 443
280
294
  2️⃣ On your OpenClaw machine, install plugin and configure:
281
295
  openclaw plugins install openclaw-rocketchat
282
296
  openclaw rocketchat setup
@@ -284,7 +298,6 @@ You'll see:
284
298
  openclaw rocketchat add-bot
285
299
  ```
286
300
 
287
- > Custom port: `RC_PORT=4000 bash install-rc.sh`
288
301
  > No Docker? The script auto-installs it.
289
302
 
290
303
  ### Step 2: Install Plugin + Configure Connection
@@ -302,10 +315,10 @@ You'll see:
302
315
  === Rocket.Chat Setup Wizard ===
303
316
 
304
317
  Rocket.Chat server address
305
- (local: http://127.0.0.1:3000, remote: http://PUBLIC_IP:PORT)
306
- [default http://127.0.0.1:3000]: http://123.45.67.89:3000
318
+ (local: https://127.0.0.1, remote: https://PUBLIC_IP)
319
+ [default https://127.0.0.1]: https://123.45.67.89
307
320
 
308
- ⏳ Testing connection to http://123.45.67.89:3000 ...
321
+ ⏳ Testing connection to https://123.45.67.89 ...
309
322
  ✅ Connected! Rocket.Chat version: 8.1.0
310
323
 
311
324
  Admin account
@@ -315,6 +328,7 @@ Choose: 1
315
328
 
316
329
  ⏳ Creating admin (internal, you don't need to remember)...
317
330
  Public registration disabled (secure)
331
+ Email two-factor auth disabled
318
332
  ✅ Admin created
319
333
 
320
334
  Create your phone login account
@@ -333,10 +347,13 @@ Confirm: ********
333
347
 
334
348
  📱 Phone setup:
335
349
  1. Download "Rocket.Chat" from App Store
336
- 2. Server address: http://123.45.67.89:3000
350
+ 2. Open the app, server address: https://123.45.67.89
351
+ First connection will warn about untrusted certificate — tap "Trust" or "Continue"
337
352
  3. Username: zhangsan
338
353
  4. Password: the one you just set
339
354
 
355
+ 🔥 Important: Make sure your server firewall allows port 443
356
+
340
357
  💡 Next: openclaw rocketchat add-bot
341
358
  ```
342
359
 
@@ -382,8 +399,8 @@ Bind to which Agent?
382
399
  1. Download Rocket.Chat App
383
400
  - **iPhone**: Search **"Rocket.Chat"** on App Store
384
401
  - **Android**: Search **"Rocket.Chat"** on Google Play, or download APK from the [official site](https://www.rocket.chat/download-apps)
385
- - **Desktop**: [Download desktop client](https://www.rocket.chat/download-apps), or open `http://YOUR_IP:3000` in your browser
386
- 2. Open the app, tap **"Add Server"**, enter: `http://YOUR_PUBLIC_IP:3000`
402
+ - **Desktop**: [Download desktop client](https://www.rocket.chat/download-apps), or open `https://YOUR_IP` in your browser
403
+ 2. Open the app, tap **"Add Server"**, enter: `https://YOUR_PUBLIC_IP` (trust the self-signed certificate on first connection)
387
404
  3. Login with the credentials from Step 1
388
405
  4. Find the bot, send a message, start chatting!
389
406
 
@@ -403,18 +420,16 @@ If you chose Mode B (split deployment), run on your remote VPS:
403
420
  ```bash
404
421
  # SSH into your VPS, then one-click install:
405
422
  curl -fsSL https://raw.githubusercontent.com/Kxiandaoyan/openclaw-rocketchat/master/install-rc.sh | bash
406
-
407
- # Or specify a custom port:
408
- RC_PORT=4000 bash install-rc.sh
409
423
  ```
410
424
 
411
425
  The script will automatically:
412
426
  - Detect and install Docker (if not present)
413
- - Pull Rocket.Chat + MongoDB images
427
+ - Deploy Rocket.Chat + MongoDB + Nginx (HTTPS)
428
+ - Generate a self-signed certificate
414
429
  - Start services and wait until ready
415
- - Output the server address and next steps
430
+ - Output the `https://PUBLIC_IP` address and next steps
416
431
 
417
- After installation, go back to your OpenClaw machine and run `openclaw rocketchat setup`, choose "Connect to remote server", and enter the address output by the script.
432
+ After installation, go back to your OpenClaw machine and run `openclaw rocketchat setup`, enter `https://VPS_PUBLIC_IP`.
418
433
 
419
434
  </details>
420
435
 
@@ -476,9 +491,9 @@ Join existing groups?
476
491
  ✅ User lisi created (full access)
477
492
  Permission: ✅ Full access
478
493
  Joined: AI Squad
479
- Login: http://123.45.67.89:3000 / Username: lisi
494
+ Login: https://123.45.67.89 / Username: lisi
480
495
 
481
- 📱 Tell lisi to download Rocket.Chat App, server: http://123.45.67.89:3000
496
+ 📱 Tell lisi to download Rocket.Chat App, server: https://123.45.67.89
482
497
  Login with the username and password above, then:
483
498
  - Discuss with AI together in "AI Squad" group
484
499
  - DM any bot directly for one-on-one AI conversations
@@ -565,7 +580,7 @@ openclaw rocketchat status
565
580
  ```
566
581
  === Rocket.Chat Status ===
567
582
 
568
- Server: Running - http://123.45.67.89:3000
583
+ Server: Running - https://123.45.67.89
569
584
  MongoDB: Running
570
585
 
571
586
  Users
@@ -594,7 +609,7 @@ openclaw rocketchat uninstall
594
609
 
595
610
  | Command | Description |
596
611
  |---|---|
597
- | `openclaw rocketchat setup` | Connect to Rocket.Chat + create admin + create phone account |
612
+ | `openclaw rocketchat setup` | Connect to Rocket.Chat (HTTPS) + create admin + create phone account |
598
613
  | `openclaw rocketchat add-bot` | Add bot + bind Agent + create DM |
599
614
  | `openclaw rocketchat add-group` | Create private channel (multi-bot group) |
600
615
  | `openclaw rocketchat add-user` | Add phone login user |
@@ -605,6 +620,41 @@ openclaw rocketchat uninstall
605
620
 
606
621
  All commands are **interactive** — no flags to memorize, just follow the prompts.
607
622
 
623
+ ## Config Example
624
+
625
+ All config is written automatically by CLI commands into `openclaw.json` — you don't need to edit it manually:
626
+
627
+ ```json5
628
+ {
629
+ // Agents are managed by openclaw agents add (plugin doesn't touch these)
630
+ agents: {
631
+ list: [
632
+ { id: "main", default: true },
633
+ { id: "work", name: "Work Helper" },
634
+ ],
635
+ },
636
+
637
+ // Everything below is written automatically by plugin CLI commands
638
+ bindings: [
639
+ { agentId: "main", match: { channel: "rocketchat", accountId: "molty" } },
640
+ { agentId: "work", match: { channel: "rocketchat", accountId: "work-claw" } },
641
+ ],
642
+ channels: {
643
+ rocketchat: {
644
+ enabled: true,
645
+ serverUrl: "https://123.45.67.89",
646
+ accounts: {
647
+ molty: { botUsername: "molty", botDisplayName: "Lobster" },
648
+ "work-claw": { botUsername: "work-claw", botDisplayName: "Work Helper" },
649
+ },
650
+ groups: {
651
+ "AI Squad": { requireMention: false, bots: ["molty", "work-claw"] },
652
+ },
653
+ },
654
+ },
655
+ }
656
+ ```
657
+
608
658
  ## Architecture
609
659
 
610
660
  ### Mode A: Co-located
@@ -616,22 +666,27 @@ Everything on one server — simplest setup.
616
666
  │ 📱 Your Phone │
617
667
  │ Rocket.Chat App │
618
668
  └─────────────┬───────────────────────────────┘
619
- HTTP (Public IP:3000)
669
+ HTTPS (:443)
620
670
  ┌─────────────▼───────────────────────────────┐
621
671
  │ Your Server (one machine does it all) │
622
672
  │ │
623
- ┌─────────────────┐ ┌──────────────────┐
624
- │ │ Rocket.Chat OpenClaw Gateway │ │
625
- │ │ (Docker) │
626
- │ │ │◄─┤ @openclaw/ │ │
627
- │ │ ┌───────────┐ │ │ rocketchat │ │
628
- │ │ │ MongoDB │ │ plugin │ │
629
- │ │ └───────────┘
630
- └─────────────────┘ ┌─────────────┐ │ │
631
- │ Agent: main │ │ │
632
- Agent: work │ │ │
633
- └─────────────┘ │ │
634
- └──────────────────┘
673
+ ┌──────────────────────────────────────┐
674
+ │ │ Docker
675
+ │ │ ┌───────┐ ┌──────────┐ ┌───────┐
676
+ │ │ │ Nginx │─▸│Rocket.Chat│─▸│MongoDB│
677
+ │ │ │ :443 │ │ :3000 │ │ │ │
678
+ │ │ │(HTTPS)│ │(internal)│ │
679
+ │ │ └───────┘ └──────────┘ └───────┘
680
+ └──────────────────────────────────────┘
681
+
682
+ ┌──────────────────────────────────────┐
683
+ │ │ OpenClaw Gateway
684
+ │ │ @openclaw/rocketchat plugin │ │
685
+ │ │ ┌─────────────┐ │ │
686
+ │ │ │ Agent: main │ │ │
687
+ │ │ │ Agent: work │ │ │
688
+ │ │ └─────────────┘ │ │
689
+ │ └──────────────────────────────────────┘ │
635
690
  └──────────────────────────────────────────────┘
636
691
  ```
637
692
 
@@ -644,25 +699,25 @@ RC on a cloud VPS, OpenClaw on home network or low-spec machine. Great when you
644
699
  │ 📱 Your Phone │
645
700
  │ Rocket.Chat App │
646
701
  └─────────────┬───────────────────────────────┘
647
- HTTP (Public IP:3000)
702
+ HTTPS (:443)
648
703
  ┌─────────────▼───────────────────────────────┐
649
704
  │ Cloud VPS (cheap 1C1G is enough) │
650
705
  │ │
651
- ┌─────────────────┐
652
- │ │ Rocket.Chat │ ← install-rc.sh
653
- │ │ (Docker) one-click install
654
- │ │ ┌───────────┐
655
- │ │ │ MongoDB │ │
656
- │ │ └───────────┘
657
- └────────▲────────┘
658
- └───────────┼──────────────────────────────────┘
659
- │ HTTP/WebSocket (public network)
660
- ┌───────────┼──────────────────────────────────┐
706
+ ┌──────────────────────────────────────┐
707
+ │ │ Docker (install-rc.sh one-click)
708
+ │ │ ┌───────┐ ┌──────────┐ ┌───────┐
709
+ │ │ │ Nginx │─▸│Rocket.Chat│─▸│MongoDB│
710
+ │ │ │ :443 │ │ :3000 │ │ │ │
711
+ │ │ │(HTTPS)│(internal) │ │ │ │
712
+ │ │ └───────┘ └─────▲────┘ └───────┘ │ │
713
+ │ └───────────────────┼──────────────────┘ │
714
+ └──────────────────────┼───────────────────────┘
715
+ │ HTTPS/WebSocket (public network)
716
+ ┌──────────────────────┼───────────────────────┐
661
717
  │ Home Network / Local Machine │
662
-
663
- ┌────────┴─────────────────────────────┐
718
+
719
+ ┌───────────────────┴──────────────────┐
664
720
  │ │ OpenClaw Gateway │ │
665
- │ │ │ │
666
721
  │ │ @openclaw/rocketchat plugin │ │
667
722
  │ │ (connects to remote RC via internet) │ │
668
723
  │ │ │ │
@@ -674,10 +729,129 @@ RC on a cloud VPS, OpenClaw on home network or low-spec machine. Great when you
674
729
  └───────────────────────────────────────────────┘
675
730
  ```
676
731
 
677
- > For Mode B, just run `install-rc.sh` on your remote VPS to install Rocket.Chat, then run `openclaw rocketchat setup` locally and choose "Connect to remote server".
732
+ > For Mode B, just run `install-rc.sh` on your remote VPS to install Rocket.Chat (with Nginx HTTPS), then run `openclaw rocketchat setup` locally and enter `https://PUBLIC_IP`.
678
733
 
679
734
  ## FAQ
680
735
 
736
+ <details>
737
+ <summary><b>Setup says "registration is disabled" — what do I do?</b></summary>
738
+
739
+ This means setup was previously run and auto-disabled public registration. Solutions:
740
+
741
+ **Option 1: Reset Rocket.Chat (recommended, cleanest)**
742
+
743
+ ```bash
744
+ cd ~/rocketchat && docker compose down -v
745
+ curl -fsSL https://raw.githubusercontent.com/Kxiandaoyan/openclaw-rocketchat/master/install-rc.sh | bash
746
+ openclaw rocketchat setup
747
+ openclaw rocketchat add-bot
748
+ ```
749
+
750
+ **Option 2: Use existing admin**
751
+
752
+ If you know the admin username/password, re-run setup and choose "Use existing admin account".
753
+
754
+ </details>
755
+
756
+ <details>
757
+ <summary><b>How to reinstall the plugin / start over?</b></summary>
758
+
759
+ ```bash
760
+ # 1. Remove old plugin
761
+ rm -rf ~/.openclaw/extensions/openclaw-rocketchat
762
+
763
+ # 2. Clean residual config entries
764
+ python3 -c "
765
+ import json
766
+ with open('$HOME/.openclaw/openclaw.json') as f:
767
+ cfg = json.load(f)
768
+ for key in ['entries', 'installs']:
769
+ if 'plugins' in cfg and key in cfg['plugins'] and 'openclaw-rocketchat' in cfg['plugins'][key]:
770
+ del cfg['plugins'][key]['openclaw-rocketchat']
771
+ with open('$HOME/.openclaw/openclaw.json', 'w') as f:
772
+ json.dump(cfg, f, indent=2, ensure_ascii=False)
773
+ f.write('\n')
774
+ "
775
+
776
+ # 3. Reinstall
777
+ npm cache clean --force
778
+ openclaw plugins install openclaw-rocketchat
779
+ openclaw rocketchat setup
780
+ ```
781
+
782
+ </details>
783
+
784
+ <details>
785
+ <summary><b>How to completely start fresh (including Rocket.Chat reset)?</b></summary>
786
+
787
+ ```bash
788
+ # 1. Stop and remove Rocket.Chat containers and data
789
+ cd ~/rocketchat && docker compose down -v
790
+
791
+ # 2. Remove plugin and credentials
792
+ rm -rf ~/.openclaw/extensions/openclaw-rocketchat
793
+ rm -rf ~/.openclaw/credentials/rocketchat
794
+
795
+ # 3. Clean config file
796
+ python3 -c "
797
+ import json
798
+ with open('$HOME/.openclaw/openclaw.json') as f:
799
+ cfg = json.load(f)
800
+ for key in ['entries', 'installs']:
801
+ if 'plugins' in cfg and key in cfg['plugins'] and 'openclaw-rocketchat' in cfg['plugins'][key]:
802
+ del cfg['plugins'][key]['openclaw-rocketchat']
803
+ if 'channels' in cfg and 'rocketchat' in cfg['channels']:
804
+ del cfg['channels']['rocketchat']
805
+ cfg['bindings'] = [b for b in cfg.get('bindings', []) if b.get('match', {}).get('channel') != 'rocketchat']
806
+ with open('$HOME/.openclaw/openclaw.json', 'w') as f:
807
+ json.dump(cfg, f, indent=2, ensure_ascii=False)
808
+ f.write('\n')
809
+ "
810
+
811
+ # 4. Start fresh
812
+ curl -fsSL https://raw.githubusercontent.com/Kxiandaoyan/openclaw-rocketchat/master/install-rc.sh | bash
813
+ openclaw plugins install openclaw-rocketchat
814
+ openclaw rocketchat setup
815
+ openclaw rocketchat add-bot
816
+ ```
817
+
818
+ </details>
819
+
820
+ <details>
821
+ <summary><b>Rocket.Chat Docker management commands</b></summary>
822
+
823
+ ```bash
824
+ # Check container status
825
+ docker ps
826
+
827
+ # View logs
828
+ cd ~/rocketchat && docker compose logs -f
829
+
830
+ # Stop service
831
+ cd ~/rocketchat && docker compose stop
832
+
833
+ # Start service
834
+ cd ~/rocketchat && docker compose start
835
+
836
+ # Restart service
837
+ cd ~/rocketchat && docker compose restart
838
+
839
+ # Completely uninstall (delete all data)
840
+ cd ~/rocketchat && docker compose down -v
841
+ ```
842
+
843
+ </details>
844
+
845
+ <details>
846
+ <summary><b>Are self-signed certificates secure? The app says "untrusted" — what do I do?</b></summary>
847
+
848
+ Self-signed certificates have the same encryption strength as regular certificates (RSA 2048) — the only difference is they're not verified by a third-party CA. For a self-hosted server, this is perfectly fine.
849
+
850
+ The app will warn about an "untrusted certificate" on first connection — tap "Trust" or "Continue". It won't ask again after that.
851
+
852
+ If you have a domain name, you can replace the self-signed certificate with Let's Encrypt to get the "green lock".
853
+ </details>
854
+
681
855
  <details>
682
856
  <summary><b>Are push notifications reliable in China?</b></summary>
683
857