From ff58f9707f5f8237bbb66e25b723ada98cc4ecce Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 18 Jul 2023 02:11:06 -0600 Subject: [PATCH 1/2] Add Health check endpoint at /api/service/health-check --- app/Http/Controllers/HealthCheckController.php | 16 ++++++++++++++++ routes/api.php | 1 + 2 files changed, 17 insertions(+) create mode 100644 app/Http/Controllers/HealthCheckController.php diff --git a/app/Http/Controllers/HealthCheckController.php b/app/Http/Controllers/HealthCheckController.php new file mode 100644 index 00000000..0af2f63f --- /dev/null +++ b/app/Http/Controllers/HealthCheckController.php @@ -0,0 +1,16 @@ +withHeaders([ + 'Content-Type' => 'text/plain', + 'Cache-Control' => 'max-age=0, must-revalidate, no-cache, no-store' + ]); + } +} diff --git a/routes/api.php b/routes/api.php index 384202f2..835fa7b0 100644 --- a/routes/api.php +++ b/routes/api.php @@ -17,6 +17,7 @@ Route::get('.well-known/nodeinfo', 'FederationController@nodeinfoWellKnown')->na Route::get('.well-known/host-meta', 'FederationController@hostMeta')->name('well-known.hostMeta'); Route::redirect('.well-known/change-password', '/settings/password'); Route::get('api/nodeinfo/2.0.json', 'FederationController@nodeinfo'); +Route::get('api/service/health-check', 'HealthCheckController@get'); Route::group(['prefix' => 'api'], function() use($middleware) { From ecc697a241207cb4bba7c8ec7bcc8832d8594320 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 18 Jul 2023 02:12:10 -0600 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ecedcab..0bcf22cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added - Import from Instagram ([#4466](https://github.com/pixelfed/pixelfed/pull/4466)) ([cf3078c5](https://github.com/pixelfed/pixelfed/commit/cf3078c5)) - Sign-in with Mastodon ([#4545](https://github.com/pixelfed/pixelfed/pull/4545)) ([45b9404e](https://github.com/pixelfed/pixelfed/commit/45b9404e)) +- Health check endpoint at /api/service/health-check ([ff58f970](https://github.com/pixelfed/pixelfed/commit/ff58f970)) ### Updates - Update Notifications.vue component, fix filtering logic to prevent endless spinner ([3df9b53f](https://github.com/pixelfed/pixelfed/commit/3df9b53f))