feat: Provides a new reading scheme for profile privacy through environment variables (#1520)

* fix: fix openim make install

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>

* fix: fix openim make init

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>

* fix: remove docker compose mysql

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>

---------

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong
2023-12-05 21:28:00 +08:00
committed by GitHub
parent c0194f6ef4
commit 119e8dbb2f
4 changed files with 16 additions and 21 deletions
+12 -2
View File
@@ -39,13 +39,18 @@ openim::log::info "Read more configuration information: https://github.com/openi
for template in "${!TEMPLATES[@]}"; do
if [[ ! -f "${template}" ]]; then
openim::log::error_exit "template file ${template} does not exist..."
openim::log::error_exit "Template file ${template} does not exist..."
exit 1
fi
done
for template in "${!TEMPLATES[@]}"; do
IFS=';' read -ra OUTPUT_FILES <<< "${TEMPLATES[$template]}"
for output_file in "${OUTPUT_FILES[@]}"; do
if [[ -f "${output_file}" ]]; then
read -p "File ${output_file} already exists. Overwrite? (Y/N): "
echo -n "File ${output_file} already exists. Overwrite? (Y/N): "
read -r -n 1 REPLY
echo # Adds a line to wrap after user input
if [[ $REPLY =~ ^[Yy]$ ]]; then
openim::log::info "Overwriting ${output_file}. Previous configuration will be lost."
else
@@ -55,6 +60,10 @@ for template in "${!TEMPLATES[@]}"; do
fi
openim::log::info "⌚ Working with template file: ${template} to ${output_file}..."
if [[ ! -f "${OPENIM_ROOT}/scripts/genconfig.sh" ]]; then
openim::log::error "genconfig.sh script not found"
exit 1
fi
"${OPENIM_ROOT}/scripts/genconfig.sh" "${ENV_FILE}" "${template}" > "${output_file}" || {
openim::log::error "Error processing template file ${template}"
exit 1
@@ -63,4 +72,5 @@ for template in "${!TEMPLATES[@]}"; do
done
done
openim::log::success "✨ All configuration files have been successfully generated!"
+2 -2
View File
@@ -42,11 +42,11 @@ fi
pushd "${OPENIM_ROOT}"
${DOCKER_COMPOSE_COMMAND} stop
curl https://gitee.com/openimsdk/openim-docker/raw/main/example/full-openim-server-and-chat.yml -o docker-compose.yml && make init && docker compose up -d
curl https://gitee.com/openimsdk/openim-docker/raw/main/example/full-openim-server-and-chat.yml -o docker-compose.yml
"${OPENIM_ROOT}"/scripts/init-config.sh
${DOCKER_COMPOSE_COMMAND} up --remove-orphans -d
sleep 60
${DOCKER_COMPOSE_COMMAND} logs openim-server
${DOCKER_COMPOSE_COMMAND} ps
popd
popd