add & run prettier-plugin-nginx

This commit is contained in:
Aminda Suomalainen 2023-05-18 11:33:33 +03:00
parent e0dc070cd1
commit 687a6433bb
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
8 changed files with 132 additions and 152 deletions

View File

@ -18,6 +18,7 @@ repos:
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
exclude: .*\.nginx$
- id: fix-byte-order-marker
- id: trailing-whitespace
# Let's not touch LICENSE files or reuse.software directory
@ -69,7 +70,8 @@ repos:
hooks:
- id: prettier
exclude_types: [python, pyi, jupyter]
additional_dependencies: ["prettier@2.8.8"]
additional_dependencies:
["prettier@2.8.8", "prettier-plugin-nginx@1.0.3"]
# Black, opinionated Python code formatter
# - repo: https://github.com/psf/black
@ -86,6 +88,7 @@ repos:
alias: ec
# I don't actually care about line lengths as more than a guideline
args: [-disable-max-line-length]
exclude: .*\.nginx$
# # Python linter
# - repo: local

View File

@ -8,7 +8,6 @@ server {
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
server_name bitbot.relpda.mikaela.info;
access_log /var/log/nginx/bitbot.access.log main;
location / {

View File

@ -11,32 +11,27 @@ server {
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
#location /api/ {
# proxy_pass http://[::1]:9050;
# }
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
@ -46,7 +41,6 @@ server {
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#

View File

@ -3,10 +3,8 @@ server {
listen [::]:80 default_server ipv6only=on;
listen 443 default_server ssl http2;
listen [::]:443 default_server ssl http2 ipv6only=on;
root /var/www/default/;
index index.php index.html index.htm;
### Generating SSL certificate:
## mkdir -p /etc/nginx/ssl && cd /etc/nginx/ssl
## openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout nginx.key -out nginx.crt
@ -18,34 +16,32 @@ server {
# **2014-11-07** https://wiki.mozilla.org/Security/Server_Side_TLS
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:50m;
# Diffie-Hellman parameter for DHE ciphersuites, recommended 4096 bits
# See generation on line 14
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
# Intermediate configuration. tweak to your needs.
# comment just for me, don't uncomment.
#ssl_ciphers '';
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
ssl_prefer_server_ciphers on;
# Enable this if your want HSTS (recommended)
add_header Strict-Transport-Security "max-age=15552000; includeSubdomains; preload";
add_header Strict-Transport-Security
"max-age=15552000; includeSubdomains; preload";
add_header X-Frame-Options SAMEORIGIN;
add_header Content-Security-Policy upgrade-insecure-requests;
add_header Content-Security-Policy
upgrade-insecure-requests;
add_header X-Xss-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
# OCSP Stapling ---
# fetch OCSP records from URL in ssl_certificate and cache them
ssl_stapling on;
ssl_stapling_verify on;
## verify chain of trust of OCSP response using Root CA and Intermediate certs
#ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;
#resolver ::1;
# ----- end of Mozilla Server Side TLS recommendations -----
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
@ -60,16 +56,13 @@ server {
autoindex on;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /usr/share/nginx/html;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {

View File

@ -3,19 +3,17 @@ server {
listen [::]:80;
listen 443;
listen [::]:443;
# Enable this if your want HSTS (recommended)
add_header Strict-Transport-Security "max-age=15552000; includeSubdomains; preload";
add_header Strict-Transport-Security
"max-age=15552000; includeSubdomains; preload";
add_header X-Frame-Options SAMEORIGIN;
add_header Content-Security-Policy upgrade-insecure-requests;
add_header X-Xss-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
server_name something.example.org;
# NOTE: For X-Real-IP & X-Forwarded-For see ../conf.d/rproxy.conf
# Behind CloudFlare see ../conf.d/cloudflare.conf
location / {
proxy_pass http://localhost:8080;
}

View File

@ -1,21 +1,18 @@
server {
# default_server from default vhost must exist somewhere!
listen 80;
listen [::]:80;
listen 443;
listen [::]:443;
# Enable this if your want HSTS (recommended)
add_header Strict-Transport-Security "max-age=15552000; includeSubdomains; preload";
add_header Strict-Transport-Security
"max-age=15552000; includeSubdomains; preload";
add_header X-Frame-Options SAMEORIGIN;
add_header Content-Security-Policy upgrade-insecure-requests;
add_header X-Xss-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
root /var/www/vhostdir;
index index.php index.html index.htm;
# vhost address
server_name vhost.example.org;
@ -32,17 +29,13 @@ server {
# index index.html index.htm;
# autoindex on;
#}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /usr/share/nginx/html;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {