diff --git a/.gitignore b/.gitignore index 675ce10c7..e4617bae8 100644 --- a/.gitignore +++ b/.gitignore @@ -32,10 +32,12 @@ _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 ### OpenIM deploy ### deployments/openim-server/charts @@ -388,8 +390,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 -config/alertmanager.yml -config/prometheus.yml \ No newline at end of file +dist/ \ No newline at end of file diff --git a/config/Readme.md b/config/Readme.md new file mode 100644 index 000000000..c3de781d2 --- /dev/null +++ b/config/Readme.md @@ -0,0 +1,22 @@ +# OpenIM Config/ + +## 目录结构 + +``` + +``` + + +## 配置文件 + + + +## 配置项说明 + + +## 如何使用 + + +## 版本管理和升级 + +## 如何贡献 diff --git a/config/open-im-ng-example.conf b/config/templates/open-im-ng-example.conf similarity index 100% rename from config/open-im-ng-example.conf rename to config/templates/open-im-ng-example.conf diff --git a/config/prometheus-dashboard.yaml b/config/templates/prometheus-dashboard.yaml similarity index 100% rename from config/prometheus-dashboard.yaml rename to config/templates/prometheus-dashboard.yaml diff --git a/config/email.tmpl b/deployments/templates/email.tmpl similarity index 100% rename from config/email.tmpl rename to deployments/templates/email.tmpl diff --git a/config/instance-down-rules.yml b/deployments/templates/instance-down-rules.yml similarity index 100% rename from config/instance-down-rules.yml rename to deployments/templates/instance-down-rules.yml diff --git a/config/notification.yaml b/deployments/templates/notification.yaml similarity index 88% rename from config/notification.yaml rename to deployments/templates/notification.yaml index 5e5223a00..665c21261 100644 --- a/config/notification.yaml +++ b/deployments/templates/notification.yaml @@ -12,18 +12,36 @@ # 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 #是否发送消息,false不发消息为无声的触发同步。true发消息需要触发会话,rpc notification直接发两次,一次消息一次通知, options字段isNotification是否为通知 - reliabilityLevel: 1 # 1为online才发送 2为必达 - unreadCount: false # 只在isSendMsg为true的情况下有作用 + 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: - enable: false # 开启该开关 - title: "create group title" # xx create the group + # 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" -# 不加消息contentType,content统一json 结构体使用pb的 - +# Content type is not added here. +# Content should use a JSON structure conforming to the protobuf format. groupInfoSet: isSendMsg: false @@ -334,4 +352,3 @@ conversationSetPrivate: title: "burn after reading" desc: "burn after reading" ext: "burn after reading" - diff --git a/scripts/init-config.sh b/scripts/init-config.sh index d8f43dec0..a2fc0e2a1 100755 --- a/scripts/init-config.sh +++ b/scripts/init-config.sh @@ -35,6 +35,9 @@ declare -A TEMPLATES=( ["${OPENIM_ROOT}/deployments/templates/openim.yaml"]="${OPENIM_ROOT}/config/config.yaml" ["${OPENIM_ROOT}/deployments/templates/prometheus.yml"]="${OPENIM_ROOT}/config/prometheus.yml" ["${OPENIM_ROOT}/deployments/templates/alertmanager.yml"]="${OPENIM_ROOT}/config/alertmanager.yml" + ["${OPENIM_ROOT}/deployments/templates/email.tmpl"]="${OPENIM_ROOT}/config/email.tmpl" + ["${OPENIM_ROOT}/deployments/templates/instance-down-rules.yml"]="${OPENIM_ROOT}/config/instance-down-rules.yml" + ["${OPENIM_ROOT}/deployments/templates/notification.yaml"]="${OPENIM_ROOT}/config/notification.yaml" ) # Templates for example files @@ -43,6 +46,9 @@ declare -A EXAMPLES=( ["${OPENIM_ROOT}/deployments/templates/openim.yaml"]="${OPENIM_ROOT}/config/templates/config.yaml.template" ["${OPENIM_ROOT}/deployments/templates/prometheus.yml"]="${OPENIM_ROOT}/config/templates/prometheus.yml.template" ["${OPENIM_ROOT}/deployments/templates/alertmanager.yml"]="${OPENIM_ROOT}/config/templates/alertmanager.yml.template" + ["${OPENIM_ROOT}/deployments/templates/email.tmpl"]="${OPENIM_ROOT}/config/templates/email.tmpl.template" + ["${OPENIM_ROOT}/deployments/templates/instance-down-rules.yml"]="${OPENIM_ROOT}/config/templates/instance-down-rules.yml.template" + ["${OPENIM_ROOT}/deployments/templates/notification.yaml"]="${OPENIM_ROOT}/config/templates/notification.yaml.template" ) # Command-line options