From a500b3449a723a468296c97fdcbb448f930a040d Mon Sep 17 00:00:00 2001 From: root Date: Sat, 6 Jul 2019 23:30:27 +0000 Subject: [PATCH] Fixed up config.pgp, re-added files that will need to exist still --- config.php | 4 +-- githook.php | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ teapot.php | 6 +++++ 3 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 githook.php create mode 100644 teapot.php diff --git a/config.php b/config.php index a531808..fea1b60 100644 --- a/config.php +++ b/config.php @@ -3,10 +3,10 @@ $site_name="☣ thunix ☣"; //Root for the site, in a browser -$site_root="https://thunix.net/~ubergeek/thunix_site"; +$site_root="https://dev.thunix.cf"; //Local base root for app files -$doc_root="/home/ubergeek/public_html/thunix_site"; +$doc_root="/var/www/dev.thunix.cf"; //Site style // site is the default. Specify something else here to switch diff --git a/githook.php b/githook.php new file mode 100644 index 0000000..84d21f4 --- /dev/null +++ b/githook.php @@ -0,0 +1,70 @@ + $ratelimit ) { + touch ( $ansible_dropfile ); + touch ( $ansible_lastrun ); + echo "HTTP 200 - Ansible webhook recieved."; + } + else { + http_response_code(429); + echo "HTTP 429 - Rate Limited."; + exit(0); + } +} +elseif ($data["repository"]["full_name"] == 'thunix/www') { + syslog(LOG_INFO, 'WWW Webhook recieved.'); + if ( time () - filemtime ( $lastrun ) > $ratelimit ) { + touch ( $www_dropfile ); + touch ( $www_lastrun ); + http_response_code(200); + echo "HTTP 200 - WWW webhook recieved."; + } + else { + http_response_code(429); + echo "HTTP 429 - Rate Limited."; + exit(0); + } + } +else { + http_response_code(418); + echo "HTTP 418 - I'm a teapot."; + exit(0); + } +?> + diff --git a/teapot.php b/teapot.php new file mode 100644 index 0000000..85dc757 --- /dev/null +++ b/teapot.php @@ -0,0 +1,6 @@ +