1 / 6

Git Guide for System Administrators

The Git Version Control feature is used to alter certain configuration changes, such as gc.auto. A Git RPM provided by cPanel is used by this feature.<br>

htshosting
Télécharger la présentation

Git Guide for System Administrators

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Git Version Control is a feature, which includes many changes when compared with the Git default configuration. Certain restrictions are also imposed on cPanel-hosted

  2. repositories. cPanel is a popular Linux-based web hosting control panel. Through it you can manage all services of your web hosting account in a single place. Web hosting is the service through which websites are made accessible over the Internet. This service is provided by web hosting companies. In web hosting, server space is made available for storing web content. When the stored web content is delivered over the Internet to the Internet-connected devices of users then websites become accessible. Server space as well as the necessary technologies and services are included in web hosting service. Web hosting can be of many types, such as shared, reseller, dedicated, VPS, cloud, and WordPress. In order to be known as the “Best Website Hosting Company”, or as the “Top Cloud Hosting Company” or as the “Best Linux Hosting Company”, a web hosting service provider needs to provide not only an outstanding quality of service but also such hosting plans that are budget-friendly and which cater to various hosting requirements, and HTS Hosting excels in it. Limitations of the Git Version Control Feature The following restrictions are imposed by the Git Version Control feature on cPanel-hosted repositories: Only a single remote repository is supported for each local repository. Users need to use only the command line, if they want to use multiple remote repositories. Neither whitespace nor the following characters can be included by users in repository paths: \ * | " ' < > & @ ` $ { } [ ] ( ) ; ? : = % # This feature cannot be used for creating, viewing, or deleting repositories in the following cPanel controlled directories: .cpanel, .cphorde, .htpasswds, .ssh, .trash, access-logs, cgi-bin, etc, perl5, logs, mail, ssl, spamassassin, var, tmp. The . or .. directory references cannot be used by cPanel users while entering the repository path in the interface. Changes in Configuration The below-mentioned configuration settings can be changed through this feature. gc.auto – The garbage-collection setting of Git has been disabled for all repositories managed by cPanel. receive.denyCurrentBranch – This setting is automatically set by the system to the updateInstead option in each configuration file of cPanel-managed repository. This configuration is ensured by the system each time that a new repository is created via the function of VersionControl::create. The working tree is automatically updated by Git due to the updateInstead option. This happens whenever changes are pushed into the current branch. A cPanel provided Git RPM is used by this feature. Git binaries are symlinked by the Git RPM in the /usr/local/cpanel/3rdparty/bin/ directory to the

  3. /usr/local/cpanel/3rdparty/lib/path-bin/ directory. This ensures that these exist in the default path of the user. Deployment It is highly recommended that changes be deployed on your local computer from a remote repository or its clone. The contents of the repository that is managed by cpanel should not be changed directly. Repositories need to meet the below-mentioned requirements prior to deployment. A clean working tree. A valid checked-in file, .cpanel.yml, in the top-level directory. One or multiple local or remote branches. The system won’t display deployment information if these requirements are not met by a repository. Moreover, the system will disable deployment functionality. Certain important points need to be mentioned here. These are as follows: A post-receive hook is added by the system to all cPanel-managed repositories. Any command can be run automatically by this hook, in the .cpanel.yml file, when changes are deployed. Historical data related to the deployment process is stored by the system in an SQLite database within the file, /home/user/.cpanel/datastore/vc_deploy.sqlite. In it, the cPanel account name is represented by the term “user”. SSH Host Key Verification The system automatically checks for the public SSH key of the remote server in the file, /home/user/.ssh/known_hosts, when a repository is cloned by users via SSH. In it, the term “user” is used for the username of the account. In the event that the remote host isn’t registered with the system, the system prompts the user to accept it. Subsequently it is added to the file, /home/user/.ssh/known_hosts. In it, the term “user” is used for the username of the account. The system displays a confirmation message when the remote host is already registered. The system displays a warning, when the public key of the remote host changes. You need to check for announcements regarding public key updates with regard to third-party remote hosts. Announcements about such changes are made by most companies which host repositories. In the context of remote hosts that are controlled by you, you need to take into consideration whether the recent events on your system have resulted in changes to the public key. Checks are performed by the system every time a user updates the information of the repository or tries to execute changes from the repository through the cPanel interface. You need to exercise caution when you can’t verify the change’s validity.

  4. This is especially true for such a repository that contains sensitive content. A Man-in-the- Middle attack can be indicated by an altered SSH key. The Enable strict SSH host key checking setting needs to be enabled in the Security section of the Tweak Settings interface in WHM. This enables the users to view these warnings. WHM >> Home >> Security >> Tweak Settings Troubleshooting The following steps should be used to troubleshoot the problems experienced by cPanel users with regard to their repositories: Missing Repositories –When repositories exist on the command line but are not displayed in the Git Version Control interface in cPanel, then the cause of the issue might be that the feature ignores repositories created by the users on the command line. Missing Branches –When the branches’ expected list isn’t displayed in the Git Version Control interface in cPanel, the cause of the issue can be the factors that have been mentioned below. The branches exist in the repository’s copies on your local computer or remote repository host. However, these do not exist within the cPanel- managed repository. It is a bare repository. Branches are not included in such repositories. Cloned Repositories– The system does clone the remote repository but the Git Version Control interface in cPanel only displays the repository path and name. cPanel >> Home >> Files >> Git Version Control When a repository is cloned by the users, the system clones it with the aid of a queued process, which runs as that cPanel user. Depending on the size of the repository that is being cloned, clones can consume a lot of time. Only the repository name, the repository path, along with a progress indicator are displayed by the Git Version Control interface in cPanel, when the clone process runs. Moreover, most of the management functionality for the repository is temporarily disabled by the system. The process_user_tasks binary runs as the cPanel user for processing each clone. Each user’s queue exists in his/her .capnel/user_tasks/ directory. You need to stop the process and delete the directory in order to resolve issues that have to do with clones.

  5. When a user tries to clone a remote repository via SSH and gets errors regarding a refused connection, then one of the following actions need to be carried out: The repository needs to be cloned in a read-only configuration via HTTPS. The SSH key pair of the cPanel account needs to be registered as a deployment key with the host of the remote repository. SSH Access –When problems are encountered with regard to SSH access, it needs to be ensured that the accounts of the users and the server, include the below- mentioned configurations and settings: The Shell Access setting is enabled for the account in the Modify an Account interface in WHM. WHM >> Home >> Account Functions >> Modify an Account The SSH Access & Terminal feature is enabled for the feature list of the user in the Feature Manager interface of WHM. WHM >> Home >> Packages >> Feature Manager It is possible to publicly access Port 22. You need to use the ssh -pport command to SSH in to the account, when a nonstandard Git port is used by the server. In it, the term “port” represents the port number. When none of the solutions that have been mentioned here are able to fix the issue, then you need to ensure that the public SSH keys of the user have been configured correctly in the SSH Access interface in cPanel. cPanel >> Home >> Security >> SSH Access Before concluding, let us mention the locations to which this feature logs the errors and messages. Queue-related items - /home/username/.cpanel/logs/user_task_runner.log Errors and stack traces - /usr/local/cpanel/logs/error_log Deployment-related issues - /home/username/.cpanel/logs/vc_TIMESTAMP_git_deploy.log In it, the term “TIMESTAMP” represents the operation’s time.

  6. Creation-related issues - /home/username/.cpanel/logs/vc_TIMESTAMP_git_create.log In it, the term “TIMESTAMP” represents the operation’s time.

More Related