"Healthcheck" endpoint

This commit is contained in:
simonmicro
2023-05-21 16:53:02 +02:00
parent 58624bdf35
commit 3f7fa53eb3
2 changed files with 5 additions and 4 deletions

View File

@@ -26,12 +26,11 @@ Make sure to support the developers by buying the choosen subscription for your
This is _optional_. You can simply use the default instance of this API (host is noted inside the `setup.py` script) and profit from "automatic" updates.
Just transfer the `www` files inside a public accessible root-folder on your _dedicated_ Apache webserver (really everthing with PHP support works). Also make sure your instance has a valid SSL-certificate (Let's encrypt is enough), otherwise it may won't work.
An example Apache install process can be found [here](docs/apache/install.md). If you want to test your instance, just open the public accessible URI in your browser and append `/notification` to it - if you see some JSON with the text, then everything worked!
An example Apache install process can be found [here](docs/apache/install.md). If you want to test your instance, just open the public accessible URI in your browser and append `/healthz` to it - if you see some JSON with the text, then everything worked!
### Nett2Know ###
* This modification will also block any communication to the Pritunl servers - so no calling home :)
* The `ultimate` mode is still a little bit buggy. This is caused by some hacky workarounds to get all features displayed (the server is already unlocked). Caused by this workaround some items are maybe shown instead of being hidden. If you find such thing - just ping me about it.
* SSO will not work with this api version! As Pritunls own authentication servers handle the whole SSO stuff, track instance ids and verify users I won't implement this part for privacy concerns (and also this would need to be securly implemented and need a database).
* SSO will not work with this api version! As Pritunls own authentication servers handle the whole SSO stuff, track instance ids and verify users, I won't implement this part for privacy concerns (and also this would need to be securly implemented and a database).
* This api has also its own docker image. Take a look into the `docker` folder and enjoy!
Have fun with your new premium/enterprise/ultimate Pritunl instance!

View File

@@ -18,7 +18,9 @@ $result = null;
if(isset($_GET['path'])) {
$path = trim($_GET['path'], ' /');
$pathParts = explode('/', $_GET['path']);
if(count($pathParts) > 1 && $pathParts[0] == 'notification') {
if(count($pathParts) > 0 && $pathParts[0] == 'healthz') {
$result = 'OK';
} else if(count($pathParts) > 1 && $pathParts[0] == 'notification') {
// Any notification/[version] will be answered here
$msg = 'Fake API endpoint for v' . $minVersionName . ' active and reachable (contacted at ' . date('r') . ').';
if(intval($pathParts[1]) < $minVersionNumber) {