feat: add scripts set

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong(cubxxw-openim)
2023-08-17 16:55:19 +08:00
parent 31611f5657
commit ab91f24fd1
10 changed files with 570 additions and 113 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ readonly ENV_FILE=${ENV_FILE:-${OPENIM_ROOT}/scripts/install/environment.sh}
# 定义关联数组,其中键是模板文件,值是对应的输出文件 (en: Defines an associative array where the keys are the template files and the values are the corresponding output files.)
declare -A TEMPLATES=(
["${OPENIM_ROOT}/deployments/templates/env_template.yaml"]="${OPENIM_ROOT}/.env"
["${OPENIM_ROOT}/deployments/templates/openim.yaml"]="${OPENIM_ROOT}/openim_config.yaml"
["${OPENIM_ROOT}/deployments/templates/openim.yaml"]="${OPENIM_ROOT}/config/openim_config.yaml"
)
for template in "${!TEMPLATES[@]}"; do
+1 -1
View File
@@ -87,7 +87,7 @@ openim::common::dependency_port() {
${MYSQL_PORT} # MySQL port
${REDIS_PORT} # Redis port
${ZOOKEEPER_PORT} # Zookeeper port
${KAFKA_PORT} # Kafka port
# ${KAFKA_PORT} # Kafka port
${MongoDB_PORT} # MongoDB port
${MINIO_PORT} # MinIO port
)
+5 -1
View File
@@ -26,6 +26,9 @@ source "${OPENIM_ROOT}/scripts/lib/init.sh"
IP=$(openim::util::get_server_ip)
#TODO
IP=http://127.0.0.1
function def() {
local var_name="$1"
local default_value="${2:-}"
@@ -106,6 +109,7 @@ readonly MINIO_ENDPOINT=${MINIO_ENDPOINT:-"http://${IP}:${MINIO_PORT}"}
def "MINIO_ACCESS_KEY" "${USER}" # MinIO的访问密钥ID
def "MINIO_SECRET_KEY" "${PASSWORD}" # MinIO的密钥
def "MINIO_SESSION_TOKEN" # MinIO的会话令牌
readonly MINIO_SIGN_ENDPOINT=${MINIO_SIGN_ENDPOINT:-"http://${IP}:${MINIO_PORT}"} # signEndpoint为minio公网地址 # MinIO的会话令牌
def "COS_BUCKET_URL" "https://temp-1252357374.cos.ap-chengdu.myqcloud.com" # 腾讯云COS的存储桶URL
def "COS_SECRET_ID" # 腾讯云COS的密钥ID
def "COS_SECRET_KEY" # 腾讯云COS的密钥
@@ -215,7 +219,7 @@ def "GROUP_MSG_READ_RECEIPT" "true" # 群消息已读回执启用
def "SINGLE_MSG_READ_RECEIPT" "true" # 单一消息已读回执启用
def "RETAIN_CHAT_RECORDS" "365" # 保留聊天记录
# 聊天记录清理时间
readonly CHAT_RECORDS_CLEAR_TIME=${CHAT_RECORDS_CLEAR_TIME:-'0 2 * * *'}
readonly CHAT_RECORDS_CLEAR_TIME=${CHAT_RECORDS_CLEAR_TIME:-'0 2 * * 3'}
# 消息销毁时间
readonly MSG_DESTRUCT_TIME=${MSG_DESTRUCT_TIME:-'0 2 * * *'}
def "SECRET" "${PASSWORD}" # 密钥
+1
View File
@@ -52,6 +52,7 @@ function execute_scripts() {
else
openim::log::errexit "Script ${script_path##*/} is missing or not executable."
fi
sleep 1
done
}