diff --git a/deployments/templates/env_template.yaml b/deployments/templates/env_template.yaml index 958644632..c72b4492d 100644 --- a/deployments/templates/env_template.yaml +++ b/deployments/templates/env_template.yaml @@ -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. + USER="${USER}" PASSWORD="${PASSWORD}" MINIO_ENDPOINT="${MINIO_ENDPOINT}" diff --git a/deployments/templates/openim-api.yaml b/deployments/templates/openim-api.yaml index 31b756078..15fae592c 100644 --- a/deployments/templates/openim-api.yaml +++ b/deployments/templates/openim-api.yaml @@ -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. + name: openim-api description: "This is a description for openim-api" type: "service" diff --git a/deployments/templates/openim-cmdutils.yaml b/deployments/templates/openim-cmdutils.yaml index 4e9bf4af3..a8a50777d 100644 --- a/deployments/templates/openim-cmdutils.yaml +++ b/deployments/templates/openim-cmdutils.yaml @@ -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. + name: openim-cmdutils description: "This is a description for openim-cmdutils" type: "service" diff --git a/deployments/templates/openim-msggateway.yaml b/deployments/templates/openim-msggateway.yaml index 071c2397b..cbd5364c5 100644 --- a/deployments/templates/openim-msggateway.yaml +++ b/deployments/templates/openim-msggateway.yaml @@ -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. + name: openim-msggateway description: "This is a description for openim-msggateway" type: "service" diff --git a/deployments/templates/openim-msgtransfer.yaml b/deployments/templates/openim-msgtransfer.yaml index d6b30c30a..31e6cac78 100644 --- a/deployments/templates/openim-msgtransfer.yaml +++ b/deployments/templates/openim-msgtransfer.yaml @@ -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. + name: openim-msgtransfer description: "This is a description for openim-msgtransfer" type: "service" diff --git a/deployments/templates/openim-push.yaml b/deployments/templates/openim-push.yaml index 911a01437..655b9c32c 100644 --- a/deployments/templates/openim-push.yaml +++ b/deployments/templates/openim-push.yaml @@ -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. + name: openim-push description: "This is a description for openim-push" type: "service" diff --git a/deployments/templates/openim-rpc-auth.yaml b/deployments/templates/openim-rpc-auth.yaml index bb43ed233..3435cec37 100644 --- a/deployments/templates/openim-rpc-auth.yaml +++ b/deployments/templates/openim-rpc-auth.yaml @@ -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. + name: openim-rpc-auth description: "This is a description for openim-rpc-auth" type: "service" diff --git a/deployments/templates/openim-rpc-conversation.yaml b/deployments/templates/openim-rpc-conversation.yaml index b71520ec8..7f3829488 100644 --- a/deployments/templates/openim-rpc-conversation.yaml +++ b/deployments/templates/openim-rpc-conversation.yaml @@ -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. + name: openim-rpc-conversation description: "This is a description for openim-rpc-conversation" type: "service" diff --git a/deployments/templates/openim-rpc-friend.yaml b/deployments/templates/openim-rpc-friend.yaml index b8a7e6641..1f4c7f1e4 100644 --- a/deployments/templates/openim-rpc-friend.yaml +++ b/deployments/templates/openim-rpc-friend.yaml @@ -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. + name: openim-rpc-friend description: "This is a description for openim-rpc-friend" type: "service" diff --git a/deployments/templates/openim-rpc-group.yaml b/deployments/templates/openim-rpc-group.yaml index 6f90ec493..4577f508e 100644 --- a/deployments/templates/openim-rpc-group.yaml +++ b/deployments/templates/openim-rpc-group.yaml @@ -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. + name: openim-rpc-group description: "This is a description for openim-rpc-group" type: "service" diff --git a/deployments/templates/openim-rpc-msg.yaml b/deployments/templates/openim-rpc-msg.yaml index 9214871fb..7991ef81d 100644 --- a/deployments/templates/openim-rpc-msg.yaml +++ b/deployments/templates/openim-rpc-msg.yaml @@ -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. + name: openim-rpc-msg description: "This is a description for openim-rpc-msg" type: "service" diff --git a/deployments/templates/openim-rpc-third.yaml b/deployments/templates/openim-rpc-third.yaml index 5914a8bac..6867460f0 100644 --- a/deployments/templates/openim-rpc-third.yaml +++ b/deployments/templates/openim-rpc-third.yaml @@ -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. + name: openim-rpc-third description: "This is a description for openim-rpc-third" type: "service" diff --git a/deployments/templates/openim-rpc-user.yaml b/deployments/templates/openim-rpc-user.yaml index a79084096..3f9d31f8c 100644 --- a/deployments/templates/openim-rpc-user.yaml +++ b/deployments/templates/openim-rpc-user.yaml @@ -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. + name: openim-rpc-user description: "This is a description for openim-rpc-user" type: "service" diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh index 944dc850c..1c83be329 100755 --- a/scripts/genconfig.sh +++ b/scripts/genconfig.sh @@ -20,12 +20,12 @@ env_file="$1" template_file="$2" -IAM_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -source "${IAM_ROOT}/scripts/lib/init.sh" +source "${OPENIM_ROOT}/scripts/lib/init.sh" if [ $# -ne 2 ];then - iam::log::error "Usage: genconfig.sh scripts/environment.sh configs/iam-apiserver.yaml" + openim::log::error "Usage: scripts/genconfig.sh scripts/environment.sh configs/openim-api.yaml" exit 1 fi @@ -37,13 +37,13 @@ set +u for env in $(sed -n 's/^[^#].*${\(.*\)}.*/\1/p' ${template_file}) do if [ -z "$(eval echo \$${env})" ];then - iam::log::error "environment variable '${env}' not set" + openim::log::error "environment variable '${env}' not set" missing=true fi done if [ "${missing}" ];then - iam::log::error 'You may run `source scripts/environment.sh` to set these environment' + openim::log::error 'You may run `source scripts/environment.sh` to set these environment' exit 1 fi diff --git a/scripts/install/README.md b/scripts/install/README.md new file mode 100644 index 000000000..dbc6ca958 --- /dev/null +++ b/scripts/install/README.md @@ -0,0 +1,87 @@ +# OpenIM Suite Scripts + +The OpenIM Suite represents a comprehensive collection of scripts, each tailored to manage and operate specific services within the OpenIM ecosystem. These scripts offer consistent, reliable, and efficient tools for initializing, controlling, and managing various OpenIM services on a Linux platform. + +## Features + +- **Robustness:** Built with Bash's error handling mechanisms (`errexit`, `nounset`, and `pipefail`), ensuring scripts fail fast and provide relevant error messages. +- **Modularity:** Each script is dedicated to a particular service, promoting clarity and ease of maintenance. +- **Comprehensive Logging:** Integrated logging utilities offer real-time insights into operations, enhancing transparency and debuggability. +- **Systemd Integration:** Where applicable, scripts integrate with the systemd service manager, offering standardized service controls like start, stop, restart, and status checks. + +## Scripts Overview + +1. **openim-api:** Control interface for the OpenIM API service. +2. **openim-cmdutils:** Utility toolkit for common OpenIM command-line operations. +3. **openim-crontask:** Manages the OpenIM CronTask service, with both direct and systemctl installation methods. +4. **openim-msggateway:** Script to operate the OpenIM Message Gateway service. +5. **openim-msgtransfer:** Manages the OpenIM Message Transfer functionalities. +6. **openim-push:** Interface for controlling the OpenIM Push Notification service. +7. **openim-rpc-auth:** Script dedicated to the OpenIM RPC Authentication service. +8. **openim-rpc-conversation:** Manages operations related to the OpenIM RPC Conversation service. +9. **openim-rpc-friend:** Control interface for the OpenIM RPC Friend functionalities. +10. **openim-rpc-group:** Script for managing the OpenIM RPC Group service. +11. **openim-rpc-msg:** Operates the OpenIM RPC Messaging service. +12. **openim-rpc-third:** Script dedicated to third-party integrations with OpenIM RPC. +13. **openim-rpc-user:** Control interface for OpenIM RPC User operations. + +## Usage + +The scripts within the OpenIM Suite generally adhere to two primary execution methodologies. To illustrate these methodologies, we'll use `openim-crontask` as a representative example. + +1. **Direct Script Execution:** Running the script directly, typically for straightforward start/stop operations. + + ```bash + ./[script-name].sh + ``` + +2. **Function-based Execution:** Invoking specific functions within the script for more specialized operations (e.g., install, uninstall). + + ```bash + ./[script-name].sh [function-name] + ``` + +### 1. Direct Script Execution + +This method involves invoking the script directly, initiating its default behavior. For instance, with `openim-crontask`, direct execution will start the OpenIM CronTask as a background process. + +**Example:** + +```bash +./openim-crontask.sh +``` + +Upon execution, the script will source any necessary configurations, log the start of the CronTask, and finally run the CronTask in the background. The log messages will provide feedback about the process, ensuring the user is informed of the task's progress. + +### 2. Function-based Execution + +This approach is more specialized, enabling users to call specific functions defined within the script. This is particularly useful for tasks like installation, uninstallation, and status checks. + +For the `openim-crontask` script: + +- **Installation**: It includes building the service, generating configuration files, setting up systemd services, and starting the service. + + ```bash + ./openim-crontask.sh openim::crontask::install + ``` + +- **Uninstallation**: Stops the service, removes associated binaries, configuration files, and systemd service files. + + ```bash + ./openim-crontask.sh openim::crontask::uninstall + ``` + +- **Status Check**: Verifies the running status of the service, checking for active processes and listening ports. + + ```bash + ./openim-crontask.sh openim::crontask::status + ``` + +It's crucial to familiarize oneself with the available functions within each script. This ensures optimal utilization of the provided tools and a deeper understanding of the underlying operations. + + + +## Notes + +- Always ensure you have the correct permissions before executing any script. +- Environment variables may need to be set or sourced depending on your installation and configuration. \ No newline at end of file diff --git a/scripts/install/environment.sh b/scripts/install/environment.sh index ce3c4a7ea..0c9f53386 100755 --- a/scripts/install/environment.sh +++ b/scripts/install/environment.sh @@ -65,7 +65,7 @@ def "CA_FILE" "${OPENIM_CONFIG_DIR}/cert/ca.pem" # TODO 注意: 一般的配置都可以使用 def 函数来定义,如果是包含特殊字符,比如说: # TODO readonly MSG_DESTRUCT_TIME=${MSG_DESTRUCT_TIME:-'0 2 * * *'} -# TODO 使用 readonly 来定义合适,负责无法正常解析 +# TODO 使用 readonly 来定义合适,负责无法正常解析, 并且 yaml 模板需要加 "" 来包裹 ###################### Zookeeper 配置信息 ###################### def "ZOOKEEPER_SCHEMA" "openim" # Zookeeper的模式 diff --git a/scripts/install/install.sh b/scripts/install/install.sh new file mode 100755 index 000000000..c7277a797 --- /dev/null +++ b/scripts/install/install.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# 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_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd -P) +[[ -z ${COMMON_SOURCED} ]] && source ${OPENIM_ROOT}/scripts/install/common.sh + +# common.sh environment.sh mariadb_for_ubuntu.sh msg_transfer_start.sh push_start.sh start_rpc_service.sh vimrc +# dependency.sh install.sh msg_gateway_start.sh openim-crontask.sh redis_for_ubuntu.sh test.sh \ No newline at end of file diff --git a/scripts/install/man.sh b/scripts/install/man.sh new file mode 100644 index 000000000..96d94ab8b --- /dev/null +++ b/scripts/install/man.sh @@ -0,0 +1,96 @@ +#!/usr/bin/env bash +# 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-man.sh Script to manage man pages for openim +# +# Description: +# This script manages the man pages for the OpenIM software suite. +# It provides facilities to install, uninstall, and verify the +# installation status of the man pages related to OpenIM components. +# +# Usage: +# ./openim-man.sh openim::man::install - Install man pages +# ./openim-man.sh openim::man::uninstall - Uninstall man pages +# ./openim-man.sh openim::man::status - Check installation status +# +# Dependencies: +# - Assumes there's a common.sh in "${OPENIM_ROOT}/scripts/install/" +# containing shared functions and variables. +# - Relies on the script "${OPENIM_ROOT}/scripts/update-generated-docs.sh" +# to generate the man pages. +# +# Notes: +# - This script must be run with appropriate permissions to modify the +# system man directories. +# - Always ensure you're in the script's directory or provide the correct +# path when executing. +################################################################################ + +# Define the root of the build/dist directory +OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd) + +# Ensure the common script is sourced +[[ -z ${COMMON_SOURCED} ]] && source "${OPENIM_ROOT}/scripts/install/common.sh" + +# Print usage information after installation +function openim::man::info() { +cat <<- EOF +Usage: + man openim-server # Display the man page for openim-server +EOF +} + +# Install the man pages for openim +function openim::man::install() { + # Navigate to the openim root directory + pushd "${OPENIM_ROOT}" > /dev/null + + # Generate man pages for each component + "${OPENIM_ROOT}/scripts/update-generated-docs.sh" + openim::common::sudo "cp docs/man/man1/* /usr/share/man/man1/" + + # Verify installation status + if openim::man::status; then + openim::log::info "Installed openim-server man page successfully" + openim::man::info + fi + + # Return to the original directory + popd > /dev/null +} + +# Uninstall the man pages for openim +function openim::man::uninstall() { + # Turn off exit-on-error temporarily to handle non-existing files gracefully + set +o errexit + openim::common::sudo "rm -f /usr/share/man/man1/openim-*" + set -o errexit + + openim::log::info "Uninstalled openim man pages successfully" +} + +# Check the installation status of the man pages +function openim::man::status() { + if ! ls /usr/share/man/man1/openim-* &> /dev/null; then + openim::log::error "OpenIM man files not found. Perhaps they were not installed correctly." + return 1 + fi + return 0 +} + +# Execute the appropriate function based on the given arguments +if [[ "$*" =~ openim::man:: ]]; then + eval "$*" +fi diff --git a/scripts/install/openim-crontask.sh b/scripts/install/openim-crontask.sh index 0ea78c289..b1a6f3327 100755 --- a/scripts/install/openim-crontask.sh +++ b/scripts/install/openim-crontask.sh @@ -13,6 +13,30 @@ # 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 CronTask Control Script +# +# Description: +# This script provides a control interface for the OpenIM CronTask service within a Linux environment. It supports two installation methods: installation via function calls to systemctl, and direct installation through background processes. +# +# Features: +# 1. Robust error handling leveraging Bash built-ins such as 'errexit', 'nounset', and 'pipefail'. +# 2. Capability to source common utility functions and configurations, ensuring environmental consistency. +# 3. Comprehensive logging tools, offering clear operational insights. +# 4. Support for creating, managing, and interacting with Linux systemd services. +# 5. Mechanisms to verify the successful running of the service. +# +# Usage: +# 1. Direct Script Execution: +# This will start the OpenIM CronTask directly through a background process. +# Example: ./[script-name].sh +# +# 2. Controlling through Functions for systemctl operations: +# Specific operations like installation, uninstallation, and status check can be executed by passing the respective function name as an argument to the script. +# Example: ./[script-name].sh openim::crontask::install +# +# Note: Ensure that the appropriate permissions and environmental variables are set prior to script execution. +# set -o errexit set +o nounset diff --git a/scripts/install/redis_for_ubuntu.sh b/scripts/install/redis_for_ubuntu.sh old mode 100644 new mode 100755 diff --git a/scripts/path_info.sh b/scripts/path_info.sh index 9953abc08..37ca4fbd8 100755 --- a/scripts/path_info.sh +++ b/scripts/path_info.sh @@ -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. + # Don't put the space between "=" openim_msggateway="openim-msggateway" msg_gateway_binary_root="$OPENIM_ROOT/$BIN_DIR" diff --git a/tools/imctl/cmd/imctl/imctl.go b/tools/imctl/cmd/imctl/imctl.go index 3afe57699..fea2023a9 100644 --- a/tools/imctl/cmd/imctl/imctl.go +++ b/tools/imctl/cmd/imctl/imctl.go @@ -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. + // iamctl is the command line tool for iam platform. package main diff --git a/tools/imctl/internal/imctl/cmd/cmd.go b/tools/imctl/internal/imctl/cmd/cmd.go index cf4ec477e..77a0ecb09 100644 --- a/tools/imctl/internal/imctl/cmd/cmd.go +++ b/tools/imctl/internal/imctl/cmd/cmd.go @@ -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. + package cmd import ( diff --git a/tools/imctl/internal/imctl/cmd/profiling.go b/tools/imctl/internal/imctl/cmd/profiling.go index eb460b270..eaf9acceb 100644 --- a/tools/imctl/internal/imctl/cmd/profiling.go +++ b/tools/imctl/internal/imctl/cmd/profiling.go @@ -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. + package cmd import ( diff --git a/tools/imctl/internal/imctl/util/interrupt/interrupt.go b/tools/imctl/internal/imctl/util/interrupt/interrupt.go index 4f7a7bf1b..e1d8386de 100644 --- a/tools/imctl/internal/imctl/util/interrupt/interrupt.go +++ b/tools/imctl/internal/imctl/util/interrupt/interrupt.go @@ -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. + // Package interrupt deal with signals. package interrupt diff --git a/tools/imctl/internal/imctl/util/templates/command_groups.go b/tools/imctl/internal/imctl/util/templates/command_groups.go index 7e86578a3..538b43ac4 100644 --- a/tools/imctl/internal/imctl/util/templates/command_groups.go +++ b/tools/imctl/internal/imctl/util/templates/command_groups.go @@ -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. + package templates import ( diff --git a/tools/imctl/internal/imctl/util/templates/markdown.go b/tools/imctl/internal/imctl/util/templates/markdown.go index d32146fc1..5621163f8 100644 --- a/tools/imctl/internal/imctl/util/templates/markdown.go +++ b/tools/imctl/internal/imctl/util/templates/markdown.go @@ -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. + package templates import ( diff --git a/tools/imctl/internal/imctl/util/templates/normalizers.go b/tools/imctl/internal/imctl/util/templates/normalizers.go index fbc52c8e8..f5873a0be 100644 --- a/tools/imctl/internal/imctl/util/templates/normalizers.go +++ b/tools/imctl/internal/imctl/util/templates/normalizers.go @@ -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. + package templates import ( diff --git a/tools/imctl/internal/imctl/util/templates/templater.go b/tools/imctl/internal/imctl/util/templates/templater.go index e616ec602..7b75cef13 100644 --- a/tools/imctl/internal/imctl/util/templates/templater.go +++ b/tools/imctl/internal/imctl/util/templates/templater.go @@ -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. + package templates import ( diff --git a/tools/imctl/internal/imctl/util/templates/templates.go b/tools/imctl/internal/imctl/util/templates/templates.go index 1ef16981a..ec71434ce 100644 --- a/tools/imctl/internal/imctl/util/templates/templates.go +++ b/tools/imctl/internal/imctl/util/templates/templates.go @@ -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. + // Package templates provides template functions for working with templates. package templates