- Saved searches
- Use saved searches to filter your results more quickly
- vicenteguerra/git-deploy
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
- Saved searches
- Use saved searches to filter your results more quickly
- jonls/php-git-server
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
- Saved searches
- Use saved searches to filter your results more quickly
- License
- Licenses found
- AndyD87/CcGitServer
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Php Script for Auto-Pull in server (Using WebHook from GitLab, GitHub and Bitbucket)
vicenteguerra/git-deploy
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
A PHP script to automatically pull from a repository to a web server (using a webhook on GitHub, GitLab, or Bitbucket).
You can configure which branch this script pulls from. This script is useful for both development and production servers.
Generate an SSH key and add it to your account so that git pull can be run without a password.
Copy the git-deploy folder and its contents in to your public folder (typically public_html). Note that you can change the name of the folder if desired.
Rename git-deploy/deploy.sample.php to git-deploy/deploy.php, and update each variable to a value that suits your needs. Multiple copies of git-deploy/deploy.sample.php can be made for multiple projects or versions (you just need to change the webhook url to match the new name). An example of a live configuration is below.
define("TOKEN", "secret-token"); define("REMOTE_REPOSITORY", "git@github.com:username/custom-project.git"); define("DIR", "/var/www/vhosts/repositories/custom-project"); define("BRANCH", "refs/heads/master"); define("LOGFILE", "deploy.log"); define("GIT", "/usr/bin/git"); define("MAX_EXECUTION_TIME", 180); define("BEFORE_PULL", "/usr/bin/git reset --hard @ "); define("AFTER_PULL", "/usr/bin/node ./node_modules/gulp/bin/gulp.js default");
When deploy.php is called by the web-hook, the webserver user ( www , www-data , apache , etc. ) will attempt to run git pull . . Since you probably cloned into the repository as yourself, and your user therefore owns it, the webserver user needs to be given write access. It is suggested this be accomplished by changing the repository group to the webserver user’s and giving the group write permissions:
- Open a terminal to the directory containing the repository on the server.
- run sudo chown -R $USER:webserverusername custom-project-repo-dir/.git/ to change the group of the repo.
- run sudo chmod -R g+s custom-project-repo-dir/.git/ to make the group assignment inherited for new files/dirs.
- run sudo chmod -R 775 custom-project-repo-dir/.git/ to set read & write for both owner and group.
On GitHub | GitLab | Bitbucket
In your repository, navigate to Settings → Webhooks → Add webhook, and use the following settings:
- Payload URL: https://www.yoursite.com/git-deploy/deploy.php
- Content type: application/json
- Secret: The value of TOKEN in config.php
- Which events would you like to trigger this webhook?: 🔘 Just the push event
- Active: ☑️
Click «Add webhook» to save your settings, and the script should start working.
In your repository, navigate to Settings → Integrations, and use the following settings:
- URL: https://www.yoursite.com/git-deploy/deploy.php
- Secret Token: The value of TOKEN in config.php
- Trigger: ☑️ Push events
- Enable SSL verification: ☑️ (only if using SSL, see GitLab’s documentation for more details)
Click «Add webhook» to save your settings, and the script should start working.
In your repository, navigate to Settings → Webhooks → Add webhook, and use the following settings:
- Title: git-deploy
- URL: https://www.yoursite.com/git-deploy/deploy.php?token=secret-token
- Active: ☑️
- SSL / TLS: ⬜ Skip certificate verification (only if using SSL, see Bitbucket’s documentation for more details)
- Triggers: 🔘 Repository push
Click «Save» to save your settings, and the script should start working.
If you’d prefer to integrate git-deploy with your CI scripts rather than using traditional Webhooks, you can trigger the hook via the following wget command.
wget --quiet --output-document=- --content-on-error --header="Content-Type: application/json" --post-data='' 'https://www.example.com/git-deploy/deploy.php?token=secret-token'
Additionally, you can add the parameters sha=COMMIT_HASH and reset=true to the URL in order to instruct git-deploy to reset to a specific commit. Note that this will overwrite any local changes you may have made. This can be useful for integration with things like GitLab’s Environments feature.
I appreciate the collaboration of @JacobDB
About
Php Script for Auto-Pull in server (Using WebHook from GitLab, GitHub and Bitbucket)
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
No-dependency, PHP implementation of the Git HTTP protocol.
jonls/php-git-server
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
This is an implementation of the simple Git HTTP protocol in PHP. It allows you to serve Git repositories from a simple PHP-enabled server in situations where the git command is not available.
Git is not required to be installed on the server. There is no dependency on the git command, thus it can be installed on a server where git is not available.
It serves most files directly from the files system, and also generates the files /info/refs and /objects/info/packs , without the need for executing git update-server-info on the server.
About
No-dependency, PHP implementation of the Git HTTP protocol.
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
PHP based server for git repositories with integrated webdav
License
LGPL-3.0, GPL-3.0 licenses found
Licenses found
AndyD87/CcGitServer
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Target of this git server for HTTP is to keep configuration and requirements as simple as possible. This server supports both: dumb and smart https. The used method will be automaticaly selected by checking the Requirements on server.
Some setups for git, to publish repositories, over HTTP requires a seperate webDAV module for push support.
For example, a git repository with apache requires to setup DAV in it’s http.conf, wich makes the repositories not very portable. To avoid this configurations CcGitServer implements a very simplified DAV Server to communicate with git.
This makes it possible to keep files and folders outside of webserver directory.
Additionally, it is possible to connect with a separate user interface.
It is currently working as background application.
At the moment, there is no ui to browse projects, but is planed. You will see the progress on Project Page.
Nevertheless some requirements are necessary:
For smart http:
For dumb http:
- php-xml
- for clone and fetching nothing is required.
- for push support, the webserver must be able to pass through PROPFIND, LOCK. requests.
No auth required for clone or fetch. Default users for push:
It is very important to change this valuess!
This project is designed to run without configuration in any directory in an webserver. Just the requirements as definied in Requirements must be available.
But it is recommended to change user data!
The next example will demonstrate a simple setup.
If a more complex setup is required, for example to integrate in a existing frameworkt, look at Integration
Example for apache on Ubuntu:
You can run the following example in one script at Tools/ExampleUbuntuSetup.sh.
Be aware to use this script in a productive system, it’s just an example.
Install apache and php with modules
sudo apt-get install apache2 php php-xml sudo a2enmod redirect sudo service apache2 restart
If .htaccess is not already enabled
sudo echo "" | sudo tee -a /etc/apache2/sites-available/000-default.conf sudo echo " AllowOverride All" | sudo tee -a /etc/apache2/sites-available/000-default.conf sudo echo " " | sudo tee -a /etc/apache2/sites-available/000-default.conf
cd /var/www/html sudo git clone https://github.com/AndyD87/CcGitServer.git git
cd /var/www/html/git sudo php git.php create ExampleProject sudo chown -R www-data.www-data *
First clone from repository
cd ~ git clone http://localhost/git/Example.git
Other than in Setup, the CcGitServer can be configured to run in more complex envirionments too.
Some webpages already have an user control or have seperate data folders, they can integrate CcGitServer by confguring thier own interfaces.
You can see an example in /Tools/ExampleUbuntuIntegration/git.php
For an working example you can use /Tools/ExampleUbuntuIntegrationSetup.sh
Do not use it in productive systems, it’s just for demonstration purpose.
The server can be configured to run with different directories too.
By setting an own implementation of ICcLinkConverter to CcGitServer::setLinkConverter(), it is possible to work with projects in different locations.
CcLinkConverter can be used as an example for a default configuration and can be overloaded to.
By setting an own implementation of IGitServerAuth to CcGitServer::setAuth(), it is possible to work with an own
With CcGitServerAuth there is a default implementation of IGitServerAuth, wich will be loaded if no other Interfwas was set.
This system is very rudimental, and mainly designed to run on internal networks.
- Security features It is dangerous to run it on internet,
- Avoid dependency from php-xml
- test locking, it is just working with .lock files
- Simple html ui for browsing projects
If you need help, you can find me on GitHub or on my Website.
Author CcGitServer: Andreas Dirmeier
CcGitServer is licensed under LGPL v3. Look at COPYING and COPYING.LESSER for further information.
About
PHP based server for git repositories with integrated webdav