Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/ofborg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a4a30446ae55
Choose a base ref
...
head repository: NixOS/ofborg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b405973d443a
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Oct 6, 2020

  1. php: add README.md explaining the configuration

    It was lost in the `Not you: team` change. It probably makes sense to
    keep this documented as people involved in this project might change
    over time and sometimes memory can also be blurry :)
    andir authored and cole-h committed Oct 6, 2020
    1

    Partially verified

    This commit is signed with the committer’s verified signature.
    domenkozar’s contribution has been verified via GPG key.
    We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
    Copy the full SHA
    b405973 View commit details
Showing with 38 additions and 0 deletions.
  1. +38 −0 php/README.md
38 changes: 38 additions & 0 deletions php/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Webhook Receiver

This PHP code receives the GitHub webhook, checks them for integrity and publishes messages on rabbitmq.


## Configuration

The code expects a `config.php` in it's parent directory. An example configuration looks like this:

```php
<?php

require_once __DIR__ . '/vendor/autoload.php';
use PhpAmqpLib\Connection\AMQPSSLConnection;
use PhpAmqpLib\Message\AMQPMessage;

function rabbitmq_conn($timeout = 3) {
$host = 'events.nix.gsc.io';
$connection = new AMQPSSLConnection(
$host, 5671,
'eventsuser, eventspassword, '/',
array(
'verify_peer' => true,
'verify_peer_name' => true,
'peer_name' => $host,
'verify_depth' => 10,
'ca_file' => '/etc/ssl/certs/ca-certificates.crt',
), array(
'connection_timeout' => $timeout,
)
);
return $connection;
}

function gh_secret() {
return "github webhook secret";
}
```