Gathering detailed insights and metrics for @zeph1rus/nginx-config-scaffold
Gathering detailed insights and metrics for @zeph1rus/nginx-config-scaffold
A tool to scaffold out NGINX certificates and proxy/upstream hostnames so you can test your configs in CI
npm install @zeph1rus/nginx-config-scaffold
Typescript
Module System
Min. Node Version
Node Version
NPM Version
76.5
Supply Chain
87
Quality
74.1
Maintenance
100
Vulnerability
78.7
License
JavaScript (98.37%)
Dockerfile (1.18%)
Shell (0.45%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
1,220
Last Day
1
Last Week
10
Last Month
29
Last Year
263
16 Commits
1 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
0.2.2
Package Id
@zeph1rus/nginx-config-scaffold@0.2.2
Unpacked Size
722.00 kB
Size
136.35 kB
File Count
20
NPM Version
8.19.4
Node Version
16.20.0
Publised On
24 May 2023
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
42.9%
10
Compared to previous week
Last month
222.2%
29
Compared to previous month
Last year
-72.5%
263
Compared to previous year
3
nginx-config-scaffold
is a tool to help you scaffold out nginx config dependencies, such as hostnames for upstreams and proxy destinations, and to create dummy certificates to allow you to test nginx configs (using nginx -t
) without having to have your full nginx environment available.
Install with npm install @zeph1rus/nginx-config-scaffold
You'll need a version of Node.JS greater than 12.0.0
, greater than 16 is HIGHLY RECOMMENDED!
If you're testing nginx configs in an ephemeral CI environment such as GitHub Actions, Gitlab, or Bitbucket cloud, just install nginx, copy your config to the nginx config directory, and run
npx run nginx-config-scaffold --basedir <your-config-dir>
by default, we only create certificates, if you wish for your hosts file to be updated with proxies or upstreams there are additional parameters to add.
One most Unixey platforms we will try to write to /etc/hosts
, on Solaris it's /etc/inet/hosts
and on Windows we try C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
--basedir <baseDir> Directory to scan configs from recursively
--upstreams Add upstreams to hosts file
--proxies Add proxy hosts to hosts file
--dryrun Don't make changes, just tell me what actions would be performed
--help/-h This help
We've provided a sample dockerfile and entrypoint.sh to allow you to build a docker image and use that to test. You will want to update MY_CONFDIR_CHANGE_ME
to match your config directory
When run this container will exit with a non-zero exit code if the test fails
FROM alpine:latest
RUN apk add nginx nodejs npm
COPY MY_CONFDIR_CHANGE_ME /etc/nginx
RUN mkdir /opt/app
WORKDIR "/opt/app"
COPY "entrypoint.sh" "."
RUN chmod u+x entrypoint.sh
RUN npm i @zeph1rus/nginx-config-scaffold
ENTRYPOINT ["./entrypoint.sh"]
#!/usr/bin/env sh
npx nginx-config-scaffold --basedir /etc/nginx --upstreams --proxies
nginx -t
This should work fine on NGINX plus installs, as long as you have it installed, if not the tests will fail on nginx-plus specific directives.
No vulnerabilities found.
No security vulnerabilities found.