Integrated environment configuration method and device, electronic equipment and storage medium

By compiling the authorization script file in the target container and using the authorization login information to obtain data from the remote warehouse, the problems of low configuration efficiency and poor applicability of the integrated environment are solved, automated configuration and migration are achieved, and configuration efficiency and security are improved. sex.

CN119271259APending Publication Date: 2025-01-07CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411221873.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

In the prior art, the integrated environment configuration is inefficient and does not have migratory ability, resulting in the inability to automatically configure when the environment changes, affecting the applicability of the configuration.

Method used

By presetting the authorization script file in the target container for compilation, generating the authorization file, and using the authorization login information to obtain data from the remote warehouse, it realizes an integrated environment configuration without manual operations and is migable.

Benefits of technology

Improve the efficiency of integrated environment configuration, realize automated configuration when environment changes, and enhance the applicability and security of configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271259A_ABST
    Figure CN119271259A_ABST
Patent Text Reader

Abstract

The invention relates to an integrated environment configuration method and device, electronic equipment and a storage medium, and the integrated environment configuration method comprises the steps: starting a target container according to an environment configuration requirement, and if an authorization file corresponding to a preset warehouse does not exist in the target container, executing a preset script compiler through the preset script compiler; compiling an authorization script file in the target container to obtain a target authorization file, the target authorization file comprising authorization login information corresponding to the preset warehouse, and obtaining warehouse data from the preset warehouse according to the authorization login information so as to perform integrated environment configuration based on the warehouse data, therefore, the integrated environment configuration can be carried out without manual operation, the problem that the configuration efficiency is low when the integrated environment configuration is carried out through manual operation in the prior art is solved, and the configuration efficiency of the integrated environment configuration can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to an integrated environment configuration method, device, electronic device and storage medium. Background Art

[0002] With the development of the Internet, various software programs are constantly being developed and applied. In the software development process, integrated environment configuration is a very important link, which involves building a complete development, testing and deployment environment for the entire life cycle of the application. In the specific process of integrated environment configuration, containers are usually used for configuration, and the software data used for integration is usually stored in a remote warehouse. At this time, it is necessary to obtain the software data from the remote warehouse through the container. The method adopted in the existing relevant technical means is to obtain the required software data from the remote warehouse through manual operation to configure the integrated environment. However, the integrated environment configuration through manual operation will have the problem of low configuration efficiency. Summary of the invention

[0003] In order to solve the above technical problems, the present application provides an integrated environment configuration method, device, electronic device and storage medium.

[0004] In a first aspect, the present application provides an integrated environment configuration method, comprising:

[0005] Start the target container according to the environment configuration requirements;

[0006] If the authorization file corresponding to the preset warehouse does not exist in the target container, compile according to the authorization script file in the target container to obtain a target authorization file, wherein the target authorization file includes the authorization login information corresponding to the preset warehouse;

[0007] According to the authorized login information, obtaining warehouse data from the preset warehouse;

[0008] An integrated environment configuration is performed based on the warehouse data to obtain an integrated environment configuration result.

[0009] Optionally, compiling according to the authorization script file in the target container to obtain a target authorization file includes:

[0010] Extract the authorization script file from the target container;

[0011] The authorization script file is encrypted and compiled by a preset script compiler to generate encryption code information and key information;

[0012] The target authorization file is generated based on the encrypted code information and the key information.

[0013] Optionally, after compiling the authorization script file in the target container to obtain the target authorization file, the method further includes:

[0014] Extracting the encryption code information and the key information from the target authorization file;

[0015] Decrypting the encrypted code information using the key information to obtain script logic information;

[0016] The authorized login information is extracted from the script logic information.

[0017] Optionally, obtaining warehouse data from the preset warehouse according to the authorized login information includes:

[0018] Sending the authorized login information to the preset warehouse;

[0019] Receiving a login verification result sent by the preset warehouse, where the login verification result is a verification result generated by the preset warehouse based on the authorized login information;

[0020] When the login verification result is a verification pass result, sending a data request to the preset warehouse;

[0021] Receive warehouse data fed back by the preset warehouse in response to the data request.

[0022] Optionally, sending the authorization login information to the preset warehouse includes:

[0023] Extracting account password information and valid authorization date from the authorized login information;

[0024] Get the local date;

[0025] If the local date is within the valid authorization date, the account and password information is sent to the preset warehouse.

[0026] Optionally, performing integrated environment configuration based on the warehouse data to obtain an integrated environment configuration result includes:

[0027] Performing integration environment configuration according to the warehouse data to obtain integration progress information;

[0028] If the integration progress information is integration completion information, the target container is destroyed and the integration environment configuration result is generated.

[0029] Optionally, after starting the target container according to the environment configuration requirements, the method further includes:

[0030] When the target container is started, extracting a preset detection script from the target container;

[0031] Run the detection script to detect whether the authorization file exists in the target container;

[0032] If the authorization file exists in the target container, the authorization file is determined as the target authorization file, and the step of acquiring warehouse data from the preset warehouse is performed according to the authorization login information.

[0033] In a second aspect, the present application provides an integrated environment configuration device, including:

[0034] The startup module is used to start the target container according to the environment configuration requirements;

[0035] A compiling module, for compiling the authorization script file in the target container by a preset script compiler to obtain a target authorization file if the authorization file corresponding to the preset warehouse does not exist in the target container, wherein the target authorization file includes the authorization login information corresponding to the preset warehouse;

[0036] An acquisition module, used to acquire warehouse data from the preset warehouse according to the authorized login information;

[0037] The integrated environment configuration module is used to perform integrated environment configuration based on the warehouse data to obtain an integrated environment configuration result.

[0038] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0039] Memory, used to store computer programs;

[0040] The processor is used to implement the integrated environment configuration method described in any one of the first aspects when executing the program stored in the memory.

[0041] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the integrated environment configuration method as described in any one of the first aspects is implemented.

[0042] The embodiment of the present application starts a target container based on the environment configuration requirements. If the authorization file corresponding to the preset warehouse does not exist in the target container, the authorization script file in the target container is compiled by a preset script compiler to obtain a target authorization file, and the target authorization file includes the authorization login information corresponding to the preset warehouse, and based on the authorization login information, the warehouse data is obtained from the preset warehouse to perform integrated environment configuration based on the warehouse data to obtain an integrated environment configuration result, so that the integrated environment configuration can be performed without manual operation, thereby solving the problem of low configuration efficiency of integrated environment configuration performed by manual operation in the existing related technology, and can effectively improve the configuration efficiency of the integrated environment configuration. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0045] Figure 1 A flowchart of an integrated environment configuration method provided in an embodiment of the present application;

[0046] Figure 2 A schematic diagram of the structure of an integrated environment configuration device provided in an embodiment of the present application;

[0047] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0049] Integrated environment configuration is mainly to configure an environment for running or testing applications in different environments. In the existing related technologies, containers are used to obtain software data from remote warehouses for configuration. There are two specific ways to obtain software data. One is to manually enter the account password to obtain software data from the remote warehouse for configuration. This method cannot perform remote automatic configuration, resulting in low configuration efficiency. The other method is SSH Key Pair (SSH Key Pair), SSH key pairs provide a secure way to authenticate, which allows users to log in to remote servers without a password. Using SSH key pairs for integrated environment configuration usually involves the following steps: Generate a new SSH key pair using the ssh-keygen command on the local computer. This will create a private key and a public key. Save the private key on the local computer and make sure it is safe. Configure the SSH client in the ~ / .ssh / config file to use this private key. Copy the public key to each server in the integrated environment and add it to the ~ / .ssh / authorized_keys file. This can be done with the ssh-copy-id command or manual copying. Edit the / etc / ssh / sshd_config file on the server and make sure public key authentication is enabled (PubkeyAuthentication yes), and possibly disable password authentication (PasswordAuthentication no) To improve security, use the SSH command to try to log in to the server without a password. If the configuration is correct, you will be able to log in directly without entering a password. Although this method can be used for secure communication and identity authentication, the private key is usually kept locally by the user, while the public key is placed on the remote server. In this way, the user can log in to the remote server securely without entering a password. However, since the private key needs to be kept locally by the user, the configuration environment has a high stability requirement during the application of this method. That is, when the configuration environment changes, such as changing the device or user, the private key cannot be retained, that is, it is impossible to log in to the remote server again. That is, there is a problem that the container cannot be migrated and has poor applicability due to lack of portability.

[0050] In order to solve the problems of low configuration efficiency and poor applicability of integrated environment configuration in the prior art, the present application provides an integrated environment configuration method, device, electronic device and storage medium. According to the environment configuration requirements, the target container is started. If the authorization file corresponding to the preset warehouse does not exist in the target container, the authorization script file in the target container is compiled by a preset script compiler to obtain a target authorization file. The target authorization file includes the authorization login information corresponding to the preset warehouse, and the warehouse data is obtained from the preset warehouse according to the authorization login information, that is, it plays a role in obtaining warehouse data from the preset warehouse without using an SSH key pair, so that the integrated environment configuration method of the present application has portability and achieves the purpose of improving applicability. Subsequently, the integrated environment configuration is performed based on the warehouse data to obtain the integrated environment configuration result, so that the integrated environment configuration can be performed without manual operation, thereby solving the problem of low configuration efficiency of the integrated environment configuration performed by manual operation in the existing related technology, and can effectively improve the configuration efficiency of the integrated environment configuration.

[0051] Figure 1 A flow chart of a method for determining a verification method provided in an embodiment of the present application. The method can be applied to one or more electronic devices such as a client and a server. In addition, the execution subject of the method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute the method, or a plurality of electronic devices can cooperate with each other to execute the method. When the above-mentioned execution subject is software, the method can be implemented as a plurality of software or software modules, or as a single software or software module. No specific limitation is made herein.

[0052] like Figure 1 As shown, the present application discloses an embodiment, providing an integrated environment configuration method, which may specifically include the following steps:

[0053] Step S110: Start the target container according to the environment configuration requirements.

[0054] Among them, the environment configuration requirement indicates the requirement for integrated environment configuration at present, and the environment configuration requirement can be generated by the startup instruction input by the user according to the requirement, or it can be generated by the server according to real-time detection information, and this embodiment does not make specific limitations on this; thus, the target container can be started according to the environment configuration requirement, and the target container represents a container pre-configured for integrated environment configuration. Of course, different environment configuration requirements can start different target containers, and this embodiment does not make specific limitations on this.

[0055] Step S120: If the authorization file corresponding to the preset warehouse does not exist in the target container, compile according to the authorization script file in the target container to obtain a target authorization file, which includes the authorization login information corresponding to the preset warehouse.

[0056] Specifically, after starting the target container, it can be determined whether there is an authorization file in the target container, and the authorization file represents a file containing authorization login preset warehouse information; if there is no authorization file corresponding to the preset warehouse in the target container, the authorization script file in the target container can be obtained, and the authorization script file can represent a script file containing authorization login preset warehouse information, and then the authorization script file can be compiled and encrypted to obtain the target authorization file, and the target authorization file represents a file containing authorization login information corresponding to the preset warehouse.

[0057] It can be seen that in this embodiment, by pre-configuring the authorization script file in the target container, when the target container is started, the authorization script file can be compiled to obtain the target authorization file containing the authorization login information, so that in the process of using the target container to configure the integrated environment, there is no need to use the SSH key pair. The authorization login information for logging into the preset warehouse can be obtained. That is, when the configuration environment changes, the SSH key pair cannot be used. The authorization script file can also be pre-configured in the target container to interact with the preset warehouse, so that the integrated environment configuration method of the present application has portability, thereby achieving the purpose of improving applicability.

[0058] In one example, after the container is started, if the authorization file corresponding to the preset warehouse does not exist in the target container, an authorization script file pre-configured in the target container, such as a shell script, can be obtained. Since the shell script records specific content in plain text, in order to improve data security, the shell script can be compiled by a preset shc script compiler, such as using the shc-f name.sh command to operate the shell script to generate a target authorization file corresponding to the shell script, such as generating two files, name.sh.x and name.sh.xc, where name.sh.x supports renaming and name.sh.xc can be deleted, so that the plain text shell script file can be compiled and encrypted into an unreadable binary target authorization file; of course, the above is only an example for illustration, and the specific implementation example can be adaptively adjusted according to needs and scenarios, and this embodiment is not specifically limited by comparison.

[0059] Step S130: Obtain warehouse data from a preset warehouse according to the authorized login information.

[0060] Specifically, after obtaining the target authorization file, the authorization login information can be extracted from the target authorization file. The authorization login information represents the information used to authorize login to the preset warehouse, such as account password, identification code and other information, and the preset warehouse represents the data used to store the integrated environment configuration, such as software application data, environment configuration parameters, application files and other data; thus, the authorization login information can be used to log in to the preset warehouse, and the warehouse data can be obtained from the preset warehouse. The warehouse data represents the configuration data corresponding to the target container, that is, when performing different integrated environment configurations, different target containers can be determined, and warehouse data for configuring different integrated environment configurations can be obtained from the preset warehouse based on different target containers.

[0061] Step S140: Perform integration environment configuration based on the warehouse data to obtain an integration environment configuration result.

[0062] Specifically, after obtaining the warehouse data, the integrated environment configuration can be performed based on the warehouse data to obtain the integrated environment configuration result. Since the warehouse data can contain software application data, environment configuration parameters and other data, the integrated environment configuration can include the configuration of the integrated software and the integrated environment, and the integrated environment configuration result is generated after the configuration is completed. The integrated environment configuration result can be the integrated environment configuration completion result or the integrated environment configuration failure result.

[0063] It can be seen that in this embodiment, the target container is started according to the environment configuration requirements. If the authorization file corresponding to the preset warehouse does not exist in the target container, the authorization script file in the target container is compiled by the preset script compiler to obtain the target authorization file. The target authorization file contains the authorization login information corresponding to the preset warehouse, and the warehouse data is obtained from the preset warehouse according to the authorization login information, which means that the warehouse data can be obtained from the preset warehouse without using an SSH key pair. This makes the integrated environment configuration method of the present application portable and achieves the purpose of improving applicability. Subsequently, the integrated environment configuration is performed based on the warehouse data to obtain the integrated environment configuration result, so that the integrated environment configuration can be performed without manual operation, thereby solving the problem of low configuration efficiency of integrated environment configuration performed by manual operation in the existing related technology, and can effectively improve the configuration efficiency of the integrated environment configuration.

[0064] In an optional embodiment of the present application, step S120 is compiled according to the authorization script file in the target container to obtain the target authorization file, which may specifically include the following sub-steps: extracting the authorization script file from the target container; encrypting and compiling the authorization script file through a preset script compiler to generate encryption code information and key information; and generating the target authorization file based on the encryption code information and key information.

[0065] In this embodiment, when there is no authorization file corresponding to the preset warehouse in the target container, the authorization script file can be extracted from the target container, and the authorization script file can be pre-configured in the target container. Then, the authorization script file can be encrypted and compiled by the preset script compiler to generate encrypted code information and key information, wherein the preset script compiler can be pre-configured in the target container, and the encrypted code information can represent the code information obtained after encrypting and compiling the authorization script file, and the key information represents the key generated synchronously when encrypting and compiling the authorization script file.

[0066] It can be seen that in this embodiment, after the target container is started, if there is no authorization file corresponding to the preset warehouse in the target container, the script compiler can be automatically run to encrypt and compile the authorization script file containing the authorization login information in time, thereby avoiding the problem of authorization login information leakage and improving security.

[0067] In an optional embodiment of the present application, the authorized script file is encrypted and compiled by a preset script compiler to generate encrypted code information and key information, which may specifically include the following sub-steps: the authorized script file is encrypted and compiled by a script compiler to generate compiled code information, array information and key information; the compiled code information and array information are used to generate encrypted code information.

[0068] In this embodiment, in the process of encrypting and compiling the authorized script file using a script compiler, code information, array information and key information can be compiled specifically, wherein the compiled code information is the code information generated by compiling the authorized script file, and the array information can represent an array generated during the encoding process for obfuscating the code. The specific array information can include one or more arrays, so that the array information can be combined with the compiled code information to generate encrypted code information, so that the encrypted code information contains array information for obfuscating the code, thereby increasing the difficulty of disassembly.

[0069] In one example, when the script compiler is an shc compiler and the authorized script file is a shell script file, encrypting and compiling the shell script file through the shc compiler tool is actually an encryption operation on the content of the shell script file, and encrypting and encoding the shell script file in a logically readable plaintext code state into encrypted code information of an unreadable binary file, thereby achieving the purpose of keeping the authorized script file confidential. Specifically, the encryption principle of the shc compiler tool is a process of generating a C code file from a shell script file through the -f parameter, in which a set of keys, i.e., key information, is generated in the process, and the key algorithm uses the rc4 algorithm, and multiple arrays, i.e., array information, are generated at the same time, which plays a role in confusing the code in the compiled code information, making the disassembly difficulty increased; the key information generated in the process, because rc4 is a sequential stream encryption algorithm, so each time the same script executes the -f parameter to generate an encrypted file, the generated key information is random, and the ciphertext is different, thereby increasing the reliability of encryption.

[0070] In an optional embodiment of the present application, step S120 is compiled according to the authorization script file in the target container. After obtaining the target authorization file, it may further include the following sub-steps: extracting encryption code information and key information from the target authorization file; decrypting the encryption code information using the key information to obtain script logic information; and extracting authorization login information from the script logic information.

[0071] In this embodiment, after compiling according to the authorization script file in the target container to obtain the target authorization file, the encrypted code information and key information can be extracted from the target authorization file, and the encrypted code information can be decrypted using the key information to obtain script logic information. The script logic information represents the script logic represented by the authorization script file before encryption. At this time, the authorization login information can be extracted from the script logic information. The specific extraction method can be to execute the script logic information to generate the authorization login information.

[0072] In one example, the process of determining the authorized login information in the target authorization file can be to run the encrypted executable file, that is, to run the encrypted code information, and based on the key information, combine the rc4 function to decrypt the encrypted code information, obtain the script logic information before encryption, and then execute the decrypted script logic information to obtain the authorized login information. Subsequently, the script logic information can be deleted to prevent leakage and improve security.

[0073] In an optional embodiment of the present application, step S130 obtains warehouse data from the preset warehouse based on the authorized login information, and may specifically include the following sub-steps: sending the authorized login information to the preset warehouse; receiving the login verification result sent by the preset warehouse, the login verification result is the verification result generated by the preset warehouse based on the authorized login information; when the login verification result is a verification pass result, sending a data request to the preset warehouse; receiving the warehouse data fed back by the preset warehouse in response to the data request.

[0074] Specifically, in this embodiment, after obtaining the target authorization file, the authorization login information can be determined based on the target authorization file, and then the authorization login information can be sent to the preset warehouse, so that the preset warehouse verifies the authorization login information and generates a login verification result. The verification process of the preset warehouse can verify whether the authorization login information is legal, and can also verify the validity period of the authorization login information. This embodiment does not make specific limitations on this. The login verification result is used to indicate whether the current authorization login information has passed the verification and can establish communication for data interaction, that is, the login verification result can be a verification pass result or a verification failure result; thereby, the login verification result sent by the preset warehouse can be received, and the login verification result is the verification result generated by the preset warehouse based on the sent authorization login information, and it is determined whether the login verification result is a verification pass result. When the login verification result is a verification pass result, it can be determined that the current authorization login information has passed the verification and can establish communication with the preset warehouse for data interaction. At this time, a data request can be sent to the preset warehouse, so that the preset warehouse can feedback warehouse data according to the data request, and then the warehouse data fed back by the preset warehouse for the data request can be received.

[0075] In one example, you can run a pipeline script on the Jenkins platform. The script uses a shell command to operate the clone_git tool to clone remote warehouse files. Specifically, you can first define a Pipeline stage named "git clone" and use Steps to indicate the start step. You can place specific operation instructions here, such as sh"', which is a shell step used to execute Shell commands. Then you can use docker exec -i Test_contain / bin / bash-c" to use the docker exec command to execute the / bin / bash script in the container named Test_contain in an interactive (-i) container. The -c option is used to specify the subsequent commands, and then the commands in the container can be executed.

[0076] "cd / opt / clone_git${inte_branch}${asw_http_URL} / clone_git${SVN_TOOL}": The specific execution method can be, switch to the / opt / clone_git directory through the cd command, the directory name is followed by two variables inte_branch and asw_http_URL, they may represent the integration branch and HTTP URL address, and then execute the script or program in the / clone_git directory (specified by the SVN_TOOL variable); where inte_branch is the branch name, asw_http_URL is the Uniform Resource Locator (URL) of the remote distributed version control tool (GIT warehouse), and SVN_TOOL is the remote sub-version control system (Subversion, SVN) warehouse URL. At this time, after executing the above command through the script, the remote warehouse file can be obtained without password; of course, the above is only an example for illustration, and the specific implementation example can be adaptively adjusted according to needs and scenarios, and this embodiment is not specifically limited by comparison.

[0077] In an optional embodiment of the present application, the authorized login information is sent to the preset warehouse, which may specifically include the following sub-steps: extracting the account password information and the valid authorization date from the authorized login information; obtaining the local date; if the local date is within the valid authorization date, sending the account password information to the preset warehouse.

[0078] In this embodiment, after determining the authorized login information, the account password information and the valid authorization date can be extracted from the authorized login information, wherein the account password information represents the information used to log in and verify the preset warehouse, and the valid authorization date represents the validity period of the target container. Then the local date can be obtained, and the local date represents the current real-time date, so that it can be determined whether the local date is within the valid authorization date. If the local date is not within the valid authorization date, it means that the validity period of the authorization script file of the current target container has expired, and there is no right to log in to the pre-examination warehouse to obtain warehouse data. At this time, there is no need to execute subsequent steps, and an expired prompt message is output; if the local date is within the valid authorization date, it means that the authorization script file of the current target container is still within the validity period, and the account password information can be sent to the preset warehouse, and then the warehouse data can be obtained from the pre-examination warehouse.

[0079] In one example, the ssh-key verification method used in the existing related technology is equivalent to permanent authorization as long as the ssh-key is configured and the environment is not destroyed. At this time, there is a problem that is not conducive to term management. In this embodiment, the effective authorization date in the authorization login information can be used to specifically manage the term of the authorization script file of each target container. The specific method can also be to modify the account password information to make the authorization script file invalid, or to add the -e parameter to specify the expiration time, that is, to configure the effective authorization date, for example, it expires on 20240628. The operation command example is: shc-e 28 / 06 / 2024-f name.sh. Of course, the above is only an example for illustration. The specific implementation example can be adaptively adjusted according to needs and scenarios. This embodiment is not specifically limited by comparison.

[0080] In an optional embodiment of the present application, step S140 performs integration environment configuration based on warehouse data to obtain integration environment configuration results, which may specifically include the following sub-steps: performing integration environment configuration based on warehouse data to obtain integration progress information; if the integration progress information is integration completion information, destroying the target container and generating an integration environment configuration result.

[0081] In this embodiment, in the process of configuring the integrated environment based on the warehouse data, integration progress information can be obtained, and the integration progress information indicates the progress of the current integrated environment configuration. When the integration progress information is integration completion information, it means that the current integrated environment configuration has been completed. At this time, the target container can be destroyed and the integrated environment configuration result can be generated, thereby releasing system resources.

[0082] It can be seen that compared with the response-related technology that uses a containerized environment with a commonly used shh-key configuration, the strategy selection for remote non-confidential cloning operations requires that the container environment must exist stably for a long time and cannot be destroyed and rebuilt. Therefore, when the environment is idle, there is a problem of long-term occupation of system resources. In this embodiment, when the integrated environment configuration is completed, the target container is destroyed, thereby avoiding the problem of long-term occupation of system resources and achieving the purpose of effectively releasing system resources.

[0083] In an optional embodiment of the present application, after starting the target container according to the environment configuration requirements, step S110 may further include the following sub-steps: when the target container is started, extracting a preset detection script from the target container; running the detection script to detect whether there is an authorization file in the target container; if there is an authorization file in the target container, determining the authorization file as the target authorization file, and executing the step of obtaining warehouse data from the preset warehouse according to the authorization login information.

[0084] In this embodiment, when the target container is started, a preset detection script can be extracted from the target container. The detection script represents a script for detecting the authorization file. Then, the detection script can be run to check whether there is an authorization file in the target container. When the authorization file exists in the target container, the authorization file can be determined as the target authorization file, and the step of obtaining warehouse data from the preset warehouse based on the authorized login information is executed; that is, the authorization file can be configured during the pre-creation process of the target container, thereby improving the operating efficiency of the target container.

[0085] In one example, when the detection script is the / root.bashre script, when the target container starts, the / root.bashre script can be obtained and run by itself to detect whether the authorization file exists. The detection command can be as follows:

[0086] if[! -f / opt / clone_git];then shc -f / opt / clone_git.sh -o / opt / clone_git;rm

[0087] / opt / clone_git.sh*;fi

[0088] In addition, the process of creating the target container in this application can be as follows:

[0089] 1) Use the apt-get command to obtain the Ubuntu 20.04 operating system base image.

[0090] 2) Compile the Dockerfile tool and customize the basic image of the operating system. Specifically, you can add sed-i's / archive.ubuntu.com / mirrors.aliyun.com / g' / etc / apt / sources.list in the Dockerfile to update the domestic mirror source.

[0091] 3) Add apt get operation. To deploy shc and gcc tools in the image, first use RUNapt update\, which plays the role of Docker instruction and is used to execute the apt update command in the container. This command will update the local package list to ensure that the subsequent installation command can obtain the latest version of the package. Then, you can use &&apt install-y shc gcc\ to install shc and gcc (GNU, the -y option means automatically accepting all prompts during the installation process without manual confirmation; continue to use apt install-y command to install git (a distributed version control system), subversion (a version control system) and pip (Python package management tool) to execute the / opt / run.sh script file. run.sh is a script that needs to be executed when building the image. It is located in the / opt directory of the container. Then execute the dpkg-reconfigure dash command, which is used to reconfigure dash (Debian Almquist Shell) to ensure that dash is correctly configured as a login shell.

[0092] 4) After installing the shc and gcc tools, you also need to deploy the git and svn tools to obtain the file data of the preset repository. You can also use the dpkg-reconfigure dash command to allow the use of the dash interpreter to increase the compatibility of shell command execution in the image.

[0093] 5) For other applications that need to be deployed directly on the operating system, you can continue to add the apt install command after &&apt install-ygitsubversion pip\ or add them one by one after pip in the &&apt install-y git subversionpip\ line with spaces to install the application in the container.

[0094] 6) bash / opt / run.sh reduces the number of operations that need to be completed through multiple RUN commands by running the run.sh script. Fewer RUN commands can be used, which can effectively reduce the size of the built image. The run.sh script is introduced so that when the container starts, shc can be directly run to encrypt files and install offline files;

[0095] 7) For software packages that cannot be deployed using the apt command, you can deploy them by running the run.sh script. The permission file git_clone.sh provides the account information required to download files in the git or svn repository, which cannot be displayed in plain text after the container is started.

[0096] 8) Use the COPY . / clone_git.sh / opt / command in the Dockerfile to copy the plaintext script file to the workspace.

[0097] 9) In the run.sh script, write a command to the user login tool ~ / .bashrc to detect whether clone_git.sh has been encrypted when the user logs in. If it is not encrypted, use shc -f / opt / clone_git.sh -o

[0098] / opt / clone_git command to encrypt and rename. Then use the rm / opt / clone_git.sh* command to delete the original plaintext password file and related files.

[0099] 10) Run docker build –t<images name> .Repackage the image.

[0100] 11) After the new image is built, use the command docker save -o<pkg name> .tar<image name> Save as a local mirror tarball,<pkg name> .tar is the name of the tarball you want to save.<image name> It is the image name, which consists of REPOSITORY:TAG.

[0101] Of course, the above is only an example for illustration. The specific implementation can be adaptively adjusted according to needs and scenarios, and this embodiment is not specifically limited. In this embodiment, the integrated environment is configured through the target container, and the compatibility and portability between the integrated environment and the operating system can be improved through containerization technology, and the interference between different integrated services under the same host can be isolated and protected. Personalized customization, encrypted management accounts, system configuration modification and other operations are performed in the container image to improve the flexibility of use without affecting the customer host. It can also be destroyed after use, and does not occupy system resources during non-business hours.

[0102] like Figure 2 As shown, the present application also discloses an embodiment, providing an integrated environment configuration device, which may include the following modules:

[0103] A startup module 210 is used to start a target container according to the environment configuration requirements;

[0104] A compiling module 220 is used to compile a target authorization file according to the authorization script file in the target container if the authorization file corresponding to the preset warehouse does not exist in the target container, and the target authorization file includes the authorization login information corresponding to the preset warehouse;

[0105] An acquisition module 240, configured to acquire warehouse data from the preset warehouse according to the authorized login information;

[0106] The integrated environment configuration module 250 is used to perform integrated environment configuration based on the warehouse data to obtain an integrated environment configuration result.

[0107] In an optional embodiment of the present application, the compiling module 220 may include:

[0108] An extraction unit, used to extract the authorization script file from the target container;

[0109] The encryption compilation unit is used to encrypt and compile the authorized script file through a preset script compiler to generate encryption code information and key information;

[0110] A generating unit is used to generate the target authorization file based on the encryption code information and the key information.

[0111] In an optional embodiment of the present application, the encryption compilation unit may include:

[0112] The encryption compilation subunit is used to encrypt and compile the authorized script file through the script compiler to generate compilation code information, array information and the key information;

[0113] A generating subunit is used to generate the encrypted code information by using the compiled code information and the array information.

[0114] In an optional embodiment of the present application, the integrated environment configuration device may further include:

[0115] A first extraction module, used for extracting the encryption code information and the key information from the target authorization file;

[0116] A decryption module, used to decrypt the encrypted code information using the key information to obtain script logic information;

[0117] The second extraction module is used to extract the authorized login information from the script logic information.

[0118] In an optional embodiment of the present application, the acquisition module 240 may include:

[0119] A first sending unit, used to send the authorized login information to the preset warehouse;

[0120] A first receiving unit, configured to receive a login verification result sent by the preset warehouse, wherein the login verification result is a verification result generated by the preset warehouse based on the authorized login information;

[0121] A second sending unit, configured to send a data request to the preset warehouse when the login verification result is a verification pass result;

[0122] The second receiving unit is configured to receive warehouse data fed back by the preset warehouse in response to the data request.

[0123] In an optional embodiment of the present application, the first sending unit may include:

[0124] An extraction subunit, used to extract account password information and valid authorization date from the authorized login information;

[0125] Get the subunit to get the local date;

[0126] The sending subunit is used to send the account and password information to the preset warehouse if the local date is within the valid authorization date.

[0127] In an optional embodiment of the present application, the integrated environment configuration module 250 may include:

[0128] An integration environment configuration unit, used to configure the integration environment according to the warehouse data to obtain integration progress information;

[0129] A destroying unit is used to destroy the target container and generate the integration environment configuration result if the integration progress information is integration completion information.

[0130] In an optional embodiment of the present application, the integrated environment configuration device may further include:

[0131] A third extraction module, configured to extract a preset detection script from the target container when the target container is started;

[0132] A running module, used to run the detection script to detect whether the authorization file exists in the target container;

[0133] The determination module is used to determine the authorization file as the target authorization file if the authorization file exists in the target container, and execute the step of obtaining warehouse data from the preset warehouse according to the authorization login information.

[0134] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0135] like Figure 3As shown, an embodiment of the present application provides an electronic device, including a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340;

[0136] Memory 330, for storing computer programs;

[0137] In one embodiment of the present application, the processor 310 is used to execute the program stored in the memory 330, implement the integrated environment configuration method provided by any of the above method embodiments, start the target container according to the environment configuration requirements, and if the authorization file corresponding to the preset warehouse does not exist in the target container, compile the authorization script file in the target container through the preset script compiler to obtain the target authorization file, the target authorization file includes the authorization login information corresponding to the preset warehouse, and obtain the warehouse data from the preset warehouse according to the authorization login information, that is, it plays the role of obtaining the warehouse data from the preset warehouse without using the SSH key pair, so that the integrated environment configuration method of the present application has portability and achieves the purpose of improving applicability, and then performs the integrated environment configuration based on the warehouse data to obtain the integrated environment configuration result, so that the integrated environment configuration can be performed without manual operation, thereby solving the problem of low configuration efficiency of the integrated environment configuration performed by manual operation in the existing related technology, and can effectively improve the configuration efficiency of the integrated environment configuration. .

[0138] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the integrated environment configuration method provided by any of the above method embodiments is implemented. According to the environment configuration requirements, the target container is started. If there is no authorization file corresponding to the preset warehouse in the target container, the authorization script file in the target container is compiled by a preset script compiler to obtain a target authorization file. The target authorization file contains the authorization login information corresponding to the preset warehouse, and according to the authorization login information, the warehouse data is obtained from the preset warehouse, that is, it plays the role of obtaining warehouse data from the preset warehouse without using an SSH key pair, so that the integrated environment configuration method of the present application has portability and achieves the purpose of improving applicability. Subsequently, the integrated environment configuration is performed based on the warehouse data to obtain the integrated environment configuration result, so that the integrated environment configuration can be performed without manual operation, thereby solving the problem of low configuration efficiency of integrated environment configuration performed by manual operation in the existing related technology, and can effectively improve the configuration efficiency of integrated environment configuration. .

[0139] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0140] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0141] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. An integrated environment configuration method, characterized in that: include: Start the target container according to the environment configuration requirements; If the authorization file corresponding to the preset warehouse does not exist in the target container, compile according to the authorization script file in the target container to obtain a target authorization file, wherein the target authorization file includes the authorization login information corresponding to the preset warehouse; According to the authorized login information, obtaining warehouse data from the preset warehouse; An integrated environment configuration is performed based on the warehouse data to obtain an integrated environment configuration result.

2. The integrated environment configuration method according to claim 1, characterized in that: The step of compiling the authorization script file in the target container to obtain the target authorization file includes: Extract the authorization script file from the target container; The authorization script file is encrypted and compiled by a preset script compiler to generate encryption code information and key information; The target authorization file is generated based on the encrypted code information and the key information.

3. The integrated environment configuration method according to claim 2, characterized in that: The authorization script file is encrypted and compiled by a preset script compiler to generate encryption code information and key information, including: The authorized script file is encrypted and compiled by the script compiler to generate compiled code information, array information and the key information; The encrypted code information is generated using the compiled code information and the array information.

4. The integrated environment configuration method according to claim 2, characterized in that: After compiling the authorization script file in the target container to obtain the target authorization file, the method further includes: Extracting the encryption code information and the key information from the target authorization file; Decrypting the encrypted code information using the key information to obtain script logic information; The authorized login information is extracted from the script logic information.

5. The integrated environment configuration method according to claim 1, characterized in that: The obtaining warehouse data from the preset warehouse according to the authorized login information includes: Sending the authorized login information to the preset warehouse; Receiving a login verification result sent by the preset warehouse, where the login verification result is a verification result generated by the preset warehouse based on the authorized login information; When the login verification result is a verification pass result, sending a data request to the preset warehouse; Receive warehouse data fed back by the preset warehouse in response to the data request.

6. The integrated environment configuration method according to claim 5, characterized in that: The sending the authorization login information to the preset warehouse includes: Extracting account password information and valid authorization date from the authorized login information; Get the local date; If the local date is within the valid authorization date, the account and password information is sent to the preset warehouse.

7. The integrated environment configuration method according to claim 1, characterized in that: The integrated environment configuration is performed based on the warehouse data to obtain the integrated environment configuration result, including: Performing integration environment configuration according to the warehouse data to obtain integration progress information; If the integration progress information is integration completion information, the target container is destroyed and the integration environment configuration result is generated.

8. An integrated environment configuration device, characterized in that: include: The startup module is used to start the target container according to the environment configuration requirements; A compiling module, for compiling according to the authorization script file in the target container to obtain a target authorization file if the authorization file corresponding to the preset warehouse does not exist in the target container, wherein the target authorization file includes the authorization login information corresponding to the preset warehouse; An acquisition module, used to acquire warehouse data from the preset warehouse according to the authorized login information; The integrated environment configuration module is used to perform integrated environment configuration based on the warehouse data to obtain an integrated environment configuration result.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the integrated environment configuration method described in any one of claims 1 to 7 when executing the program stored in the memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the integrated environment configuration method according to any one of claims 1 to 7 is implemented.