{"id":34171600,"url":"https://github.com/r2dtools/goapacheconf","last_synced_at":"2026-03-11T07:01:45.583Z","repository":{"id":316462932,"uuid":"1039575024","full_name":"r2dtools/goapacheconf","owner":"r2dtools","description":"GoApacheConf is a Go library for parsing, modifying, and regenerating Apache configuration files. It makes it easy to work with Apache config blocks and directives programmatically in your Go applications.","archived":false,"fork":false,"pushed_at":"2025-11-16T11:53:44.000Z","size":480,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-18T08:05:12.277Z","etag":null,"topics":["apache","config","configuration","developer-tools","devops","golang","parser"],"latest_commit_sha":null,"homepage":"","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/r2dtools.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-17T14:35:49.000Z","updated_at":"2025-11-16T11:51:35.000Z","dependencies_parsed_at":"2025-10-25T08:21:31.067Z","dependency_job_id":null,"html_url":"https://github.com/r2dtools/goapacheconf","commit_stats":null,"previous_names":["r2dtools/goapacheconf"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/r2dtools/goapacheconf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r2dtools%2Fgoapacheconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r2dtools%2Fgoapacheconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r2dtools%2Fgoapacheconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r2dtools%2Fgoapacheconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r2dtools","download_url":"https://codeload.github.com/r2dtools/goapacheconf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r2dtools%2Fgoapacheconf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30373508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["apache","config","configuration","developer-tools","devops","golang","parser"],"created_at":"2025-12-15T11:23:27.643Z","updated_at":"2026-03-11T07:01:45.578Z","avatar_url":"https://github.com/r2dtools.png","language":"Go","readme":"# GoApacheConf\n\n**GoApacheConf** is a Go library for parsing, modifying, and regenerating **Apache configuration files**.  \nIt makes it easy to work with Apache config blocks and directives programmatically in your Go applications.\n\nPowered by [Participle v2](https://github.com/alecthomas/participle) under the hood.\n\n---\n\n\n## 📦 Installation\n\n```bash\ngo get github.com/r2dtools/goapacheconf\n```\n\n---\n\n## 🚀 Usage Example\n\nParse the entire Apache configuration and inspect blocks and directives:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/r2dtools/goapacheconf\"\n)\n\nfunc main() {\n\t// Load Apache config from /etc/apache2\n\tconfig, err := goapacheconf.GetConfig(\"/etc/apache2\", \"\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Find VirtualHost blocks\n\tblocks := config.FindVirtualHostBlocks()\n\tif len(blocks) == 0 {\n\t\tpanic(\"virtual host block not found\")\n\t}\n\tvBlock := blocks[0]\n\n\t// Get DocumentRoot\n\tfmt.Println(vBlock.GetDocumentRoot())\n\n\t// Find \"ErrorLog\" directives\n\tdirectives := vBlock.FindDirectives(\"ErrorLog\")\n\tif len(directives) == 0 {\n\t\tpanic(\"directive not found\")\n\t}\n\n\t// Print the first ErrorLog directive value\n\tfmt.Println(directives[0].GetFirstValue())\n}\n```\n\n👉 For more examples, check the tests.\n\n---\n\n## 🔧 Roadmap\n\n- Support for additional Apache directive types  \n- Advanced helpers for config manipulation  \n- Built-in config validation  \n\n---\n\n## 📜 License\n\nMIT License. See [LICENSE](./LICENSE) for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr2dtools%2Fgoapacheconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr2dtools%2Fgoapacheconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr2dtools%2Fgoapacheconf/lists"}