Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -391,4 +391,5 @@ Sessionx.vim
dist/
.env
config/config.yaml
config/alertmanager.yml
config/alertmanager.yml
config/prometheus.yml
16 changes: 0 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,6 @@ networks:
gateway: '${DOCKER_BRIDGE_GATEWAY}'

services:
mysql:
image: mysql:5.7
ports:
- "${MYSQL_PORT}:3306"
container_name: mysql
volumes:
- "${DATA_DIR}/components/mysql/data:/var/lib/mysql"
- "/etc/localtime:/etc/localtime"
environment:
MYSQL_ROOT_PASSWORD: "${MYSQL_PASSWORD}"
restart: always
networks:
server:
# open-im-server_server
ipv4_address: ${MYSQL_NETWORK_ADDRESS}

mongodb:
image: mongo:6.0.2
ports:
Expand Down
14 changes: 12 additions & 2 deletions scripts/init-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -63,4 +72,5 @@ for template in "${!TEMPLATES[@]}"; do
done
done


openim::log::success "✨ All configuration files have been successfully generated!"
4 changes: 2 additions & 2 deletions scripts/install-im-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading