Skip to content

Commit 1326238

Browse files
renovate[bot]Zoey2936
authored andcommitted
dep updates/see description
little php design preview (dead host/default page/fancyindex) improved "exploit blocking" fancyindex now default off block access to .git folders/files change NGINX_404_REDIRECT default to false
1 parent 941950e commit 1326238

37 files changed

+491
-8132
lines changed

.github/workflows/update-and-lint.yml

+2-9
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,12 @@ jobs:
2121
cd backend
2222
yarn install --no-lockfile
2323
yarn eslint . --fix
24-
- name: update
25-
run: |
26-
curl -L https://unpkg.com/xregexp/xregexp-all.js -o rootfs/nftd/xregexp-all.js
27-
curl -L https://unpkg.com/showdown/dist/showdown.min.js -o rootfs/nftd/showdown.min.js
28-
curl -L https://code.jquery.com/jquery-"$(git ls-remote --tags https://github.com/jquery/jquery | cut -d/ -f3 | sort -V | tail -1)".min.js -o rootfs/nftd/jquery.min.js
29-
curl -L https://cdn.jsdelivr.net/npm/bootstrap@"$(git ls-remote --tags https://github.com/twbs/bootstrap v3.3.* | cut -d/ -f3 | sort -V | tail -1)"/dist/css/bootstrap.min.css -o rootfs/html/404/bootstrap.min.css
30-
curl -L https://cdn.jsdelivr.net/npm/bootstrap@"$(git ls-remote --tags https://github.com/twbs/bootstrap v3.3.* | cut -d/ -f3 | sort -V | tail -1)"/dist/css/bootstrap.min.css -o rootfs/html/default/bootstrap.min.css
3124
- name: nginxbeautifier
3225
run: |
3326
yarn global add nginxbeautifier
34-
mv rootfs/usr/local/nginx/conf/conf.d/include/block-exploits.conf block-exploits.conf
27+
mv -v rootfs/usr/local/nginx/conf/exploits.conf exploits.conf
3528
nginxbeautifier -s 4 -r rootfs/usr/local/nginx/conf
36-
mv block-exploits.conf rootfs/usr/local/nginx/conf/conf.d/include/block-exploits.conf
29+
mv -v exploits.conf rootfs/usr/local/nginx/conf/exploits.conf
3730
- name: push changes
3831
run: |
3932
git add -A

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ RUN apk upgrade --no-cache -a && \
5959
echo "APPSEC_FAILURE_ACTION=deny" | tee -a /src/crowdsec-nginx-bouncer/lua-mod/config_example.conf && \
6060
sed -i "s|BOUNCING_ON_TYPE=all|BOUNCING_ON_TYPE=ban|g" /src/crowdsec-nginx-bouncer/lua-mod/config_example.conf
6161

62-
FROM zoeyvid/nginx-quic:288-python
62+
FROM zoeyvid/nginx-quic:290-python
6363
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
6464

6565
ARG CRS_VER=v4.3.0
6666

6767
COPY rootfs /
68-
COPY --from=zoeyvid/certbot-docker:35 /usr/local /usr/local
68+
COPY --from=zoeyvid/certbot-docker:38 /usr/local /usr/local
6969
COPY --from=zoeyvid/curl-quic:388 /usr/local/bin/curl /usr/local/bin/curl
7070

7171
RUN apk upgrade --no-cache -a && \
@@ -130,7 +130,7 @@ ENV PUID=0 \
130130
DISABLE_H3_QUIC=false \
131131
NGINX_ACCESS_LOG=false \
132132
NGINX_LOG_NOT_FOUND=false \
133-
NGINX_404_REDIRECT=true \
133+
NGINX_404_REDIRECT=false \
134134
NGINX_DISABLE_PROXY_BUFFERING=false \
135135
CLEAN=true \
136136
FULLCLEAN=false \

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ a) Custom Nginx Configuration (advanced tab), which looks the following for file
150150
- Note: the slash at the end of the file path is important
151151
```
152152
location / {
153-
include conf.d/include/acme-challenge.conf;
153+
include conf.d/include/always.conf;
154154
alias /var/www/<your-html-site-folder-name>/;
155+
fancyindex off; # alternative to nginxs "index" option (looks better and has more options)
155156
}
156157
```
157158
b) Custom Nginx Configuration (advanced tab), which looks the following for file server and **php**:
@@ -161,8 +162,9 @@ b) Custom Nginx Configuration (advanced tab), which looks the following for file
161162
- Note: to add more php extension using envs you can set in the compose file
162163
```
163164
location / {
164-
include conf.d/include/acme-challenge.conf;
165+
include conf.d/include/always.conf;
165166
alias /var/www/<your-html-site-folder-name>/;
167+
fancyindex off; # alternative to nginxs "index" option (looks better and has more options)
166168
167169
location ~ [^/]\.php(/|$) {
168170
fastcgi_pass php82;

backend/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"eslint": "9.4.0",
3434
"eslint-config-prettier": "9.1.0",
3535
"eslint-plugin-prettier": "5.1.3",
36-
"globals": "15.3.0",
37-
"prettier": "3.3.0"
36+
"globals": "15.4.0",
37+
"prettier": "3.3.1"
3838
}
3939
}

backend/templates/dead_host.conf

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ server {
88
{% include "_forced_tls.conf" %}
99
{% include "_brotli.conf" %}
1010

11-
include conf.d/include/acme-challenge.conf;
12-
include conf.d/include/block-exploits.conf;
11+
include conf.d/include/always.conf;
1312

1413
{{ advanced_config }}
1514

1615
{% if use_default_location == 1 or use_default_location == true %}
1716
location / {
18-
include conf.d/include/acme-challenge.conf;
19-
root /html/404;
17+
include conf.d/include/always.conf;
18+
root /html/dead;
2019
try_files $uri /index.html;
2120
}
2221
{% endif %}

backend/templates/default.conf

+6-7
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,16 @@ server {
1717
include conf.d/include/brotli.conf;
1818
include conf.d/include/force-tls.conf;
1919
include conf.d/include/tls-ciphers.conf;
20-
include conf.d/include/acme-challenge.conf;
21-
include conf.d/include/block-exploits.conf;
20+
include conf.d/include/always.conf;
2221

2322
#ssl_certificate ;
2423
#ssl_certificate_key ;
2524
#ssl_trusted_certificate ;
2625

2726
{%- if value == "404" %}
2827
location / {
29-
include conf.d/include/acme-challenge.conf;
30-
root /html/404;
28+
include conf.d/include/always.conf;
29+
root /html/dead;
3130
try_files $uri /index.html;
3231
}
3332
{%- endif %}
@@ -38,22 +37,22 @@ server {
3837

3938
{%- if value == "redirect" %}
4039
location / {
41-
include conf.d/include/acme-challenge.conf;
40+
include conf.d/include/always.conf;
4241
return 307 {{ meta.redirect }};
4342
}
4443
{%- endif %}
4544

4645
{%- if value == "congratulations" %}
4746
location / {
48-
include conf.d/include/acme-challenge.conf;
47+
include conf.d/include/always.conf;
4948
root /html/default;
5049
try_files $uri /index.html;
5150
}
5251
{%- endif %}
5352

5453
{%- if value == "html" %}
5554
location / {
56-
include conf.d/include/acme-challenge.conf;
55+
include conf.d/include/always.conf;
5756
root /data/etc/html;
5857
try_files $uri /index.html;
5958
}

backend/templates/proxy_host.conf

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ server {
2222
{% endif %}
2323
{% endif %}
2424

25-
include conf.d/include/acme-challenge.conf;
26-
include conf.d/include/block-exploits.conf;
25+
include conf.d/include/always.conf;
2726

2827
{% if access_list_id > 0 %}
2928
{% if access_list.items.length > 0 %}
@@ -38,7 +37,7 @@ server {
3837

3938
{% if use_default_location == 1 or use_default_location == true %}
4039
location / {
41-
include conf.d/include/acme-challenge.conf;
40+
include conf.d/include/always.conf;
4241

4342
{% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %}
4443
proxy_set_header Upgrade $http_upgrade;

backend/templates/redirection_host.conf

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ server {
88
{% include "_forced_tls.conf" %}
99
{% include "_brotli.conf" %}
1010

11-
include conf.d/include/acme-challenge.conf;
12-
include conf.d/include/block-exploits.conf;
11+
include conf.d/include/always.conf;
1312

1413
{{ advanced_config }}
1514

1615
{% if use_default_location == 1 or use_default_location == true %}
1716
location / {
18-
include conf.d/include/acme-challenge.conf;
17+
include conf.d/include/always.conf;
1918
{% if preserve_path == 1 or preserve_path == true %}
2019
return {{ forward_http_code }} {{ forward_scheme }}://{{ forward_domain_name }}$request_uri;
2120
{% else %}

compose.override.yaml

-14
This file was deleted.

compose.yaml

+12-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ services:
3131
# - "DISABLE_HTTP=true" # disables nginx to listen on port 80, default false
3232
# - "DISABLE_H3_QUIC=true" # disables nginx to listen on port 443 udp for default and your hosts, this will disable HTTP/3 and QUIC, default false
3333
# - "NGINX_LOG_NOT_FOUND=true" # Allow logging of 404 errors, default false
34-
# - "NGINX_404_REDIRECT=false" # Redirect to / instead of showing a 404 error page, default true
34+
# - "NGINX_404_REDIRECT=true" # Redirect to / instead of showing a 404 error page, default false
3535
# - "NGINX_DISABLE_PROXY_BUFFERING=true" # Disables the proxy-buffering option of nginx, default false
3636
# - "CLEAN=false" # Clean folders, default true
3737
# - "FULLCLEAN=true" # Clean unused config folders, default false
@@ -47,3 +47,14 @@ services:
4747
# - "PHP83=true" # Activate PHP83, default false
4848
# - "PHP83_APKS=php83-curl php83-openssl" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=community&arch=x86_64&name=php83-*, default none, requires PHP83
4949
# - "PHP_APKS=php-pecl-apcu php-pecl-redis" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=community&arch=x86_64&name=php-*, default none, requires PHP82 and/or PHP83, not recommended, please use PHP82_APKS or PHP83_APKS
50+
51+
# This can be used with DISABLE_HTTP=true, to force HTTPS redirects for every host
52+
# npmplus-caddy:
53+
# container_name: npmplus-caddy
54+
# image: zoeyvid/npmplus:caddy
55+
# restart: always
56+
# network_mode: bridge
57+
# ports:
58+
# - "80:80"
59+
# environment:
60+
# - "TZ=Europe/Berlin"

frontend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "A beautiful interface for creating Nginx endpoints",
55
"main": "js/index.js",
66
"dependencies": {
7-
"@babel/core": "7.24.6",
7+
"@babel/core": "7.24.7",
88
"babel-core": "6.26.3",
99
"babel-loader": "8.3.0",
1010
"babel-preset-env": "1.7.0",

rootfs/html/404/bootstrap.min.css

-6
This file was deleted.

rootfs/html/404/index.html

-26
This file was deleted.

rootfs/html/dead/index.html

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Dead Host</title>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<meta name="application-name" content="NPMplus" />
8+
<meta name="author" content="ZoeyVid" />
9+
<meta name="description" content="Dead Host Page of NPMplus" />
10+
<meta name="keywords" content="NPMplus, dead" />
11+
<!-- TODO: Icon -->
12+
<link rel="icon" type="image/webp" href="/favicon.webp" />
13+
</head>
14+
<body>
15+
<style>
16+
@media (prefers-color-scheme: dark) {
17+
body {
18+
background-color: rgb(17 24 39);
19+
color: white;
20+
}
21+
22+
#box {
23+
background-color: rgb(31 41 55);
24+
}
25+
}
26+
27+
@media (prefers-color-scheme: light) {
28+
body {
29+
background-color: white;
30+
color: black;
31+
}
32+
33+
#box {
34+
background-color: rgb(229 231 235);
35+
}
36+
}
37+
38+
body {
39+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
40+
text-align: center;
41+
}
42+
43+
#box {
44+
border-radius: 2rem;
45+
position: absolute;
46+
padding: 1rem;
47+
padding-right: 5rem;
48+
padding-left: 5rem;
49+
top: 50%;
50+
left: 50%;
51+
transform: translate(-50%, -50%);
52+
}
53+
54+
h1 {
55+
font-size: 64px;
56+
}
57+
58+
p {
59+
font-size: 24px;
60+
}
61+
62+
#notice {
63+
font-size: 12px;
64+
position: fixed;
65+
bottom: 0;
66+
left: 50%;
67+
transform: translateX(-50%);
68+
}
69+
70+
@media (max-width: 600px) {
71+
h1 {
72+
font-size: 32px;
73+
}
74+
75+
p {
76+
font-size: 16px;
77+
}
78+
79+
#box {
80+
padding-right: 2rem;
81+
padding-left: 2rem;
82+
}
83+
}
84+
</style>
85+
<div id="box">
86+
<h1>Dead Host</h1>
87+
</div>
88+
<p id="notice">Powered by <a href="https://github.com/ZoeyVid/NPMplus">NPMplus</a></p>
89+
</body>
90+
</html>

rootfs/html/default/bootstrap.min.css

-6
This file was deleted.

0 commit comments

Comments
 (0)