Skip to content

Commit

Permalink
dep updates/nginxfmt
Browse files Browse the repository at this point in the history
Signed-off-by: Zoey <zoey@z0ey.de>
  • Loading branch information
renovate[bot] authored and Zoey2936 committed Jun 15, 2023
1 parent cabf78f commit f129453
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 155 deletions.
55 changes: 0 additions & 55 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

18 changes: 0 additions & 18 deletions .github/ISSUE_TEMPLATE/dns_challenge_request.md

This file was deleted.

32 changes: 0 additions & 32 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform="$BUILDPLATFORM" alpine:3.18.0 as frontend
FROM --platform="$BUILDPLATFORM" alpine:3.18.2 as frontend
COPY frontend /build/frontend
COPY global/certbot-dns-plugins.js /build/frontend/certbot-dns-plugins.js
ARG NODE_ENV=production \
Expand All @@ -12,7 +12,7 @@ COPY darkmode.css /build/frontend/dist/css/darkmode.css
COPY security.txt /build/frontend/dist/.well-known/security.txt


FROM --platform="$BUILDPLATFORM" alpine:3.18.0 as backend
FROM --platform="$BUILDPLATFORM" alpine:3.18.2 as backend
COPY backend /build/backend
COPY global/certbot-dns-plugins.js /build/backend/certbot-dns-plugins.js
ARG NODE_ENV=production \
Expand All @@ -29,14 +29,14 @@ RUN apk add --no-cache ca-certificates nodejs-current yarn && \
yarn cache clean --all


FROM python:3.11.3-alpine3.18 as certbot
FROM python:3.11.4-alpine3.18 as certbot
RUN apk add --no-cache ca-certificates build-base libffi-dev && \
python3 -m venv /usr/local/certbot && \
. /usr/local/certbot/bin/activate && \
pip install --no-cache-dir certbot
pip install --no-cache-dir certbot nginxfmt


FROM --platform="$BUILDPLATFORM" alpine:3.18.0 as crowdsec
FROM --platform="$BUILDPLATFORM" alpine:3.18.2 as crowdsec
RUN apk add --no-cache ca-certificates git build-base && \
git clone --recursive https://github.com/crowdsecurity/cs-nginx-bouncer /src && \
cd /src && \
Expand All @@ -53,7 +53,7 @@ RUN apk add --no-cache ca-certificates git build-base && \
sed -i "s|CAPTCHA_TEMPLATE_PATH=.*|CAPTCHA_TEMPLATE_PATH=/data/etc/crowdsec/crowdsec.conf|g" lua-mod/config_example.conf


FROM zoeyvid/nginx-quic:142
FROM zoeyvid/nginx-quic:157
COPY rootfs /
RUN apk add --no-cache ca-certificates tzdata \
lua5.1-lzlib \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ so that the barrier for entry here is low.
- Try to whitelist the Content-Type you are sending (for example, `application/activity+json` for Mastodon and `application/dns-message` for DoH).
- Try to whitelist the HTTP request method you are using (for example, `PUT` is blocked by default, which also affects NPM).
- Note: To fix [this issue](https://github.com/SpiderLabs/ModSecurity/issues/2848), instead of running `nginx -s reload`, this fork kills nginx and relaunches it. This can result in a 502 error when you update your hosts
- Darkmode button in the footer for comfortable viewing (CSS done by https://github.com/theraw)
- Darkmode button in the footer for comfortable viewing (CSS done by [@theraw](https://github.com/theraw))
- Fixes proxy to https origin when the origin only accepts TLSv1.3
- Only enables TLSv1.2 and TLSv1.3 protocols
- Faster creation of TLS certificates can be achieved by eliminating unnecessary Nginx reloads and configuration creations.
Expand Down
4 changes: 2 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"gravatar": "1.8.2",
"jsonwebtoken": "9.0.0",
"knex": "2.4.2",
"liquidjs": "10.7.1",
"liquidjs": "10.8.2",
"lodash": "4.17.21",
"moment": "2.29.4",
"mysql": "2.18.1",
Expand All @@ -30,7 +30,7 @@
"author": "Jamie Curnow <jc@jc21.com>",
"license": "MIT",
"devDependencies": {
"eslint": "8.40.0",
"eslint": "8.42.0",
"eslint-plugin-align-assignments": "1.1.2"
}
}
1 change: 0 additions & 1 deletion backend/templates/_listen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
listen [::]:443 quic;

add_header alt-svc 'h3=":443"; ma=86400, h3-29=":443"; ma=86400';
http3 on;
{% endif %}
{% endif %}
server_name {{ domain_names | join: " " }};
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A beautiful interface for creating Nginx endpoints",
"main": "js/index.js",
"dependencies": {
"@babel/core": "7.22.1",
"@babel/core": "7.22.5",
"babel-core": "6.26.3",
"babel-loader": "8.3.0",
"babel-preset-env": "1.7.0",
Expand Down
6 changes: 4 additions & 2 deletions rootfs/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ if [ "$FULLCLEAN" = "true" ]; then
certbot-cleaner.sh
fi

find /data/nginx -type f -name '*.conf' -exec sed -i "s|80 http2|80|g" {} \;
find /data/nginx -type f -name '*.conf' -exec sed -i "s| http2||g" {} \;
find /data/nginx -type f -name '*.conf' -exec sed -i "s|\(listen .*\) http3|\1 quic|g" {} \;
find /data/nginx -type f -name '*.conf' -exec sed -i "s|/data/nginx/html/|/data/etc/html/|g" {} \;

Expand All @@ -308,6 +308,7 @@ find /data/nginx -type f -name '*.conf' -exec sed -i "s|include conf.d/include/f
find /data/nginx -type f -name '*.conf' -exec sed -i "s|include conf.d/include/ssl-ciphers.conf;|include conf.d/include/tls-ciphers.conf;|g" {} \;
find /data/nginx -type f -name '*.conf' -exec sed -i "s|include conf.d/include/letsencrypt-acme-challenge.conf;|include conf.d/include/acme-challenge.conf;|g" {} \;

find /data/nginx -type f -name '*.conf' -exec sed -i "/http3/d" {} \;
find /data/nginx -type f -name '*.conf' -exec sed -i "/Asset Caching/d" {} \;
find /data/nginx -type f -name '*.conf' -exec sed -i "/assets.conf/d" {} \;

Expand Down Expand Up @@ -555,6 +556,7 @@ sed -i "s|ssl_certificate .*|ssl_certificate $NPM_CERT;|g" /data/nginx/default.c
sed -i "s|ssl_certificate_key .*|ssl_certificate_key $NPM_KEY;|g" /data/nginx/default.conf
if [ -n "$NPM_CHAIN" ]; then sed -i "s|ssl_trusted_certificate .*|ssl_trusted_certificate $NPM_CHAIN;|g" /data/nginx/default.conf; fi

find /data/nginx -type f -name '*.conf' -exec nginxfmt {} \;

chmod -R 770 /data/tls \
/data/etc/npm \
Expand Down Expand Up @@ -585,7 +587,7 @@ if [ "$PUID" != "0" ]; then
/usr/local/nginx \
/data \
/tmp
sed -i "s|user root;|#user root;|g" /usr/local/nginx/conf/nginx.conf
sed -i "s|user root;|#user root;|g" /usr/local/nginx/conf/nginx.conf
sudo -Eu npm launch.sh
else
chown -R 0:0 /usr/local/certbot \
Expand Down
44 changes: 23 additions & 21 deletions rootfs/usr/local/nginx/conf/conf.d/include/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,33 @@
# Default Site
# ------------------------------------------------------------
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 80 default_server;
listen [::]:80 default_server;

listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;

listen 443 quic default_server;
listen [::]:443 quic default_server;
listen 443 quic default_server;
listen [::]:443 quic default_server;

server_name _;
server_name _;

include conf.d/include/brotli.conf;
include conf.d/include/force-ssl.conf;
include conf.d/include/tls-ciphers.conf;
include conf.d/include/acme-challenge.conf;
include conf.d/include/block-exploits.conf;
add_header alt-svc 'h3=":443"; ma=86400, h3-29=":443"; ma=86400';
http3 on;
include conf.d/include/brotli.conf;
include conf.d/include/force-ssl.conf;
include conf.d/include/tls-ciphers.conf;
include conf.d/include/acme-challenge.conf;
include conf.d/include/block-exploits.conf;
add_header alt-svc 'h3=":443";
ma=86400, h3-29=":443";
ma=86400';
http3 on;

#ssl_certificate ;
#ssl_certificate_key ;
#ssl_trusted_certificate ;
#ssl_certificate ;
#ssl_certificate_key ;
#ssl_trusted_certificate ;

location / {
include conf.d/include/acme-challenge.conf;
alias /html/default/;
}
location / {
include conf.d/include/acme-challenge.conf;
alias /html/default/;
}
}
4 changes: 3 additions & 1 deletion rootfs/usr/local/nginx/conf/conf.d/no-server-name.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ server {
include conf.d/include/force-tls.conf;
include conf.d/include/tls-ciphers.conf;
include conf.d/include/block-exploits.conf;
add_header alt-svc 'h3=":443"; ma=86400, h3-29=":443"; ma=86400';
add_header alt-svc 'h3=":443";
ma=86400, h3-29=":443";
ma=86400';
http3 on;

#ssl_certificate ;
Expand Down
4 changes: 3 additions & 1 deletion rootfs/usr/local/nginx/conf/conf.d/npm-no-server-name.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ server {
include conf.d/include/force-tls.conf;
include conf.d/include/tls-ciphers.conf;
include conf.d/include/block-exploits.conf;
add_header alt-svc 'h3=":443"; ma=86400, h3-29=":443"; ma=86400';
add_header alt-svc 'h3=":443";
ma=86400, h3-29=":443";
ma=86400';
http3 on;

#ssl_certificate ;
Expand Down
12 changes: 7 additions & 5 deletions rootfs/usr/local/nginx/conf/conf.d/npm.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
server {
listen 81 ssl http2 default_server;
listen 81 quic default_server;

listen [::]:81 ssl http2 default_server;
listen [::]:81 quic default_server;
add_header alt-svc 'h3=":443"; ma=86400, h3-29=":443"; ma=86400';
add_header alt-svc 'h3=":443";
ma=86400, h3-29=":443";
ma=86400';
http3 on;

server_name _;
Expand All @@ -15,7 +17,7 @@ server {

modsecurity on;
modsecurity_rules_file /usr/local/nginx/conf/conf.d/include/modsecurity.conf;

#ssl_certificate ;
#ssl_certificate_key ;
#ssl_trusted_certificate ;
Expand All @@ -26,7 +28,7 @@ server {

location /api/ {
proxy_pass http://127.0.0.1:48693/;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header Early-Data $ssl_early_data;
Expand All @@ -35,7 +37,7 @@ server {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $host;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
Expand Down
Loading

0 comments on commit f129453

Please sign in to comment.