mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 22:39:18 +08:00
Compare commits
180 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 093b3f640c | |||
| 90428ee76b | |||
| 60368e429c | |||
| 8161eab91b | |||
| 2efa041664 | |||
| a2da40ceab | |||
| add05a5f26 | |||
| 776081b35d | |||
| 77f0b2460b | |||
| 8e5e792a60 | |||
| 4c593d2436 | |||
| 14838b0ac8 | |||
| 2fb6674fc9 | |||
| 3025c61a7a | |||
| 077df0486e | |||
| 820bf83102 | |||
| 6027d2dfa3 | |||
| e6371f804d | |||
| de54be961f | |||
| 4cc3e0b194 | |||
| c7a884511b | |||
| e5083d5809 | |||
| 266237861b | |||
| 0aae970298 | |||
| 3be16ce3e8 | |||
| c4a140043c | |||
| 66bf8496b8 | |||
| ce32c8d9c1 | |||
| 760a119015 | |||
| d236f4070c | |||
| a412ab33a6 | |||
| ef19cf4f8d | |||
| 07dfde965c | |||
| afac910ecf | |||
| c2b8279ddc | |||
| 0c745782b0 | |||
| 2ba45691c4 | |||
| 8d5d54af33 | |||
| 571e239992 | |||
| 159822e207 | |||
| 89b59eb82e | |||
| 76b35210aa | |||
| 093f9a3b34 | |||
| 7ad8a7241d | |||
| c71bcefcbe | |||
| c4a8602428 | |||
| b17b364b02 | |||
| 7e2c535f37 | |||
| e0244d9ca7 | |||
| 6764fa5e70 | |||
| a3acba5eea | |||
| baf0d1888c | |||
| 5b99eb21e7 | |||
| 58ab340d1e | |||
| d8eec588de | |||
| b19d1f1726 | |||
| d446bdb943 | |||
| d3047d73b6 | |||
| 09c3229d9d | |||
| 4abddd8247 | |||
| c70ee5cbfb | |||
| 7bb44b8b88 | |||
| e1c2e94ec9 | |||
| 019ef60616 | |||
| 16bc053d09 | |||
| 9e2a256817 | |||
| 587533df4d | |||
| 61f83212b2 | |||
| 5d1cf8c061 | |||
| f1ba5c2bff | |||
| 11108e1ddf | |||
| c19bafc49d | |||
| d594d6f517 | |||
| 3fffc2f212 | |||
| 49f4e3f0de | |||
| bed112d037 | |||
| a7138cb3b7 | |||
| 959c5a7ae1 | |||
| 1e52376d7b | |||
| c68a61d8c2 | |||
| 7ddb84f7fc | |||
| cfde7bb0ff | |||
| 998d4a3504 | |||
| b90b8a1a55 | |||
| 53a3f475f3 | |||
| cff90a3099 | |||
| 2220645429 | |||
| cd1235fb32 | |||
| 47dd6b17f6 | |||
| 7389639f17 | |||
| de451d4cea | |||
| 11a147792d | |||
| f10528010b | |||
| 34ed032af1 | |||
| ed5f012c0d | |||
| 87610568ae | |||
| c8463a0a80 | |||
| f1c9686ada | |||
| c5c5b2fd8e | |||
| c2dfc37b0b | |||
| 2cef0f62b3 | |||
| 01c3d4725b | |||
| bb4463349e | |||
| 6b55cfd0b8 | |||
| bb6462647a | |||
| 60f4f67fb7 | |||
| 4cd2713fd6 | |||
| 119e8dbb2f | |||
| c0194f6ef4 | |||
| 1c1322e3d2 | |||
| 4b192027aa | |||
| be5a3e5a3f | |||
| 5b697d5e95 | |||
| 0efc235f45 | |||
| 35bac04f58 | |||
| 4c7e0295bf | |||
| ceb669dfb8 | |||
| 02142c55b2 | |||
| 100926da0e | |||
| f935d36715 | |||
| 3cecbbc69a | |||
| e4046994cf | |||
| 403cfb6055 | |||
| 1f7dfa33d7 | |||
| a9153afc38 | |||
| 7a13284b2e | |||
| 75375adf62 | |||
| b17c6ec924 | |||
| fb74453c18 | |||
| 82d238afbe | |||
| 2c9a2239d8 | |||
| 56fd78653c | |||
| 872dcae27a | |||
| 6ba0d618e4 | |||
| a19f0e534f | |||
| eeb16d4116 | |||
| ae048417ee | |||
| 7502b4ac0f | |||
| 05ab3fcd06 | |||
| 7698368957 | |||
| 0d5fe4e6d6 | |||
| 2ac54e09a6 | |||
| 7153eeb178 | |||
| fd42c6dced | |||
| 69eb24f702 | |||
| 65c1c412da | |||
| 2496a16a88 | |||
| d1af343b13 | |||
| a580c15f6a | |||
| 8e0cb6dc47 | |||
| 005ff53c3c | |||
| e2004c1e9d | |||
| 686fa80800 | |||
| a32e94b5ae | |||
| a285f02631 | |||
| e40aca81dc | |||
| 4eb8e0068d | |||
| 9d542edc96 | |||
| b562da5c37 | |||
| 3ba861fd90 | |||
| 194a94cb8e | |||
| 82a8f3351f | |||
| 297a8db788 | |||
| 815fa15392 | |||
| 1aef30dac4 | |||
| 3d3781f8d8 | |||
| 21505bce9b | |||
| a0621aead4 | |||
| a9e590109c | |||
| 450fe26cc0 | |||
| cb0bf64435 | |||
| 62e9980f3c | |||
| d2f0af1b8b | |||
| 3ce1e6ed71 | |||
| 1664579cf7 | |||
| cc1f7739e1 | |||
| a4b28c9523 | |||
| 726f14fd40 | |||
| 5806446f90 | |||
| 7722714251 |
@@ -1,79 +0,0 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
#---------------Infrastructure configuration---------------------#
|
||||
etcd:
|
||||
etcdSchema: openim #默认即可
|
||||
etcdAddr: [ 127.0.0.1:2379 ] #单机部署时,默认即可
|
||||
userName:
|
||||
password:
|
||||
secret: openIM123
|
||||
|
||||
mysql:
|
||||
dbMysqlDatabaseName: admin_chat # 数据库名字 默认即可
|
||||
|
||||
# 默认管理员账号
|
||||
admin:
|
||||
defaultAccount:
|
||||
account: [ "admin1", "admin2" ]
|
||||
defaultPassword: [ "password1", "password2" ]
|
||||
openIMUserID: [ "openIM123456", "openIMAdmin" ]
|
||||
faceURL: [ "", "" ]
|
||||
nickname: [ "admin1", "admin2" ]
|
||||
level: [ 1, 100 ]
|
||||
|
||||
|
||||
adminapi:
|
||||
openImAdminApiPort: [ 10009 ] #管理后台api服务端口,默认即可,需要开放此端口或做nginx转发
|
||||
listenIP: 0.0.0.0
|
||||
|
||||
chatapi:
|
||||
openImChatApiPort: [ 10008 ] #登录注册,默认即可,需要开放此端口或做nginx转发
|
||||
listenIP: 0.0.0.0
|
||||
|
||||
rpcport: # rpc服务端口 默认即可
|
||||
openImAdminPort: [ 30200 ]
|
||||
openImChatPort: [ 30300 ]
|
||||
|
||||
|
||||
rpcregistername: #rpc注册服务名,默认即可
|
||||
openImChatName: Chat
|
||||
openImAdminCMSName: Admin
|
||||
|
||||
chat:
|
||||
codeTTL: 300 #短信验证码有效时间(秒)
|
||||
superVerificationCode: 666666 # 超级验证码
|
||||
alismsverify: #阿里云短信配置,在阿里云申请成功后修改以下四项
|
||||
accessKeyId:
|
||||
accessKeySecret:
|
||||
signName:
|
||||
verificationCodeTemplateCode:
|
||||
|
||||
|
||||
oss:
|
||||
tempDir: enterprise-temp # 临时密钥上传的目录
|
||||
dataDir: enterprise-data # 最终存放目录
|
||||
aliyun:
|
||||
endpoint: https://oss-cn-chengdu.aliyuncs.com
|
||||
accessKeyID: ""
|
||||
accessKeySecret: ""
|
||||
bucket: ""
|
||||
tencent:
|
||||
BucketURL: ""
|
||||
serviceURL: https://cos.COS_REGION.myqcloud.com
|
||||
secretID: ""
|
||||
secretKey: ""
|
||||
sessionToken: ""
|
||||
bucket: ""
|
||||
use: "minio"
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,85 +0,0 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
#more prometheus-compose.yml
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
external_labels:
|
||||
monitor: 'openIM-monitor'
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'prometheus'
|
||||
static_configs:
|
||||
- targets: ['localhost:9091']
|
||||
|
||||
- job_name: 'openIM-server'
|
||||
metrics_path: /metrics
|
||||
static_configs:
|
||||
- targets: ['localhost:10002']
|
||||
labels:
|
||||
group: 'api'
|
||||
|
||||
- targets: ['localhost:20110']
|
||||
labels:
|
||||
group: 'user'
|
||||
|
||||
- targets: ['localhost:20120']
|
||||
labels:
|
||||
group: 'friend'
|
||||
|
||||
- targets: ['localhost:20130']
|
||||
labels:
|
||||
group: 'message'
|
||||
|
||||
- targets: ['localhost:20140']
|
||||
labels:
|
||||
group: 'msg-gateway'
|
||||
|
||||
- targets: ['localhost:20150']
|
||||
labels:
|
||||
group: 'group'
|
||||
|
||||
- targets: ['localhost:20160']
|
||||
labels:
|
||||
group: 'auth'
|
||||
|
||||
- targets: ['localhost:20170']
|
||||
labels:
|
||||
group: 'push'
|
||||
|
||||
- targets: ['localhost:20120']
|
||||
labels:
|
||||
group: 'friend'
|
||||
|
||||
|
||||
- targets: ['localhost:20230']
|
||||
labels:
|
||||
group: 'conversation'
|
||||
|
||||
|
||||
- targets: ['localhost:21400', 'localhost:21401', 'localhost:21402', 'localhost:21403']
|
||||
labels:
|
||||
group: 'msg-transfer'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- job_name: 'node'
|
||||
scrape_interval: 8s
|
||||
static_configs:
|
||||
- targets: ['localhost:9100']
|
||||
|
||||
@@ -20,7 +20,6 @@ CHANGELOG/
|
||||
|
||||
# Ignore deployment-related files
|
||||
docker-compose.yaml
|
||||
deployments/
|
||||
|
||||
# Ignore assets
|
||||
assets/
|
||||
|
||||
+17
-1
@@ -20,4 +20,20 @@ coverage:
|
||||
paths:
|
||||
- pkg/* # only include coverage in "pkg/" folder
|
||||
informational: true # Always pass check
|
||||
patch: off # disable the commit only checks
|
||||
tools: # declare a new status context "tools"
|
||||
paths:
|
||||
- tools/* # only include coverage in "tools/" folder
|
||||
informational: true # Always pass check
|
||||
test: # declare a new status context "test"
|
||||
paths:
|
||||
- test/* # only include coverage in "test/" folder
|
||||
informational: true # Always pass check
|
||||
# internal: # declare a new status context "internal"
|
||||
# paths:
|
||||
# - internal/* # only include coverage in "internal/" folder
|
||||
# informational: true # Always pass check
|
||||
# cmd: # declare a new status context "cmd"
|
||||
# paths:
|
||||
# - cmd/* # only include coverage in "cmd/" folder
|
||||
# informational: true # Always pass check
|
||||
patch: off # disable the commit only checks
|
||||
|
||||
@@ -24,38 +24,49 @@ on:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
create-pr:
|
||||
sync-issue-to-pr:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.pull_request.base.ref == 'main'
|
||||
# && github.event.pull_request.merged == true
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Sync Issue to PR
|
||||
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main'
|
||||
run: |
|
||||
PR_BODY="${{ github.event.pull_request.body }}"
|
||||
|
||||
- name: Create PR to release branch
|
||||
run: |
|
||||
ISSUEID=$(gh pr view ${{ github.event.pull_request.number }} --repo $OWNER/$REPO | grep -oP 'Fixes #\K\d+')
|
||||
echo "===========> $ISSUEID"
|
||||
ISSUE=$(gh issue view $ISSUEID --repo $OWNER/$REPO --json labels,assignees,milestone,title)
|
||||
echo "===========> $ISSUE"
|
||||
ISSUE_NUMBER=$(echo "$PR_BODY" | grep -oP 'Fixes #\K\d+')
|
||||
if [[ -z "$ISSUE_NUMBER" ]]; then
|
||||
echo "No Issue number found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LABELS=$(echo $ISSUE | jq -r '.labels[] | select(.name) | .name' | jq -R -r -s -c 'split("\n")[:-1] | join(",")')
|
||||
ASSIGNEES=$(echo $ISSUE | jq -r '.assignees[] | select(.login) | .login' | jq -R -s -c 'split("\n")[:-1] | join(",")')
|
||||
MILESTONE=$(echo $ISSUE | jq -r '.milestone | select(.title) | .title')
|
||||
TITLE=$(echo $ISSUE | jq -r '.title')
|
||||
echo "Issue number found: $ISSUE_NUMBER"
|
||||
|
||||
gh pr edit ${{ github.event.pull_request.number }} --repo $OWNER/$REPO --add-label "$LABELS" --add-assignee "$ASSIGNEES" --milestone "$MILESTONE"
|
||||
# Using GitHub CLI to get issue details
|
||||
gh issue view "$ISSUE_NUMBER" --repo "${{ github.repository }}" --json labels,assignees,milestone,title > issue_data.json
|
||||
|
||||
# git checkout -b bot/merge-to-release-$ISSUEID
|
||||
# git push origin bot/merge-to-release-$ISSUEID
|
||||
# gh pr create --base release --head bot/merge-to-release-$ISSUEID --title "Merge main to release" --body ""
|
||||
# gh pr create --base main --head feat/auto-release-pr-624 --title "The bug is fixed" --body "$x" --repo openimsdk/open-im-server --reviewer "cubxxw"
|
||||
continue-on-error: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
ISSUE: ${{ github.event.issue.html_url }}
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
REPO: ${{ github.event.repository.name }}
|
||||
# Check if jq is installed
|
||||
if ! command -v jq &> /dev/null; then
|
||||
echo "Installing jq..."
|
||||
sudo apt-get install -y jq
|
||||
fi
|
||||
|
||||
# Parse data with jq
|
||||
LABELS=$(jq -r '.labels | map(.name) | join(",")' issue_data.json)
|
||||
ASSIGNEES=$(jq -r '.assignees | map(.login) | join(",")' issue_data.json)
|
||||
MILESTONE=$(jq -r '.milestone.title' issue_data.json)
|
||||
|
||||
# Check if any of the fields are empty and set them to None
|
||||
LABELS=${LABELS:-None}
|
||||
ASSIGNEES=${ASSIGNEES:-None}
|
||||
MILESTONE=${MILESTONE:-None}
|
||||
|
||||
# Edit the PR with issue details, handling empty fields
|
||||
gh pr edit "${{ github.event.pull_request.number }}" --repo "${{ github.repository }}" \
|
||||
${LABELS:+--add-label "$LABELS"} \
|
||||
${ASSIGNEES:+--add-assignee "$ASSIGNEES"} \
|
||||
${MILESTONE:+--milestone "$MILESTONE"}
|
||||
continue-on-error: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
In addition to Slack, we also offer the following ways to get in touch:
|
||||
|
||||
+ <a href="https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q" target="_blank"><img src="https://img.shields.io/badge/Slack-OpenIM%2B-blueviolet?logo=slack&logoColor=white"></a> We also have Slack channels for you to communicate and discuss. To join, visit https://slack.com/ and join our [👀 Open-IM-Server slack](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q) team channel.
|
||||
+ <a href="https://mail.google.com/mail/u/0/?fs=1&tf=cm&to=winxu81@gmail.com" target="_blank"><img src="https://img.shields.io/badge/gmail-%40OOpenIMSDKCore?style=social&logo=gmail"></a> Get in touch with us on [Gmail](https://mail.google.com/mail/u/0/?fs=1&tf=cm&to=winxu81@gmail.com). If you have any questions or issues that need resolving, or any suggestions and feedback for our open source projects, please feel free to contact us via email.
|
||||
+ <a href="https://mail.google.com/mail/u/0/?fs=1&tf=cm&to=info@openim.io" target="_blank"><img src="https://img.shields.io/badge/gmail-%40OOpenIMSDKCore?style=social&logo=gmail"></a> Get in touch with us on [Gmail](https://mail.google.com/mail/u/0/?fs=1&tf=cm&to=winxu81@gmail.com). If you have any questions or issues that need resolving, or any suggestions and feedback for our open source projects, please feel free to contact us via email.
|
||||
+ <a href="https://doc.rentsoft.cn/" target="_blank"><img src="https://img.shields.io/badge/%E5%8D%9A%E5%AE%A2-%40OpenIMSDKCore-blue?style=social&logo=Octopus%20Deploy"></a> Read our [blog](https://doc.rentsoft.cn/). Our blog is a great place to stay up-to-date with Open-IM-Server projects and trends. On the blog, we share our latest developments, tech trends, and other interesting information.
|
||||
+ <a href="https://github.com/OpenIMSDK/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg" target="_blank"><img src="https://img.shields.io/badge/%E5%BE%AE%E4%BF%A1-OpenIMSDKCore-brightgreen?logo=wechat&style=flat-square"></a> Add [Wechat](https://github.com/OpenIMSDK/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg) and indicate that you are a user or developer of Open-IM-Server. We will process your request as soon as possible.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: Create Tag
|
||||
name: OpenIM Create Tag
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: 'Github Rebot for Cherry Pick when PR is merged'
|
||||
name: Github Rebot for Cherry Pick when PR is merged
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
|
||||
@@ -48,10 +48,12 @@ jobs:
|
||||
images: openim/openim-server
|
||||
# generate Docker tags based on the following events/attributes
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
@@ -87,6 +89,17 @@ jobs:
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server
|
||||
# generate Docker tags based on the following events/attributes
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Log in to AliYun Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
@@ -122,10 +135,12 @@ jobs:
|
||||
images: ghcr.io/openimsdk/openim-server
|
||||
# generate Docker tags based on the following events/attributes
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
@@ -1,139 +0,0 @@
|
||||
# Copyright © 2023 OpenIM open source community. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: Build OpenIM Web Docker image
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 3 * * *'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- release-*
|
||||
tags:
|
||||
- v*
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: "1.20"
|
||||
|
||||
jobs:
|
||||
build-openim-web-dockerhub:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# docker.io/openim/openim-web:latest
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: openim/openim-web
|
||||
# generate Docker tags based on the following events/attributes
|
||||
tags: |
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-tools/openim-web/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
build-openim-web-aliyun:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
# registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-web:latest
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta2
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-web
|
||||
|
||||
- name: Log in to AliYun Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: registry.cn-hangzhou.aliyuncs.com
|
||||
username: ${{ secrets.ALIREGISTRY_USERNAME }}
|
||||
password: ${{ secrets.ALIREGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-tools/openim-web/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta2.outputs.tags }}
|
||||
labels: ${{ steps.meta2.outputs.labels }}
|
||||
|
||||
build-openim-web-ghcr:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
# ghcr.io/openimsdk/openim-web:latest
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta2
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-web
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./build/images/openim-tools/openim-web/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta2.outputs.tags }}
|
||||
labels: ${{ steps.meta2.outputs.labels }}
|
||||
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: Check-Coverage
|
||||
name: OpenIM Check Coverage
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: "OpenIM CLA Assistant"
|
||||
name: OpenIM CLA Assistant
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
@@ -33,7 +33,7 @@ env:
|
||||
OPEN_IM_SERVER_CLA_DOCUMENT: https://github.com/openim-sigs/cla/blob/main/README.md
|
||||
OPEN_IM_SERVER_SIGNATURES_PATH: signatures/${{ github.event.repository.name }}/cla.json
|
||||
|
||||
OPEN_IM_SERVER_ALLOWLIST: kubbot,bot*
|
||||
OPEN_IM_SERVER_ALLOWLIST: kubbot,openimbot,bot*,dependabot,sweep-ai,*bot,bot-*,bot/*,bot-/*,bot,*[bot]
|
||||
|
||||
jobs:
|
||||
CLAAssistant:
|
||||
|
||||
+25
-24
@@ -19,6 +19,10 @@ on:
|
||||
tags:
|
||||
- 'v*.*.0'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
create-branch:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -36,41 +40,38 @@ jobs:
|
||||
- name: Install git-chglog
|
||||
run: make install.git-chglog
|
||||
|
||||
- name: Create Branch
|
||||
- name: Create Branch and Push
|
||||
env:
|
||||
TAG_NAME: ${{ github.ref_name }}
|
||||
run: |
|
||||
TAG_NAME=${GITHUB_REF/refs\/tags\//}
|
||||
IFS='.' read -ra VERSION_PARTS <<< "$TAG_NAME"
|
||||
if [[ "${VERSION_PARTS[2]}" = "0" ]]; then
|
||||
BRANCH_NAME="release-v${VERSION_PARTS[0]}.${VERSION_PARTS[1]}"
|
||||
echo "Creating branch $BRANCH_NAME"
|
||||
git checkout -b "$BRANCH_NAME"
|
||||
git push origin "$BRANCH_NAME"
|
||||
else
|
||||
echo "Not a release tag. Skipping branch creation."
|
||||
fi
|
||||
continue-on-error: true
|
||||
|
||||
- name: Push Changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "Auto Commit CHANGELOG"
|
||||
branch: release-v${VERSION_PARTS[0]}.${VERSION_PARTS[1]}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
|
||||
- name: Create and Push CHANGELOG
|
||||
- name: Create and Commit CHANGELOG
|
||||
if: endsWith(github.ref_name, '.0')
|
||||
run: |
|
||||
git checkout main
|
||||
TAG_NAME=${GITHUB_REF/refs\/tags\//}
|
||||
git fetch --all
|
||||
TAG_NAME=${GITHUB_REF#refs/tags/}
|
||||
IFS='.' read -ra VERSION_PARTS <<< "$TAG_NAME"
|
||||
if [[ "${VERSION_PARTS[2]}" = "0" ]]; then
|
||||
cd CHANGELOG
|
||||
git-chglog --tag-filter-pattern "v${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.*" -o "CHANGELOG-${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.md"
|
||||
git add "CHANGELOG-${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.md"
|
||||
git commit -m "Update CHANGELOG for $TAG_NAME"
|
||||
fi
|
||||
git checkout main
|
||||
cd CHANGELOG
|
||||
git-chglog --tag-filter-pattern "v${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.*" -o "CHANGELOG-${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.md"
|
||||
git add "CHANGELOG-${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.md"
|
||||
git commit -m "Update CHANGELOG for $TAG_NAME" || echo "No changes to commit."
|
||||
continue-on-error: true
|
||||
|
||||
- name: Push Changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
- name: Push CHANGELOG to Main
|
||||
if: steps.create-and-commit-changelog.outputs.changes == 'true'
|
||||
uses: ad-m/github-push-action@v0.6.0
|
||||
with:
|
||||
commit_message: "Auto Commit CHANGELOG"
|
||||
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
branch: main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
continue-on-error: true
|
||||
@@ -1,55 +0,0 @@
|
||||
# Copyright © 2023 OpenIM open source community. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: OpenIM Deploy for dev
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'devops' # Only for the dev branch
|
||||
- 'main'
|
||||
paths:
|
||||
- '.github/workflows/*'
|
||||
# - '__test__/**' # dev No immediate testing is required
|
||||
- 'src/**'
|
||||
- 'Dockerfile'
|
||||
- 'docker-compose.yml'
|
||||
- 'bin/*'
|
||||
|
||||
jobs:
|
||||
deploy-dev:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: executing remote ssh commands using password
|
||||
uses: appleboy/ssh-action@v1.0.0
|
||||
env:
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
REPO: ${{ github.event.repository.name }}
|
||||
with:
|
||||
host: "${{ secrets.SG_M1_HOST }}, ${{ secrets.SG_N1_HOST }}, ${{ secrets.SG_N2_HOST}}"
|
||||
username: ${{ secrets.SG_USERNAME }}
|
||||
password: ${{ secrets.SG_PASSWORD }}
|
||||
port: ${{ secrets.SG_PORT }}
|
||||
envs: OWNER,REPO
|
||||
script_stop: true
|
||||
script: |
|
||||
mkdir -p /test/openim
|
||||
cd /test/openim
|
||||
pwd;ls -al
|
||||
echo "OWNER: $OWNER"
|
||||
echo "REPO: $REPO"
|
||||
git clone -b develop https://github.com/${OWNER}/${REPO}.git; cd ${REPO}
|
||||
docker compose up -d
|
||||
continue-on-error: true
|
||||
@@ -2,7 +2,7 @@
|
||||
# Licensed under the MIT License (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
name: Dependency Review
|
||||
name: OpenIM Dependency Review
|
||||
on: [pull_request]
|
||||
|
||||
permissions:
|
||||
|
||||
@@ -54,6 +54,19 @@ jobs:
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Log in to AliYun Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: registry.cn-hangzhou.aliyuncs.com
|
||||
username: ${{ secrets.ALIREGISTRY_USERNAME }}
|
||||
password: ${{ secrets.ALIREGISTRY_TOKEN }}
|
||||
|
||||
################################################
|
||||
# build/
|
||||
# └── docker
|
||||
@@ -89,7 +102,20 @@ jobs:
|
||||
id: meta1
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-api
|
||||
images: |
|
||||
ghcr.io/openimsdk/openim-api
|
||||
openim/openim-api
|
||||
registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-api
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image for openim-api
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -107,7 +133,20 @@ jobs:
|
||||
id: meta2
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-cmdutils
|
||||
images: |
|
||||
ghcr.io/openimsdk/openim-cmdutils
|
||||
openim/openim-cmdutils
|
||||
registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-cmdutils
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image for openim-cmdutils
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -125,7 +164,20 @@ jobs:
|
||||
id: meta3
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-crontask
|
||||
images: |
|
||||
ghcr.io/openimsdk/openim-crontask
|
||||
openim/openim-crontask
|
||||
registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-crontask
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image for openim-crontask
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -143,7 +195,20 @@ jobs:
|
||||
id: meta4
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-msggateway
|
||||
images: |
|
||||
ghcr.io/openimsdk/openim-msggateway
|
||||
openim/openim-msggateway
|
||||
registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-msggateway
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image for openim-msggateway
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -161,7 +226,20 @@ jobs:
|
||||
id: meta5
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-msgtransfer
|
||||
images: |
|
||||
ghcr.io/openimsdk/openim-msgtransfer
|
||||
openim/openim-msgtransfer
|
||||
registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-msgtransfer
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image for openim-msgtransfer
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -179,7 +257,20 @@ jobs:
|
||||
id: meta6
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-push
|
||||
images: |
|
||||
ghcr.io/openimsdk/openim-push
|
||||
openim/openim-push
|
||||
registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-push
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image for openim-push
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -197,7 +288,20 @@ jobs:
|
||||
id: meta7
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-auth
|
||||
images: |
|
||||
ghcr.io/openimsdk/openim-rpc-auth
|
||||
openim/openim-rpc-auth
|
||||
registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-rpc-auth
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-auth
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -215,7 +319,20 @@ jobs:
|
||||
id: meta8
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-conversation
|
||||
images: |
|
||||
ghcr.io/openimsdk/openim-rpc-conversation
|
||||
openim/openim-rpc-conversation
|
||||
registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-rpc-conversation
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-conversation
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -233,7 +350,20 @@ jobs:
|
||||
id: meta9
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-friend
|
||||
images: |
|
||||
ghcr.io/openimsdk/openim-rpc-friend
|
||||
openim/openim-rpc-friend
|
||||
registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-rpc-friend
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-friend
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -251,7 +381,20 @@ jobs:
|
||||
id: meta10
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-group
|
||||
images: |
|
||||
ghcr.io/openimsdk/openim-rpc-group
|
||||
openim/openim-rpc-group
|
||||
registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-rpc-group
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-group
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -269,7 +412,20 @@ jobs:
|
||||
id: meta11
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-msg
|
||||
images: |
|
||||
ghcr.io/openimsdk/openim-rpc-msg
|
||||
openim/openim-rpc-msg
|
||||
registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-rpc-msg
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-msg
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -287,7 +443,20 @@ jobs:
|
||||
id: meta12
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-third
|
||||
images: |
|
||||
ghcr.io/openimsdk/openim-rpc-third
|
||||
openim/openim-rpc-third
|
||||
registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-rpc-third
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-third
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -305,7 +474,20 @@ jobs:
|
||||
id: meta13
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
with:
|
||||
images: ghcr.io/openimsdk/openim-rpc-user
|
||||
images: |
|
||||
ghcr.io/openimsdk/openim-rpc-user
|
||||
openim/openim-rpc-user
|
||||
registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-rpc-user
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image for openim-rpc-user
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -318,4 +500,3 @@ jobs:
|
||||
labels: ${{ steps.meta13.outputs.labels }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: e2e
|
||||
name: OpenIM Linux System E2E Test
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -22,6 +22,9 @@ on:
|
||||
# run e2e test every 4 hours
|
||||
- cron: 0 */4 * * *
|
||||
|
||||
env:
|
||||
CALLBACK_ENABLE: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Test
|
||||
@@ -41,4 +44,101 @@ jobs:
|
||||
|
||||
- name: Create e2e test
|
||||
run: |
|
||||
echo "...test e2e"
|
||||
echo "...test e2e"
|
||||
|
||||
execute-linux-systemd-scripts:
|
||||
name: Execute OpenIM script on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
environment:
|
||||
name: openim
|
||||
strategy:
|
||||
matrix:
|
||||
go_version: ["1.20"]
|
||||
os: ["ubuntu-latest"]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go ${{ matrix.go_version }}
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ matrix.go_version }}
|
||||
id: go
|
||||
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
with:
|
||||
version: '3.x' # If available, use the latest major version that's compatible
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Docker Operations
|
||||
run: |
|
||||
sudo make init
|
||||
sudo docker compose up -d
|
||||
sudo sleep 20
|
||||
|
||||
- name: Module Operations
|
||||
run: |
|
||||
sudo make tidy
|
||||
sudo make tools.verify.go-gitlint
|
||||
|
||||
- name: Build, Start
|
||||
run: |
|
||||
sudo ./scripts/install/install.sh -i
|
||||
|
||||
- name: Exec OpenIM System Status Chack
|
||||
run: |
|
||||
sudo ./scripts/install/install.sh -s
|
||||
|
||||
- name: Exec OpenIM API test
|
||||
run: |
|
||||
mkdir -p ./tmp
|
||||
touch ./tmp/test.md
|
||||
echo "# OpenIM Test" >> ./tmp/test.md
|
||||
echo "## OpenIM API Test" >> ./tmp/test.md
|
||||
echo "<details><summary>Command Output for OpenIM API Test</summary>" >> ./tmp/test.md
|
||||
echo "<pre><code>" >> ./tmp/test.md
|
||||
sudo make test-api | tee -a ./tmp/test.md
|
||||
echo "</code></pre>" >> ./tmp/test.md
|
||||
echo "</details>" >> ./tmp/test.md
|
||||
|
||||
- name: Exec OpenIM E2E Test
|
||||
run: |
|
||||
echo "" >> ./tmp/test.md
|
||||
echo "## OpenIM E2E Test" >> ./tmp/test.md
|
||||
echo "<details><summary>Command Output for OpenIM E2E Test</summary>" >> ./tmp/test.md
|
||||
echo "<pre><code>" >> ./tmp/test.md
|
||||
sudo make test-e2e | tee -a ./tmp/test.md
|
||||
echo "</code></pre>" >> ./tmp/test.md
|
||||
echo "</details>" >> ./tmp/test.md
|
||||
|
||||
- name: Comment PR with file
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
filePath: ./tmp/test.md
|
||||
comment_tag: nrt_file
|
||||
reactions: eyes, rocket
|
||||
mode: recreate
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Check outputs
|
||||
run: |
|
||||
echo "id : ${{ steps.nrt_message.outputs.id }}"
|
||||
echo "body : ${{ steps.nrt_message.outputs.body }}"
|
||||
echo "html_url : ${{ steps.nrt_message.outputs.html_url }}"
|
||||
|
||||
- name: Exec OpenIM System uninstall
|
||||
run: |
|
||||
sudo ./scripts/install/install.sh -u
|
||||
|
||||
- name: gobenchdata publish
|
||||
uses: bobheadxi/gobenchdata@v1
|
||||
with:
|
||||
PRUNE_COUNT: 30
|
||||
GO_TEST_FLAGS: -cpu 1,2
|
||||
PUBLISH: true
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
continue-on-error: true
|
||||
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: first-interaction
|
||||
name: OpenIM First Interaction
|
||||
|
||||
on:
|
||||
issues:
|
||||
|
||||
@@ -17,6 +17,7 @@ on:
|
||||
issues:
|
||||
types:
|
||||
- labeled
|
||||
|
||||
jobs:
|
||||
add-comment:
|
||||
if: github.event.label.name == 'help wanted' || github.event.label.name == 'good first issue'
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: 'issue translator'
|
||||
name: OpenIM Issue Aotu Translator
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
# ./*.md all markdown files in the root directory
|
||||
args: --verbose -E -i --no-progress --exclude-path './CHANGELOG' './**/*.md'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GH_PAT}}
|
||||
GITHUB_TOKEN: ${{secrets.BOT_GITHUB_TOKEN}}
|
||||
|
||||
- name: Create Issue From File
|
||||
if: env.lychee_exit_code != 0
|
||||
|
||||
@@ -12,12 +12,13 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: 'OpenIM Commit Action'
|
||||
name: OpenIM OpenCommit Action
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
# this list of branches is often enough,
|
||||
# but you may still ignore other public branches
|
||||
branches-ignore: [main master dev development release]
|
||||
|
||||
jobs:
|
||||
opencommit:
|
||||
@@ -27,20 +28,20 @@ jobs:
|
||||
permissions: write-all
|
||||
steps:
|
||||
- name: Setup Node.js Environment
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16'
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: di-sukharev/opencommit@github-action-v1.0.4
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
|
||||
env:
|
||||
# set openAI api key in repo actions secrets,
|
||||
# for openAI keys go to: https://platform.openai.com/account/api-keys
|
||||
# for repo secret go to: https://github.com/kuebcub/settings/secrets/actions
|
||||
# for repo secret go to: <your_repo_url>/settings/secrets/actions
|
||||
OCO_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
|
||||
# customization
|
||||
@@ -48,5 +49,7 @@ jobs:
|
||||
OCO_OPENAI_BASE_PATH: ''
|
||||
OCO_DESCRIPTION: false
|
||||
OCO_EMOJI: false
|
||||
OCO_MODEL: gpt-3.5-turbo
|
||||
OCO_LANGUAGE: en
|
||||
OCO_MODEL: gpt-3.5-turbo-16k
|
||||
OCO_LANGUAGE: en
|
||||
OCO_PROMPT_MODULE: conventional-commit
|
||||
continue-on-error: true
|
||||
+159
-29
@@ -18,39 +18,42 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- release-*
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
- "README.md"
|
||||
- "README_zh-CN.md"
|
||||
- "**.md"
|
||||
- "docs/**"
|
||||
- "CONTRIBUTING.md"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- release-*
|
||||
paths-ignore:
|
||||
- "README.md"
|
||||
- "README_zh-CN.md"
|
||||
- "CONTRIBUTING.md"
|
||||
- "CONTRIBUTING/**"
|
||||
- "**.md"
|
||||
- "docs/**"
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.19"
|
||||
GOLANGCI_VERSION: "v1.50.1"
|
||||
|
||||
|
||||
jobs:
|
||||
openim:
|
||||
name: Test with go ${{ matrix.go_version }} on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
environment:
|
||||
name: openim
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
go_version: ["1.19","1.20","1.21"]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- name: Setup
|
||||
uses: actions/checkout@v4
|
||||
@@ -64,7 +67,11 @@ jobs:
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
with:
|
||||
version: 2.x
|
||||
version: '3.x' # If available, use the latest major version that's compatible
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: OpenIM Scripts Verification(make verify)
|
||||
run: sudo make verify
|
||||
|
||||
- name: Module Operations
|
||||
run: |
|
||||
@@ -82,16 +89,14 @@ jobs:
|
||||
- name: Build Source
|
||||
run: sudo make build
|
||||
|
||||
- name: Build multiarch PLATFORMS
|
||||
if: startsWith(github.ref, 'refs/heads/release-')
|
||||
run: |
|
||||
sudo make multiarch
|
||||
|
||||
- name: Cleanup Build
|
||||
run: sudo make clean
|
||||
|
||||
- name: Push Changes to Main
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "cicd: robot automated Change"
|
||||
branch: main
|
||||
continue-on-error: true
|
||||
|
||||
- name: Set Current Directory
|
||||
id: set_directory
|
||||
run: echo "::set-output name=directory::$(pwd)"
|
||||
@@ -108,8 +113,11 @@ jobs:
|
||||
continue-on-error: true
|
||||
|
||||
openim-start:
|
||||
name: Test OpenIM install/start on ${{ matrix.os }}
|
||||
name: Test OpenIM install/start on ${{ matrix.os }}-${{ matrix.arch }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
environment:
|
||||
name: openim
|
||||
strategy:
|
||||
@@ -122,20 +130,65 @@ jobs:
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
with:
|
||||
version: 2.x
|
||||
version: '3.x' # If available, use the latest major version that's compatible
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Run OpenIM make install start
|
||||
run: |
|
||||
sudo make install
|
||||
|
||||
# - name: Check the OpenIM environment and status
|
||||
# run: |
|
||||
# sudo docker images
|
||||
# sudo docker ps
|
||||
|
||||
- name: Check the OpenIM environment and status
|
||||
if: runner.os == 'Linux' && matrix.arch == 'amd64'
|
||||
id: docker_info
|
||||
run: |
|
||||
sleep 30
|
||||
echo "images<<EOF" >> $GITHUB_ENV
|
||||
sudo docker images >> $GITHUB_ENV
|
||||
echo "EOF" >> $GITHUB_ENV
|
||||
echo "containers<<EOF" >> $GITHUB_ENV
|
||||
sudo docker ps >> $GITHUB_ENV
|
||||
echo "EOF" >> $GITHUB_ENV
|
||||
|
||||
- name: Comment PR
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
if: runner.os == 'Linux' && matrix.arch == 'amd64'
|
||||
with:
|
||||
message: |
|
||||
> [!TIP]
|
||||
> Run make install to check the status
|
||||
|
||||
### Docker Images:
|
||||
<details><summary>Click to expand docker images</summary>
|
||||
```bash
|
||||
${{ env.images }}
|
||||
```
|
||||
</details>
|
||||
|
||||
### Docker Processes:
|
||||
<details><summary>Click to expand docker ps</summary>
|
||||
```bash
|
||||
${{ env.containers }}
|
||||
```
|
||||
</details>
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
|
||||
execute-scripts:
|
||||
name: Execute OpenIM script on ${{ matrix.os }}
|
||||
name: Execute OpenIM Script On ${{ matrix.os }}-${{ matrix.arch }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
environment:
|
||||
name: openim
|
||||
strategy:
|
||||
matrix:
|
||||
go_version: ["1.20"]
|
||||
os: ["ubuntu-latest"]
|
||||
go_version: ["1.21"]
|
||||
os: ["ubuntu-latest", "macos-latest"]
|
||||
arch: [arm64, armv7, amd64]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@@ -145,28 +198,105 @@ jobs:
|
||||
with:
|
||||
go-version: ${{ matrix.go_version }}
|
||||
id: go
|
||||
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
with:
|
||||
version: 2.x
|
||||
- name: Docker Operations
|
||||
run: |
|
||||
curl -o docker-compose.yml https://raw.githubusercontent.com/OpenIMSDK/openim-docker/main/example/basic-openim-server-dependency.yml
|
||||
sudo docker compose up -d
|
||||
sudo sleep 60
|
||||
version: '3.x' # If available, use the latest major version that's compatible
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Module Operations
|
||||
# - name: Install latest Bash (macOS only)
|
||||
# if: runner.os == 'macOS' && matrix.arch == 'arm64'
|
||||
# run: |
|
||||
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
# brew update
|
||||
|
||||
# brew install bash
|
||||
# brew install gnu-sed
|
||||
|
||||
# echo "/usr/local/bin" >> $GITHUB_PATH
|
||||
# echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
|
||||
# continue-on-error: true
|
||||
|
||||
- name: Set up Docker for Ubuntu
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo make init
|
||||
sudo docker compose up -d
|
||||
sudo sleep 20
|
||||
|
||||
# - name: Set up Docker for macOS
|
||||
# if: runner.os == 'macOS' && matrix.arch == 'arm64'
|
||||
# run: |
|
||||
# brew install --cask docker
|
||||
# open /Applications/Docker.app
|
||||
|
||||
# sleep 10
|
||||
# docker-compose --version || brew install docker-compose
|
||||
|
||||
# docker-compose up -d
|
||||
# sleep 20
|
||||
|
||||
- name: Module Operations for Ubuntu
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo make tidy
|
||||
sudo make tools.verify.go-gitlint
|
||||
|
||||
- name: Build, Start and Check Services
|
||||
# - name: Module Operations for macOS
|
||||
# if: runner.os == 'macOS'
|
||||
# run: |
|
||||
# make tidy
|
||||
# make tools.verify.go-gitlint
|
||||
|
||||
- name: Build, Start, Check Services and Print Logs for Ubuntu
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo make init
|
||||
sudo make build
|
||||
sudo make start
|
||||
sudo make check
|
||||
|
||||
- name: Print OpenIM Logs
|
||||
run: sudo cat ./_output/logs/* 2>/dev/null
|
||||
continue-on-error: true
|
||||
- name: Restart Services and Print Logs for Ubuntu
|
||||
if: runner.os == 'Linux' && matrix.arch == 'amd64'
|
||||
run: |
|
||||
sudo make restart
|
||||
sudo make check
|
||||
|
||||
- name: Build, Start, Check Services and Print Logs for macOS
|
||||
if: runner.os == 'macOS' && matrix.arch == 'arm64'
|
||||
run: |
|
||||
make build
|
||||
|
||||
openim-test-build-image:
|
||||
name: Build OpenIM Docker Image
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
environment:
|
||||
name: openim
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Go ${{ matrix.go_version }}
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ matrix.go_version }}
|
||||
id: go
|
||||
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
with:
|
||||
version: '3.x' # If available, use the latest major version that's compatible
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Test Docker Build
|
||||
run: |
|
||||
sudo make init
|
||||
sudo make image
|
||||
|
||||
- name: Get OpenIM Docker Images Status
|
||||
id: docker_processes
|
||||
run: |
|
||||
sudo docker images
|
||||
sudo docker ps
|
||||
|
||||
@@ -41,8 +41,10 @@ jobs:
|
||||
run: |
|
||||
git config user.name 'openimbot'
|
||||
git config user.email 'openimsdk@qq.com'
|
||||
git checkout -b cicd/patch-${{ github.event.number }}
|
||||
- uses: actions/setup-node@v3
|
||||
BRANCH_NAME="auto-pr-$(date +'%Y%m%d%H%M%S')"
|
||||
git checkout -b $BRANCH_NAME
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
- name: Run go modules tidy
|
||||
@@ -50,6 +52,7 @@ jobs:
|
||||
sudo make tidy
|
||||
sudo make tools.verify.go-gitlint
|
||||
echo "Run go modules tidy successfully"
|
||||
continue-on-error: true
|
||||
|
||||
- name: Run go format
|
||||
run: |
|
||||
@@ -75,13 +78,8 @@ jobs:
|
||||
echo "Run unit test and get test coverage successfully"
|
||||
continue-on-error: true
|
||||
|
||||
# - name: Initialize CodeQL
|
||||
# uses: github/codeql-action/init@v2
|
||||
# with:
|
||||
# languages: go
|
||||
|
||||
# - name: Perform CodeQL Analysis
|
||||
# uses: github/codeql-action/analyze@v2
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
|
||||
- name: OpenIM verify copyright
|
||||
run: |
|
||||
@@ -89,31 +87,26 @@ jobs:
|
||||
sudo make add-copyright
|
||||
echo "OpenIM verify successfully"
|
||||
continue-on-error: true
|
||||
|
||||
# - name: Commit code
|
||||
# run: |
|
||||
# git add .
|
||||
# git commit -m "cicd: bump League Patch to cicd/patch-${{ github.event.number }}"
|
||||
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
with:
|
||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
commit-message: "cicd: bump League Patch to cicd/patch-${{ github.event.number }}"
|
||||
title: Bump League Patch to cicd/patch-${{ github.event.number }}
|
||||
commit-message: "cicd: bump League Patch"
|
||||
author: kubbot <kubbot@3293172751ysy@gmail.com>
|
||||
signoff: false
|
||||
draft: false
|
||||
branch: "cicd/patch-${{ github.event.number }}"
|
||||
branch: ''
|
||||
assignees: cubxxw
|
||||
reviewers: cubxxw
|
||||
delete-branch: true
|
||||
title: "Bump League Patch auto PR: $(date +'%Y%m%d')"
|
||||
body: |
|
||||
Review criteria:
|
||||
|
||||
- [ ] Disenchanter can connect and issue actions
|
||||
|
||||
This is an automated PR. @ ${{ github.actor }}
|
||||
This is an automated PR. @ $(date +'%Y%m%d')
|
||||
<sub>[workflow](https://github.com/openimsdk/open-im-server/blob/main/.github/workflows/pull-request.yml).</sub>
|
||||
base: main
|
||||
labels: |
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: OpenIM executes the script validation code
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
- "README.md"
|
||||
- "README_zh-CN.md"
|
||||
- "CONTRIBUTING.md"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- "README.md"
|
||||
- "README_zh-CN.md"
|
||||
- "CONTRIBUTING.md"
|
||||
- "docs/**"
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.19"
|
||||
GOLANGCI_VERSION: "v1.50.1"
|
||||
|
||||
jobs:
|
||||
openim:
|
||||
name: Test with go ${{ matrix.go_version }} on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: write
|
||||
environment:
|
||||
name: openim
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
go_version: ["1.21"]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- name: Setup
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: In ${{ matrix.os }} Execute the script validation code
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ matrix.go_version }}
|
||||
id: go
|
||||
|
||||
- name: scripts validation
|
||||
run: |
|
||||
sudo make verify
|
||||
continue-on-error: true
|
||||
|
||||
- name: verify format
|
||||
run: |
|
||||
sudo make format
|
||||
continue-on-error: true
|
||||
|
||||
- name: verify license
|
||||
run: |
|
||||
sudo make verify-copyright
|
||||
continue-on-error: true
|
||||
+9
-18
@@ -29,26 +29,19 @@ tmp/
|
||||
bin/
|
||||
output/
|
||||
_output/
|
||||
deployments/charts/generated-configs/
|
||||
|
||||
### OpenIM Config ###
|
||||
config/config.yaml
|
||||
./config/config.yaml
|
||||
.env
|
||||
./.env
|
||||
config/config.yaml
|
||||
config/alertmanager.yml
|
||||
config/prometheus.yml
|
||||
config/email.tmpl
|
||||
config/notification.yaml
|
||||
config/instance-down-rules.yml
|
||||
|
||||
### OpenIM deploy ###
|
||||
deploy/openim_demo
|
||||
deploy/openim-api
|
||||
deploy/openim-rpc-msg_gateway
|
||||
deploy/openim-msgtransfer
|
||||
deploy/openim-push
|
||||
deploy/openim_timer_task
|
||||
deploy/openim-rpc-user
|
||||
deploy/openim-rpc-friend
|
||||
deploy/openim-rpc-group
|
||||
deploy/openim-rpc-msg
|
||||
deploy/openim-rpc-auth
|
||||
deploy/Open-IM-SDK-Core
|
||||
deployments/openim-server/charts
|
||||
|
||||
# files used by the developer
|
||||
.idea.md
|
||||
@@ -398,6 +391,4 @@ Sessionx.vim
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/go,git,vim,tags,test,emacs,backup,jetbrains
|
||||
.idea
|
||||
dist/
|
||||
.env
|
||||
config/config.yaml
|
||||
dist/
|
||||
+12
-77
@@ -715,83 +715,18 @@ linters:
|
||||
# enable-all: true
|
||||
disable-all: true
|
||||
enable:
|
||||
- typecheck
|
||||
- asciicheck
|
||||
- bodyclose
|
||||
- cyclop
|
||||
# - depguard
|
||||
- dogsled
|
||||
- dupl
|
||||
- durationcheck
|
||||
- errcheck
|
||||
- errorlint
|
||||
- exhaustive
|
||||
- exportloopref
|
||||
# - forbidigo
|
||||
- funlen
|
||||
# - gci
|
||||
# - gochecknoinits
|
||||
- gocognit
|
||||
- goconst
|
||||
- gocyclo
|
||||
- godot
|
||||
- godox
|
||||
- gofmt
|
||||
- gofumpt
|
||||
- goheader
|
||||
- goimports
|
||||
- gomoddirectives
|
||||
- gomodguard
|
||||
- goprintffuncname
|
||||
- gosec
|
||||
- gosimple
|
||||
- govet
|
||||
- importas
|
||||
- ineffassign
|
||||
- lll
|
||||
- makezero
|
||||
- misspell
|
||||
- nakedret
|
||||
- nestif
|
||||
- nilerr
|
||||
- nlreturn
|
||||
- noctx
|
||||
- nolintlint
|
||||
- paralleltest
|
||||
- prealloc
|
||||
- predeclared
|
||||
- promlinter
|
||||
- revive
|
||||
- rowserrcheck
|
||||
- sqlclosecheck
|
||||
- staticcheck
|
||||
- stylecheck
|
||||
- thelper
|
||||
- tparallel
|
||||
- unconvert
|
||||
- unparam
|
||||
- unused
|
||||
- wastedassign
|
||||
- whitespace
|
||||
- bidichk
|
||||
- wastedassign
|
||||
- execinquery
|
||||
- nosprintfhostport
|
||||
- grouper
|
||||
- decorder
|
||||
- errchkjson
|
||||
- maintidx
|
||||
#- containedctx
|
||||
#- tagliatelle
|
||||
#- nonamedreturns
|
||||
#- nilnil
|
||||
#- tenv
|
||||
#- varnamelen
|
||||
#- contextcheck
|
||||
#- errname
|
||||
#- ForceTypeAssert
|
||||
#- nilassign
|
||||
fast: false
|
||||
- typecheck # 基本的类型检查
|
||||
- gofmt # 格式检查
|
||||
- govet # Go 语言的标准检查工具
|
||||
- gosimple # 简化代码的建议
|
||||
- misspell # 拼写错误
|
||||
- staticcheck # 静态检查
|
||||
- unused # 未使用的代码检查
|
||||
- goimports # 检查导入是否正确排序和格式化
|
||||
- godot # 注释句点检查
|
||||
- bodyclose # 确保 HTTP response body 被关闭
|
||||
- errcheck # 检查是否遗漏了错误返回值
|
||||
fast: true
|
||||
|
||||
issues:
|
||||
# List of regexps of issue texts to exclude, empty list by default.
|
||||
|
||||
@@ -20,7 +20,7 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
## OpenIM versioning policy
|
||||
|
||||
+ [OpenIM Version](../docs/conversions/version.md)
|
||||
+ [OpenIM Version](../docs/contrib/version.md)
|
||||
|
||||
## command
|
||||
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ representative at an online or offline event.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
3293172751nss@gmail.com.
|
||||
`security@openim.io`.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
|
||||
+9
-3
@@ -42,6 +42,12 @@ If you are familiar with [Makefile](./Makefile) , you can easily see the clever
|
||||
|
||||
The [Makefile](./Makefile) is for every developer, even if you don't know how to use the Makefile tool, don't worry, we provide two great commands to get you up to speed with the Makefile architecture, `make help` and `make help-all`, it can reduce problems of the developing environment.
|
||||
|
||||
In accordance with the naming conventions adopted by OpenIM and drawing reference from the Google Naming Conventions as per the guidelines available at https://google.github.io/styleguide/go/, the following expectations for naming practices within the project are set forth:
|
||||
|
||||
+ https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/code-conventions.md
|
||||
+ https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/go-code.md
|
||||
|
||||
|
||||
## Code of ConductCode of Conduct
|
||||
|
||||
#### Code and doc contribution
|
||||
@@ -186,7 +192,7 @@ We divide the problem into security and general problems:
|
||||
|
||||
Security issues are always treated seriously. As our usual principle, we discourage anyone to spread security issues. If you find a security issue of Open-IM-Server, please do not discuss it in public and even do not open a public issue.
|
||||
|
||||
Instead we encourage you to send us a private email to winxu81@gmail.com to report this.
|
||||
Instead we encourage you to send us a private email to info@openim.io to report this.
|
||||
|
||||
#### Reporting general issues
|
||||
|
||||
@@ -270,7 +276,7 @@ You can find some very formal PR in [RFC](https://github.com/openimsdk/open-im-s
|
||||
**🈴 Reviewing PRs:**
|
||||
|
||||
+ Be respectful and constructive
|
||||
+ Assign yourself to the PR
|
||||
+ Assign yourself to the PR (comment `/assign`)
|
||||
+ Check if all checks are passing
|
||||
+ Suggest changes instead of simply commenting on found issues
|
||||
+ If you are unsure about something, ask the author
|
||||
@@ -369,7 +375,7 @@ Our most recommended way to get in touch is through [Slack](https://join.slack.c
|
||||
In addition to Slack, we also offer the following ways to get in touch:
|
||||
|
||||
+ <a href="https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q" target="_blank"><img src="https://img.shields.io/badge/slack-%40OpenIMSDKCore-informational?logo=slack&style=flat-square"></a>: We also have Slack channels for you to communicate and discuss. To join, visit https://slack.com/ and join our [👀 Open-IM-Server slack](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q) team channel.
|
||||
+ <a href="https://mail.google.com/mail/u/0/?fs=1&tf=cm&to=4closetool3@gmail.com" target="_blank"><img src="https://img.shields.io/badge/gmail-%40OOpenIMSDKCore?style=social&logo=gmail"></a>: Get in touch with us on [Gmail](winxu81@gmail.com). If you have any questions or issues that need resolving, or any suggestions and feedback for our open source projects, please feel free to contact us via email.
|
||||
+ <a href="https://mail.google.com/mail/u/0/?fs=1&tf=cm&to=4closetool3@gmail.com" target="_blank"><img src="https://img.shields.io/badge/gmail-%40OOpenIMSDKCore?style=social&logo=gmail"></a>: Get in touch with us on [Gmail](info@openim.io). If you have any questions or issues that need resolving, or any suggestions and feedback for our open source projects, please feel free to contact us via email.
|
||||
+ <a href="https://doc.rentsoft.cn/" target="_blank"><img src="https://img.shields.io/badge/%E5%8D%9A%E5%AE%A2-%40OpenIMSDKCore-blue?style=social&logo=Octopus%20Deploy"></a>: Read our [blog](https://doc.rentsoft.cn/). Our blog is a great place to stay up-to-date with Open-IM-Server projects and trends. On the blog, we share our latest developments, tech trends, and other interesting information.
|
||||
+ <a href="https://github.com/OpenIMSDK/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg" target="_blank"><img src="https://img.shields.io/badge/%E5%BE%AE%E4%BF%A1-OpenIMSDKCore-brightgreen?logo=wechat&style=flat-square"></a>: Add [Wechat](https://github.com/OpenIMSDK/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg) and indicate that you are a user or developer of Open-IM-Server. We will process your request as soon as possible.
|
||||
|
||||
|
||||
+3
-2
@@ -25,7 +25,8 @@ WORKDIR ${SERVER_WORKDIR}
|
||||
|
||||
# Copy scripts and binary files to the production image
|
||||
COPY --from=builder ${OPENIM_SERVER_BINDIR} /openim/openim-server/_output/bin
|
||||
# COPY --from=builder ${OPENIM_SERVER_CMDDIR} /openim/openim-server/scripts
|
||||
# COPY --from=builder ${SERVER_WORKDIR}/config /openim/openim-server/config
|
||||
COPY --from=builder ${OPENIM_SERVER_CMDDIR} /openim/openim-server/scripts
|
||||
COPY --from=builder ${SERVER_WORKDIR}/config /openim/openim-server/config
|
||||
COPY --from=builder ${SERVER_WORKDIR}/deployments /openim/openim-server/deployments
|
||||
|
||||
CMD ["/openim/openim-server/scripts/docker-start-all.sh"]
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
## all: Run tidy, gen, add-copyright, format, lint, cover, build ✨
|
||||
.PHONY: all
|
||||
all: tidy gen add-copyright verify lint cover restart
|
||||
all: tidy gen add-copyright verify test-api lint cover restart
|
||||
|
||||
# ==============================================================================
|
||||
# Build set
|
||||
@@ -73,9 +73,9 @@ gen:
|
||||
demo:
|
||||
@$(MAKE) go.demo
|
||||
|
||||
## versionchecker: Check version of openim. ✨
|
||||
.PHONY: versionchecker
|
||||
versionchecker:
|
||||
## version: Check version of openim. ✨
|
||||
.PHONY: version
|
||||
version:
|
||||
@$(MAKE) go.versionchecker
|
||||
|
||||
## build: Build binaries by default ✨
|
||||
@@ -93,9 +93,9 @@ start:
|
||||
stop:
|
||||
@$(MAKE) go.stop
|
||||
|
||||
## restart: Restart openim ✨
|
||||
## restart: Restart openim (make init configuration file is initialized) ✨
|
||||
.PHONY: restart
|
||||
restart: clean stop build init start
|
||||
restart: clean stop build start check
|
||||
|
||||
## multiarch: Build binaries for multiple platforms. See option PLATFORMS. ✨
|
||||
.PHONY: multiarch
|
||||
@@ -166,6 +166,15 @@ test:
|
||||
cover:
|
||||
@$(MAKE) go.test.cover
|
||||
|
||||
## test-api: Run api test. ✨
|
||||
.PHONY: test-api
|
||||
test-api:
|
||||
@$(MAKE) go.test.api
|
||||
|
||||
## test-e2e: Run e2e test
|
||||
test-e2e:
|
||||
@$(MAKE) go.test.e2e
|
||||
|
||||
## updates: Check for updates to go.mod dependencies. ✨
|
||||
.PHONY: updates
|
||||
@$(MAKE) go.updates
|
||||
|
||||
+13
-9
@@ -1,5 +1,5 @@
|
||||
<p align="center">
|
||||
<a href="https://www.openim.online">
|
||||
<a href="https://openim.io">
|
||||
<img src="./assets/logo-gif/openim-logo.gif" width="60%" height="30%"/>
|
||||
</a>
|
||||
</p>
|
||||
@@ -23,12 +23,16 @@
|
||||
<p align="center">
|
||||
<a href="./README.md"><b> English </b></a> •
|
||||
<a href="./README-zh_CN.md"><b> 简体中文 </b></a> •
|
||||
<a href="https://www.openim.online/en"><b> Docs </b></a>
|
||||
<a href="https://openim.io/en"><b> Docs </b></a>
|
||||
</p>
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
## 🟢 扫描微信进群交流
|
||||
<img src="./docs/images/Wechat.jpg" width="300">
|
||||
|
||||
|
||||
## Ⓜ️ 关于 OpenIM
|
||||
|
||||
OpenIM 不仅仅是一个开源的即时消息组件,它是你的应用程序生态系统的一个不可或缺的部分。查看下面的图表,了解 AppServer、AppClient、OpenIMServer 和 OpenIMSDK 是如何交互的。
|
||||
@@ -86,22 +90,22 @@ OpenIM 我们的目标是建立一个顶级的开源社区。我们有一套标
|
||||
|
||||
在开始之前,请确保你的更改是有需求的。最好的方法是创建一个[新的讨论](https://github.com/openimsdk/open-im-server/discussions/new/choose) 或 [Slack 通信](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q),或者如果你发现一个问题,首先[报告它](https://github.com/openimsdk/open-im-server/issues/new/choose)。
|
||||
|
||||
+ [代码标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/go_code.md)
|
||||
+ [代码标准](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/go-code.md)
|
||||
|
||||
+ [Docker 镜像标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md)
|
||||
+ [Docker 镜像标准](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/images.md)
|
||||
|
||||
+ [目录标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/directory.md)
|
||||
+ [目录标准](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/directory.md)
|
||||
|
||||
+ [提交标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/commit.md)
|
||||
+ [提交标准](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/commit.md)
|
||||
|
||||
+ [版本控制标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md)
|
||||
+ [版本控制标准](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/version.md)
|
||||
|
||||
+ [接口标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/interface.md)
|
||||
+ [接口标准](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/interface.md)
|
||||
|
||||
+ [OpenIM配置和环境变量设置](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md)
|
||||
|
||||
> **Note**
|
||||
> 针对中国的用户,阅读我们的 [Docker 镜像标准](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md) 以便使用国内 aliyun 的镜像地址。OpenIM 也有针对中国的 gitee 同步仓库,你可以在 [gitee.com](https://gitee.com/openimsdk) 上找到它。
|
||||
> 针对中国的用户,阅读我们的 [Docker 镜像标准](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/images.md) 以便使用国内 aliyun 的镜像地址。OpenIM 也有针对中国的 gitee 同步仓库,你可以在 [gitee.com](https://gitee.com/openimsdk) 上找到它。
|
||||
|
||||
## :link: 链接
|
||||
|
||||
|
||||
@@ -1,33 +1,30 @@
|
||||
<p align="center">
|
||||
<a href="https://www.openim.online">
|
||||
<a href="https://openim.io">
|
||||
<img src="./assets/logo-gif/openim-logo.gif" width="60%" height="30%"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<h3 align="center" style="border-bottom: none">
|
||||
⭐️ Open source Instant Messaging Server ⭐️ <br>
|
||||
<h3>
|
||||
<div align="center">
|
||||
|
||||
[](https://github.com/openimsdk/open-im-server/stargazers)
|
||||
[](https://github.com/openimsdk/open-im-server/network/members)
|
||||
[](https://app.codecov.io/gh/openimsdk/open-im-server)
|
||||
[](https://goreportcard.com/report/github.com/openimsdk/open-im-server)
|
||||
[](https://pkg.go.dev/github.com/openimsdk/open-im-server/v3)
|
||||
[](https://github.com/openimsdk/open-im-server/blob/main/LICENSE)
|
||||
[](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q)
|
||||
[](https://www.bestpractices.dev/projects/8045)
|
||||
[](https://github.com/openimsdk/open-im-server/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22)
|
||||
[](https://golang.org/)
|
||||
|
||||
<p align=center>
|
||||
<a href="https://goreportcard.com/report/github.com/openimsdk/open-im-server"><img src="https://goreportcard.com/badge/github.com/openimsdk/open-im-server" alt="A+"></a>
|
||||
<a href="https://github.com/openimsdk/open-im-server/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22"><img src="https://img.shields.io/github/issues/openimsdk/open-im-server/good%20first%20issue?logo=%22github%22" alt="good first"></a>
|
||||
<a href="https://github.com/openimsdk/open-im-server"><img src="https://img.shields.io/github/stars/openimsdk/open-im-server.svg?style=flat&logo=github&colorB=deeppink&label=stars"></a>
|
||||
<a href="https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q"><img src="https://img.shields.io/badge/Slack-300%2B-blueviolet?logo=slack&logoColor=white"></a>
|
||||
<a href="https://github.com/openimsdk/open-im-server/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green"></a>
|
||||
<a href="https://golang.org/"><img src="https://img.shields.io/badge/Language-Go-blue.svg"></a>
|
||||
<a href="https://pkg.go.dev/github.com/openimsdk/open-im-server/v3"><img src="https://pkg.go.dev/badge/github.com/openimsdk/open-im-server/v3.svg" alt="Go Reference"></a>
|
||||
</p>
|
||||
[**English**](./README.md) •
|
||||
[**简体中文**](./README-zh_CN.md) •
|
||||
[**Docs**](https://openim.io/en)
|
||||
|
||||
</div>
|
||||
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="./README.md"><b> English </b></a> •
|
||||
<a href="./README-zh_CN.md"><b> 简体中文 </b></a> •
|
||||
<a href="https://www.openim.online/en"><b> Docs </b></a>
|
||||
</p>
|
||||
|
||||
</p>
|
||||
|
||||
## Ⓜ️ About OpenIM
|
||||
|
||||
@@ -61,7 +58,7 @@ It's crafted in Golang and supports cross-platform deployment, ensuring a cohere
|
||||
+ **REST API**: OpenIMServer provides REST API for business systems, aiming to empower your operations with additional functionalities like group creation and message push via backend interfaces.
|
||||
+ **Callbacks**: To expand its utility across varied business forms, OpenIMServer offers callback capabilities. That is, it sends a request to the business server before or after an event occurs, such as sending a message, enriching the interaction and data exchange flow in the communication processes.
|
||||
|
||||
👉 **[Learn More](https://doc.rentsoft.cn/guides/introduction/product)**
|
||||
👉 **[Learn More](https://docs.openim.io/guides/introduction/product)**
|
||||
|
||||
<!--
|
||||
|
||||
@@ -100,6 +97,10 @@ It's crafted in Golang and supports cross-platform deployment, ensuring a cohere
|
||||
|
||||
## :rocket: Quick Start
|
||||
|
||||
We support many platforms. Here are the addresses for quick experience on the web side:
|
||||
|
||||
👉 **[OpenIM online web demo](https://web-enterprise.rentsoft.cn/)**
|
||||
|
||||
You can quickly learn OpenIM engineering solutions, all it takes is one simple command:
|
||||
|
||||
```bash
|
||||
@@ -118,7 +119,7 @@ It is recommended to use Docker Compose for deployment, which can easily and qui
|
||||
|
||||
> **Note**
|
||||
>
|
||||
> If you don't know OpenIM's versioning policy, 📚Read our release policy: https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md
|
||||
> If you don't know OpenIM's versioning policy, 📚Read our release policy: https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/version.md
|
||||
|
||||
|
||||
</details>
|
||||
@@ -133,7 +134,7 @@ Ur need `Go 1.20` or higher version, and `make`.
|
||||
go version && make --version || echo "Error: One of the commands failed."
|
||||
```
|
||||
|
||||
Version Details: https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md
|
||||
Version Details: https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/version.md
|
||||
|
||||
You can get the version number from the command below or from [github releases](https://github.com/openimsdk/open-im-server/tags).
|
||||
|
||||
@@ -141,7 +142,7 @@ You can get the version number from the command below or from [github releases](
|
||||
$ curl --silent "https://api.github.com/repos/openimsdk/open-im-server/releases" | jq -r '.[].tag_name'
|
||||
```
|
||||
|
||||
We have our own version management policy, if you are interested in our version management, I recommend reading [📚 OpenIM Version](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md), We recommend using stable versions such as `v3.3.0` and `v3.2.0` whenever possible. `v3.1.1-alpha.3` as well as `v3.3.0-beta.0` and `v3.2.0-rc.0` are pre-release or beta versions and are not recommended.
|
||||
We have our own version management policy, if you are interested in our version management, I recommend reading [📚 OpenIM Version](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/version.md), We recommend using stable versions such as `v3.3.0` and `v3.2.0` whenever possible. `v3.1.1-alpha.3` as well as `v3.3.0-beta.0` and `v3.2.0-rc.0` are pre-release or beta versions and are not recommended.
|
||||
|
||||
Set `OPENIM_VERSION` environment variables for the latest `OPENIM_VERSION` number, or replace the `OPENIM_VERSION` for you to install the OpenIM-Server `OPENIM_VERSION`:
|
||||
|
||||
@@ -179,8 +180,9 @@ Read: Configuration center document:https://github.com/openimsdk/open-im-serve
|
||||
</details>
|
||||
-->
|
||||
|
||||
+ **[Source Code Deployment Guide](https://doc.rentsoft.cn/guides/gettingStarted/imSourceCodeDeployment)**
|
||||
+ **[Docker Deployment Guide](https://doc.rentsoft.cn/guides/gettingStarted/dockerCompose)**
|
||||
+ **[Source Code Deployment Guide](https://docs.openim.io/guides/gettingStarted/imSourceCodeDeployment)**
|
||||
+ **[Production deployment of Linux systems](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/install-openim-linux-system.md)**
|
||||
+ **[Docker Deployment Guide](https://docs.openim.io/guides/gettingStarted/dockerCompose)**
|
||||
+ **[Kubernetes Deployment Guide](https://github.com/openimsdk/open-im-server/tree/main/deployments)**
|
||||
|
||||
<!--
|
||||
@@ -198,22 +200,42 @@ Delve into the heart of Open-IM-Server's functionality with our architecture dia
|
||||
|
||||
## :hammer_and_wrench: To start developing OpenIM
|
||||
|
||||
[](https://vscode.dev/github/openimsdk/open-im-server)
|
||||
|
||||
OpenIM Our goal is to build a top-level open source community. We have a set of standards, in the [Community repository](https://github.com/OpenIMSDK/community).
|
||||
|
||||
If you'd like to contribute to this Open-IM-Server repository, please read our [contributor documentation](https://github.com/openimsdk/open-im-server/blob/main/CONTRIBUTING.md).
|
||||
|
||||
Before you start, please make sure your changes are in demand. The best for that is to create a [new discussion](https://github.com/openimsdk/open-im-server/discussions/new/choose) OR [Slack Communication](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q), or if you find an issue, [report it](https://github.com/openimsdk/open-im-server/issues/new/choose) first.
|
||||
|
||||
- [Code Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/go_code.md)
|
||||
- [Docker Images Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md)
|
||||
- [Directory Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/directory.md)
|
||||
- [Commit Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/commit.md)
|
||||
- [Versioning Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md)
|
||||
- [Interface Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/api.md)
|
||||
- [Log Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/logging.md)
|
||||
- [Error Code Standards](https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/error_code.md)
|
||||
- [OpenIM configuration and environment variable Settings](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md)
|
||||
|
||||
- [OpenIM API Reference](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/api.md)
|
||||
- [OpenIM Bash Logging](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/bash-log.md)
|
||||
- [OpenIM CI/CD Actions](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/cicd-actions.md)
|
||||
- [OpenIM Code Conventions](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/code-conventions.md)
|
||||
- [OpenIM Commit Guidelines](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/commit.md)
|
||||
- [OpenIM Development Guide](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/development.md)
|
||||
- [OpenIM Directory Structure](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/directory.md)
|
||||
- [OpenIM Environment Setup](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/environment.md)
|
||||
- [OpenIM Error Code Reference](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/error-code.md)
|
||||
- [OpenIM Git Workflow](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/git-workflow.md)
|
||||
- [OpenIM Git Cherry Pick Guide](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/gitcherry-pick.md)
|
||||
- [OpenIM GitHub Workflow](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/github-workflow.md)
|
||||
- [OpenIM Go Code Standards](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/go-code.md)
|
||||
- [OpenIM Image Guidelines](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/images.md)
|
||||
- [OpenIM Initial Configuration](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/init-config.md)
|
||||
- [OpenIM Docker Installation Guide](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/install-docker.md)
|
||||
- [OpenIM OpenIM Linux System Installation](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/install-openim-linux-system.md)
|
||||
- [OpenIM Linux Development Guide](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/linux-development.md)
|
||||
- [OpenIM Local Actions Guide](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/local-actions.md)
|
||||
- [OpenIM Logging Conventions](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/logging.md)
|
||||
- [OpenIM Offline Deployment](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/offline-deployment.md)
|
||||
- [OpenIM Protoc Tools](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/protoc-tools.md)
|
||||
- [OpenIM Testing Guide](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/test.md)
|
||||
- [OpenIM Utility Go](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/util-go.md)
|
||||
- [OpenIM Makefile Utilities](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/util-makefile.md)
|
||||
- [OpenIM Script Utilities](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/util-scripts.md)
|
||||
- [OpenIM Versioning](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/version.md)
|
||||
- [Manage backend and monitor deployment](https://github.com/openimsdk/open-im-server/tree/main/docs/contrib/prometheus-grafana.md)
|
||||
|
||||
## :busts_in_silhouette: Community
|
||||
|
||||
|
||||
+25
-126
@@ -3,12 +3,36 @@
|
||||
|
||||
before:
|
||||
hooks:
|
||||
- make clean
|
||||
# You may remove this if you don't use go modules.
|
||||
- make tidy
|
||||
- make copyright.add
|
||||
# you may remove this if you don't need go generate
|
||||
- go generate ./...
|
||||
|
||||
git:
|
||||
# What should be used to sort tags when gathering the current and previous
|
||||
# tags if there are more than one tag in the same commit.
|
||||
#
|
||||
# Default: '-version:refname'
|
||||
tag_sort: -version:creatordate
|
||||
|
||||
# What should be used to specify prerelease suffix while sorting tags when gathering
|
||||
# the current and previous tags if there are more than one tag in the same commit.
|
||||
#
|
||||
# Since: v1.17
|
||||
prerelease_suffix: "-"
|
||||
|
||||
# Tags to be ignored by GoReleaser.
|
||||
# This means that GoReleaser will not pick up tags that match any of the
|
||||
# provided values as either previous or current tags.
|
||||
#
|
||||
# Templates: allowed.
|
||||
# Since: v1.21.
|
||||
ignore_tags:
|
||||
- nightly
|
||||
# - "{{.Env.IGNORE_TAG}}"
|
||||
|
||||
snapshot:
|
||||
name_template: "{{ incpatch .Version }}-next"
|
||||
|
||||
@@ -255,131 +279,6 @@ builds:
|
||||
- "6"
|
||||
- "7"
|
||||
|
||||
- binary: infra
|
||||
id: infra
|
||||
main: ./tools/infra/infra.go
|
||||
goos:
|
||||
- darwin
|
||||
- windows
|
||||
- linux
|
||||
goarch:
|
||||
- s390x
|
||||
- mips64
|
||||
- mips64le
|
||||
- amd64
|
||||
- ppc64le
|
||||
- arm64
|
||||
goarm:
|
||||
- "6"
|
||||
- "7"
|
||||
|
||||
- binary: ncpu
|
||||
id: ncpu
|
||||
main: ./tools/ncpu/ncpu.go
|
||||
goos:
|
||||
- darwin
|
||||
- windows
|
||||
- linux
|
||||
goarch:
|
||||
- s390x
|
||||
- mips64
|
||||
- mips64le
|
||||
- amd64
|
||||
- ppc64le
|
||||
- arm64
|
||||
goarm:
|
||||
- "6"
|
||||
- "7"
|
||||
|
||||
- binary: openim-web
|
||||
id: openim-web
|
||||
main: ./tools/openim-web/openim-web.go
|
||||
goos:
|
||||
- darwin
|
||||
- windows
|
||||
- linux
|
||||
goarch:
|
||||
- s390x
|
||||
- mips64
|
||||
- mips64le
|
||||
- amd64
|
||||
- ppc64le
|
||||
- arm64
|
||||
goarm:
|
||||
- "6"
|
||||
- "7"
|
||||
|
||||
- binary: component
|
||||
id: component
|
||||
main: ./tools/component/component.go
|
||||
goos:
|
||||
- darwin
|
||||
- windows
|
||||
- linux
|
||||
goarch:
|
||||
- s390x
|
||||
- mips64
|
||||
- mips64le
|
||||
- amd64
|
||||
- ppc64le
|
||||
- arm64
|
||||
goarm:
|
||||
- "6"
|
||||
- "7"
|
||||
|
||||
- binary: versionchecker
|
||||
id: versionchecker
|
||||
main: ./tools/versionchecker/versionchecker.go
|
||||
goos:
|
||||
- darwin
|
||||
- windows
|
||||
- linux
|
||||
goarch:
|
||||
- s390x
|
||||
- mips64
|
||||
- mips64le
|
||||
- amd64
|
||||
- ppc64le
|
||||
- arm64
|
||||
goarm:
|
||||
- "6"
|
||||
- "7"
|
||||
|
||||
- binary: changelog
|
||||
id: changelog
|
||||
main: ./tools/changelog/changelog.go
|
||||
goos:
|
||||
- darwin
|
||||
- windows
|
||||
- linux
|
||||
goarch:
|
||||
- s390x
|
||||
- mips64
|
||||
- mips64le
|
||||
- amd64
|
||||
- ppc64le
|
||||
- arm64
|
||||
goarm:
|
||||
- "6"
|
||||
- "7"
|
||||
|
||||
- binary: yamlfmt
|
||||
id: yamlfmt
|
||||
main: ./tools/yamlfmt/yamlfmt.go
|
||||
goos:
|
||||
- darwin
|
||||
- windows
|
||||
- linux
|
||||
goarch:
|
||||
- s390x
|
||||
- mips64
|
||||
- mips64le
|
||||
- amd64
|
||||
- ppc64le
|
||||
- arm64
|
||||
goarm:
|
||||
- "6"
|
||||
- "7"
|
||||
|
||||
# TODO:Need a script, such as the init - release to help binary to find the right directory
|
||||
# ,which can be compiled binary
|
||||
@@ -620,4 +519,4 @@ checksum:
|
||||
algorithm: sha256
|
||||
|
||||
release:
|
||||
prerelease: auto
|
||||
prerelease: auto
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM BASE_IMAGE
|
||||
|
||||
WORKDIR ${SERVER_WORKDIR}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||
|
||||
# Set go mod installation source and proxy
|
||||
|
||||
FROM golang:1.20 AS builder
|
||||
|
||||
ARG GO111MODULE=on
|
||||
ARG GOPROXY=https://goproxy.cn,direct
|
||||
|
||||
WORKDIR /openim/openim-server
|
||||
|
||||
ENV GO111MODULE=$GO111MODULE
|
||||
ENV GOPROXY=$GOPROXY
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN make build BINS=openim-rpc-encryption
|
||||
|
||||
RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-encryption /usr/bin/openim-rpc-encryption
|
||||
|
||||
# FROM ghcr.io/openim-sigs/openim-bash-image:latest
|
||||
FROM ghcr.io/openim-sigs/openim-bash-image:latest
|
||||
|
||||
WORKDIR /openim/openim-server
|
||||
|
||||
COPY --from=builder /usr/bin/openim-rpc-encryption ./bin/openim-rpc-encryption
|
||||
|
||||
ENTRYPOINT ["./bin/openim-rpc-encryption"]
|
||||
@@ -0,0 +1,45 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||
|
||||
# Set go mod installation source and proxy
|
||||
|
||||
FROM golang:1.20 AS builder
|
||||
|
||||
ARG GO111MODULE=on
|
||||
ARG GOPROXY=https://goproxy.cn,direct
|
||||
|
||||
WORKDIR /openim/openim-server
|
||||
|
||||
ENV GO111MODULE=$GO111MODULE
|
||||
ENV GOPROXY=$GOPROXY
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN make build BINS=openim-rpc-extend-msg
|
||||
|
||||
RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-extend-msg /usr/bin/openim-rpc-extend-msg
|
||||
|
||||
# FROM ghcr.io/openim-sigs/openim-bash-image:latest
|
||||
FROM ghcr.io/openim-sigs/openim-bash-image:latest
|
||||
|
||||
WORKDIR /openim/openim-server
|
||||
|
||||
COPY --from=builder /usr/bin/openim-rpc-extend-msg ./bin/openim-rpc-extend-msg
|
||||
|
||||
ENTRYPOINT ["./bin/openim-rpc-extend-msg"]
|
||||
+42
-15
@@ -18,18 +18,25 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strconv"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/discovery_register"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/OpenIMSDK/protocol/constant"
|
||||
"github.com/OpenIMSDK/tools/discoveryregistry"
|
||||
"github.com/OpenIMSDK/tools/log"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/internal/api"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/db/cache"
|
||||
kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister"
|
||||
ginProm "github.com/openimsdk/open-im-server/v3/pkg/common/ginprometheus"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -42,19 +49,18 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
func run(port int) error {
|
||||
log.ZInfo(context.Background(), "Openim api port:", "port", port)
|
||||
func run(port int, proPort int) error {
|
||||
log.ZInfo(context.Background(), "Openim api port:", "port", port, "proPort", proPort)
|
||||
|
||||
if port == 0 {
|
||||
err := "port is empty"
|
||||
if port == 0 || proPort == 0 {
|
||||
err := "port or proPort is empty:" + strconv.Itoa(port) + "," + strconv.Itoa(proPort)
|
||||
log.ZError(context.Background(), err, nil)
|
||||
|
||||
return fmt.Errorf(err)
|
||||
}
|
||||
|
||||
rdb, err := cache.NewRedis()
|
||||
if err != nil {
|
||||
log.ZError(context.Background(), "Failed to initialize Redis", err)
|
||||
|
||||
return err
|
||||
}
|
||||
log.ZInfo(context.Background(), "api start init discov client")
|
||||
@@ -62,26 +68,32 @@ func run(port int) error {
|
||||
var client discoveryregistry.SvcDiscoveryRegistry
|
||||
|
||||
// Determine whether zk is passed according to whether it is a clustered deployment
|
||||
client, err = discovery_register.NewDiscoveryRegister(config.Config.Envs.Discovery)
|
||||
client, err = kdisc.NewDiscoveryRegister(config.Config.Envs.Discovery)
|
||||
if err != nil {
|
||||
log.ZError(context.Background(), "Failed to initialize discovery register", err)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
if err = client.CreateRpcRootNodes(config.Config.GetServiceNames()); err != nil {
|
||||
log.ZError(context.Background(), "Failed to create RPC root nodes", err)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
log.ZInfo(context.Background(), "api register public config to discov")
|
||||
if err = client.RegisterConf2Registry(constant.OpenIMCommonConfigKey, config.Config.EncodeConfig()); err != nil {
|
||||
log.ZError(context.Background(), "Failed to register public config to discov", err)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
log.ZInfo(context.Background(), "api register public config to discov success")
|
||||
router := api.NewGinRouter(client, rdb)
|
||||
if config.Config.Prometheus.Enable {
|
||||
p := ginProm.NewPrometheus("app", prommetrics.GetGinCusMetrics("Api"))
|
||||
p.SetListenAddress(fmt.Sprintf(":%d", proPort))
|
||||
p.Use(router)
|
||||
}
|
||||
log.ZInfo(context.Background(), "api init router success")
|
||||
|
||||
var address string
|
||||
if config.Config.Api.ListenIP != "" {
|
||||
address = net.JoinHostPort(config.Config.Api.ListenIP, strconv.Itoa(port))
|
||||
@@ -90,10 +102,25 @@ func run(port int) error {
|
||||
}
|
||||
log.ZInfo(context.Background(), "start api server", "address", address, "OpenIM version", config.Version)
|
||||
|
||||
err = router.Run(address)
|
||||
if err != nil {
|
||||
log.ZError(context.Background(), "api run failed", err, "address", address)
|
||||
server := http.Server{Addr: address, Handler: router}
|
||||
go func() {
|
||||
err = server.ListenAndServe()
|
||||
if err != nil && err != http.ErrServerClosed {
|
||||
log.ZError(context.Background(), "api run failed", err, "address", address)
|
||||
os.Exit(1)
|
||||
}
|
||||
}()
|
||||
|
||||
sigs := make(chan os.Signal, 1)
|
||||
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
|
||||
<-sigs
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||
defer cancel()
|
||||
|
||||
// graceful shutdown operation.
|
||||
if err := server.Shutdown(ctx); err != nil {
|
||||
log.ZError(context.Background(), "failed to api-server shutdown", err)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ func main() {
|
||||
msgGatewayCmd.AddWsPortFlag()
|
||||
msgGatewayCmd.AddPortFlag()
|
||||
msgGatewayCmd.AddPrometheusPortFlag()
|
||||
|
||||
if err := msgGatewayCmd.Exec(); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import (
|
||||
func main() {
|
||||
msgTransferCmd := cmd.NewMsgTransferCmd()
|
||||
msgTransferCmd.AddPrometheusPortFlag()
|
||||
msgTransferCmd.AddTransferProgressFlag()
|
||||
if err := msgTransferCmd.Exec(); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
# OpenIM Configuration Guide
|
||||
|
||||
<!-- vscode-markdown-toc -->
|
||||
* 1. [Directory Structure and File Descriptions](#DirectoryStructureandFileDescriptions)
|
||||
* 1.1. [Directory Structure](#DirectoryStructure)
|
||||
* 1.2. [Directory Structure Explanation](#DirectoryStructureExplanation)
|
||||
* 2. [File Descriptions](#FileDescriptions)
|
||||
* 2.1. [Files in the Root Directory](#FilesintheRootDirectory)
|
||||
* 2.2. [Files in the `templates/` Directory](#FilesinthetemplatesDirectory)
|
||||
* 3. [Configuration File Generation](#ConfigurationFileGeneration)
|
||||
* 3.1. [How to Use `init-config.sh` Script](#HowtoUseinit-config.shScript)
|
||||
* 3.2. [Examples of Operations](#ExamplesofOperations)
|
||||
* 3.3. [Points to Note](#PointstoNote)
|
||||
* 4. [Example Directory](#ExampleDirectory)
|
||||
* 4.1. [Overview](#Overview)
|
||||
* 4.2. [Structure](#Structure)
|
||||
* 4.3. [How to Use These Examples](#HowtoUseTheseExamples)
|
||||
* 4.4. [Tips for Using Example Files:](#TipsforUsingExampleFiles:)
|
||||
* 5. [Configuration Item Descriptions](#ConfigurationItemDescriptions)
|
||||
* 6. [Version Management and Upgrading](#VersionManagementandUpgrading)
|
||||
* 6.1. [Pulling the Latest Code](#PullingtheLatestCode)
|
||||
* 6.2. [Generating the Latest Example Configuration Files](#GeneratingtheLatestExampleConfigurationFiles)
|
||||
* 6.3. [Comparing Configuration File Differences](#ComparingConfigurationFileDifferences)
|
||||
* 6.4. [Updating Configuration Files](#UpdatingConfigurationFiles)
|
||||
* 6.5. [Updating Binary Files and Restarting Services](#UpdatingBinaryFilesandRestartingServices)
|
||||
* 6.6. [Best Practices for Version Management](#BestPracticesforVersionManagement)
|
||||
* 7. [How to Contribute](#HowtoContribute)
|
||||
* 7.1. [OpenIM Configuration Item Descriptions](#OpenIMConfigurationItemDescriptions)
|
||||
* 7.2. [Modifying Template Files](#ModifyingTemplateFiles)
|
||||
* 7.3. [Updating Configuration Center Scripts](#UpdatingConfigurationCenterScripts)
|
||||
* 7.4. [Configuration File Generation Process](#ConfigurationFileGenerationProcess)
|
||||
* 7.5. [Contribution Guidelines](#ContributionGuidelines)
|
||||
* 7.6. [Submission and Review](#SubmissionandReview)
|
||||
|
||||
<!-- vscode-markdown-toc-config
|
||||
numbering=true
|
||||
autoSave=true
|
||||
/vscode-markdown-toc-config -->
|
||||
<!-- /vscode-markdown-toc -->
|
||||
|
||||
|
||||
## 1. <a name='DirectoryStructureandFileDescriptions'></a>Directory Structure and File Descriptions
|
||||
|
||||
This document details the structure of the `config` directory, aiding users in understanding and managing configuration files.
|
||||
|
||||
### 1.1. <a name='DirectoryStructure'></a>Directory Structure
|
||||
|
||||
```bash
|
||||
$ tree config
|
||||
├── alertmanager.yml
|
||||
├── config.yaml
|
||||
├── email.tmpl
|
||||
├── instance-down-rules.yml
|
||||
├── notification.yaml
|
||||
├── prometheus.yml
|
||||
├── Readme.md
|
||||
└── templates
|
||||
├── alertmanager.yml.template
|
||||
├── config.yaml.template
|
||||
├── email.tmpl.template
|
||||
├── env.template
|
||||
├── instance-down-rules.yml.template
|
||||
├── notification.yaml.template
|
||||
├── open-im-ng-example.conf
|
||||
├── prometheus-dashboard.yaml
|
||||
└── prometheus.yml.template
|
||||
```
|
||||
|
||||
### 1.2. <a name='DirectoryStructureExplanation'></a>Directory Structure Explanation
|
||||
|
||||
- **Root Directory (`config/`)**: Contains actual configuration files and the `templates` subdirectory.
|
||||
- **`templates/` Subdirectory**: Stores configuration templates for generating or updating configuration files in the root directory.
|
||||
|
||||
## 2. <a name='FileDescriptions'></a>File Descriptions
|
||||
|
||||
### 2.1. <a name='FilesintheRootDirectory'></a>Files in the Root Directory
|
||||
|
||||
- **`alertmanager.yml`**: Configuration file for AlertManager, managing and setting up the alert system.
|
||||
- **`config.yaml`**: The main application configuration file, covering service settings.
|
||||
- **`email.tmpl`**: Template file for email notifications, defining email format and content.
|
||||
- **`instance-down-rules.yml`**: Instance downtime rules configuration file for the monitoring system.
|
||||
- **`notification.yaml`**: Configuration file for notification settings, defining different types of notifications.
|
||||
- **`prometheus.yml`**: Configuration file for the Prometheus monitoring system, setting monitoring metrics and rules.
|
||||
|
||||
### 2.2. <a name='FilesinthetemplatesDirectory'></a>Files in the `templates/` Directory
|
||||
|
||||
- **`alertmanager.yml.template`**: Template for AlertManager configuration.
|
||||
- **`config.yaml.template`**: Main configuration template for the application.
|
||||
- **`email.tmpl.template`**: Template for email notifications.
|
||||
- **`env.template`**: Template for environmental variable configurations, setting environment-related configurations.
|
||||
- **`instance-down-rules.yml.template`**: Template for instance downtime rules.
|
||||
- **`notification.yaml.template`**: Template for notification settings.
|
||||
- **`open-im-ng-example.conf`**: Example configuration file for the application.
|
||||
- **`prometheus-dashboard.yaml`**: Prometheus dashboard configuration file, specific to the OpenIM application.
|
||||
- **`prometheus.yml.template`**: Template for Prometheus configuration.
|
||||
|
||||
## 3. <a name='ConfigurationFileGeneration'></a>Configuration File Generation
|
||||
|
||||
Configuration files can be automatically generated using the `make init` command or the `./scripts/init-config.sh` script. These scripts conveniently extract templates from the `templates` directory and generate or update actual configuration files in the root directory.
|
||||
|
||||
### 3.1. <a name='HowtoUseinit-config.shScript'></a>How to Use `init-config.sh` Script
|
||||
|
||||
```bash
|
||||
$ ./scripts/init-config.sh --help
|
||||
Usage: init-config.sh [options]
|
||||
Options:
|
||||
-h, --help Show this help message
|
||||
--force Overwrite existing files without prompt
|
||||
--skip Skip generation if file exists
|
||||
--examples Generate example files
|
||||
--clean-config Clean all configuration files
|
||||
--clean-examples Clean all example files
|
||||
```
|
||||
|
||||
### 3.2. <a name='ExamplesofOperations'></a>Examples of Operations
|
||||
|
||||
- Generate all template configuration files:
|
||||
|
||||
```bash
|
||||
$ ./scripts/init-config.sh --examples
|
||||
```
|
||||
|
||||
- Force overwrite existing configuration files:
|
||||
|
||||
```bash
|
||||
$ ./scripts/init-config.sh --force
|
||||
```
|
||||
|
||||
### 3.3. <a name='PointstoNote'></a>Points to Note
|
||||
|
||||
- **Template files should not be directly modified**: Files in the `template` directory are templates included in source code management. Direct modification may lead to version conflicts or management issues.
|
||||
- **Operations for Windows Users**: Windows users can use the `cp` command to copy files from the `template` directory to the `config/` directory and then modify the configuration items as needed.
|
||||
|
||||
## 4. <a name='ExampleDirectory'></a>Example Directory
|
||||
|
||||
Welcome to our project's `examples` directory! This directory contains a range of example files, showcasing various configurations and settings of our software. These examples are intended to provide you with templates that can serve as a starting point for your own configurations.
|
||||
|
||||
### 4.1. <a name='Overview'></a>Overview
|
||||
|
||||
In this directory, you'll find examples suitable for a variety of use cases. Each file is a template with default values and configurations, demonstrating best practices and typical scenarios. Whether you're just getting started or looking to implement complex settings, these examples should help you get on the right track.
|
||||
|
||||
### 4.2. <a name='Structure'></a>Structure
|
||||
|
||||
Here's a quick overview of the contents in this directory:
|
||||
|
||||
- `env-example.yaml`: Demonstrates how to set up environmental variables.
|
||||
- `openim-example.yaml`: Example configuration file for the OpenIM application.
|
||||
- `prometheus-example.yml`: Example configuration for monitoring with Prometheus.
|
||||
- `alertmanager-example.yml`: Template for setting up Alertmanager configuration.
|
||||
|
||||
### 4.3. <a name='HowtoUseTheseExamples'></a>How to Use These Examples
|
||||
|
||||
To use these examples, simply copy the relevant files to your working directory and rename them as needed (for example, removing the `-example` suffix). Then, modify the files according to your needs.
|
||||
|
||||
### 4.4. <a name='TipsforUsingExampleFiles:'></a>Tips for Using Example Files:
|
||||
|
||||
1. **Read Comments**: Each file contains comments explaining the various sections and settings. Make sure to read these comments for a better understanding of how to customize the file.
|
||||
2. **Check Required Changes**: Some examples might require mandatory changes before they can be used effectively (such as setting specific environmental variables).
|
||||
3. **Version Compatibility**: Ensure that the example files are compatible with the version of the software you are using.
|
||||
|
||||
## 5. <a name='ConfigurationItemDescriptions'></a>Configuration Item Descriptions
|
||||
|
||||
## 6. <a name='VersionManagementandUpgrading'></a>Version Management and Upgrading
|
||||
|
||||
When managing and upgrading the `config` directory's versions, it is crucial to ensure that the configuration files in both the local `config/` and `config/templates/` directories are kept in sync. This process can ensure that your configuration files are consistent with the latest standard templates, while also maintaining custom settings.
|
||||
|
||||
### 6.1. <a name='PullingtheLatestCode'></a>Pulling the Latest Code
|
||||
|
||||
First, ensure that your local repository is in sync with the remote repository. This can be achieved by pulling the latest code:
|
||||
|
||||
```bash
|
||||
$ git pull
|
||||
```
|
||||
|
||||
### 6.2. <a name='GeneratingtheLatestExampleConfigurationFiles'></a>Generating the Latest Example Configuration Files
|
||||
|
||||
Next, generate the latest example configuration files. This can be done by running the `init-config.sh` script, using the `--examples` option to generate example files, and the `--skip` option to avoid overwriting existing configuration files:
|
||||
|
||||
```bash
|
||||
$ ./scripts/init-config.sh --examples --skip
|
||||
```
|
||||
|
||||
### 6.3. <a name='ComparingConfigurationFileDifferences'></a>Comparing Configuration File Differences
|
||||
|
||||
Once the latest example configuration files are generated, you need to compare the configuration files in the `config/` and `config/templates/` directories to find any potential differences. This step ensures that you can identify and integrate any important updates or changes. Tools like `diff` can be helpful in completing this step:
|
||||
|
||||
```bash
|
||||
$ diff -ur config/ config/templates/
|
||||
```
|
||||
|
||||
### 6.4. <a name='UpdatingConfigurationFiles'></a>Updating Configuration Files
|
||||
|
||||
Based on the comparison results, manually update the configuration files in the `config/` directory to reflect the latest configurations in `config/templates/`. During this process, ensure to retain any custom configuration settings.
|
||||
|
||||
### 6.5. <a name='UpdatingBinaryFilesandRestartingServices'></a>Updating Binary Files and Restarting Services
|
||||
|
||||
After updating the configuration files, the next step is to update any related binary files. This typically involves downloading and installing the latest version of the application or service. Depending on the specific application or service, this might involve running specific update scripts or directly downloading the latest version from official sources.
|
||||
|
||||
Once the binary files are updated, the services need to be restarted to apply the new configurations. Make sure to conduct necessary checks before restarting to ensure the correctness of the configurations.
|
||||
|
||||
### 6.6. <a name='BestPracticesforVersionManagement'></a>Best Practices for Version Management
|
||||
|
||||
- **Record Changes**: When committing changes to a version control system, ensure to log detailed change logs.
|
||||
- **Stay Synced**: Regularly sync with the remote repository to ensure that your local configurations are in line with the latest developments.
|
||||
- **Backup**: Backup your current configurations before making any significant changes, so that you can revert to a previous state if necessary.
|
||||
|
||||
By following these steps and best practices, you can ensure effective management and smooth upgrading of your `config` directory.
|
||||
|
||||
## 7. <a name='HowtoContribute'></a>How to Contribute
|
||||
|
||||
If you have an understanding of the logic behind OpenIM's configuration generation, then you will clearly know where to make modifications to contribute code.
|
||||
|
||||
### 7.1. <a name='OpenIMConfigurationItemDescriptions'></a>OpenIM Configuration Item Descriptions
|
||||
|
||||
First, it is recommended to read the [OpenIM Configuration Items Document](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md). This will help you understand the roles of various configuration items and how they affect the operation of OpenIM.
|
||||
|
||||
### 7.2. <a name='ModifyingTemplateFiles'></a>Modifying Template Files
|
||||
|
||||
To contribute to OpenIM, focus on the `./deployments/templates` directory. This contains various configuration template files, which are the basis for generating the final configuration files.
|
||||
|
||||
When making modifications, ensure that your changes align with OpenIM's configuration requirements and logic. This may involve adding new template files or modifying existing files to reflect new configuration options or structural changes.
|
||||
|
||||
### 7.3. <a name='UpdatingConfigurationCenterScripts'></a>Updating Configuration Center Scripts
|
||||
|
||||
In addition to modifying template files, pay attention to the `./scripts/install/environment.sh` script. In this script, you may need to add or modify environment variables.
|
||||
|
||||
This script is responsible for defining environment variables that influence configuration generation. Therefore, any new configuration items or modifications to existing items need to be reflected here.
|
||||
|
||||
### 7.4. <a name='ConfigurationFileGenerationProcess'></a>Configuration File Generation Process
|
||||
|
||||
The essence of the `make init` command is to use the environment variables defined in `/scripts/install/environment.sh` to render the template files in the `./deployments/templates` directory, thereby generating the final configuration files.
|
||||
|
||||
When contributing code, ensure that your changes work smoothly in this process and do not cause errors during configuration file generation.
|
||||
|
||||
### 7.5. <a name='ContributionGuidelines'></a>Contribution Guidelines
|
||||
|
||||
- **Code Review**: Ensure your changes have passed code review. This typically means that the code should be clear, easy to understand, and adhere to the project's coding style and best practices.
|
||||
- **Testing**: Before submitting changes, conduct thorough tests to ensure new or modified configurations work as expected and do not negatively impact existing functionalities.
|
||||
- **Documentation**: If you have added a new configuration option or made significant changes to an existing one, update the relevant documentation to assist other users and developers in understanding and utilizing these changes.
|
||||
|
||||
### 7.6. <a name='SubmissionandReview'></a>Submission and Review
|
||||
|
||||
After completing your changes, submit your code to the OpenIM repository in the form of a Pull Request (PR). The PR will be reviewed by the project maintainers and you may be asked to make further modifications or provide additional information.
|
||||
@@ -0,0 +1,47 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
###################### AlertManager Configuration ######################
|
||||
# AlertManager configuration using environment variables
|
||||
#
|
||||
# Resolve timeout
|
||||
# SMTP configuration for sending alerts
|
||||
# Templates for email notifications
|
||||
# Routing configurations for alerts
|
||||
# Receiver configurations
|
||||
global:
|
||||
resolve_timeout: 5m
|
||||
smtp_from: alert@openim.io
|
||||
smtp_smarthost: smtp.163.com:465
|
||||
smtp_auth_username: alert@openim.io
|
||||
smtp_auth_password: YOURAUTHPASSWORD
|
||||
smtp_require_tls: false
|
||||
smtp_hello: xxx监控告警
|
||||
|
||||
templates:
|
||||
- /etc/alertmanager/email.tmpl
|
||||
|
||||
route:
|
||||
group_by: ['alertname']
|
||||
group_wait: 5s
|
||||
group_interval: 5s
|
||||
repeat_interval: 5m
|
||||
receiver: email
|
||||
receivers:
|
||||
- name: email
|
||||
email_configs:
|
||||
- to: 'alert@example.com'
|
||||
html: '{{ template "email.to.html" . }}'
|
||||
headers: { Subject: "[OPENIM-SERVER]Alarm" }
|
||||
send_resolved: true
|
||||
@@ -19,6 +19,9 @@
|
||||
# --| target: config/config.yaml
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
envs:
|
||||
discovery: zookeeper
|
||||
|
||||
###################### Zookeeper ######################
|
||||
# Zookeeper configuration
|
||||
# It's not recommended to modify the schema
|
||||
@@ -26,44 +29,28 @@
|
||||
# Zookeeper address
|
||||
# Zookeeper username
|
||||
# Zookeeper password
|
||||
envs:
|
||||
discovery: zookeeper
|
||||
|
||||
zookeeper:
|
||||
schema: openim
|
||||
address: [ 172.28.0.1:12181 ]
|
||||
username: ''
|
||||
password: ''
|
||||
|
||||
###################### Mysql ######################
|
||||
# MySQL configuration
|
||||
# Currently, only single machine setup is supported
|
||||
#
|
||||
# Maximum number of open connections
|
||||
# Maximum number of idle connections
|
||||
# Maximum lifetime in seconds a connection can be reused
|
||||
# Log level: 1=slient, 2=error, 3=warn, 4=info
|
||||
# Slow query threshold in milliseconds
|
||||
mysql:
|
||||
address: [ 172.28.0.1:13306 ]
|
||||
username: root
|
||||
password: openIM123
|
||||
database: openIM_v3
|
||||
maxOpenConn: 1000
|
||||
maxIdleConn: 100
|
||||
maxLifeTime: 60
|
||||
logLevel: 4
|
||||
slowThreshold: 500
|
||||
|
||||
###################### Mongo ######################
|
||||
# MongoDB configuration
|
||||
# If uri is not empty, it will be used directly
|
||||
#
|
||||
# MongoDB address for standalone setup, Mongos address for sharded cluster setup
|
||||
# Default MongoDB database name
|
||||
# Maximum connection pool size
|
||||
|
||||
# If uri is not empty, it will be used directly for the MongoDB connection.
|
||||
# This is a complete MongoDB URI string.
|
||||
# Example: mongodb://user:password@host1:port1,host2:port2/dbname?options
|
||||
mongo:
|
||||
uri: ''
|
||||
|
||||
# List of MongoDB server addresses.
|
||||
# Used for constructing the MongoDB URI if 'uri' above is empty.
|
||||
# For a standalone setup, specify the address of the single server.
|
||||
# For a sharded cluster, specify the addresses of the Mongos servers.
|
||||
# Example: [ '172.28.0.1:37017', '172.28.0.2:37017' ]
|
||||
# Default MongoDB database name
|
||||
# Maximum connection pool size
|
||||
address: [ 172.28.0.1:37017 ]
|
||||
database: openIM_v3
|
||||
username: root
|
||||
@@ -135,14 +122,14 @@ api:
|
||||
# minio.signEndpoint is minio public network address
|
||||
object:
|
||||
enable: "minio"
|
||||
apiURL: "http://127.0.0.1:10002"
|
||||
apiURL: "http://14.155.64.202:10002"
|
||||
minio:
|
||||
bucket: "openim"
|
||||
endpoint: "http://172.28.0.1:10005"
|
||||
accessKeyID: "root"
|
||||
secretAccessKey: "openIM123"
|
||||
sessionToken: ''
|
||||
signEndpoint: "http://127.0.0.1:10005"
|
||||
signEndpoint: "http://14.155.64.202:10005"
|
||||
publicRead: false
|
||||
cos:
|
||||
bucketURL: https://temp-1252357374.cos.ap-chengdu.myqcloud.com
|
||||
@@ -158,17 +145,24 @@ object:
|
||||
accessKeySecret: ''
|
||||
sessionToken: ''
|
||||
publicRead: false
|
||||
kodo:
|
||||
endpoint: "http://s3.cn-east-1.qiniucs.com"
|
||||
bucket: "demo-9999999"
|
||||
bucketURL: "http://your.domain.com"
|
||||
accessKeyID: ''
|
||||
accessKeySecret: ''
|
||||
sessionToken: ''
|
||||
publicRead: false
|
||||
|
||||
###################### RPC Port Configuration ######################
|
||||
# RPC service ports
|
||||
# These ports are passed into the program by the script and are not recommended to modify
|
||||
# For launching multiple programs, just fill in multiple ports separated by commas
|
||||
# For example, [10110, 10111]
|
||||
rpcPort:
|
||||
rpcPort:
|
||||
openImUserPort: [ 10110 ]
|
||||
openImFriendPort: [ 10120 ]
|
||||
openImMessagePort: [ 10130 ]
|
||||
openImMessageGatewayPort: [ 10140 ]
|
||||
openImGroupPort: [ 10150 ]
|
||||
openImAuthPort: [ 10160 ]
|
||||
openImPushPort: [ 10170 ]
|
||||
@@ -199,7 +193,7 @@ rpcRegisterName:
|
||||
# Whether to output in json format
|
||||
# Whether to include stack trace in logs
|
||||
log:
|
||||
storageLocation: ../../logs/
|
||||
storageLocation: /data/workspaces/open-im-server/logs/
|
||||
rotationTime: 24
|
||||
remainRotationCount: 2
|
||||
remainLogLevel: 6
|
||||
@@ -216,8 +210,8 @@ log:
|
||||
# Websocket connection handshake timeout
|
||||
longConnSvr:
|
||||
openImWsPort: [ 10001 ]
|
||||
openImMessageGatewayPort: [ 10140 ]
|
||||
websocketMaxConnNum: 100000
|
||||
openImMessageGatewayPort: [ 10140 ]
|
||||
websocketMaxMsgLen: 4096
|
||||
websocketTimeout: 10
|
||||
|
||||
@@ -313,14 +307,23 @@ iosPush:
|
||||
# Timeout in seconds
|
||||
# Whether to continue execution if callback fails
|
||||
callback:
|
||||
url:
|
||||
url: ""
|
||||
beforeSendSingleMsg:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeUpdateUserInfoEx:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterUpdateUserInfoEx:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterSendSingleMsg:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeSendGroupMsg:
|
||||
enable: false
|
||||
timeout: 5
|
||||
@@ -328,6 +331,7 @@ callback:
|
||||
afterSendGroupMsg:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
msgModify:
|
||||
enable: false
|
||||
timeout: 5
|
||||
@@ -335,12 +339,15 @@ callback:
|
||||
userOnline:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
userOffline:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
userKickOff:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
offlinePush:
|
||||
enable: false
|
||||
timeout: 5
|
||||
@@ -365,6 +372,10 @@ callback:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterCreateGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeMemberJoinGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
@@ -373,17 +384,130 @@ callback:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterSetGroupMemberInfo:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
setMessageReactionExtensions:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
|
||||
quitGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
killGroupMember:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
dismissGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
joinGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
groupMsgRead:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
singleMsgRead:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
updateUserInfo:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeUserRegister:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterUserRegister:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
transferGroupOwner:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeSetFriendRemark:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterSetFriendRemark:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterGroupMsgRead:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterGroupMsgRevoke:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterJoinGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeInviteUserToGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
joinGroupAfter:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
setGroupInfoAfter:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
setGroupInfoBefore:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
revokeMsgAfter:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
addBlackBefore:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
addFriendAfter:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
addFriendAgreeBefore:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
deleteFriendAfter:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
importFriendsBefore:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
importFriendsAfter:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
removeBlackAfter:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
###################### Prometheus ######################
|
||||
# Prometheus configuration for various services
|
||||
# The number of Prometheus ports per service needs to correspond to rpcPort
|
||||
# The number of ports needs to be consistent with msg_transfer_service_num in script/path_info.sh
|
||||
prometheus:
|
||||
enable: false
|
||||
grafanaUrl: 172.28.0.1:13000
|
||||
apiPrometheusPort: [20100]
|
||||
userPrometheusPort: [ 20110 ]
|
||||
friendPrometheusPort: [ 20120 ]
|
||||
messagePrometheusPort: [ 20130 ]
|
||||
@@ -0,0 +1,16 @@
|
||||
{{ define "email.to.html" }}
|
||||
{{ range .Alerts }}
|
||||
<!-- Begin of OpenIM Alert -->
|
||||
<div style="border:1px solid #ccc; padding:10px; margin-bottom:10px;">
|
||||
<h3>OpenIM Alert</h3>
|
||||
<p><strong>Alert Program:</strong> Prometheus Alert</p>
|
||||
<p><strong>Severity Level:</strong> {{ .Labels.severity }}</p>
|
||||
<p><strong>Alert Type:</strong> {{ .Labels.alertname }}</p>
|
||||
<p><strong>Affected Host:</strong> {{ .Labels.instance }}</p>
|
||||
<p><strong>Affected Service:</strong> {{ .Labels.job }}</p>
|
||||
<p><strong>Alert Subject:</strong> {{ .Annotations.summary }}</p>
|
||||
<p><strong>Trigger Time:</strong> {{ .StartsAt.Format "2006-01-02 15:04:05" }}</p>
|
||||
</div>
|
||||
<!-- End of OpenIM Alert -->
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -17,24 +17,27 @@
|
||||
# ======================================
|
||||
|
||||
# The user for authentication or system operations.
|
||||
# Default: USER=root
|
||||
# Default: OPENIM_USER=root
|
||||
USER=root
|
||||
|
||||
# Password associated with the specified user for authentication.
|
||||
# Default: PASSWORD=openIM123
|
||||
PASSWORD=openIM123
|
||||
|
||||
# Endpoint for the MinIO object storage service.
|
||||
# Default: MINIO_ENDPOINT=http://172.28.0.1:10005
|
||||
MINIO_ENDPOINT=http://172.28.0.1:10005
|
||||
|
||||
# Base URL for the application programming interface (API).
|
||||
# Default: API_URL=http://172.28.0.1:10002
|
||||
API_URL=http://127.0.0.1:10002
|
||||
API_URL=http://14.155.64.202:10002
|
||||
|
||||
# Directory path for storing data files or related information.
|
||||
# Default: DATA_DIR=./
|
||||
DATA_DIR=./
|
||||
DATA_DIR=/data/workspaces/open-im-server
|
||||
|
||||
# Choose the appropriate image address, the default is GITHUB image,
|
||||
# you can choose docker hub, for Chinese users can choose Ali Cloud
|
||||
# export IMAGE_REGISTRY="ghcr.io/openimsdk"
|
||||
# export IMAGE_REGISTRY="openim"
|
||||
# export IMAGE_REGISTRY="registry.cn-hangzhou.aliyuncs.com/openimsdk"
|
||||
IMAGE_REGISTRY=ghcr.io/openimsdk
|
||||
|
||||
# ======================================
|
||||
# ========= Network Configuration ======
|
||||
@@ -48,50 +51,19 @@ DOCKER_BRIDGE_SUBNET=172.28.0.0/16
|
||||
# Default: DOCKER_BRIDGE_GATEWAY=172.28.0.1
|
||||
DOCKER_BRIDGE_GATEWAY=172.28.0.1
|
||||
|
||||
# Address or hostname for the MySQL network.
|
||||
# Default: MYSQL_NETWORK_ADDRESS=172.28.0.2
|
||||
MYSQL_NETWORK_ADDRESS=172.28.0.2
|
||||
|
||||
# Address or hostname for the MongoDB network.
|
||||
# Default: MONGO_NETWORK_ADDRESS=172.28.0.3
|
||||
MONGO_NETWORK_ADDRESS=172.28.0.3
|
||||
|
||||
# Address or hostname for the Redis network.
|
||||
# Default: REDIS_NETWORK_ADDRESS=172.28.0.4
|
||||
REDIS_NETWORK_ADDRESS=172.28.0.4
|
||||
|
||||
# Address or hostname for the Kafka network.
|
||||
# Default: KAFKA_NETWORK_ADDRESS=172.28.0.5
|
||||
KAFKA_NETWORK_ADDRESS=172.28.0.5
|
||||
|
||||
# Address or hostname for the ZooKeeper network.
|
||||
# Default: ZOOKEEPER_NETWORK_ADDRESS=172.28.0.6
|
||||
ZOOKEEPER_NETWORK_ADDRESS=172.28.0.6
|
||||
|
||||
# Address or hostname for the MinIO network.
|
||||
# Default: MINIO_NETWORK_ADDRESS=172.28.0.7
|
||||
MINIO_NETWORK_ADDRESS=172.28.0.7
|
||||
|
||||
# Address or hostname for the OpenIM web network.
|
||||
# Default: OPENIM_WEB_NETWORK_ADDRESS=172.28.0.8
|
||||
OPENIM_WEB_NETWORK_ADDRESS=172.28.0.8
|
||||
|
||||
# Address or hostname for the OpenIM server network.
|
||||
# Default: OPENIM_SERVER_NETWORK_ADDRESS=172.28.0.9
|
||||
OPENIM_SERVER_NETWORK_ADDRESS=172.28.0.9
|
||||
|
||||
# Address or hostname for the OpenIM chat network.
|
||||
# Default: OPENIM_CHAT_NETWORK_ADDRESS=172.28.0.10
|
||||
OPENIM_CHAT_NETWORK_ADDRESS=172.28.0.10
|
||||
|
||||
# Address or hostname for the Prometheus network.
|
||||
# Default: PROMETHEUS_NETWORK_ADDRESS=172.28.0.11
|
||||
PROMETHEUS_NETWORK_ADDRESS=172.28.0.11
|
||||
|
||||
# Address or hostname for the Grafana network.
|
||||
# Default: GRAFANA_NETWORK_ADDRESS=172.28.0.12
|
||||
GRAFANA_NETWORK_ADDRESS=172.28.0.12
|
||||
|
||||
MONGO_NETWORK_ADDRESS=172.28.0.2
|
||||
REDIS_NETWORK_ADDRESS=172.28.0.3
|
||||
KAFKA_NETWORK_ADDRESS=172.28.0.4
|
||||
ZOOKEEPER_NETWORK_ADDRESS=172.28.0.5
|
||||
MINIO_NETWORK_ADDRESS=172.28.0.6
|
||||
OPENIM_WEB_NETWORK_ADDRESS=172.28.0.7
|
||||
OPENIM_SERVER_NETWORK_ADDRESS=172.28.0.8
|
||||
OPENIM_CHAT_NETWORK_ADDRESS=172.28.0.9
|
||||
PROMETHEUS_NETWORK_ADDRESS=172.28.0.10
|
||||
GRAFANA_NETWORK_ADDRESS=172.28.0.11
|
||||
NODE_EXPORTER_NETWORK_ADDRESS=172.28.0.12
|
||||
OPENIM_ADMIN_FRONT_NETWORK_ADDRESS=172.28.0.13
|
||||
ALERT_MANAGER_NETWORK_ADDRESS=172.28.0.14
|
||||
|
||||
# ===============================================
|
||||
# = Component Extension Configuration =
|
||||
@@ -101,38 +73,24 @@ GRAFANA_NETWORK_ADDRESS=172.28.0.12
|
||||
# ----- ZooKeeper Configuration -----
|
||||
# Address or hostname for the ZooKeeper service.
|
||||
# Default: ZOOKEEPER_ADDRESS=172.28.0.1
|
||||
ZOOKEEPER_ADDRESS=172.28.0.6
|
||||
ZOOKEEPER_ADDRESS=172.28.0.5
|
||||
|
||||
# Port for ZooKeeper service.
|
||||
# Default: ZOOKEEPER_PORT=12181
|
||||
ZOOKEEPER_PORT=12181
|
||||
|
||||
# ----- MySQL Configuration -----
|
||||
|
||||
# Address or hostname for the MySQL service.
|
||||
# Default: MYSQL_ADDRESS=172.28.0.1
|
||||
MYSQL_ADDRESS=172.28.0.2
|
||||
|
||||
# Port on which MySQL database service is running.
|
||||
# Default: MYSQL_PORT=13306
|
||||
MYSQL_PORT=13306
|
||||
|
||||
# Password to authenticate with the MySQL database service.
|
||||
# Default: MYSQL_PASSWORD=openIM123
|
||||
MYSQL_PASSWORD=openIM123
|
||||
|
||||
# ----- MongoDB Configuration -----
|
||||
# Address or hostname for the MongoDB service.
|
||||
# Default: MONGO_ADDRESS=172.28.0.1
|
||||
MONGO_ADDRESS=172.28.0.3
|
||||
MONGO_ADDRESS=172.28.0.2
|
||||
|
||||
# Port on which MongoDB service is running.
|
||||
# Default: MONGO_PORT=37017
|
||||
MONGO_PORT=37017
|
||||
# MONGO_PORT=37017
|
||||
|
||||
# Username to authenticate with the MongoDB service.
|
||||
# Default: MONGO_USERNAME=root
|
||||
MONGO_USERNAME=root
|
||||
# MONGO_USERNAME=root
|
||||
|
||||
# Password to authenticate with the MongoDB service.
|
||||
# Default: MONGO_PASSWORD=openIM123
|
||||
@@ -145,7 +103,7 @@ MONGO_DATABASE=openIM_v3
|
||||
# ----- Redis Configuration -----
|
||||
# Address or hostname for the Redis service.
|
||||
# Default: REDIS_ADDRESS=172.28.0.1
|
||||
REDIS_ADDRESS=172.28.0.4
|
||||
REDIS_ADDRESS=172.28.0.3
|
||||
|
||||
# Port on which Redis in-memory data structure store is running.
|
||||
# Default: REDIS_PORT=16379
|
||||
@@ -158,7 +116,10 @@ REDIS_PASSWORD=openIM123
|
||||
# ----- Kafka Configuration -----
|
||||
# Address or hostname for the Kafka service.
|
||||
# Default: KAFKA_ADDRESS=172.28.0.1
|
||||
KAFKA_ADDRESS=172.28.0.5
|
||||
KAFKA_ADDRESS=172.28.0.4
|
||||
|
||||
# Kakfa username to authenticate with the Kafka service.
|
||||
# KAFKA_USERNAME=''
|
||||
|
||||
# Port on which Kafka distributed streaming platform is running.
|
||||
# Default: KAFKA_PORT=19092
|
||||
@@ -179,7 +140,7 @@ KAFKA_OFFLINEMSG_MONGO_TOPIC=offlineMsgToMongoMysql
|
||||
# ----- MinIO Configuration ----
|
||||
# Address or hostname for the MinIO object storage service.
|
||||
# Default: MINIO_ADDRESS=172.28.0.1
|
||||
MINIO_ADDRESS=172.28.0.7
|
||||
MINIO_ADDRESS=172.28.0.6
|
||||
|
||||
# Port on which MinIO object storage service is running.
|
||||
# Default: MINIO_PORT=10005
|
||||
@@ -187,7 +148,7 @@ MINIO_PORT=10005
|
||||
|
||||
# Access key to authenticate with the MinIO service.
|
||||
# Default: MINIO_ACCESS_KEY=root
|
||||
MINIO_ACCESS_KEY=root
|
||||
# MINIO_ACCESS_KEY=root
|
||||
|
||||
# Secret key corresponding to the access key for MinIO authentication.
|
||||
# Default: MINIO_SECRET_KEY=openIM123
|
||||
@@ -196,7 +157,7 @@ MINIO_SECRET_KEY=openIM123
|
||||
# ----- Prometheus Configuration -----
|
||||
# Address or hostname for the Prometheus service.
|
||||
# Default: PROMETHEUS_ADDRESS=172.28.0.1
|
||||
PROMETHEUS_ADDRESS=172.28.0.11
|
||||
PROMETHEUS_ADDRESS=172.28.0.10
|
||||
|
||||
# Port on which Prometheus service is running.
|
||||
# Default: PROMETHEUS_PORT=19090
|
||||
@@ -205,11 +166,11 @@ PROMETHEUS_PORT=19090
|
||||
# ----- Grafana Configuration -----
|
||||
# Address or hostname for the Grafana service.
|
||||
# Default: GRAFANA_ADDRESS=172.28.0.1
|
||||
GRAFANA_ADDRESS=172.28.0.12
|
||||
GRAFANA_ADDRESS=172.28.0.11
|
||||
|
||||
# Port on which Grafana service is running.
|
||||
# Default: GRAFANA_PORT=3000
|
||||
GRAFANA_PORT=3000
|
||||
# Default: GRAFANA_PORT=13000
|
||||
GRAFANA_PORT=13000
|
||||
|
||||
# ======================================
|
||||
# ============ OpenIM Web ===============
|
||||
@@ -225,7 +186,7 @@ OPENIM_WEB_PORT=11001
|
||||
|
||||
# Address or hostname for the OpenIM web service.
|
||||
# Default: OPENIM_WEB_ADDRESS=172.28.0.1
|
||||
OPENIM_WEB_ADDRESS=172.28.0.8
|
||||
OPENIM_WEB_ADDRESS=172.28.0.7
|
||||
|
||||
# ======================================
|
||||
# ========= OpenIM Server ==============
|
||||
@@ -233,7 +194,7 @@ OPENIM_WEB_ADDRESS=172.28.0.8
|
||||
|
||||
# Address or hostname for the OpenIM server.
|
||||
# Default: OPENIM_SERVER_ADDRESS=172.28.0.1
|
||||
OPENIM_SERVER_ADDRESS=172.28.0.9
|
||||
OPENIM_SERVER_ADDRESS=172.28.0.8
|
||||
|
||||
# Port for the OpenIM WebSockets.
|
||||
# Default: OPENIM_WS_PORT=10001
|
||||
@@ -249,12 +210,13 @@ API_OPENIM_PORT=10002
|
||||
# ======================================
|
||||
|
||||
# Branch name for OpenIM chat.
|
||||
# Default: CHAT_BRANCH=main
|
||||
CHAT_BRANCH=main
|
||||
# Default: CHAT_IMAGE_VERSION=main
|
||||
# https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/version.md
|
||||
CHAT_IMAGE_VERSION=main
|
||||
|
||||
# Address or hostname for the OpenIM chat service.
|
||||
# Default: OPENIM_CHAT_ADDRESS=172.28.0.1
|
||||
OPENIM_CHAT_ADDRESS=172.28.0.10
|
||||
OPENIM_CHAT_ADDRESS=172.28.0.9
|
||||
|
||||
# Port for the OpenIM chat API.
|
||||
# Default: OPENIM_CHAT_API_PORT=10008
|
||||
@@ -270,9 +232,29 @@ OPENIM_CHAT_DATA_DIR=./openim-chat/main
|
||||
# ======================================
|
||||
|
||||
# Branch name for OpenIM server.
|
||||
# Default: SERVER_BRANCH=main
|
||||
SERVER_BRANCH=main
|
||||
# Default: SERVER_IMAGE_VERSION=main
|
||||
SERVER_IMAGE_VERSION=main
|
||||
|
||||
# Port for the OpenIM admin API.
|
||||
# Default: OPENIM_ADMIN_API_PORT=10009
|
||||
OPENIM_ADMIN_API_PORT=10009
|
||||
|
||||
# Port for the node exporter.
|
||||
# Default: NODE_EXPORTER_PORT=19100
|
||||
NODE_EXPORTER_PORT=19100
|
||||
|
||||
# Port for the prometheus.
|
||||
# Default: PROMETHEUS_PORT=19090
|
||||
PROMETHEUS_PORT=19090
|
||||
|
||||
# Port for the grafana.
|
||||
# Default: GRAFANA_PORT=13000
|
||||
GRAFANA_PORT=13000
|
||||
|
||||
# Port for the admin front.
|
||||
# Default: OPENIM_ADMIN_FRONT_PORT=11002
|
||||
OPENIM_ADMIN_FRONT_PORT=11002
|
||||
|
||||
# Port for the alertmanager.
|
||||
# Default: ALERT_MANAGER_PORT=19093
|
||||
ALERT_MANAGER_PORT=19093
|
||||
@@ -0,0 +1,36 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
groups:
|
||||
- name: instance_down
|
||||
rules:
|
||||
- alert: InstanceDown
|
||||
expr: up == 0
|
||||
for: 1m
|
||||
labels:
|
||||
severity: critical
|
||||
annotations:
|
||||
summary: "Instance {{ $labels.instance }} down"
|
||||
description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 1 minutes."
|
||||
|
||||
- name: database_insert_failure_alerts
|
||||
rules:
|
||||
- alert: DatabaseInsertFailed
|
||||
expr: (increase(msg_insert_redis_failed_total[5m]) > 0) or (increase(msg_insert_mongo_failed_total[5m]) > 0)
|
||||
for: 1m
|
||||
labels:
|
||||
severity: critical
|
||||
annotations:
|
||||
summary: "Increase in MsgInsertRedisFailedCounter or MsgInsertMongoFailedCounter detected"
|
||||
description: "Either MsgInsertRedisFailedCounter or MsgInsertMongoFailedCounter has increased in the last 5 minutes, indicating failures in message insert operations to Redis or MongoDB,maybe the redis or mongodb is crash."
|
||||
@@ -0,0 +1,354 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Determines if a message should be sent. If set to false, it triggers a silent sync without a message. If true, it requires triggering a conversation.
|
||||
# For rpc notification, send twice: once as a message and once as a notification.
|
||||
# The options field 'isNotification' indicates if it's a notification.
|
||||
groupCreated:
|
||||
isSendMsg: true
|
||||
|
||||
# Reliability level of the message sending.
|
||||
# Set to 1 to send only when online, 2 for guaranteed delivery.
|
||||
reliabilityLevel: 1
|
||||
|
||||
# This setting is effective only when 'isSendMsg' is true.
|
||||
# It controls whether to count unread messages.
|
||||
unreadCount: false
|
||||
|
||||
# Configuration for offline push notifications.
|
||||
offlinePush:
|
||||
# Enables or disables offline push notifications.
|
||||
enable: false
|
||||
|
||||
# Title for the notification when a group is created.
|
||||
title: "create group title"
|
||||
|
||||
# Description for the notification.
|
||||
desc: "create group desc"
|
||||
|
||||
# Additional information for the notification.
|
||||
ext: "create group ext"
|
||||
|
||||
# Content type is not added here.
|
||||
# Content should use a JSON structure conforming to the protobuf format.
|
||||
|
||||
groupInfoSet:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupInfoSet title"
|
||||
desc: "groupInfoSet desc"
|
||||
ext: "groupInfoSet ext"
|
||||
|
||||
|
||||
joinGroupApplication:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "joinGroupApplication title"
|
||||
desc: "joinGroupApplication desc"
|
||||
ext: "joinGroupApplication ext"
|
||||
|
||||
memberQuit:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "memberQuit title"
|
||||
desc: "memberQuit desc"
|
||||
ext: "memberQuit ext"
|
||||
|
||||
groupApplicationAccepted:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupApplicationAccepted title"
|
||||
desc: "groupApplicationAccepted desc"
|
||||
ext: "groupApplicationAccepted ext"
|
||||
|
||||
groupApplicationRejected:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: " title"
|
||||
desc: " desc"
|
||||
ext: " ext"
|
||||
|
||||
|
||||
groupOwnerTransferred:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupOwnerTransferred title"
|
||||
desc: "groupOwnerTransferred desc"
|
||||
ext: "groupOwnerTransferred ext"
|
||||
|
||||
memberKicked:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "memberKicked title"
|
||||
desc: "memberKicked desc"
|
||||
ext: "memberKicked ext"
|
||||
|
||||
memberInvited:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "memberInvited title"
|
||||
desc: "memberInvited desc"
|
||||
ext: "memberInvited ext"
|
||||
|
||||
memberEnter:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "memberEnter title"
|
||||
desc: "memberEnter desc"
|
||||
ext: "memberEnter ext"
|
||||
|
||||
groupDismissed:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupDismissed title"
|
||||
desc: "groupDismissed desc"
|
||||
ext: "groupDismissed ext"
|
||||
|
||||
groupMuted:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupMuted title"
|
||||
desc: "groupMuted desc"
|
||||
ext: "groupMuted ext"
|
||||
|
||||
groupCancelMuted:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupCancelMuted title"
|
||||
desc: "groupCancelMuted desc"
|
||||
ext: "groupCancelMuted ext"
|
||||
defaultTips:
|
||||
tips: "group Cancel Muted"
|
||||
|
||||
|
||||
groupMemberMuted:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupMemberMuted title"
|
||||
desc: "groupMemberMuted desc"
|
||||
ext: "groupMemberMuted ext"
|
||||
|
||||
groupMemberCancelMuted:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupMemberCancelMuted title"
|
||||
desc: "groupMemberCancelMuted desc"
|
||||
ext: "groupMemberCancelMuted ext"
|
||||
|
||||
groupMemberInfoSet:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupMemberInfoSet title"
|
||||
desc: "groupMemberInfoSet desc"
|
||||
ext: "groupMemberInfoSet ext"
|
||||
|
||||
groupInfoSetAnnouncement:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupInfoSetAnnouncement title"
|
||||
desc: "groupInfoSetAnnouncement desc"
|
||||
ext: "groupInfoSetAnnouncement ext"
|
||||
|
||||
|
||||
groupInfoSetName:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupInfoSetName title"
|
||||
desc: "groupInfoSetName desc"
|
||||
ext: "groupInfoSetName ext"
|
||||
|
||||
|
||||
#############################friend#################################
|
||||
friendApplicationAdded:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "Somebody applies to add you as a friend"
|
||||
desc: "Somebody applies to add you as a friend"
|
||||
ext: "Somebody applies to add you as a friend"
|
||||
|
||||
friendApplicationApproved:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "Someone applies to add your friend application"
|
||||
desc: "Someone applies to add your friend application"
|
||||
ext: "Someone applies to add your friend application"
|
||||
|
||||
friendApplicationRejected:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "Someone rejected your friend application"
|
||||
desc: "Someone rejected your friend application"
|
||||
ext: "Someone rejected your friend application"
|
||||
|
||||
friendAdded:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "We have become friends"
|
||||
desc: "We have become friends"
|
||||
ext: "We have become friends"
|
||||
|
||||
friendDeleted:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "deleted a friend"
|
||||
desc: "deleted a friend"
|
||||
ext: "deleted a friend"
|
||||
|
||||
friendRemarkSet:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "Your friend's profile has been changed"
|
||||
desc: "Your friend's profile has been changed"
|
||||
ext: "Your friend's profile has been changed"
|
||||
|
||||
blackAdded:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "blocked a user"
|
||||
desc: "blocked a user"
|
||||
ext: "blocked a user"
|
||||
|
||||
blackDeleted:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "Remove a blocked user"
|
||||
desc: "Remove a blocked user"
|
||||
ext: "Remove a blocked user"
|
||||
|
||||
friendInfoUpdated:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "friend info updated"
|
||||
desc: "friend info updated"
|
||||
ext: "friend info updated"
|
||||
|
||||
#####################user#########################
|
||||
userInfoUpdated:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "Remove a blocked user"
|
||||
desc: "Remove a blocked user"
|
||||
ext: "Remove a blocked user"
|
||||
|
||||
userStatusChanged:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "user status changed"
|
||||
desc: "user status changed"
|
||||
ext: "user status changed"
|
||||
|
||||
#####################conversation#########################
|
||||
conversationChanged:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "conversation changed"
|
||||
desc: "conversation changed"
|
||||
ext: "conversation changed"
|
||||
|
||||
conversationSetPrivate:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "burn after reading"
|
||||
desc: "burn after reading"
|
||||
ext: "burn after reading"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,99 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# my global config
|
||||
global:
|
||||
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
|
||||
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
|
||||
# scrape_timeout is set to the global default (10s).
|
||||
|
||||
# Alertmanager configuration
|
||||
alerting:
|
||||
alertmanagers:
|
||||
- static_configs:
|
||||
- targets: ['172.28.0.1:19093']
|
||||
|
||||
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
|
||||
rule_files:
|
||||
- "instance-down-rules.yml"
|
||||
# - "first_rules.yml"
|
||||
# - "second_rules.yml"
|
||||
|
||||
# A scrape configuration containing exactly one endpoint to scrape:
|
||||
# Here it's Prometheus itself.
|
||||
scrape_configs:
|
||||
# The job name is added as a label "job='job_name'"" to any timeseries scraped from this config.
|
||||
# Monitored information captured by prometheus
|
||||
- job_name: 'node-exporter'
|
||||
static_configs:
|
||||
- targets: [ '172.28.0.1:19100' ]
|
||||
labels:
|
||||
namespace: 'default'
|
||||
|
||||
# prometheus fetches application services
|
||||
- job_name: 'openimserver-openim-api'
|
||||
static_configs:
|
||||
- targets: [ '172.28.0.1:20100' ]
|
||||
labels:
|
||||
namespace: 'default'
|
||||
- job_name: 'openimserver-openim-msggateway'
|
||||
static_configs:
|
||||
- targets: [ '172.28.0.1:20140' ]
|
||||
labels:
|
||||
namespace: 'default'
|
||||
- job_name: 'openimserver-openim-msgtransfer'
|
||||
static_configs:
|
||||
- targets: [ 172.28.0.1:21400, 172.28.0.1:21401, 172.28.0.1:21402, 172.28.0.1:21403 ]
|
||||
labels:
|
||||
namespace: 'default'
|
||||
- job_name: 'openimserver-openim-push'
|
||||
static_configs:
|
||||
- targets: [ '172.28.0.1:20170' ]
|
||||
labels:
|
||||
namespace: 'default'
|
||||
- job_name: 'openimserver-openim-rpc-auth'
|
||||
static_configs:
|
||||
- targets: [ '172.28.0.1:20160' ]
|
||||
labels:
|
||||
namespace: 'default'
|
||||
- job_name: 'openimserver-openim-rpc-conversation'
|
||||
static_configs:
|
||||
- targets: [ '172.28.0.1:20230' ]
|
||||
labels:
|
||||
namespace: 'default'
|
||||
- job_name: 'openimserver-openim-rpc-friend'
|
||||
static_configs:
|
||||
- targets: [ '172.28.0.1:20120' ]
|
||||
labels:
|
||||
namespace: 'default'
|
||||
- job_name: 'openimserver-openim-rpc-group'
|
||||
static_configs:
|
||||
- targets: [ '172.28.0.1:20150' ]
|
||||
labels:
|
||||
namespace: 'default'
|
||||
- job_name: 'openimserver-openim-rpc-msg'
|
||||
static_configs:
|
||||
- targets: [ '172.28.0.1:20130' ]
|
||||
labels:
|
||||
namespace: 'default'
|
||||
- job_name: 'openimserver-openim-rpc-third'
|
||||
static_configs:
|
||||
- targets: [ '172.28.0.1:21301' ]
|
||||
labels:
|
||||
namespace: 'default'
|
||||
- job_name: 'openimserver-openim-rpc-user'
|
||||
static_configs:
|
||||
- targets: [ '172.28.0.1:20110' ]
|
||||
labels:
|
||||
namespace: 'default'
|
||||
@@ -1,119 +0,0 @@
|
||||
# OpenIM 应用容器化部署指南
|
||||
|
||||
OpenIM 支持很多种集群化部署方式,包括但不限于 helm, sealos, kubeam, kubesphere, kubeflow, kuboard, kubespray, k3s, k3d, k3c, k3sup, k3v, k3x
|
||||
|
||||
**目前还在开发这个模块,预计 v3.2.0 之前会有一个集群方案。**
|
||||
|
||||
目前各个贡献者,以及之前的官方有出过一些可以参考的方案:
|
||||
|
||||
- https://github.com/OpenIMSDK/k8s-jenkins
|
||||
- https://github.com/openimsdk/open-im-server-k8s-deploy
|
||||
- https://github.com/OpenIMSDK/openim-charts
|
||||
- https://github.com/showurl/deploy-openim
|
||||
|
||||
|
||||
### 依赖检查
|
||||
|
||||
```bash
|
||||
Kubernetes: >= 1.16.0-0
|
||||
Helm: >= 3.0
|
||||
```
|
||||
|
||||
|
||||
### 最低配置
|
||||
|
||||
建议生产环境的最低配置如下:
|
||||
|
||||
```bash
|
||||
CPU: 4
|
||||
Memory: 8G
|
||||
Disk: 100G
|
||||
```
|
||||
|
||||
## 生成配置文件
|
||||
|
||||
我们将自动文件全部自动化处理了,所以生成配置文件对于 openim 来说是可选的,但是如果你想要自定义配置,可以参考下面的步骤:
|
||||
|
||||
```bash
|
||||
$ make init
|
||||
# 或者是使用脚本:
|
||||
# ./scripts/init-config.sh
|
||||
```
|
||||
此时会帮你在 `deployments/openim/config` 目录下生成配置文件,你可以根据自己的需求进行修改。
|
||||
|
||||
|
||||
## 集群搭建
|
||||
|
||||
如果你已经有了一个 `kubernetes` 集群,或者是你希望自己从头开始搭建一个 `kubernetes` 那么你可以直接跳过这一步。
|
||||
|
||||
为了快速开始,我使用 [sealos](https://github.com/labring/sealos) 来快速搭建集群,sealos 底层也是对 kubeadm 的封装:
|
||||
|
||||
```bash
|
||||
$ SEALOS_VERSION=`curl -s https://api.github.com/repos/labring/sealos/releases/latest | grep -oE '"tag_name": "[^"]+"' | head -n1 | cut -d'"' -f4` && \
|
||||
curl -sfL https://raw.githubusercontent.com/labring/sealos/${SEALOS_VERSION}/scripts/install.sh |
|
||||
sh -s ${SEALOS_VERSION} labring/sealos
|
||||
```
|
||||
|
||||
**支持的版本:**
|
||||
|
||||
+ docker: `labring/kubernetes-docker`:(v1.24.0~v1.27.0)
|
||||
+ containerd: `labring/kubernetes`:(v1.24.0~v1.27.0)
|
||||
|
||||
|
||||
#### 安装集群:
|
||||
|
||||
集群的信息如下:
|
||||
|
||||
| 机器名 | IP地址 | 系统信息 |
|
||||
|---------|-----------------|------------------------------------------------------------------------------------------------------------|
|
||||
| master01| 10.0.0.9 | Linux VM-0-9-ubuntu 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
|
||||
| node01 | 10.0.0.4 | Linux VM-0-9-ubuntu 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
|
||||
| node02 | 10.0.0.10 | Linux VM-0-9-ubuntu 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
|
||||
|
||||
```bash
|
||||
$ export CLUSTER_USERNAME=ubuntu
|
||||
$ export CLUSTER_PASSWORD=123456
|
||||
$ sudo sealos run labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24.1 \
|
||||
--masters 10.0.0.9 \
|
||||
--nodes 10.0.0.4,10.0.0.10 \
|
||||
-u "$CLUSTER_USERNAME" \
|
||||
-p "$CLUSTER_PASSWORD"
|
||||
```
|
||||
|
||||
> **Node**
|
||||
> 卸载的方式:使用 `kubeadm` 卸载并不会清除 `etcd` 和 `cni` 相关,所以需要手动清除,或者使用 `sealos` 卸载。
|
||||
> ```bash
|
||||
> sealos reset
|
||||
> ```
|
||||
|
||||
### 安装 helm
|
||||
|
||||
helm通过打包的方式,支持发布的版本管理和控制,很大程度上简化了Kubernetes应用的部署和管理。
|
||||
|
||||
|
||||
**使用脚本:**
|
||||
|
||||
```bash
|
||||
$ curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||
```
|
||||
|
||||
**添加仓库:**
|
||||
|
||||
```bash
|
||||
$ helm repo add brigade https://openimsdk.github.io/openim-charts
|
||||
```
|
||||
|
||||
### OpenIM 的镜像策略
|
||||
|
||||
自动化提供的 aliyun, ghcr, docker hub: https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md
|
||||
|
||||
**本地化测试构建方法:**
|
||||
|
||||
```bash
|
||||
$ make image
|
||||
```
|
||||
|
||||
|
||||
### 容器化安装
|
||||
|
||||
具体安装步骤如下:
|
||||
@@ -0,0 +1,175 @@
|
||||
# OpenIM Application Containerization Deployment Guide
|
||||
|
||||
OpenIM supports a variety of cluster deployment methods, including but not limited to `helm`, `sealos`, `kustomize`
|
||||
|
||||
Various contributors, as well as previous official releases, have provided some referenceable solutions:
|
||||
|
||||
+ [k8s-jenkins Repository](https://github.com/OpenIMSDK/k8s-jenkins)
|
||||
+ [open-im-server-k8s-deploy Repository](https://github.com/openimsdk/open-im-server-k8s-deploy)
|
||||
+ [openim-charts Repository](https://github.com/OpenIMSDK/openim-charts)
|
||||
+ [deploy-openim Repository](https://github.com/showurl/deploy-openim)
|
||||
|
||||
### Dependency Check
|
||||
|
||||
```bash
|
||||
Kubernetes: >= 1.16.0-0
|
||||
Helm: >= 3.0
|
||||
```
|
||||
|
||||
### Minimum Configuration
|
||||
|
||||
The recommended minimum configuration for a production environment is as follows:
|
||||
|
||||
```yaml
|
||||
CPU: 4
|
||||
Memory: 8G
|
||||
Disk: 100G
|
||||
```
|
||||
|
||||
## Configuration File Generation
|
||||
|
||||
We have automated all the files, making the generation of configuration files optional for OpenIM. However, if you desire custom configurations, you can follow the steps below:
|
||||
|
||||
```bash
|
||||
$ make init
|
||||
# Alternatively, use script:
|
||||
# ./scripts/init-config.sh
|
||||
```
|
||||
|
||||
At this point, configuration files will be generated under `deployments/openim/config`, which you can modify as per your requirements.
|
||||
|
||||
## Cluster Setup
|
||||
|
||||
If you already have a `kubernetes` cluster, or if you wish to build a `kubernetes` cluster from scratch, you can skip this step.
|
||||
|
||||
For a quick start, I used [sealos](https://github.com/labring/sealos) to rapidly set up the cluster, with sealos also being a wrapper for kubeadm at its core:
|
||||
|
||||
```bash
|
||||
$ SEALOS_VERSION=`curl -s https://api.github.com/repos/labring/sealos/releases/latest | grep -oE '"tag_name": "[^"]+"' | head -n1 | cut -d'"' -f4` && \
|
||||
curl -sfL https://raw.githubusercontent.com/labring/sealos/${SEALOS_VERSION}/scripts/install.sh |
|
||||
sh -s ${SEALOS_VERSION} labring/sealos
|
||||
```
|
||||
|
||||
**Supported Versions:**
|
||||
|
||||
+ docker: `labring/kubernetes-docker`:(v1.24.0~v1.27.0)
|
||||
+ containerd: `labring/kubernetes`:(v1.24.0~v1.27.0)
|
||||
|
||||
#### Cluster Installation:
|
||||
|
||||
Cluster details are as follows:
|
||||
|
||||
| Hostname | IP Address | System Info |
|
||||
| -------- | ---------- | ------------------------------------------------------------ |
|
||||
| master01 | 10.0.0.9 | `Linux VM-0-9-ubuntu 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux` |
|
||||
| node01 | 10.0.0.4 | Similar to master01 |
|
||||
| node02 | 10.0.0.10 | Similar to master01 |
|
||||
|
||||
```bash
|
||||
$ export CLUSTER_USERNAME=ubuntu
|
||||
$ export CLUSTER_PASSWORD=123456
|
||||
$ sudo sealos run labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24.1 \
|
||||
--masters 10.0.0.9 \
|
||||
--nodes 10.0.0.4,10.0.0.10 \
|
||||
-u "$CLUSTER_USERNAME" \
|
||||
-p "$CLUSTER_PASSWORD"
|
||||
```
|
||||
|
||||
> **Node** Uninstallation method: using `kubeadm` for uninstallation does not remove `etcd` and `cni` related configurations. Manual clearance or using `sealos` for uninstallation is needed.
|
||||
>
|
||||
> ```bash
|
||||
> $ sealos reset
|
||||
> ```
|
||||
|
||||
If you are local, you can also use Kind and Minikube to test, for example, using Kind:
|
||||
|
||||
```bash
|
||||
$ GO111MODULE="on" go get sigs.k8s.io/kind@v0.11.1
|
||||
$ kind create cluster
|
||||
```
|
||||
|
||||
### Installing helm
|
||||
|
||||
Helm simplifies the deployment and management of Kubernetes applications to a large extent by offering version control and release management through packaging.
|
||||
|
||||
**Using Script:**
|
||||
|
||||
```bash
|
||||
$ curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||
```
|
||||
|
||||
**Adding Repository:**
|
||||
|
||||
```bash
|
||||
$ helm repo add brigade https://openimsdk.github.io/openim-charts
|
||||
```
|
||||
|
||||
### OpenIM Image Strategy
|
||||
|
||||
Automated offerings include aliyun, ghcr, docker hub: [Image Documentation](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/images.md)
|
||||
|
||||
**Local Test Build Method:**
|
||||
|
||||
```bash
|
||||
$ make image
|
||||
```
|
||||
|
||||
> This command assists in quickly building the required images locally. For a detailed build strategy, refer to the [Build Documentation](https://github.com/openimsdk/open-im-server/blob/main/build/README.md).
|
||||
|
||||
## Installation
|
||||
|
||||
Explore our Helm-Charts repository and read through: [Helm-Charts Repository](https://github.com/openimsdk/helm-charts)
|
||||
|
||||
|
||||
Using the helm charts repository, you can ignore the following configuration, but if you want to just use the server and scale on top of it, you can go ahead:
|
||||
|
||||
**Use the Helm template to generate the deployment yaml file: `openim-charts.yaml`**
|
||||
|
||||
**Gen Image:**
|
||||
|
||||
```bash
|
||||
../scripts/genconfig.sh ../scripts/install/environment.sh ./templates/helm-image.yaml > ./charts/generated-configs/helm-image.yaml
|
||||
```
|
||||
|
||||
**Gen Charts:**
|
||||
|
||||
```bash
|
||||
for chart in ./charts/*/; do
|
||||
if [[ "$chart" == *"generated-configs"* || "$chart" == *"helmfile.yaml"* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ -f "${chart}values.yaml" ]; then
|
||||
helm template "$chart" -f "./charts/generated-configs/helm-image.yaml" -f "./charts/generated-configs/config.yaml" -f "./charts/generated-configs/notification.yaml" >> openim-charts.yaml
|
||||
else
|
||||
helm template "$chart" >> openim-charts.yaml
|
||||
fi
|
||||
done
|
||||
```
|
||||
|
||||
**Use Helmfile:**
|
||||
|
||||
```bash
|
||||
GO111MODULE=on go get github.com/roboll/helmfile@latest
|
||||
```
|
||||
|
||||
```bash
|
||||
export MONGO_ADDRESS=im-mongo
|
||||
export MONGO_PORT=27017
|
||||
export REDIS_ADDRESS=im-redis-master
|
||||
export REDIS_PORT=6379
|
||||
export KAFKA_ADDRESS=im-kafka
|
||||
export KAFKA_PORT=9092
|
||||
export OBJECT_APIURL="https://openim.server.com/api"
|
||||
export MINIO_ENDPOINT="http://im-minio:9000"
|
||||
export MINIO_SIGN_ENDPOINT="https://openim.server.com/im-minio-api"
|
||||
|
||||
mkdir ./charts/generated-configs
|
||||
../scripts/genconfig.sh ../scripts/install/environment.sh ./templates/config.yaml > ./charts/generated-configs/config.yaml
|
||||
cp ../config/notification.yaml ./charts/generated-configs/notification.yaml
|
||||
../scripts/genconfig.sh ../scripts/install/environment.sh ./templates/helm-image.yaml > ./charts/generated-configs/helm-image.yaml
|
||||
```
|
||||
|
||||
```bash
|
||||
helmfile apply
|
||||
```
|
||||
@@ -0,0 +1,34 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
{{- define "defaultValues" -}}
|
||||
- ./generated-configs/helm-image.yaml
|
||||
- ./generated-configs/config.yaml
|
||||
- ./generated-configs/notification.yaml
|
||||
{{- end -}}
|
||||
|
||||
{{- define "defaultRelease" -}}
|
||||
namespace: openim
|
||||
chart: ./{{ .name }}
|
||||
values:
|
||||
- ./{{ .name }}/values.yaml
|
||||
{{- template "defaultValues" . }}
|
||||
{{- end -}}
|
||||
|
||||
releases:
|
||||
{{- $apps := list "openim-api" "openim-msggateway" "openim-msgtransfer" "openim-push" "openim-rpc-auth" "openim-rpc-conversation" "openim-rpc-friend" "openim-rpc-group" "openim-rpc-msg" "openim-rpc-third" "openim-rpc-user" }}
|
||||
{{- range $app := $apps }}
|
||||
- name: {{ $app }}
|
||||
{{- template "defaultRelease" dict "name" $app }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,53 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
apiVersion: v2
|
||||
name: openim-api
|
||||
description: A OpenIM Api Helm chart for Kubernetes
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: application
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: "1.16.0"
|
||||
|
||||
icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg
|
||||
|
||||
maintainers:
|
||||
- name: "OpenIM"
|
||||
url: "https://github.com/openimsdk"
|
||||
|
||||
keywords:
|
||||
- openim
|
||||
- im
|
||||
- chat
|
||||
|
||||
sources:
|
||||
- "https://github.com/openimsdk/open-im-server"
|
||||
- "https://github.com/openimsdk/helm-charts"
|
||||
+4
-4
@@ -6,16 +6,16 @@
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-server.fullname" . }})
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-api.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-server.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-server.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-api.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-api.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-server.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-api.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
|
||||
+10
-10
@@ -1,7 +1,7 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "openim-server.name" -}}
|
||||
{{- define "openim-api.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
@@ -10,7 +10,7 @@ Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "openim-server.fullname" -}}
|
||||
{{- define "openim-api.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
@@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "openim-server.chart" -}}
|
||||
{{- define "openim-api.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "openim-server.labels" -}}
|
||||
helm.sh/chart: {{ include "openim-server.chart" . }}
|
||||
{{ include "openim-server.selectorLabels" . }}
|
||||
{{- define "openim-api.labels" -}}
|
||||
helm.sh/chart: {{ include "openim-api.chart" . }}
|
||||
{{ include "openim-api.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
@@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "openim-server.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "openim-server.name" . }}
|
||||
{{- define "openim-api.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "openim-api.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "openim-server.serviceAccountName" -}}
|
||||
{{- define "openim-api.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "openim-server.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- default (include "openim-api.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
+13
-13
@@ -12,16 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
#more datasource-compose.yaml
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Prometheus
|
||||
type: prometheus
|
||||
access: proxy
|
||||
orgId: 1
|
||||
url: http://127.0.0.1:9091
|
||||
basicAuth: false
|
||||
isDefault: true
|
||||
version: 1
|
||||
editable: true
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: openim-cm
|
||||
data:
|
||||
config.yaml: |+
|
||||
{{- with .Values.config }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
notification.yaml: |+
|
||||
{{- with .Values.notification }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
+24
-13
@@ -15,16 +15,16 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "openim-server.fullname" . }}
|
||||
name: {{ include "openim-api.fullname" . }}
|
||||
labels:
|
||||
{{- include "openim-server.labels" . | nindent 4 }}
|
||||
{{- include "openim-api.labels" . | nindent 4 }}
|
||||
spec:
|
||||
{{- if not .Values.autoscaling.enabled }}
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "openim-server.selectorLabels" . | nindent 6 }}
|
||||
{{- include "openim-api.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.podAnnotations }}
|
||||
@@ -32,13 +32,13 @@ spec:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "openim-server.selectorLabels" . | nindent 8 }}
|
||||
{{- include "openim-api.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "openim-server.serviceAccountName" . }}
|
||||
serviceAccountName: {{ include "openim-api.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
@@ -51,16 +51,27 @@ spec:
|
||||
- name: http
|
||||
containerPort: 80
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
#livenessProbe:
|
||||
# httpGet:
|
||||
# path: /
|
||||
# port: http
|
||||
#readinessProbe:
|
||||
# httpGet:
|
||||
# path: /
|
||||
# port: http
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- mountPath: /openim/openim-server/config/config.yaml
|
||||
name: config
|
||||
subPath: config.yaml
|
||||
- mountPath: /openim/openim-server/config/
|
||||
name: config
|
||||
subPath: notification.yaml
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-cm
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
+3
-3
@@ -16,14 +16,14 @@
|
||||
apiVersion: autoscaling/v2beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "openim-server.fullname" . }}
|
||||
name: {{ include "openim-api.fullname" . }}
|
||||
labels:
|
||||
{{- include "openim-server.labels" . | nindent 4 }}
|
||||
{{- include "openim-api.labels" . | nindent 4 }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ include "openim-server.fullname" . }}
|
||||
name: {{ include "openim-api.fullname" . }}
|
||||
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "openim-server.fullname" . -}}
|
||||
{{- $fullName := include "openim-api.fullname" . -}}
|
||||
{{- $svcPort := .Values.service.port -}}
|
||||
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
|
||||
@@ -31,7 +31,7 @@ kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
labels:
|
||||
{{- include "openim-server.labels" . | nindent 4 }}
|
||||
{{- include "openim-api.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
+3
-3
@@ -15,9 +15,9 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "openim-server.fullname" . }}
|
||||
name: {{ include "openim-api.fullname" . }}
|
||||
labels:
|
||||
{{- include "openim-server.labels" . | nindent 4 }}
|
||||
{{- include "openim-api.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
@@ -26,4 +26,4 @@ spec:
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "openim-server.selectorLabels" . | nindent 4 }}
|
||||
{{- include "openim-api.selectorLabels" . | nindent 4 }}
|
||||
+2
-2
@@ -16,9 +16,9 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "openim-server.serviceAccountName" . }}
|
||||
name: {{ include "openim-api.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "openim-server.labels" . | nindent 4 }}
|
||||
{{- include "openim-api.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
@@ -0,0 +1,100 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Default values for openim-api.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: ghcr.io/openimsdk/openim-api
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: ""
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: false
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: "nginx"
|
||||
annotations:
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
hosts:
|
||||
- host: chart-example.local
|
||||
paths:
|
||||
- path: /
|
||||
pathType: ImplementationSpecific
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
# - chart-example.local
|
||||
|
||||
resources: {}
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
autoscaling:
|
||||
enabled: false
|
||||
minReplicas: 1
|
||||
maxReplicas: 100
|
||||
targetCPUUtilizationPercentage: 80
|
||||
# targetMemoryUtilizationPercentage: 80
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
|
||||
notification:
|
||||
|
||||
config:
|
||||
@@ -0,0 +1,23 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
+3
-24
@@ -13,7 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
apiVersion: v2
|
||||
name: openim-server
|
||||
name: openim-msggateway
|
||||
description: A Helm chart for Kubernetes
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
@@ -35,7 +35,7 @@ version: 0.1.0
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: "default"
|
||||
appVersion: "1.16.0"
|
||||
|
||||
icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg
|
||||
|
||||
@@ -50,25 +50,4 @@ keywords:
|
||||
|
||||
sources:
|
||||
- "https://github.com/openimsdk/open-im-server"
|
||||
- "https://github.com/openimsdk/openim-sdk-core"
|
||||
- "https://github.com/openimsdk/openim-docker"
|
||||
|
||||
dependencies:
|
||||
- name: mysql
|
||||
version: 8.0.25
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
- name: redis
|
||||
version: 14.6.1
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
- name: mongodb
|
||||
version: 10.1.0
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
- name: kafka
|
||||
version: 14.1.0
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
- name: minio
|
||||
version: 8.1.2
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
- name: zookeeper
|
||||
version: 5.17.0
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
- "https://github.com/openimsdk/helm-charts"
|
||||
@@ -0,0 +1,22 @@
|
||||
1. Get the application URL by running these commands:
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- range $host := .Values.ingress.hosts }}
|
||||
{{- range .paths }}
|
||||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-msggateway.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-msggateway.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-msggateway.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-msggateway.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
|
||||
{{- end }}
|
||||
@@ -0,0 +1,62 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "openim-msggateway.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "openim-msggateway.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "openim-msggateway.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "openim-msggateway.labels" -}}
|
||||
helm.sh/chart: {{ include "openim-msggateway.chart" . }}
|
||||
{{ include "openim-msggateway.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "openim-msggateway.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "openim-msggateway.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "openim-msggateway.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "openim-msggateway.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,89 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "openim-msggateway.fullname" . }}
|
||||
labels:
|
||||
{{- include "openim-msggateway.labels" . | nindent 4 }}
|
||||
spec:
|
||||
{{- if not .Values.autoscaling.enabled }}
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "openim-msggateway.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "openim-msggateway.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "openim-msggateway.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 80
|
||||
protocol: TCP
|
||||
- name: rpc
|
||||
containerPort: 88
|
||||
protocol: TCP
|
||||
#livenessProbe:
|
||||
# httpGet:
|
||||
# path: /
|
||||
# port: http
|
||||
#readinessProbe:
|
||||
# httpGet:
|
||||
# path: /
|
||||
# port: http
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- mountPath: /openim/openim-server/config/config.yaml
|
||||
name: config
|
||||
subPath: config.yaml
|
||||
- mountPath: /openim/openim-server/config/
|
||||
name: config
|
||||
subPath: notification.yaml
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-cm
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,42 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
{{- if .Values.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "openim-msggateway.fullname" . }}
|
||||
labels:
|
||||
{{- include "openim-msggateway.labels" . | nindent 4 }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ include "openim-msggateway.fullname" . }}
|
||||
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,75 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "openim-msggateway.fullname" . -}}
|
||||
{{- $svcPort := .Values.service.port -}}
|
||||
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
|
||||
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
{{- else -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- end }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
labels:
|
||||
{{- include "openim-msggateway.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ .path }}
|
||||
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
|
||||
pathType: {{ .pathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $svcPort }}
|
||||
{{- else }}
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,33 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "openim-msggateway.fullname" . }}
|
||||
labels:
|
||||
{{- include "openim-msggateway.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
- port: 88
|
||||
targetPort: rpc
|
||||
protocol: TCP
|
||||
name: rpc
|
||||
selector:
|
||||
{{- include "openim-msggateway.selectorLabels" . | nindent 4 }}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "openim-msggateway.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "openim-msggateway.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,96 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Default values for openim-msggateway.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: ghcr.io/openimsdk/openim-msggateway
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: ""
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: false
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: "nginx"
|
||||
annotations:
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
hosts:
|
||||
- host: chart-example.local
|
||||
paths:
|
||||
- path: /
|
||||
pathType: ImplementationSpecific
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
# - chart-example.local
|
||||
|
||||
resources: {}
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
autoscaling:
|
||||
enabled: false
|
||||
minReplicas: 1
|
||||
maxReplicas: 100
|
||||
targetCPUUtilizationPercentage: 80
|
||||
# targetMemoryUtilizationPercentage: 80
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
@@ -0,0 +1,23 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
@@ -0,0 +1,53 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
apiVersion: v2
|
||||
name: openim-msgtransfer
|
||||
description: A Helm chart for Kubernetes
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: application
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: "1.16.0"
|
||||
|
||||
icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg
|
||||
|
||||
maintainers:
|
||||
- name: "OpenIM"
|
||||
url: "https://github.com/openimsdk"
|
||||
|
||||
keywords:
|
||||
- openim
|
||||
- im
|
||||
- chat
|
||||
|
||||
sources:
|
||||
- "https://github.com/openimsdk/open-im-server"
|
||||
- "https://github.com/openimsdk/helm-charts"
|
||||
@@ -0,0 +1,22 @@
|
||||
1. Get the application URL by running these commands:
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- range $host := .Values.ingress.hosts }}
|
||||
{{- range .paths }}
|
||||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-msgtransfer.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-msgtransfer.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-msgtransfer.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-msgtransfer.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
|
||||
{{- end }}
|
||||
@@ -0,0 +1,62 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "openim-msgtransfer.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "openim-msgtransfer.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "openim-msgtransfer.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "openim-msgtransfer.labels" -}}
|
||||
helm.sh/chart: {{ include "openim-msgtransfer.chart" . }}
|
||||
{{ include "openim-msgtransfer.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "openim-msgtransfer.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "openim-msgtransfer.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "openim-msgtransfer.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "openim-msgtransfer.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,86 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "openim-msgtransfer.fullname" . }}
|
||||
labels:
|
||||
{{- include "openim-msgtransfer.labels" . | nindent 4 }}
|
||||
spec:
|
||||
{{- if not .Values.autoscaling.enabled }}
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "openim-msgtransfer.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "openim-msgtransfer.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "openim-msgtransfer.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 80
|
||||
protocol: TCP
|
||||
#livenessProbe:
|
||||
# httpGet:
|
||||
# path: /
|
||||
# port: http
|
||||
#readinessProbe:
|
||||
# httpGet:
|
||||
# path: /
|
||||
# port: http
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- mountPath: /openim/openim-server/config/config.yaml
|
||||
name: config
|
||||
subPath: config.yaml
|
||||
- mountPath: /openim/openim-server/config/
|
||||
name: config
|
||||
subPath: notification.yaml
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-cm
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,42 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
{{- if .Values.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "openim-msgtransfer.fullname" . }}
|
||||
labels:
|
||||
{{- include "openim-msgtransfer.labels" . | nindent 4 }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ include "openim-msgtransfer.fullname" . }}
|
||||
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,75 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "openim-msgtransfer.fullname" . -}}
|
||||
{{- $svcPort := .Values.service.port -}}
|
||||
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
|
||||
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
{{- else -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- end }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
labels:
|
||||
{{- include "openim-msgtransfer.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ .path }}
|
||||
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
|
||||
pathType: {{ .pathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $svcPort }}
|
||||
{{- else }}
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,29 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "openim-msgtransfer.fullname" . }}
|
||||
labels:
|
||||
{{- include "openim-msgtransfer.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "openim-msgtransfer.selectorLabels" . | nindent 4 }}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "openim-msgtransfer.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "openim-msgtransfer.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,96 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Default values for openim-msgtransfer.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: ghcr.io/openimsdk/openim-msgtransfer
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: ""
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: false
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: ""
|
||||
annotations: {}
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
hosts:
|
||||
- host: chart-example.local
|
||||
paths:
|
||||
- path: /
|
||||
pathType: ImplementationSpecific
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
# - chart-example.local
|
||||
|
||||
resources: {}
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
autoscaling:
|
||||
enabled: false
|
||||
minReplicas: 1
|
||||
maxReplicas: 100
|
||||
targetCPUUtilizationPercentage: 80
|
||||
# targetMemoryUtilizationPercentage: 80
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
@@ -0,0 +1,23 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
@@ -0,0 +1,53 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
apiVersion: v2
|
||||
name: openim-push
|
||||
description: A Helm chart for Kubernetes
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: application
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: "1.16.0"
|
||||
|
||||
icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg
|
||||
|
||||
maintainers:
|
||||
- name: "OpenIM"
|
||||
url: "https://github.com/openimsdk"
|
||||
|
||||
keywords:
|
||||
- openim
|
||||
- im
|
||||
- chat
|
||||
|
||||
sources:
|
||||
- "https://github.com/openimsdk/open-im-server"
|
||||
- "https://github.com/openimsdk/helm-charts"
|
||||
@@ -0,0 +1,22 @@
|
||||
1. Get the application URL by running these commands:
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- range $host := .Values.ingress.hosts }}
|
||||
{{- range .paths }}
|
||||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-push.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-push.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-push.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-push.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
|
||||
{{- end }}
|
||||
@@ -0,0 +1,62 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "openim-push.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "openim-push.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "openim-push.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "openim-push.labels" -}}
|
||||
helm.sh/chart: {{ include "openim-push.chart" . }}
|
||||
{{ include "openim-push.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "openim-push.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "openim-push.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "openim-push.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "openim-push.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,86 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "openim-push.fullname" . }}
|
||||
labels:
|
||||
{{- include "openim-push.labels" . | nindent 4 }}
|
||||
spec:
|
||||
{{- if not .Values.autoscaling.enabled }}
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "openim-push.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "openim-push.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "openim-push.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 80
|
||||
protocol: TCP
|
||||
#livenessProbe:
|
||||
# httpGet:
|
||||
# path: /
|
||||
# port: http
|
||||
#readinessProbe:
|
||||
# httpGet:
|
||||
# path: /
|
||||
# port: http
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- mountPath: /openim/openim-server/config/config.yaml
|
||||
name: config
|
||||
subPath: config.yaml
|
||||
- mountPath: /openim/openim-server/config/
|
||||
name: config
|
||||
subPath: notification.yaml
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-cm
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,42 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
{{- if .Values.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "openim-push.fullname" . }}
|
||||
labels:
|
||||
{{- include "openim-push.labels" . | nindent 4 }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ include "openim-push.fullname" . }}
|
||||
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,75 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "openim-push.fullname" . -}}
|
||||
{{- $svcPort := .Values.service.port -}}
|
||||
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
|
||||
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
{{- else -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- end }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
labels:
|
||||
{{- include "openim-push.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ .path }}
|
||||
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
|
||||
pathType: {{ .pathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $svcPort }}
|
||||
{{- else }}
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,29 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "openim-push.fullname" . }}
|
||||
labels:
|
||||
{{- include "openim-push.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "openim-push.selectorLabels" . | nindent 4 }}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "openim-push.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "openim-push.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -12,14 +12,14 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Default values for openim-server.
|
||||
# Default values for openim-push.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: nginx
|
||||
repository: ghcr.io/openimsdk/openim-push
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: ""
|
||||
@@ -30,7 +30,7 @@ fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: true
|
||||
create: false
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
# The name of the service account to use.
|
||||
@@ -0,0 +1,23 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user