{"id":13813591,"url":"https://github.com/soulteary/nginx-formatter","last_synced_at":"2025-05-06T20:41:30.935Z","repository":{"id":154089038,"uuid":"629522364","full_name":"soulteary/nginx-formatter","owner":"soulteary","description":"Small and easy-to-use Nginx configuration formatting tool (CLI \u0026 GUI), support Docker, x86, ARM, macOS...","archived":false,"fork":false,"pushed_at":"2023-06-01T20:34:16.000Z","size":476,"stargazers_count":57,"open_issues_count":5,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T02:41:14.074Z","etag":null,"topics":["docker","nginx","nginx-conf","nginx-configuration","nginx-docker","nginx-formatter"],"latest_commit_sha":null,"homepage":"https://soulteary.com/2023/05/20/code-writing-practice-supported-by-ai-quickly-implement-nginx-configuration-formatting-tool.html","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soulteary.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-18T13:36:30.000Z","updated_at":"2025-02-22T17:54:35.000Z","dependencies_parsed_at":"2024-08-04T04:04:28.347Z","dependency_job_id":"a9f2ddae-ac42-44f9-856c-3e414b5cf468","html_url":"https://github.com/soulteary/nginx-formatter","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soulteary%2Fnginx-formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soulteary%2Fnginx-formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soulteary%2Fnginx-formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soulteary%2Fnginx-formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soulteary","download_url":"https://codeload.github.com/soulteary/nginx-formatter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252768248,"owners_count":21801366,"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":["docker","nginx","nginx-conf","nginx-configuration","nginx-docker","nginx-formatter"],"created_at":"2024-08-04T04:01:22.366Z","updated_at":"2025-05-06T20:41:30.903Z","avatar_url":"https://github.com/soulteary.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Nginx Formatter\n\n[![CodeQL](https://github.com/soulteary/nginx-formatter/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/soulteary/nginx-formatter/actions/workflows/github-code-scanning/codeql) [![Codecov](https://github.com/soulteary/nginx-formatter/actions/workflows/codecov.yml/badge.svg)](https://github.com/soulteary/nginx-formatter/actions/workflows/codecov.yml) [![Security Scan](https://github.com/soulteary/nginx-formatter/actions/workflows/scan.yml/badge.svg)](https://github.com/soulteary/nginx-formatter/actions/workflows/scan.yml) [![Release](https://github.com/soulteary/nginx-formatter/actions/workflows/release.yaml/badge.svg)](https://github.com/soulteary/nginx-formatter/actions/workflows/release.yaml) ![Go Report Card](https://goreportcard.com/badge/github.com/soulteary/nginx-formatter) [![Docker Image](https://img.shields.io/docker/pulls/soulteary/nginx-formatter.svg)](https://hub.docker.com/r/soulteary/nginx-formatter)\n\n\u003cp style=\"text-align: center;\"\u003e\n  \u003ca href=\"README.md\" target=\"_blank\"\u003eENGLISH\u003c/a\u003e | \u003ca href=\"README_CN.md\"\u003e中文文档\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cimg src=\".github/logo.png\" width=\"120\" \u003e\n\nNginx configuration formatter ~10MB size, support CLI, WebUI, x86, ARM, Linux, macOS.\n\n\u003cimg src=\".github/preview.png\"\u003e\n\n## Download\n\nDownload the binaries for your system and architecture from the [releases page](https://github.com/soulteary/nginx-formatter/releases).\n\n\u003cimg src=\".github/dockerhub.png\" width=\"80%\" \u003e\n\nIf you use docker, you can use the following command ([DockerHub](https://hub.docker.com/r/soulteary/nginx-formatter)):\n\n```bash\ndocker pull soulteary/nginx-formatter:latest\ndocker pull soulteary/nginx-formatter:v1.1.1\n```\n\n## Usage\n\nUse default parameters to format all configuration files in the current directory:\n\n```bash\n./nginx-formatter\n```\n\n### Common Usage (CLI \u0026 WebUI)\n\nUse different indentation symbols (You can use spaces, tabs, ` `, `\\s`, `\\t`) and indentation amounts:\n\n```bash\n./nginx-formatter -indent=4 -char=\" \"\n```\n\n### CLI Usage\n\nFormat the configuration file in the specified directory:\n\n```bash\n./nginx-formatter -input=./your-dir-path\n```\n\nFormat a file somewhere and save it in a new directory:\n\n```bash\n./nginx-formatter -input=./your-dir-path -output=./your-output-dir\n```\n\n### WebUI Usage\n\nStart the web interface:\n\n```bash\n./nginx-formatter -web\n```\n\nspecified the port:\n\n```bash\n./nginx-formatter -web -port=8123\n```\n\n### Docker Usage\n\nThere is no difference between using parameters in Docker and the above, for example, we start a Web UI formatting tool service in Docker:\n\n```bash\ndocker run --rm -it -p 8080:8080 soulteary/nginx-formatter:v1.1.1 -web\n```\n\nIf you want to format the configuration of the current directory, you can use the program in Docker with a command similar to the following:\n\n```bash\ndocker run --rm -it -v `pwd`:/app soulteary/nginx-formatter:v1.1.1 -input=/app\n```\n\n## Full parameters supported\n\nList of parameters supported:\n\n```bash\nNginx Formatter\n\nUsage of ./nginx-formatter:\n  -char  \n    \tIndent char, defualt:   (default \" \")\n  -indent int\n    \tIndent size, defualt: 2 (default 2)\n  -input string\n    \tInput directory\n  -output string\n    \tOutput directory\n  -port 8080\n    \tWebUI Port, defualt: 8080 (default 8080)\n  -web false\n    \tEnable WebUI, defualt: false\n```\n\n## Credits\n\nFormatter Components\n\n- Slomkowski Created a beautifier for nginx config files with Python under [Apache-2.0 license], 24/06/2016\n  - https://github.com/1connect/nginx-config-formatter (https://github.com/slomkowski/nginx-config-formatter)\n- Yosef Ported the JavaScript beautifier under [Apache-2.0 license], 24/08/2016\n  - https://github.com/vasilevich/nginxbeautifier\n- soulteary Modify the JavaScript version for golang execution, under [Apache-2.0 license], 18/04/2023:\n  - simplify the program, fix bugs, improve running speed, and allow running in golang\n  - https://github.com/soulteary/nginx-formatter\n\nRuntime dependent Components\n\n- ECMAScript 5.1(+) implementation in Go, under [MIT license].\n  - https://github.com/dop251/goja\n\nWeb Components\n\n- Gin is a HTTP web framework written in Go (Golang), under [MIT license].\n  - https://github.com/gin-gonic/gin\n- Code Mirror, in-browser code editor, under [MIT license].\n  - https://github.com/codemirror/codemirror5\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoulteary%2Fnginx-formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoulteary%2Fnginx-formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoulteary%2Fnginx-formatter/lists"}