{"id":17237796,"url":"https://github.com/tarao/perl5-plack-middleware-serverstatus-availability","last_synced_at":"2025-08-31T20:32:51.694Z","repository":{"id":28422689,"uuid":"31937377","full_name":"tarao/perl5-Plack-Middleware-ServerStatus-Availability","owner":"tarao","description":null,"archived":false,"fork":false,"pushed_at":"2015-03-10T04:45:53.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T23:28:00.806Z","etag":null,"topics":["perl","plack"],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tarao.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-10T03:55:51.000Z","updated_at":"2015-03-10T04:45:53.000Z","dependencies_parsed_at":"2022-09-03T02:43:25.480Z","dependency_job_id":null,"html_url":"https://github.com/tarao/perl5-Plack-Middleware-ServerStatus-Availability","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarao%2Fperl5-Plack-Middleware-ServerStatus-Availability","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarao%2Fperl5-Plack-Middleware-ServerStatus-Availability/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarao%2Fperl5-Plack-Middleware-ServerStatus-Availability/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarao%2Fperl5-Plack-Middleware-ServerStatus-Availability/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarao","download_url":"https://codeload.github.com/tarao/perl5-Plack-Middleware-ServerStatus-Availability/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245573899,"owners_count":20637674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["perl","plack"],"created_at":"2024-10-15T05:43:47.212Z","updated_at":"2025-03-26T02:12:48.431Z","avatar_url":"https://github.com/tarao.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/tarao/perl5-Plack-Middleware-ServerStatus-Availability.svg?branch=master)](https://travis-ci.org/tarao/perl5-Plack-Middleware-ServerStatus-Availability)\n# NAME\n\nPlack::Middleware::ServerStatus::Availability - manually set server status\n\n# SYNOPSIS\n\n    use Plack::Builder;\n\n\n    builder {\n        enable 'ServerStatus::Availability', (\n            path =\u003e {\n                status  =\u003e '/server/avail',\n                control =\u003e '/server/control/avail',\n            },\n            allow =\u003e [ '127.0.0.1', '192.168.0.0/16', '10.0.0.0/8' ],\n            file =\u003e '/tmp/server-up',\n        );\n        $app;\n    };\n\n    $ curl http://server:port/server/avail\n    503 Server is up but is under maintenance\n\n    $ curl -X POST http://server:port/server/control/avail?action=up\n    200 Done\n\n    $ curl http://server:port/server/avail\n    503 Server is up but is under maintenance\n\n    $ curl http://server:port/server/avail\n    200 OK\n\n    $ curl -X POST http://server:port/server/control/avail?action=down\n    200 Done\n\n    $ curl http://server:port/server/avail\n    503 Server is up but is under maintenance\n\n# DESCRIPTION\n\nThis middleware is intended to show a server status which is\ncontrollable by POST requests to the status control endpoint.  This is\nuseful when you want to manually make a server under maintenance and\nautomatically detached from a load balancer.\n\n# CONFIGURATIONS\n\n- path\n\n        path =\u003e {\n            status  =\u003e $status,\n            control =\u003e $control,\n        }\n\n    `$status` is a location to display the server status.  `$control` is\n    a location to `POST` actions.  An action is specified by `action`\n    query parameter.  Its value `up` and `down` makes the server status\n    to 'available' and 'unavailable' respectively.\n\n- allow\n\n        allow =\u003e '127.0.0.1'\n        allow =\u003e [ '192.168.0.0/16', '10.0.0.0/8' ]\n\n    Host based access control of the server status and status control\n    endpoints.  Supports IPv6 address.\n\n- file\n\n        file =\u003e $file\n\n    Specifies a file to remember the availability.  The server is\n    indicated to be available if the file exist.\n\n# SEE ALSO\n\n[Plack::Middleware::ServerStatus::Lite](https://metacpan.org/pod/Plack::Middleware::ServerStatus::Lite)\n\n# ACKNOWLEDGMENT\n\nThis middleware is ported from [Karasuma::Config::ServerStatus](https://github.com/wakaba/karasuma-config/blob/master/lib/Karasuma/Config/ServerStatus.pm) to `Plack::Middleware`.\n\n# LICENSE\n\nCopyright (C) INA Lintaro\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n\n# AUTHOR\n\nINA Lintaro \u003ctarao.gnn@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarao%2Fperl5-plack-middleware-serverstatus-availability","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarao%2Fperl5-plack-middleware-serverstatus-availability","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarao%2Fperl5-plack-middleware-serverstatus-availability/lists"}