{"id":24761045,"url":"https://github.com/ziozzang/haproxy-webctl","last_synced_at":"2025-10-11T08:30:36.993Z","repository":{"id":68376242,"uuid":"10615405","full_name":"ziozzang/haproxy-webctl","owner":"ziozzang","description":"HAProxy Web Controller","archived":false,"fork":false,"pushed_at":"2013-06-21T07:47:24.000Z","size":128,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T11:51:08.583Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ziozzang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-11T05:37:01.000Z","updated_at":"2021-02-26T13:18:42.000Z","dependencies_parsed_at":"2023-02-21T05:15:28.092Z","dependency_job_id":null,"html_url":"https://github.com/ziozzang/haproxy-webctl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ziozzang/haproxy-webctl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2Fhaproxy-webctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2Fhaproxy-webctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2Fhaproxy-webctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2Fhaproxy-webctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziozzang","download_url":"https://codeload.github.com/ziozzang/haproxy-webctl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2Fhaproxy-webctl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006611,"owners_count":26084148,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-01-28T18:20:44.642Z","updated_at":"2025-10-11T08:30:36.723Z","avatar_url":"https://github.com/ziozzang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"haproxy-webctl\n==============\nHAProxy Web Controller.\nThis script can control HAProxy with no stopping of current service.\n\n\nAuthor\n======\nScript by Jioh L. Jung (ziozzang@gmail.com)\n\nRequirement\n===========\npython 2.6 or above\n- flask (pip)\n- netaddr (pip)\n- haproxyctl (GitHub)\n\n\nInstallation\n============\n- must install python-pip\n- PIP install : flask, netaddr\n- Github install: clone git://github.com/neurogeek/haproxyctl.git\n\n- Need same permission with ha-proxy.\n\n* configuration\n\nHA-Proxy configuration\n/etc/haproxy/haproxy.cfg\n\n```\nglobal\n  # socket is mandatory for haproxy-webctl.\n  stats socket /var/run/haproxy/haproxy.sock mode 0600 level admin\nbackend portal # this backend name is used for API request.\n  #default-server on-error mark-down fall 1 error-limit 1\n\n```\n\n* Install Script\n\n```\napt-get install -fy python-pip\npip install flask netaddr\n\ncd ~/\ngit clone git://github.com/neurogeek/haproxyctl.git\ncd haproxyctl/\npython setup.py install\n\ncd ~/\ngit clone git://github.com/ziozzang/haproxy-webctl.git\n```\n\n* Configuration of API Server.\nYou can fix environment for UNIX Socket (SOCK), listen port(LISTEN_PORT) and Listening IP.\n\nSecurity\n========\n* IP Allow rule.\n\nyou can edit IP allow rule in script. if client ip has not in list, they get 403(No Permission) Error.\n\n```\nALLOWED_IP_BLOCK = ['IP/mask', '....']\n```\n\nExecute\n=======\n* Run as same account with haproxy.\n\n```\n[program] -s \u003csocket_path\u003e -p \u003cport_number\u003e \u0026\n```\n\n* API Usage\n\nif server address is 1.2.3.4:7777 , you can use API like this.\n\n* Request for status of backend which name is 'backend_name'\n\n```\ncurl http://1.2.3.4:7777/servers/backend_name\n```\n\nYou can get JSON format of backend servers status.\n\n* Request for server_name enable(UP Status) on backend_name\n\n```\ncurl http://1.2.3.4:7777/enable/backend_name/server_name\n```\n\nthis can only do request, doesn't show status of backend or server.\n\n* Request for server_name disable(MAINTAINANCE Status) on backend_name\n\n```\ncurl http://1.2.3.4:7777/disable/backend_name/server_name\n```\n\nthis can only do request, doesn't show status of backend or server.\n\n\nKnown Issue\n===========\n\nif configuration has no backend, only existed listen block, use listen block name insted of backend_name.\nin this example, you can use use \"bas\" as backend_name.\n\n```\nlisten bas\n  bind *:80\n  server vm01 192.168.0.152:80 maxconn 5000 check inter 500ms\n  server vm02 192.168.0.153:80  maxconn 5000 check backup inter 500ms\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziozzang%2Fhaproxy-webctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziozzang%2Fhaproxy-webctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziozzang%2Fhaproxy-webctl/lists"}