### Start Development Server Source: https://tailchat.msgbyte.com/docs/deployment/dev Commands to install dependencies and launch the development server. ```bash pnpm install pnpm dev ``` -------------------------------- ### Install Dependencies Source: https://tailchat.msgbyte.com/docs/plugins/guide/init-env Initializes the npm project and installs the mini-star package. ```bash npm init -y npm install mini-star ``` -------------------------------- ### Configure Environment Variables and Start Service Source: https://tailchat.msgbyte.com/docs/deployment/other-way/manual Copy the example environment file, modify necessary variables (e.g., MONGO_URL, REDIS_URL, MINIO_URL), and then start the Tailchat services. The SERVICEDIR variable specifies the directory for loading microservices. ```bash cp server/.env.example server/dist/.env vim .env ``` ```bash SERVICEDIR=services,plugins pnpm start:service ``` -------------------------------- ### Start SWAG Service with Docker Compose Source: https://tailchat.msgbyte.com/docs/deployment/https-gateway After configuring the swag.env file with your domain name, use Docker Compose to start the SWAG service. This will automatically handle SSL certificate acquisition and reverse proxy setup. ```bash docker compose -f ./swag.yml up -d ``` -------------------------------- ### Install MiniStar Globally Source: https://tailchat.msgbyte.com/docs/plugins/start Install the MiniStar toolchain globally to enable plugin creation and build commands. ```bash npm install --global mini-star ``` -------------------------------- ### Copy and Edit .env Example Source: https://tailchat.msgbyte.com/docs/deployment/environment Use these commands to copy the example environment file and then edit it with your desired configurations. ```bash mv .env.example .env vi .env ``` -------------------------------- ### Initialize Environment Variables Source: https://tailchat.msgbyte.com/docs/deployment/mobile Create the .env file from the provided example template. ```bash cp.env.example.env ``` -------------------------------- ### Install Docker engine and plugins Source: https://tailchat.msgbyte.com/docs/deployment/install-docker Installs the Docker engine, CLI, containerd, and the Docker Compose plugin. ```bash sudo yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin ``` -------------------------------- ### Install Mobile Dependencies Source: https://tailchat.msgbyte.com/docs/deployment/mobile Navigate to the mobile client directory and install required packages using yarn. ```bash cd client/mobile yarn ``` -------------------------------- ### One-command Docker installation Source: https://tailchat.msgbyte.com/docs/deployment/install-docker Executes the official Docker installation script on a Linux server. ```bash curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh ``` -------------------------------- ### Initialize Tailchat Project Source: https://tailchat.msgbyte.com/docs/plugins/start Use the CLI to start a new project in the current directory. ```bash tailchat create ``` -------------------------------- ### Install Project Dependencies Source: https://tailchat.msgbyte.com/docs/deployment/other-way/manual Navigate to the tailchat directory and install all project dependencies using pnpm. This command also triggers an automatic compilation. ```bash cd tailchat pnpm install ``` -------------------------------- ### Install Tailchat SDK Source: https://tailchat.msgbyte.com/docs/advanced-usage/openapp/bot Command to install the official Tailchat client SDK via npm. ```bash npm install tailchat-client-sdk ``` -------------------------------- ### Download and Run Livekit Webhook Receiver Source: https://tailchat.msgbyte.com/docs/meeting/livekit Use these commands to download the Livekit docker-compose configuration and start the webhook receiver service. Ensure you have docker and docker-compose installed. ```bash wget https://raw.githubusercontent.com/msgbyte/tailchat/master/docker/livekit.yml docker compose -f docker-compose.yml -f livekit.yml up -d ``` -------------------------------- ### Start Tailchat with Docker Compose Source: https://tailchat.msgbyte.com/docs/deployment/docker-compose Starts the application using the configuration files present in the current directory. ```bash # Make sure the configuration files (docker-compose.yml and docker-compose.env) are in the current directory ``` -------------------------------- ### Install Tailchat CLI Source: https://tailchat.msgbyte.com/docs/cli/tailchat-cli Install or update the CLI globally using npm. ```bash npm install -g tailchat-cli@latest # Install and update with the same command ``` -------------------------------- ### Initialize Node.js Project Source: https://tailchat.msgbyte.com/docs/advanced-usage/openapp/bot Commands to create a new directory and install necessary dependencies for a Koa-based bot server. ```bash mkdir tailchat-bot && cd tailchat-bot npm init -y npm install koa koa-router tailchat-client-sdk ``` -------------------------------- ### Start application with admin support Source: https://tailchat.msgbyte.com/docs/deployment/admin Launches the application using both the base docker-compose.yml and the admin.yml files. ```bash docker compose -f docker-compose.yml -f admin.yml up -d ``` -------------------------------- ### Start Tailchat Meeting Services Source: https://tailchat.msgbyte.com/docs/meeting/deployment Launch the application containers using Docker Compose. ```bash docker compose up -d ``` -------------------------------- ### Create a Tailchat Client Plugin Source: https://tailchat.msgbyte.com/docs/plugins/guide/create-theme Use this command to initialize a new client plugin. Follow the interactive prompts to complete the setup. ```bash tailchat create --template client-plugin ``` -------------------------------- ### Configure Docker repository Source: https://tailchat.msgbyte.com/docs/deployment/install-docker Installs necessary utilities and adds the official Docker repository to the system. ```bash sudo yum install -y yum-utils # yum-utils provides the yum-config-manager command sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo ``` -------------------------------- ### Start Tailchat Server with Docker Compose Source: https://tailchat.msgbyte.com/docs/deployment/docker-compose Execute this command to start the Tailchat server and its dependencies in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Install LESS Compiler Source: https://tailchat.msgbyte.com/docs/plugins/guide/create-theme Install the 'less' npm package to enable the 'mini-star' build tool to automatically compile LESS files. ```bash npm install less ``` -------------------------------- ### Install Traefik via Helm Source: https://tailchat.msgbyte.com/docs/deployment/other-way/kubernetes/simple Deploy the Traefik ingress controller into the tailchat namespace. ```bash helm install traefik traefik/traefik -n tailchat ``` -------------------------------- ### Run MinIO via Docker Source: https://tailchat.msgbyte.com/docs/deployment/dev Starts a MinIO container with custom credentials and console address. ```bash docker run -d \ -p 19000:9000 \ -p 19001:9001 \ --name minio \ -e "MINIO_ROOT_USER=tailchat" \ -e "MINIO_ROOT_PASSWORD=com.msgbyte.tailchat" \ minio/minio server /data --console-address ":9001" ``` -------------------------------- ### Install pnpm globally Source: https://tailchat.msgbyte.com/docs/deployment/docker-compose Installs the pnpm package manager, which is recommended for maintaining consistent dependency environments. ```bash npm install -g pnpm ``` -------------------------------- ### Example Build Error Output Source: https://tailchat.msgbyte.com/docs/deployment/mobile Common build failure output when dependencies or environment variables are misconfigured. ```text error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. > Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'. > Could not create task ':app:generateDebugLintModel'. > java.lang.NullPointerException (no error message) * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 27s ``` -------------------------------- ### Download SWAG Configuration Files Source: https://tailchat.msgbyte.com/docs/deployment/https-gateway Use wget to download the SWAG configuration YAML, example environment file, and Nginx configuration. Ensure these files are placed in the correct directory structure. ```bash wget https://raw.githubusercontent.com/msgbyte/tailchat/master/docker/swag.yml wget https://raw.githubusercontent.com/msgbyte/tailchat/master/docker/swag.env.example -O swag.env mkdir config wget https://raw.githubusercontent.com/msgbyte/tailchat/master/docker/config/nginx.conf -O ./config/nginx.conf ``` -------------------------------- ### Minimal .env Configuration Source: https://tailchat.msgbyte.com/docs/deployment/dev Example environment variables required to run Tailchat in a development environment. ```text PORT=11000 MONGO_URL=mongodb://127.0.0.1:27017/tailchat REDIS_URL=redis://localhost:6379/ MINIO_URL=127.0.0.1:19000 MINIO_USER=tailchat MINIO_PASS=com.msgbyte.tailchat ``` -------------------------------- ### Serve Plugin Files Locally Source: https://tailchat.msgbyte.com/docs/plugins/guide/create-theme Use `http-server` to serve your plugin's compiled files locally. This is necessary for manual installation in Tailchat. ```bash npx http-server . ``` -------------------------------- ### Install standalone Docker Compose Source: https://tailchat.msgbyte.com/docs/deployment/install-docker Downloads and configures the standalone Docker Compose binary for systems where the plugin is not used. ```bash curl -SL https://github.com/docker/compose/releases/download/v2.4.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose # Download binaries sudo chmod +x /usr/local/bin/docker-compose # give execute permission sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose # Soft link to path, can be called directly docker-compose --version # The line command returns the version number and the installation is successful ``` -------------------------------- ### Incorrect Environment Variable Format Source: https://tailchat.msgbyte.com/docs/deployment/mobile Example of an incomplete configuration that may cause build failures. ```text GETUI_APPID=xxxxxxxxxxxx GETUI_APPKEY=yyyyyyyyy GETUI_APPSECRET=zzzzzzzzzz ``` -------------------------------- ### SMTP URI Configuration Examples Source: https://tailchat.msgbyte.com/docs/deployment/smtp Common URI formats for various email service providers. ```text smtps://:@smtp.exmail.qq.com/?pool=true ``` ```text smtps://:@smtp.163.com/?pool=true ``` ```text smtps://:@smtp.qq.com/?pool=true ``` -------------------------------- ### Define Plugin Manifest Source: https://tailchat.msgbyte.com/docs/plugins/start Create a manifest.json file to configure plugin metadata and entry points for manual installation. ```json { "label": "Web Panel Plugin", "name": "com.msgbyte.webview", "url": "/plugins/com.msgbyte.webview/index.js", "version": "0.0.0", "author": "msgbyte", "description": "Provides groups with the ability to create web panels", "requireRestart": false } ``` -------------------------------- ### Run MongoDB via Docker Source: https://tailchat.msgbyte.com/docs/deployment/dev Starts a MongoDB container on port 27017. ```bash docker run -d --name mongo -p 27017:27017 mongo:4 ``` -------------------------------- ### Run Redis via Docker Source: https://tailchat.msgbyte.com/docs/deployment/dev Starts a Redis container on port 6379. ```bash docker run -d --name redis -p 6379:6379 redis ``` -------------------------------- ### Implement Bot Message Logic Source: https://tailchat.msgbyte.com/docs/advanced-usage/openapp/bot Example of handling incoming messages and sending replies using the TailchatHTTPClient. ```javascript import { TailchatHTTPClient, stripMentionTag } from 'tailchat-client-sdk'; const host = ''; const appId = ''; const appSecret = ''; const client = new TailchatHTTPClient(host, appId, appSecret) // ... router.post('/bot/callback', async (ctx) => { const type = ctx.body.type; if (type === 'message') { const payload = ctx.body.payload; try { const message = await client.replyMessage({ messageId: payload.messageId, author: payload.messageAuthor, content: payload.messageSnippet }, { groupId: payload.groupId, converseId: payload.converseId, content: `Your message: ${stripMentionTag(payload.messageSnippet)}`, }) console.log('send message success:', message) } catch (err) { console.log('send message failed:', err) } } ctx.body = 'Bot Callback Page'; }); ``` -------------------------------- ### Tailchat CLI Benchmark Help Source: https://tailchat.msgbyte.com/docs/benchmark/cli Displays the available benchmark commands and options for the Tailchat CLI. Ensure tailchat-cli is installed and version is above 1.5.8. ```bash tailchat benchmark Tailchat Benchmark Test Commands: tailchat benchmark message Stress testing through Tailchat network requests (suitable for pure business testing) tailchat benchmark connections Test Tailchat Connections tailchat benchmark register Create Tailchat temporary account and output token Options: --version Show version number [boolean] -h, --help Show help [boolean] ``` -------------------------------- ### Run Tailchat CLI via npx Source: https://tailchat.msgbyte.com/docs/cli/tailchat-cli Execute CLI commands directly without global installation. ```bash npx tailchat-cli ``` -------------------------------- ### Check Development Environment Source: https://tailchat.msgbyte.com/docs/deployment/mobile Run the doctor command to verify the React Native development environment setup. ```bash yarn doctor ``` -------------------------------- ### Configure Cloudflare R2 External Storage Source: https://tailchat.msgbyte.com/docs/advanced-usage/external-storage Example environment variables for configuring Cloudflare R2 as an external storage service. Ensure your R2 bucket is set up and accessible via the S3 protocol. ```bash MINIO_URL=.r2.cloudflarestorage.com:443 MINIO_PATH_STYLE=Path ``` -------------------------------- ### General API Call Example Source: https://tailchat.msgbyte.com/docs/advanced-usage/openapp/bot Bots can call interfaces like ordinary users. Ensure the 'X-Token' header is included with your JWT for authentication. ```http POST /api/xxx Header Content-Type: application/json X-Token: Body { ... } ``` -------------------------------- ### Prepare Deployment Environment Source: https://tailchat.msgbyte.com/docs/meeting/deployment Navigate to the compose directory and initialize the environment configuration file. ```bash cd tailchat-meeting/compose cp docker-compose.env.example docker-compose.env vi docker-compose.env ``` -------------------------------- ### Create Project Directory Source: https://tailchat.msgbyte.com/docs/plugins/guide/init-env Initializes a new directory for the plugin project. ```bash mkdir tailchat-plugin-test && cd tailchat-plugin-test ``` -------------------------------- ### Remove existing Docker installations Source: https://tailchat.msgbyte.com/docs/deployment/install-docker Cleans up previous versions of Docker and related packages before a fresh installation. ```bash # If you have installed docker before, you can execute the following command to delete the old one sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine ``` -------------------------------- ### Get Cached Session Information Source: https://tailchat.msgbyte.com/docs/plugins/api/common Retrieves session information from the cache. ```typescript const info = getCachedConverseInfo(converseId); ``` -------------------------------- ### Get Cached User Information Source: https://tailchat.msgbyte.com/docs/plugins/api/common Retrieves user information from the cache. ```typescript const info = getCachedUserInfo(userId); ``` -------------------------------- ### Initialize Tailchat configuration via CLI Source: https://tailchat.msgbyte.com/docs/deployment/docker-compose Runs an interactive command to generate the necessary configuration files. ```bash npx tailchat-cli docker init ``` -------------------------------- ### Get Global State Source: https://tailchat.msgbyte.com/docs/plugins/api/common Accesses the global Redux state context. ```typescript const state = getGlobalState(); ``` -------------------------------- ### Get Global State Utility Source: https://tailchat.msgbyte.com/docs/plugins/api/common Utility function to retrieve the global Redux state. ```APIDOC ## GET /api/utility/getGlobalState ### Description Retrieves the current global state, typically managed by Redux. ### Method GET ### Endpoint /api/utility/getGlobalState ### Response #### Success Response (200) - **state** (object) - The global state object. #### Response Example ```json { "state": { "some": "global state data" } } ``` ``` -------------------------------- ### Download Docker Compose configuration files Source: https://tailchat.msgbyte.com/docs/deployment/docker-compose Fetches the required docker-compose.yml and docker-compose.env files from the repository. ```bash mkdir tailchat && cd tailchat wget https://raw.githubusercontent.com/msgbyte/tailchat/master/docker-compose.yml wget https://raw.githubusercontent.com/msgbyte/tailchat/master/docker-compose.env ``` -------------------------------- ### Get Group Panel Parameters Source: https://tailchat.msgbyte.com/docs/plugins/api/common Retrieves the current groupId and panelId from the hook context. ```typescript import { useGroupPanelParams } from '@capital/common'; const { groupId, panelId } = useGroupPanelParams(); ``` -------------------------------- ### Configure Environment Variables Source: https://tailchat.msgbyte.com/docs/meeting/deployment Define network and domain settings within the environment file. ```text # Internal IP MEDIASOUP_IP= # Public IP MEDIASOUP_ANNOUNCED_IP= # swag URL= SUBDOMAINS= TZ=Asia/Shanghai ``` -------------------------------- ### Apply Ingress Resource Source: https://tailchat.msgbyte.com/docs/deployment/other-way/kubernetes/simple Deploy the ingress configuration to enable routing. ```bash kubectl apply -f ingress.yml ``` -------------------------------- ### Correct Environment Variable Format Source: https://tailchat.msgbyte.com/docs/deployment/mobile Ensure all required keys exist in the .env file, even if their values are empty. ```text GETUI_APPID=xxxxxxxxxxxx GETUI_APPKEY=yyyyyyyyy GETUI_APPSECRET=zzzzzzzzzz GETUI_HUAWEI_APP_ID= ``` -------------------------------- ### Mail Error Response Format Source: https://tailchat.msgbyte.com/docs/deployment/troubleshooting Example of the error object returned when SMTP configuration is incorrect. ```javascript code:'EENVELOPE', response: '502 Invalid paramenters', responseCode: 502, command: 'MAIL FROM' ``` -------------------------------- ### Deploy Tailchat Resources Source: https://tailchat.msgbyte.com/docs/deployment/other-way/kubernetes/simple Apply the configuration files to create namespaces, persistent volumes, middleware, and the Tailchat service. ```bash kubectl apply -f namespace.yml -f pv.yml -f mongo.yml -f minio.yml -f redis.yml -f tailchat.yml ``` -------------------------------- ### Get Cached Converse Info Utility Source: https://tailchat.msgbyte.com/docs/plugins/api/common Utility function to retrieve cached conversation information. ```APIDOC ## GET /api/utility/getCachedConverseInfo ### Description Retrieves cached conversation information based on a conversation ID. ### Method GET ### Endpoint /api/utility/getCachedConverseInfo ### Query Parameters - **converseId** (string) - Required - The ID of the conversation whose information is to be retrieved. ### Response #### Success Response (200) - **info** (object) - The cached conversation information. #### Response Example ```json { "info": { "id": "converse789", "name": "General Chat" } } ``` ``` -------------------------------- ### Get Cached User Info Utility Source: https://tailchat.msgbyte.com/docs/plugins/api/common Utility function to retrieve cached user information. ```APIDOC ## GET /api/utility/getCachedUserInfo ### Description Retrieves cached user information based on a user ID. ### Method GET ### Endpoint /api/utility/getCachedUserInfo ### Query Parameters - **userId** (string) - Required - The ID of the user whose information is to be retrieved. ### Response #### Success Response (200) - **info** (object) - The cached user information. #### Response Example ```json { "info": { "id": "user123", "name": "John Doe" } } ``` ``` -------------------------------- ### Run Tailchat Benchmark CLI Commands Source: https://tailchat.msgbyte.com/docs/benchmark/report Use these commands to register a benchmark client, initiate connection tests, and test message sending/receiving with specified parameters. ```bash tailchat benchmark register https://.cloud.sealos.io --invite ``` ```bash tailchat benchmark connections https://.cloud.sealos.io ``` ```bash tailchat benchmark connections https://.cloud.sealos.io --groupId --converseId --messageNum 5 ``` -------------------------------- ### Get Modal Context Source: https://tailchat.msgbyte.com/docs/plugins/api/common Retrieves the modal context, providing access to methods like closeModal. ```typescript const { closeModal } = useModalContext(); ``` -------------------------------- ### Download admin configuration Source: https://tailchat.msgbyte.com/docs/deployment/admin Fetches the admin.yml configuration file from the official Tailchat GitHub repository. ```bash wget https://raw.githubusercontent.com/msgbyte/tailchat/master/docker/admin.yml ``` -------------------------------- ### Compile Tailchat Frontend Source: https://tailchat.msgbyte.com/docs/deployment/cdn Navigate to the client web directory and build the front-end code. Set the SERVICE_URL environment variable to your API backend address. ```bash cd client/web SERVICE_URL= pnpm build ``` -------------------------------- ### Compile All Plugins Source: https://tailchat.msgbyte.com/docs/plugins/guide/create-theme Execute the 'npm run plugins:all' command to compile all plugins, including the custom theme plugin. ```bash npm run plugins:all ``` -------------------------------- ### CLI: Test connections Source: https://tailchat.msgbyte.com/docs/benchmark/cli Simulates multiple user logins to test server performance and connection handling. ```APIDOC ## CLI Command: tailchat benchmark connections ### Description Establishes connections for multiple users using tokens generated from the registration command to test server load and message broadcast performance. ### Endpoint `tailchat benchmark connections ` ### Parameters #### Path Parameters - **url** (string) - Required - The base URL of the Tailchat service. #### Options - **--file** (string) - Optional - Path to the account token file (default: "./accounts"). - **--groupId** (string) - Optional - Target Group ID for message testing. - **--converseId** (string) - Optional - Target Converse ID for message testing. ``` -------------------------------- ### Execute Declaration Sync Command Source: https://tailchat.msgbyte.com/docs/plugins/guide/typescript-support Run this command using pnpm to automatically fetch and write remote configuration files into `types/tailchat.d.ts`. ```bash pnpm sync: declaration ``` -------------------------------- ### Get User Information Source: https://tailchat.msgbyte.com/docs/advanced-usage/openapp/oauth Retrieves user information using the obtained access token. This is a POST request to the `/open/me` endpoint. ```APIDOC ## POST /open/me ### Description Retrieves the authenticated user's profile information using an `access_token`. ### Method POST ### Endpoint `/open/me` ### Parameters #### Request Body - **access_token** (string) - Required - The access token obtained from the `/open/token` endpoint. ### Request Example ```json { "access_token": "ACCESS_TOKEN_HERE" } ``` ### Response #### Success Response (200) - **sub** (string) - The unique identifier for the user. - **nickname** (string) - The user's nickname. - **discriminator** (string) - The user's discriminator. - **avatar** (string) - The URL of the user's avatar. #### Response Example ```json { "sub": "USER_ID", "nickname": "Username", "discriminator": "1234", "avatar": "AVATAR_URL" } ``` ``` -------------------------------- ### Create Basic Koa Server Source: https://tailchat.msgbyte.com/docs/advanced-usage/openapp/bot Boilerplate code for a Koa server with routes for handling bot callbacks. ```javascript const Koa = require('koa'); const Router = require('koa-router'); const app = new Koa(); const router = new Router(); // Define route router.get('/', async (ctx) => { ctx.body = 'Hello, World!'; }); router.post('/bot/callback', async (ctx) => { ctx.body = 'Bot Callback Page'; }); // Register middleware app.use(router.routes()); app.use(router.allowedMethods()); // Start server app.listen(3000, () => { console.log('Server is running on http://localhost:3000'); }); ``` -------------------------------- ### Clone Tailchat Repository Source: https://tailchat.msgbyte.com/docs/deployment/cdn Clone the Tailchat repository to your local machine. Ensure you use pnpm version 8 for dependency installation. ```bash git clone https://github.com/msgbyte/tailchat.git cd tailchat # You can switch between different distributions by git, for example: git checkout v1.8.8 pnpm install # You need to use `pnpm` to install dependencies, using other package management tools may cause problems. and you should use pnpm@8 because here is some break change in pnpm@9 ``` -------------------------------- ### Register Test Users in Batches with Tailchat CLI Source: https://tailchat.msgbyte.com/docs/benchmark/cli Use the `register` command to create temporary accounts in batches. The command outputs login tokens to a file. Options include specifying the file path, registration count, and an invite code. ```bash tailchat benchmark register Create Tailchat temporary account and output token Options: --version Show version number [boolean] --file Account Token Path [string] [required] [default: "./accounts"] --count Register Count [number] [required] [default: 100] --invite Invite Code [string] -h, --help Show help [boolean] --url ``` ```bash tailchat benchmark register http://127.0.0.1:11000 ``` ```bash tailchat benchmark register http://127.0.0.1:11000 --count 10000 --invite ``` -------------------------------- ### Navigate to Kubernetes Configuration Directory Source: https://tailchat.msgbyte.com/docs/deployment/other-way/kubernetes/simple Change the working directory to access the prepared Kubernetes YAML files. ```bash cd docker/simple/k8s ``` -------------------------------- ### Compile Plugin with npm Source: https://tailchat.msgbyte.com/docs/plugins/guide/create-theme Run this command to compile your plugin. The compiled output will be located in the `/dist/plugins/` directory. ```bash npm run plugins:all ``` -------------------------------- ### Image Syntax Source: https://tailchat.msgbyte.com/docs/advanced-usage/richtext Use [img]Image URL[/img] to display an image. ```bbcode [img]https://tailchat.msgbyte.com/img/logo.svg[/img] ``` -------------------------------- ### Initialize and Connect Tailchat Websocket Client Source: https://tailchat.msgbyte.com/docs/advanced-usage/openapp/ws Establishes a connection to the Tailchat server using environment credentials and sets up a listener for incoming messages. ```typescript import { TailchatWsClient } from 'tailchat-client-sdk'; const HOST = process.env.HOST; const APPID = process.env.APPID; const APPSECRET = process.env.APPSECRET; if (!HOST || !APPID || !APPSECRET) { console.log('require env: HOST, APPID, APPSECRET'); process. exit(1); } const client = new TailchatWsClient(HOST, APPID, APPSECRET); client.connect().then(async() => { console.log('Login Success!'); client.onMessage((message) => { console.log('Receive message', message); }); }); ``` -------------------------------- ### Compile Tailchat project Source: https://tailchat.msgbyte.com/docs/deployment/docker-compose Builds the Docker image from the cloned source code. ```bash cd tailchat && docker compose build ``` -------------------------------- ### Compile Android Release Source: https://tailchat.msgbyte.com/docs/deployment/mobile Build the Android release APK using Gradle. ```bash cd android ./gradlew assembleRelease ``` -------------------------------- ### URL Syntax Source: https://tailchat.msgbyte.com/docs/advanced-usage/richtext Use [url]URL[/url] for a clickable URL or [url=URL]Link Text[/url] for custom link text. ```bbcode [url]https://tailchat.msgbyte.com[/url] ``` ```bbcode [url=https://tailchat.msgbyte.com ]Official website[/url] ``` -------------------------------- ### Configure Environment Variables Source: https://tailchat.msgbyte.com/docs/deployment/mobile Required environment variables for compilation, including upload store details and push service credentials. ```text TAILCHAT_UPLOAD_STORE_FILE= TAILCHAT_UPLOAD_STORE_PASSWORD= TAILCHAT_UPLOAD_KEY_ALIAS= TAILCHAT_UPLOAD_KEY_PASSWORD= GETUI_APPID= GETUI_APPKEY= GETUI_APPSECRET= GETUI_HUAWEI_APP_ID= ``` -------------------------------- ### Import Icon Component Source: https://tailchat.msgbyte.com/docs/plugins/icon Import the Icon component from the @capital/component library. This is the first step to using icons. ```javascript import { Icon } from '@capital/component'; ``` -------------------------------- ### Add Traefik Helm Repository Source: https://tailchat.msgbyte.com/docs/deployment/other-way/kubernetes/simple Register the Traefik Helm repository to the local environment. ```bash helm repo add traefik https://helm.traefik.io/traefik ``` -------------------------------- ### Test Tailchat Connections with CLI Source: https://tailchat.msgbyte.com/docs/benchmark/cli Use the `connections` command to log in and establish connections for multiple users. It reads tokens from a file generated by the `register` command. Options include specifying the account token path, group ID, and conversation ID. ```bash tailchat benchmark connections Test Tailchat Connections Options: --version Show version number [boolean] --file Account Token Path [string] [required] [default: "./accounts"] --groupId Group Id which send Message [string] --converseId Converse Id which send Message [string] -h, --help Show help [boolean] --url [required] ``` ```bash tailchat benchmark connections http://127.0.0.1:11000 ``` ```bash tailchat benchmark connections http://127.0.0.1:11000 --groupId --converseId ``` -------------------------------- ### Tailchat CLI Help Output Source: https://tailchat.msgbyte.com/docs/cli/tailchat-cli Displays the available commands and options for the Tailchat CLI. ```text tailchat Commands: tailchat create [template] Create Tailchat repo code tailchat connect Connect to Tailchat network tailchat bench Benchmark tailchat declaration Tailchat plugin type declaration tailchat docker Tailchat image management tailchat usage [pid] View Tailchat process usage Options: --version Show version number [boolean] -h, --help Show help [boolean] ``` -------------------------------- ### Compile Custom Docker Image Source: https://tailchat.msgbyte.com/docs/advanced-usage/custom-builtin-plugin Build a new Docker image with your customized plugin list. The `.` indicates the current directory as the build context. ```bash docker build -t tailchat . ``` -------------------------------- ### Mention User Syntax Source: https://tailchat.msgbyte.com/docs/advanced-usage/richtext Use [at=]Username[/at] to mention a user. ```bbcode [at=]moonrailgun[/at] ``` -------------------------------- ### Clone Tailchat Meeting Repository Source: https://tailchat.msgbyte.com/docs/meeting/deployment Download the source code from the official repository to begin the deployment process. ```bash git clone https://github.com/msgbyte/tailchat-meeting --depth=1 ``` -------------------------------- ### Configure Github integration in project Source: https://tailchat.msgbyte.com/docs/advanced-usage/github-integration Create this file in the root directory to map Github notifications to specific Tailchat groups and panels. ```json { "groupId": "", "panelId": "" } ``` -------------------------------- ### Backup and Restore MongoDB in Docker Source: https://tailchat.msgbyte.com/docs/devops/mongodb Use these commands to perform manual database operations. Replace with your specific container name. ```bash # backup docker exec -i mongodump -d tailchat --archive > ./backup.archive # restore docker exec -i mongorestore -d tailchat --archive < ./backup.archive ``` -------------------------------- ### Navigate to Tailchat Directory Source: https://tailchat.msgbyte.com/docs/advanced-usage/custom-builtin-plugin Change your current directory to the root of the cloned Tailchat repository. ```bash cd tailchat ``` -------------------------------- ### Verify Ingress Services Source: https://tailchat.msgbyte.com/docs/deployment/other-way/kubernetes/simple Check the status of services after applying the ingress configuration. ```bash kubectl get services -n tailchat ``` -------------------------------- ### Define Frontend Permission Constants Source: https://tailchat.msgbyte.com/docs/contribution/dev/role Declare core permission keys in the frontend configuration file. ```typescript export const PERMISSION = { /** * Non-plugin permission points are called core */ core: { message: 'core.message', }, }; ``` -------------------------------- ### Use Icon Component Source: https://tailchat.msgbyte.com/docs/plugins/icon Render the Icon component by passing the desired icon key as a prop. It's recommended to use icons from the 'mdi' set for a unified design. ```javascript ``` -------------------------------- ### Create Sealos Application Entry Source: https://tailchat.msgbyte.com/docs/deployment/other-way/kubernetes/sealos YAML configuration for adding a Tailchat application entry to the Sealos desktop. ```yaml apiVersion: app.sealos.io/v1 kind: App metadata: name: tailchat-app-entry spec: name: Tailchat icon: type: iframe data: url: desc: icon: https://tailchat.msgbyte.com/img/logo.svg menuData: nameColor: text-black helpDropDown: helpDocs: displayType: normal ``` -------------------------------- ### CLI: Register test users Source: https://tailchat.msgbyte.com/docs/benchmark/cli Registers temporary test users in batches and saves their authentication tokens to a local file. ```APIDOC ## CLI Command: tailchat benchmark register ### Description Creates temporary Tailchat accounts in batches and outputs tokens to a local file for subsequent testing. ### Endpoint `tailchat benchmark register ` ### Parameters #### Path Parameters - **url** (string) - Required - The base URL of the Tailchat service. #### Options - **--file** (string) - Optional - Path to save account tokens (default: "./accounts"). - **--count** (number) - Optional - Number of users to register (default: 100). - **--invite** (string) - Optional - Invite code to automatically join a test group after registration. ``` -------------------------------- ### Add Script to Sync Declaration Files Source: https://tailchat.msgbyte.com/docs/plugins/guide/typescript-support For standalone projects, add this script to your `package.json` to automatically pull remote declaration files. This helps ensure type safety, though some types might still be 'any'. ```json "scripts": { "sync:declaration": "tailchat declaration github" } ``` -------------------------------- ### Configure mini-star Source: https://tailchat.msgbyte.com/docs/plugins/guide/init-env Defines the .ministarrc.js configuration file to specify external dependencies. ```javascript // .ministarrc.js const path = require('path'); module.exports = { externalDeps: [ 'react', 'react-router', 'axios', 'styled-components', 'zustand', 'zustand/middleware/immer', ], }; ```