• Stars
    star
    182
  • Rank 211,154 (Top 5 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A proxy to let webhooks reach running services behind a firewall – [✩Star] if you're using it!

GitWebhookProxy

Go Report Card Go Doc Release GitHub tag Docker Pulls Docker Stars MicroBadger Size MicroBadger Layers license

A proxy to let webhooks to reach a Jenkins instance running behind a firewall

PROBLEM

Jenkins is awesome and matchless tool for both CI & CD; but unfortunately its a gold mine if left in wild with wide open access; so, we always want to put it behind a firewall. But when we put it behind firewall then webhooks don't work anymore and no one wants the pull based polling but rather prefer the build to start as soon as there is a commit!

SOLUTION

This little proxy makes webhooks start working again!

Supported Providers

Currently we support the following git providers out of the box:

  • Github
  • Gitlab

Configuration

GitWebhookProxy can be configured by providing the following arguments either via command line or via environment variables:

Parameter Description Default Example
listenAddress Address on which the proxy listens. :8080 127.0.0.1:80
upstreamURL URL to which the proxy requests will be forwarded (required) https://someci-instance-url.com/webhook/
secret Secret of the Webhook API. If not set validation is not made. iamasecret
provider Git Provider which generates the Webhook github github or gitlab
allowedPaths Comma-Separated String List of allowed paths on the proxy /project or github-webhook/,project/
ignoredUsers Comma-Separated String List of users to ignore while proxying Webhook request someuser
allowedUsers Comma-Separated String List of users to allow while proxying Webhook request someuser

DEPLOYING TO KUBERNETES

The GitWebhookProxy can be deployed with vanilla manifests or Helm Charts.

Vanilla Manifests

For Vanilla manifests, you can either first clone the respository or download the deployments/kubernetes/gitwebhookproxy.yaml file only.

Configuring

Below mentioned attributes in gitwebhookproxy.yaml have been hard coded to run in our cluster. Please make sure to update values of these according to your own configuration.

  1. Change below mentioned attribute's values in Ingress in gitwebhookproxy.yaml
 rules:
  - host: gitwebhookproxy.example.com
  tls:
  - hosts:
    - gitwebhookproxy.example.com
  1. Change below mentioned attribute's values in Secret in gitwebhookproxy.yaml
data:
  secret: example
  1. Change below mentioned attribute's values in ConfigMap in gitwebhookproxy.yaml
data:
  provider: github
  upstreamURL: https://jenkins.example.com
  allowedPaths: /github-webhook,/project
  ignoredUsers: stakater-user

Deploying

Then you can deploy GitwebhookProxy by running the following kubectl commands:

kubectl apply -f gitwebhookproxy.yaml -n <namespace>

Note: Make sure to update the port in deployment.yaml as well as service.yaml if you change the default listenAddress port.

Helm Charts

Alternatively if you have configured helm on your cluster, you can add gitwebhookproxy to helm from our public chart repository and deploy it via helm using below mentioned commands

  1. Add the chart repo:

    i. helm repo add stakater https://stakater.github.io/stakater-charts/

    ii. helm repo update

  2. Set configuration as discussed in the Configuring section

    i. helm fetch --untar stakater/gitwebhookproxy

    ii. Open and edit gitwebhookproxy/values.yaml in a text editor and update the values mentioned in Configuring section.

  3. Install the chart

    • helm install stakater/gitwebhookproxy -f gitwebhookproxy/values.yaml -n gitwebhookproxy

Running outside Kubernetes

Run with Docker

To run the docker container outside of Kubernetes, you can pass the configuration as the Container Entrypoint arguments. The docker image is available on docker hub. Example below:

docker run stakater/gitwebhookproxy:v0.2.63 -listen :8080 -upstreamURL google.com -provider github -secret "test"

Run with Docker compose

For docker compose, the syntax is a bit different

jenkinswebhookproxy: 
    image: 'stakater/gitwebhookproxy:latest'
    command: ["-listen", ":8080", "-secret", "test", "-upstreamURL", "jenkins.example.com, "-allowedPaths", "/github-webhook,/ghprbhook"]
    restart: on-failure

Troubleshooting

405 Method Not Allowed with Jenkins & github plugin

If you get the following error when setting up webhooks for your jobs in Jenkins, make sure you have the trailing / in the webhook configured in Jenkins.

Error Redirecting '/github-webhook' to upstream', Upstream Redirect Status: 405 Method Not Allowed

Help

Got a question? File a GitHub issue, or send us an email.

Talk to us on Slack

Join and talk to us on the #tools-gwp channel for discussing about GitWebhookProxy

Join Slack Chat

Contributing

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Developing

PRs are welcome. In general, we follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

Changelog

View our closed Pull Requests.

License

Apache2 © Stakater

About

GitWebhookProxy is maintained by Stakater. Like it? Please let us know at [email protected]

See our other projects or contact us in case of professional services and queries on [email protected]

More Repositories

1

Reloader

A Kubernetes controller to watch changes in ConfigMap and Secrets and do rolling upgrades on Pods with their associated Deployment, StatefulSet, DaemonSet and DeploymentConfig – [✩Star] if you're using it!
Go
6,996
star
2

IngressMonitorController

A Kubernetes controller to watch ingresses and create liveness alerts for your apps/microservices in UptimeRobot, StatusCake, Pingdom, etc. – [✩Star] if you're using it!
Go
479
star
3

Forecastle

Forecastle is a control panel which dynamically discovers and provides a launchpad to access applications deployed on Kubernetes – [✩Star] if you're using it!
Go
440
star
4

application

Generic helm chart for all kind of applications
Starlark
211
star
5

Konfigurator

A kubernetes operator that dynamically generates and manages app configuration based on kubernetes resources – [✩Star] if you're using it!
Go
91
star
6

til

📝 Today I Learned
88
star
7

ProxyInjector

A Kubernetes controller to inject an authentication proxy container to relevant pods - [✩Star] if you're using it!
Go
88
star
8

developer-handbook

A developer handbook!
Dockerfile
86
star
9

Chowkidar

A kubernetes controller that watches/observes events & then takes configured actions – [✩Star] if you're using it!
Go
55
star
10

Jamadar

A kubernetes controller which cleans up cluster left-overs – [✩Star] if you're using it!
Go
45
star
11

Xposer

A Kubernetes controller to manage (create/update/delete) Kubernetes Ingresses based on the Service - [✩Star] if you are using it!
Go
32
star
12

microservices-testing

how to test microservices based applications? Moved to: https://github.com/stakater/developer-handbook
26
star
13

slack-operator

Kubernetes operator for Slack
Go
19
star
14

tbd-cd-workflow

trunk based development continuous delivery workflow; Moved to: https://github.com/stakater/developer-handbook
18
star
15

aws-terraform-recipes

aws-terraform-recipes
HCL
17
star
16

Playbook

Stakater playbook and documentation!
Dockerfile
15
star
17

stakater-pipeline-library

A repo for managing pipelines for Jenkins
Groovy
15
star
18

Whitelister

A tool to white list node and developer IPs for kubernetes.
Go
14
star
19

StakaterPlatform

Stakater platform provides out of the box stacks to control, monitor, log, trace and security for applications deployed on kubernetes using CI/CD pipelines.
Shell
14
star
20

jira-service-desk-operator

Kubernetes operator for Jira Service Desk
Go
13
star
21

blueprint-network-aws

Stakater Blueprint for creating best-practices network on AWS. Stakater is an Infrastructure-as-Code DevOps solution to automate the creation of web infrastructure stack on AWS. Stakater is based on Docker, CoreOS, Terraform, Packer, Docker Compose, GoCD, Fleet, ETCD, and more.
HCL
13
star
22

ami-baker

Build custom AMI (Amazon Machine Image) on top of CoreOS
Shell
11
star
23

Scaler

A tool to modify auto scaling groups.
Go
11
star
24

StakaterNordmart

A repo to deploy nordmart microservices
Shell
11
star
25

stakater-charts

Public helm charts of opensource apps
9
star
26

infrastructure-reference

Reference infrastructure for Stakater blueprints. Stakater is an Infrastructure-as-Code DevOps solution to automate the creation of web infrastructure stack on AWS. Stakater is based on Docker, CoreOS, Terraform, Packer, Docker Compose, GoCD, Fleet, ETCD, and more.
Shell
9
star
27

docker-images

Docker Images
Dockerfile
7
star
28

nordmart-apps-gitops-config

Tenant's namespace scoped apps are deployed via this gitops config repository
7
star
29

kops-cluster-templates

A set of templates to create different kubernetes clusters using kops.
Shell
6
star
30

blueprint-storage-aws

Stakater Blueprint for creating best-practices based storage on AWS. Stakater is an Infrastructure-as-Code DevOps solution to automate the creation of web infrastructure stack on AWS. Stakater is based on Docker, CoreOS, Terraform, Packer, Docker Compose, GoCD, Fleet, ETCD, and more.
HCL
6
star
31

terraform-azure-openshift

OpenShift on Azure with Terraform!
HCL
5
star
32

employee-handbook

Handbook for Stakater Employees
Dockerfile
5
star
33

blueprint-utilities-aws

Stakater Blueprint for small utility modules on AWS. Stakater is an Infrastructure-as-Code DevOps solution to automate the creation of web infrastructure stack on AWS. Stakater is based on Docker, CoreOS, Terraform, Packer, Docker Compose, GoCD, Fleet, ETCD, and more.
HCL
5
star
34

ForecastleIcons

Collection of icons which can be referenced in Forecastle
4
star
35

charts

Stakater OpenSource Helm Charts
Smarty
4
star
36

mto-docs

Multi Tenant Operator (MTO) Documentation
Dockerfile
4
star
37

tekton-catalog

Collection of Tekton Tasks
Starlark
3
star
38

openshift-infra-gitops-example

An example gitops repo for openshift internal infrastructure
Jinja
3
star
39

StakaterCloudDocs

Stakater Cloud Documentation
JavaScript
3
star
40

house-keeper

start & stop AWS servers | night watcher | night savings
Shell
3
star
41

multiple-ingress-controllers

multiple nginx ingress controllers running on kubernetes on AWS
Shell
3
star
42

dockerfile-kafka-with-consul-template

Dockerfile of Kafka with consul template
Shell
3
star
43

dockerfile-logrotate

Dockerized Logrotate
2
star
44

operator-utils

Utility library to support operators
Go
2
star
45

continuous-integration-deployment

what is continuous integration? what is continuous delivery? what is continuous deployment? what is release strategy?
2
star
46

go-cd

Go CD template
Shell
2
star
47

blueprint-static-site-aws

A repo for creating a static web site deployment stack using aws s3 bucket, route53, and cloudfront
HCL
2
star
48

terraform-module-postgres

postgres setup on Amazon AWS using Terraform and Ansible
HCL
2
star
49

dockerfile-pipeline-tools

Image containing all the tools required for pipelines
Dockerfile
2
star
50

terraform-module-github

Terraform modules for github used for setting up a GitHub organization
HCL
2
star
51

dockerfile-nexus

Docker image for Sonatype Nexus
Shell
2
star
52

dockerfile-nginx-with-consul-template

dockerfile of nginx with consul template
Shell
2
star
53

ztp-pipeline-toolbox

ztp-pipeline-toolbox
Dockerfile
2
star
54

grafana-cloud-ansible-operator

Grafana cloud operator
Makefile
2
star
55

stakater-devops-labs

The Lab for the DevOps Workshop with Kubernetes and Containers
Java
2
star
56

dockerfile-logstash-with-consul-template

Dockerfile of Logstash with consul template
Shell
2
star
57

dockerfile-maven-jenkins

Dockerfile for Maven with Jenkins user, for Jenkins Slave
Dockerfile
2
star
58

dockerfile-maven-centos

CentOS 7 --> Java 1.8 --> Maven 3.5.4
Dockerfile
2
star
59

blueprint-instance-pool-aws

Stakater Blueprint for creating best-practices based instance pool on AWS. Stakater is an Infrastructure-as-Code DevOps solution to automate the creation of web infrastructure stack on AWS. Stakater is based on Docker, CoreOS, Terraform, Packer, Docker Compose, GoCD, Fleet, ETCD, and more.
HCL
2
star
60

terraform-aws-certificate

Certificate Generation for AWS(route 53) hosted domain using Terraform!
HCL
2
star
61

prod-deployment-reference

Stakater sub-module for infrastructure-reference and a practical reference implementation of Production deployment using custom AMI. Stakater is an Infrastructure-as-Code DevOps solution to automate the creation of web infrastructure stack on AWS, based on Docker, Terraform, and more.
HCL
2
star
62

StakaterDeliveryStack

A Stack to Setup Release(CI/CD) Apps on Kubernetes Cluster via Helm Charts i.e. Jenkins, Nexus, Chartmuseum etc.
Groovy
1
star
63

vocabulary

Stakater Vocabulary
1
star
64

pipeline-library

Libraries, utils and tools required by stakater pipelines
Shell
1
star
65

git-set-commit-status

Set commit status
Python
1
star
66

dockerfile-elasticsearch

Dockerfile for Elasticsearch
Shell
1
star
67

dockerfile-grails3

Docker File for grails 3
1
star
68

infrastructure-app-units

systemd unit files for infrastructure applications
1
star
69

operator-template

Template project for operators
Go
1
star
70

java-test-app-ci-and-versioning

Spring based Test app for CI and versioning
Java
1
star
71

dockerfile-awscli

Dockerfile for AWS CLI
1
star
72

openshift4-ansible

Setup Openshift4 via ansible
Jinja
1
star
73

stakater-reference-app-java

reference app for stakater
Java
1
star
74

dockerfile-logstash

Dockerfile of Logstash
Shell
1
star
75

dockerfile-jenkins

dockerfile for jenkins
Shell
1
star
76

provider-databricks

Databricks Crossplane provider
Go
1
star
77

terraform-module-gitlab

Terraform modules for gitlab used for setting up a GitLab Organization
HCL
1
star
78

workshop-operator

A Kubernetes Operator to install the infrastructure for running workshops/bootcamps on OpenShift.
Go
1
star
79

secrets-management

how to manage secrets?
1
star
80

coreos-and-consul-cluster-via-terraform

coreos-and-consul-cluster-via-terraform
HCL
1
star
81

dockerfile-filebeat-with-consul-template

dockerfile of filebeat with consul template
Shell
1
star
82

resume-renderer

Custom renderer for Stakater resumes
TypeScript
1
star
83

mysql-backup-glacier

Python
1
star
84

dockerfile-java

Java dockerfiles
1
star
85

coreos-vagrant-with-consul-elk

CoreOS Cluster on Vagrant with ELK Stack and Service Registration & Discovery through Consul
Ruby
1
star
86

roadmap

roadmap of stakater
1
star
87

cloud-exits

A collection of cloud exit stories
1
star
88

blueprint-solo-instance-aws

Blueprint for creating best-practices based solo instance on AWS
HCL
1
star
89

stakater-tekton-chart

Jumbo chart for creating pipeline manifests
Smarty
1
star