vicenteguerra / git-deploy

Php Script for Auto-Pull in server (Using WebHook from GitLab, GitHub and Bitbucket)
641 stars 236 forks source link

Add native support for GitHub & GitLab secret tokens #8

Closed JacobDB closed 7 years ago

JacobDB commented 7 years ago

The logic would be something like:

  1. Check for $_SERVER["HTTP_X_HUB_SIGNATURE"] (GitHub token)
  2. If no GitHub token exists, check for $_SERVER["HTTP_X_GITLAB_TOKEN"] (GitLab token)
  3. If no GitLab token exists, check for $_GET["token"]
  4. If any of the three tokens exist, compare the first one against the secret specified in config.php
  5. If no token exists, proceed with script

I'll submit a pull request for this some time this week.

Documentation:

Example:

JacobDB commented 7 years ago

Need to update the screenshots to match the new settings. github gitlab