feat: add Rocket.Chat app

This commit is contained in:
okxlin
2026-06-28 03:20:05 +08:00
parent 7c6c538125
commit ed4f1e021d
12 changed files with 424 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
# Rocket.Chat
## 产品介绍
Rocket.Chat 是一套开源团队通信协作平台,支持频道、私聊、用户管理、集成和工作区协作。
## 主要功能
- 创建团队频道和私聊会话
- 管理工作区用户、角色和权限
- 支持机器人、Webhook 和应用集成
## 访问说明
安装后通过安装表单中的 `ROOT_URL` 访问。默认地址为 `http://<服务器 IP>:18087`,实际端口以 `PANEL_APP_PORT_HTTP` 为准。
## Introduction
Rocket.Chat is an open source team communication platform for channels, direct messages, user management, integrations and workspace collaboration.
## Features
- Create team channels and direct messages
- Manage workspace users, roles and permissions
- Use bots, webhooks and app integrations
## 部署说明
- 本应用基于官方 `rocketchat-compose` 的核心服务适配,包含 Rocket.Chat、MongoDB 单节点复制集和 NATS。
- 当前固定使用 `registry.rocket.chat/rocketchat/rocket.chat:8.0.1``mongodb/mongodb-community-server:8.2-ubi8``nats:2.11-alpine`
- 应用分类:工具。
- 支持架构:amd64、arm64。
- 可选版本:`latest`,但镜像版本固定,避免自动跨版本升级。
## 端口
| 变量 | 说明 | 默认值 | 必填 |
| --- | --- | --- | --- |
| PANEL_APP_PORT_HTTP | HTTP 访问端口 | 18087 | 是 |
## 数据持久化
| 变量 | 说明 | 默认值 | 必填 |
| --- | --- | --- | --- |
| APP_DATA_DIR | MongoDB 数据目录 | ./data | 是 |
升级、迁移或修改 MongoDB/Rocket.Chat 版本前,请先在 1Panel 中备份 `APP_DATA_DIR`
## 参数说明
| 变量 | 说明 | 默认值 | 必填 |
| --- | --- | --- | --- |
| ROOT_URL | Rocket.Chat 对外访问地址,必须和真实访问协议、域名或端口保持一致 | http://127.0.0.1:18087 | 是 |
| REG_TOKEN | Rocket.Chat Cloud 注册令牌,没有可留空 | 空 | 否 |
| ADMIN_USERNAME | 初始管理员用户名 | admin | 是 |
| ADMIN_NAME | 初始管理员显示名 | Admin | 是 |
| ADMIN_EMAIL | 初始管理员邮箱 | admin@example.com | 是 |
| ADMIN_PASS | 初始管理员密码 | 随机生成 | 是 |
## 使用说明
- 首次访问后,使用安装表单中的初始管理员信息登录并完成工作区设置。
- 生产环境建议使用真实域名和 HTTPS 反向代理,并将 `ROOT_URL` 设置为最终访问地址。
- Rocket.Chat 官方建议生产环境固定版本,不要使用浮动的 `latest` 标签。
- Rocket.Chat 升级前必须阅读目标版本发布说明,确认 MongoDB 兼容版本,并按版本顺序升级;不要跳过大版本。
- 本应用未加入 Renovate 自动合并白名单,后续升级需要人工审计 MongoDB、NATS 和 Rocket.Chat 版本兼容性,并执行真实升级测试。
## 参考资料
- 官网: <https://www.rocket.chat/>
- 项目仓库: <https://github.com/RocketChat/Rocket.Chat>
- 官方 Docker Compose 文档: <https://docs.rocket.chat/docs/deploy-with-docker-docker-compose>
- 官方 Compose 仓库: <https://github.com/RocketChat/rocketchat-compose>
- 初始管理员文档: <https://docs.rocket.chat/docs/admin-account-creation>
- 安全升级指南: <https://docs.rocket.chat/docs/guidelines-for-updating-rocketchat>
+30
View File
@@ -0,0 +1,30 @@
name: Rocket.Chat
tags:
- 实用工具
title: 开源团队通信协作平台
description: 开源团队通信协作平台
additionalProperties:
key: rocketchat
name: Rocket.Chat
tags:
- Tool
shortDescZh: 开源团队通信协作平台
shortDescEn: Open source team communication platform
description:
en: An open source team communication platform for messaging, channels and workspace collaboration.
zh: 面向消息、频道和团队协作的开源通信平台。
zh-Hant: 面向訊息、頻道和團隊協作的開源通訊平台。
ja: メッセージ、チャンネル、ワークスペース協業向けのオープンソースチーム通信プラットフォームです。
ko: 메시지, 채널 및 워크스페이스 협업을 위한 오픈소스 팀 커뮤니케이션 플랫폼입니다.
ru: Открытая платформа командного общения для сообщений, каналов и совместной работы.
ms: Platform komunikasi pasukan sumber terbuka untuk mesej, saluran dan kerjasama ruang kerja.
pt-br: Plataforma open source de comunicação em equipe para mensagens, canais e colaboração.
type: website
crossVersionUpdate: false
limit: 0
website: https://www.rocket.chat/
github: https://github.com/RocketChat/Rocket.Chat
document: https://docs.rocket.chat/docs/deploy-with-docker-docker-compose
architectures:
- amd64
- arm64
+10
View File
@@ -0,0 +1,10 @@
PANEL_APP_PORT_HTTP=18087
ROOT_URL=http://127.0.0.1:18087
TZ=Asia/Shanghai
APP_DATA_DIR=./data
REG_TOKEN=
ADMIN_USERNAME=admin
ADMIN_NAME=Admin
ADMIN_EMAIL=admin@example.com
ADMIN_PASS=rocket_admin_password
CONTAINER_NAME=rocketchat
+150
View File
@@ -0,0 +1,150 @@
additionalProperties:
formFields:
- default: 18087
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Port
labelZh: 端口
label:
en: Port
zh: 端口
zh-Hant:
ja: ポート
ko: 포트
ru: Порт
ms: Port
pt-br: Porta
required: true
rule: paramPort
type: number
- default: http://127.0.0.1:18087
edit: true
envKey: ROOT_URL
labelEn: Public URL
labelZh: 外部访问地址
label:
en: Public URL
zh: 外部访问地址
zh-Hant: 外部存取位址
ja: 公開 URL
ko: 공개 URL
ru: Публичный URL
ms: URL awam
pt-br: URL publico
required: true
rule: paramExtUrl
type: text
- default: Asia/Shanghai
edit: true
envKey: TZ
labelEn: Timezone
labelZh: 时区
label:
en: Timezone
zh: 时区
zh-Hant: 時區
ja: タイムゾーン
ko: 시간대
ru: Часовой пояс
ms: Zon waktu
pt-br: Fuso horario
required: true
type: text
- default: ./data
edit: true
envKey: APP_DATA_DIR
labelEn: Data Directory
labelZh: 数据目录
label:
en: Data Directory
zh: 数据目录
zh-Hant: 資料目錄
ja: データディレクトリ
ko: 데이터 디렉터리
ru: Каталог данных
ms: Direktori data
pt-br: Diretorio de dados
required: true
type: text
- default: ""
edit: true
envKey: REG_TOKEN
labelEn: Registration Token
labelZh: 注册令牌
label:
en: Registration Token
zh: 注册令牌
zh-Hant: 註冊權杖
ja: 登録トークン
ko: 등록 토큰
ru: Токен регистрации
ms: Token pendaftaran
pt-br: Token de registro
required: false
type: text
- default: admin
edit: true
envKey: ADMIN_USERNAME
labelEn: Admin Username
labelZh: 管理员用户名
label:
en: Admin Username
zh: 管理员用户名
zh-Hant: 管理員使用者名稱
ja: 管理者ユーザー名
ko: 관리자 사용자 이름
ru: Имя администратора
ms: Nama pengguna pentadbir
pt-br: Nome de usuario administrador
required: true
type: text
- default: Admin
edit: true
envKey: ADMIN_NAME
labelEn: Admin Name
labelZh: 管理员姓名
label:
en: Admin Name
zh: 管理员姓名
zh-Hant: 管理員姓名
ja: 管理者名
ko: 관리자 이름
ru: Имя администратора
ms: Nama pentadbir
pt-br: Nome do administrador
required: true
type: text
- default: admin@example.com
edit: true
envKey: ADMIN_EMAIL
labelEn: Admin Email
labelZh: 管理员邮箱
label:
en: Admin Email
zh: 管理员邮箱
zh-Hant: 管理員信箱
ja: 管理者メール
ko: 관리자 이메일
ru: Email администратора
ms: E-mel pentadbir
pt-br: Email do administrador
required: true
type: text
- default: rocket_admin_password
edit: true
envKey: ADMIN_PASS
labelEn: Admin Password
labelZh: 管理员密码
label:
en: Admin Password
zh: 管理员密码
zh-Hant: 管理員密碼
ja: 管理者パスワード
ko: 관리자 비밀번호
ru: Пароль администратора
ms: Kata laluan pentadbir
pt-br: Senha do administrador
random: true
required: true
rule: paramComplexity
type: password
+142
View File
@@ -0,0 +1,142 @@
services:
rocketchat:
image: "registry.rocket.chat/rocketchat/rocket.chat:8.0.1"
container_name: ${CONTAINER_NAME}
restart: always
depends_on:
mongodb:
condition: service_healthy
nats:
condition: service_healthy
networks:
- 1panel-network
- rocketchat-network
ports:
- "${PANEL_APP_PORT_HTTP}:3000"
entrypoint: sh
command:
- -c
- |
protocol=$(echo $$MONGO_URL | awk -F'://' '{print $$1}')
if [ "$$protocol" = "mongodb+srv" ]; then
echo "MongoDB is using SRV protocol, starting Rocket.Chat without local TCP wait"
exec node main.js
fi
host_port=$(echo $$MONGO_URL | awk -F/ '{print $$3}')
if echo $$host_port | grep -q @; then
host_port=$(echo $$host_port | awk -F@ '{print $$2}')
fi
host=$(echo $$host_port | awk -F: '{print $$1}')
port=$(echo $$host_port | awk -F: '{print $$2}')
if [ -z "$$port" ]; then
port=27017
fi
echo "Waiting for MongoDB ($$host:$$port) before starting Rocket.Chat"
for i in $(seq 1 60); do
if nc -z $$host $$port >/dev/null 2>&1; then
exec node main.js
fi
sleep 5
done
echo "MongoDB did not become reachable in time"
exit 1
environment:
- TZ=${TZ}
- ROOT_URL=${ROOT_URL}
- PORT=3000
- DEPLOY_METHOD=docker
- DEPLOY_PLATFORM=compose
- REG_TOKEN=${REG_TOKEN}
- MONGO_URL=mongodb://mongodb:27017/rocketchat?replicaSet=rs0
- TRANSPORTER=monolith+nats://nats:4222
- INSTANCE_IP=
- ADMIN_USERNAME=${ADMIN_USERNAME}
- ADMIN_NAME=${ADMIN_NAME}
- ADMIN_EMAIL=${ADMIN_EMAIL}
- ADMIN_PASS=${ADMIN_PASS}
healthcheck:
test: ["CMD-SHELL", "nc -z -w 10 127.0.0.1 3000"]
interval: 30s
timeout: 10s
retries: 10
start_period: 90s
labels:
createdBy: "Apps"
mongodb:
image: "docker.io/mongodb/mongodb-community-server:8.2-ubi8"
container_name: ${CONTAINER_NAME}-mongodb
user: root
restart: always
networks:
- rocketchat-network
volumes:
- "${APP_DATA_DIR}/mongodb:/data/db"
entrypoint:
- sh
- -ec
- |
install -d -o mongod -g mongod -m 755 /data/db
if [ "$(stat -c '%u:%g' /data/db)" != "1000:1000" ]; then
chown -R mongod:mongod /data/db
fi
su -s /bin/sh mongod -c 'exec mongod --replSet rs0 --bind_ip_all' &
pid=$$!
until mongosh 'mongodb://127.0.0.1:27017/?directConnection=true' --quiet --eval 'db.adminCommand("ping")' >/dev/null 2>&1; do
sleep 2
done
cat >/tmp/rs-init.js <<JS
const replSetName = 'rs0';
const advertisedHost = 'mongodb';
const port = '27017';
try {
const status = rs.status();
print('Replica set already initialized: ' + status.set);
} catch (error) {
const message = String(error && (error.message || error));
if (message.includes('no replset config') || message.includes('NotYetInitialized')) {
print('Initiating replica set ' + replSetName + ' at ' + advertisedHost + ':' + port);
rs.initiate({_id: replSetName, members: [{_id: 0, host: advertisedHost + ':' + port}]});
} else {
throw error;
}
}
JS
mongosh 'mongodb://127.0.0.1:27017/?directConnection=true' --quiet /tmp/rs-init.js
for i in $(seq 1 60); do
if mongosh 'mongodb://127.0.0.1:27017/?directConnection=true' --quiet --eval 'try { quit(rs.status().ok === 1 ? 0 : 1) } catch (error) { quit(1) }' >/dev/null 2>&1; then
break
fi
sleep 2
done
wait "$$pid"
healthcheck:
test: ["CMD-SHELL", "mongosh 'mongodb://127.0.0.1:27017/?directConnection=true' --quiet --eval 'try { quit(rs.status().ok === 1 ? 0 : 1) } catch (error) { quit(1) }'"]
interval: 30s
timeout: 10s
retries: 10
start_period: 60s
labels:
createdBy: "Apps"
nats:
image: "docker.io/nats:2.11-alpine"
container_name: ${CONTAINER_NAME}-nats
restart: always
command: --http_port 8222
networks:
- rocketchat-network
healthcheck:
test: ["CMD-SHELL", "nc -z -w 10 127.0.0.1 4222"]
interval: 30s
timeout: 10s
retries: 10
start_period: 10s
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true
rocketchat-network:
driver: bridge
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
DATA_DIR="${APP_DATA_DIR:-./data}"
mkdir -p "${DATA_DIR}/mongodb"
chown -R 1000:1000 "${DATA_DIR}/mongodb" 2>/dev/null || true
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
docker-compose down --volumes
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -euo pipefail
exit 0
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

+17
View File
@@ -0,0 +1,17 @@
{
"repository": "https://github.com/RocketChat/Rocket.Chat",
"dockerDocs": "https://docs.rocket.chat/docs/deploy-with-docker-docker-compose",
"composeFile": "https://github.com/RocketChat/rocketchat-compose",
"adminAccount": "https://docs.rocket.chat/docs/admin-account-creation",
"updateGuide": "https://docs.rocket.chat/docs/guidelines-for-updating-rocketchat",
"notes": [
"Issue request: https://github.com/okxlin/appstore/issues/1870",
"Official deployment docs recommend the rocketchat-compose repository and a fixed Rocket.Chat release for production instead of a floating latest tag.",
"The appstore adaptation keeps the official core topology: Rocket.Chat 8.0.1, MongoDB 8.2 single-node replica set, and NATS 2.11.",
"Traefik, Prometheus, Grafana, log collectors and exporters from the full upstream stack are omitted to reduce privileges and exposed services in the appstore package.",
"One-shot MongoDB permission and replica-set init containers are folded into init.sh and the long-running MongoDB service because 1Panel treats completed app containers as unhealthy.",
"MongoDB bind-mount ownership is repaired inside the MongoDB container before starting mongod as the image's mongod user, avoiding host/container UID mapping assumptions.",
"Rocket.Chat 8.0.1 parses INITIAL_USER as JSON in server/startup/initialData.js; this app uses ADMIN_PASS and ADMIN_* variables for initial admin creation instead of setting INITIAL_USER=yes.",
"crossVersionUpdate is disabled because Rocket.Chat upgrades require release-note review, MongoDB compatibility checks, backups and sequential version upgrades."
]
}