{"id":31033342,"url":"https://github.com/steadybit/nginx_steadybit_module","last_synced_at":"2025-10-03T23:08:36.100Z","repository":{"id":303442686,"uuid":"1015475282","full_name":"steadybit/nginx_steadybit_module","owner":"steadybit","description":"Nginx Module for Chaos Testing","archived":false,"fork":false,"pushed_at":"2025-07-21T15:17:11.000Z","size":285,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-29T01:25:55.266Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","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/steadybit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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}},"created_at":"2025-07-07T14:57:08.000Z","updated_at":"2025-07-21T15:17:14.000Z","dependencies_parsed_at":"2025-07-07T17:36:56.548Z","dependency_job_id":"10cd5585-2233-4fa3-a401-6cbde727d045","html_url":"https://github.com/steadybit/nginx_steadybit_module","commit_stats":null,"previous_names":["steadybit/nginx_steadybit_module"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/steadybit/nginx_steadybit_module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steadybit%2Fnginx_steadybit_module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steadybit%2Fnginx_steadybit_module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steadybit%2Fnginx_steadybit_module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steadybit%2Fnginx_steadybit_module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steadybit","download_url":"https://codeload.github.com/steadybit/nginx_steadybit_module/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steadybit%2Fnginx_steadybit_module/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275051642,"owners_count":25396978,"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-09-13T02:00:10.085Z","response_time":70,"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-09-14T01:50:37.780Z","updated_at":"2025-10-03T23:08:31.068Z","avatar_url":"https://github.com/steadybit.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nginx_steadybit_module\n\n## Overview\n\n`ngx_steadybit_sleep_module` is a third-party NGINX module that allows you to introduce artificial delays (sleep) into HTTP request processing. This is useful for testing, chaos engineering, and simulating network latency in development or staging environments.\n\n## Features\n- Add a configurable delay to HTTP requests using a custom directive\n- Supports millisecond granularity\n- Designed for use with NGINX and NGINX Ingress (Red Hat UBI)\n\n## Requirements\n- NGINX (built from source, or compatible with dynamic modules)\n- Compatible with NGINX Ingress images based on Red Hat UBI (e.g., `nginx/nginx-ingress:5.0.0-ubi`)\n- GCC, make, and standard build tools (for building the module)\n\n## Build Instructions\n\n### Using Makefile (local build)\n```sh\nmake\n# The built module will be in dist/ngx_steadybit_sleep_module.so\n```\n\n### Using Docker (recommended for compatibility)\n\nTwo example Dockerfiles are provided to demonstrate how to compile and use this module:\n\n#### Dockerfile.community\nBuilds the module using the open-source NGINX base image. This is suitable for:\n- Development and testing environments\n- Open-source NGINX deployments\n- Community-based NGINX Ingress Controller\n\n```sh\ndocker build -f Dockerfile.community -t steadybit/nginx-sleep-module:community .\n```\n\n#### Dockerfile.ubi\nBuilds the module using Red Hat Universal Base Image (UBI) with NGINX. This is suitable for:\n- Enterprise environments\n- Red Hat-based deployments\n- OpenShift deployments\n- NGINX Ingress Controller based on UBI images (e.g., `nginx/nginx-ingress:5.0.0-ubi`)\n\n**IMPORTANT DISCLAIMER**: This is a modified UBI image. It is not certified or supported by Red Hat, Inc. This modified image is distributed under the MIT License (see LICENSE file). The original Red Hat UBI End User License Agreement applies to the underlying UBI components (see UBI-EULA.pdf).\n\n```sh\ndocker build -f Dockerfile.ubi -t steadybit/nginx-sleep-module:ubi .\n```\n\n**Note**: These Dockerfiles serve as examples showing how to compile and integrate the module into different NGINX base images. You can adapt them to your specific NGINX Ingress Controller image and requirements.\n\n## Usage\n\n1. **Copy the built `.so` file** to your NGINX modules directory (e.g., `/usr/lib/nginx/modules/`).\n2. **Load the module** in your `nginx.conf`:\n   ```nginx\n   load_module modules/ngx_steadybit_sleep_module.so;\n   ```\n3. **Use the directive** in your server/location block:\n   ```nginx\n   location /test-sleep {\n       sb_sleep_ms 500;  # Sleep for 500 milliseconds\n       proxy_pass http://backend;\n   }\n   ```\n\n## NGINX Ingress Controller Usage\n\nWhen using this module with NGINX Ingress Controller, additional configuration is required:\n\n### 1. Enable Snippets\nSnippets must be enabled on your NGINX Ingress Controller:\n```bash\n# Method 1: Controller arguments\n--enable-snippets\n\n# Method 2: ConfigMap option\nkubectl patch configmap \u003cingress-configmap\u003e -n \u003cnamespace\u003e --type=merge -p '{\"data\":{\"enable-snippets\":\"true\"}}'\n\n# Method 3: NGINX Ingress Operator\nkubectl patch NginxIngress nginxingress-controller -n nginx-ingress --type=merge -p '{\"spec\":{\"controller\":{\"enableSnippets\":true}}}'\n```\n\n### 2. Load Module via ConfigMap\nLoad the module using the ConfigMap approach:\n```bash\nkubectl patch configmap nginxingress-controller-nginx-ingress \\\n  -n nginx-ingress \\\n  --type=merge \\\n  -p '{\n    \"data\": {\n      \"main-snippets\": \"load_module /usr/lib/nginx/modules/ngx_steadybit_sleep_module.so;\"\n    }\n  }'\n```\n\n### 3. Use in Ingress Annotations\nThe module can then be used via configuration snippets in Ingress resources:\n```yaml\napiVersion: networking.k8s.io/v1\nkind: Ingress\nmetadata:\n  name: example-ingress\n  annotations:\n    nginx.ingress.kubernetes.io/configuration-snippet: |\n      sb_sleep_ms 500;\nspec:\n  # ... ingress spec\n```\n\n## Configuration Example\n```nginx\nload_module modules/ngx_steadybit_sleep_module.so;\n\nhttp {\n    server {\n        listen 8080;\n        location /sleep {\n            sb_sleep_ms 1000;\n            return 200 'Slept for 1 second';\n        }\n    }\n}\n```\n\n## Testing\n\nA test script is provided:\n```sh\ncd ngx_steadybit_sleep_module\nbash test-sleep-module.sh\n```\nThis will build NGINX with the module, start a test server, and run latency tests against the endpoints.\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License and Dependencies\n\n**IMPORTANT**: This project creates modified UBI images that are not certified or supported by Red Hat, Inc.\n\nThis module depends on:\n- **NGINX core** (licensed under the 2-clause BSD license)\n- **Red Hat Universal Base Image (UBI)** (subject to the Red Hat UBI End User License Agreement)\n\n**Licensing Terms:**\n- This module and its modifications are distributed under the **MIT License** (see [LICENSE](LICENSE))\n- The underlying Red Hat UBI components remain subject to the **Red Hat UBI End User License Agreement** (see [UBI-EULA.pdf](UBI-EULA.pdf))\n- No Red Hat trademarks or logos are used in the modified images\n\nPlease refer to the respective license texts for details:\n- [NGINX License](https://www.nginx.com/resources/legal)\n- [Red Hat UBI EULA](https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI) (also available locally as [UBI-EULA.pdf](UBI-EULA.pdf))","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteadybit%2Fnginx_steadybit_module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteadybit%2Fnginx_steadybit_module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteadybit%2Fnginx_steadybit_module/lists"}