{"id":22747225,"url":"https://github.com/one-com/ozone","last_synced_at":"2025-04-14T11:40:27.414Z","repository":{"id":22387532,"uuid":"93744029","full_name":"One-com/ozone","owner":"One-com","description":"Golang HTTP server/proxy daemon engine","archived":false,"fork":false,"pushed_at":"2023-02-25T02:43:42.000Z","size":1314,"stargazers_count":5,"open_issues_count":2,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T00:45:07.058Z","etag":null,"topics":["configuration","daemon","golang","http-server","library","reverse-proxy"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/One-com.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-08T11:58:04.000Z","updated_at":"2024-10-07T18:32:00.000Z","dependencies_parsed_at":"2024-06-19T05:28:32.809Z","dependency_job_id":"3a4dad66-7f40-46c5-a67e-9160e2f6d334","html_url":"https://github.com/One-com/ozone","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fozone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fozone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fozone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fozone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/One-com","download_url":"https://codeload.github.com/One-com/ozone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248874209,"owners_count":21175791,"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":["configuration","daemon","golang","http-server","library","reverse-proxy"],"created_at":"2024-12-11T03:13:48.412Z","updated_at":"2025-04-14T11:40:27.375Z","avatar_url":"https://github.com/One-com.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ozone\nGolang HTTP daemon engine.\n\nOzone is not a web framework. It's a daemon engine which will serve your http.Handler's and take care of the boilerplate to make a nice configurable well behaving daemon.\n\nThe use case for using Ozone is HTTP based micro services and infrastructure glue daemons where you know what your http.Handler should do. You just want it served with graceful zero-downtime reloads/upgrades, logging and ready made configuration integrating nicely with Linux systemd. Ozone comes with a ready made configurable and modular reverse HTTP proxy handler.\n\nOzone reads a JSON config file which defines HTTP servers, their listeners (any TLS configuration) and their http.Handler. Configuration is fully modular, letting you provide your own dedicated handler configuration.\n\nOzone can be asked to listen on a UNIX socket for commands, allowing you to control the running daemon. New commands can be implemented and registered by the application.\n\nOzone doesn't per default do access-logging. It can be configured to do that, but you can also just issue the \"alog\" command on the control socket to get access log for a specific HTTP server.\n\n#### Feature list\n\n- Modular plugable JSON configuration\n- Plugable and configurable HTTP handlers\n- Plugable reverse HTTP proxy\n- Plugable TLS configuration\n- Plugable UNIX socket control interface.\n- Graceful restarts and zero-downtime upgrades\n- Dump entire config, as parsed, to stdout in \"dry run\" mode.\n- Tunable logging and statsd metrics.\n- Client side failover for reverse proxy backends using \"virtual upstream\" pools of backend servers.\n\nOzone is build on the github.com/One-com/gone set of libraries which provide much of the functionality.\n\n## Example\n\nA simple \n\n``` go\n//...declarations left out\n\ntype handlerConfig struct {\n\tResponse string\n}\n\nfunc createHandler(name string, js jconf.SubConfig, handlerByName func(string) (http.Handler, error)) (h http.Handler, cleanup func() error, err error) {\n\th = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tvar cfg *handlerConfig\n\t\terr = js.ParseInto(\u0026cfg)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tw.Write([]byte(cfg.Response + \"\\n\"))\n\t})\n\treturn\n}\n\nfunc init() {\n\tflag.StringVar(\u0026configFile, \"c\", \"options.json\", \"Configuration file\")\n\n\tflag.BoolVar(\u0026dryrun, \"n\", false, \"Dryrun - Dump full config\")\n\tflag.StringVar(\u0026controlSocket, \"s\", \"\", \"Path to control socket\")\n\tflag.DurationVar(\u0026shutdownTimeout, \"g\", time.Duration(0), \"Default timeout (seconds) to do graceful shutdown\")\n\n\tflag.Parse()\n\t\n\tozone.Init(ozone.DumpConfig(dryrun), ozone.ControlSocket(controlSocket), ozone.ShutdownTimeout(shutdownTimeout))\n}\n\nfunc main() {\n\n    ozone.RegisterHTTPHandlerType(\"MyConfigurableHandler\", createHandler)\n\n\terr := ozone.Main(configFile)\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n}\n\n```\n\nThe configuration file is structured as:\n\n``` json\n{\n      \"HTTP\" : {  // defining HTTP servers\n          \"servername\" : {\n              \"Handler\" :  \"handlername\"  // top level HTTP handler\n              \"Listeners\" : { ... }  // specification of server listeners.\n          }\n      },\n      \"Handlers\" : {\n         \"handlername\" : {\n              \"Type\" : \"MyConfurableHandler\",\n               \"Config\" : { ... }\n          }\n      }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-com%2Fozone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fone-com%2Fozone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-com%2Fozone/lists"}