diff --git a/config/nginx/cloudflare.conf b/config/nginx/cloudflare.conf index b04720a..e3307f3 100644 --- a/config/nginx/cloudflare.conf +++ b/config/nginx/cloudflare.conf @@ -27,4 +27,3 @@ set_real_ip_from 2c0f:f248::/32; # use any of the following two real_ip_header CF-Connecting-IP; #real_ip_header X-Forwarded-For; - diff --git a/config/nginx/default_disable.conf b/config/nginx/default_disable.conf index 45092c5..4f01acf 100644 --- a/config/nginx/default_disable.conf +++ b/config/nginx/default_disable.conf @@ -1,20 +1,20 @@ map "" $empty { - default ""; + default ""; } server { - listen 80 default_server; - listen [::]:80 default_server; + listen 80 default_server; + listen [::]:80 default_server; - listen 443 ssl default_server; - listen [::]:443 ssl default_server; - http2 on; + listen 443 ssl default_server; + listen [::]:443 ssl default_server; + http2 on; - server_name _; + server_name _; - ssl_ciphers aNULL; - ssl_certificate /etc/nginx/ssl/dummy.crt; - ssl_certificate_key /etc/nginx/ssl/dummy.key; + ssl_ciphers aNULL; + ssl_certificate /etc/nginx/ssl/dummy.crt; + ssl_certificate_key /etc/nginx/ssl/dummy.key; - return 444; + return 444; } diff --git a/config/nginx/nginx.conf b/config/nginx/nginx.conf index 9df3f8c..75657bd 100644 --- a/config/nginx/nginx.conf +++ b/config/nginx/nginx.conf @@ -4,7 +4,7 @@ pid /var/run/nginx.pid; worker_processes auto; -worker_rlimit_nofile 300000; # needs to be < ulimit -n +worker_rlimit_nofile 300000; # needs to be < ulimit -n error_log /data/nginx/logs/nginx-error.log warn; @@ -41,25 +41,25 @@ http { gzip_types application/json; log_format access_json '{' - '"time": "$time_iso8601", ' - '"msec": "$msec", ' - '"status": $status, ' - '"request": "$request", ' - '"request_method": "$request_method", ' - '"request_time": $request_time, ' - '"body_bytes_sent": $body_bytes_sent, ' - '"remote_addr": "$remote_addr", ' - '"remote_user": "$remote_user", ' - '"http_referrer": "$http_referer", ' - '"http_x_forwarded_for": "$http_x_forwarded_for", ' - '"http_user_agent": "$http_user_agent", ' - '"host": "$host", ' - '"uri": "$uri", ' - '"http_cf_connecting_ip": "$http_cf_connecting_ip", ' - '"http_cf_ray": "$http_cf_ray", ' - '"http_cf_ipcountry": "$http_cf_ipcountry", ' - '"scheme": "$scheme", ' - '"http_host": "$http_host"' + '"time": "$time_iso8601", ' + '"msec": "$msec", ' + '"status": $status, ' + '"request": "$request", ' + '"request_method": "$request_method", ' + '"request_time": $request_time, ' + '"body_bytes_sent": $body_bytes_sent, ' + '"remote_addr": "$remote_addr", ' + '"remote_user": "$remote_user", ' + '"http_referrer": "$http_referer", ' + '"http_x_forwarded_for": "$http_x_forwarded_for", ' + '"http_user_agent": "$http_user_agent", ' + '"host": "$host", ' + '"uri": "$uri", ' + '"http_cf_connecting_ip": "$http_cf_connecting_ip", ' + '"http_cf_ray": "$http_cf_ray", ' + '"http_cf_ipcountry": "$http_cf_ipcountry", ' + '"scheme": "$scheme", ' + '"http_host": "$http_host"' '}'; access_log /data/nginx/logs/nginx-access.log access_json buffer=32k; diff --git a/lint.sh b/lint.sh index 5c5d34f..f2bfd8f 100755 --- a/lint.sh +++ b/lint.sh @@ -3,5 +3,4 @@ ruff check --fix . ruff format . -# https://github.com/soulteary/nginx-formatter -nginx-formatter +find . -type f -name '*.conf' -path '*/nginx*' -exec nginxfmt -v {} +; diff --git a/scripts/http_host/nginx_site.conf b/scripts/http_host/nginx_site.conf index bc96d4f..d91d8fc 100644 --- a/scripts/http_host/nginx_site.conf +++ b/scripts/http_host/nginx_site.conf @@ -12,6 +12,6 @@ server { gzip off; alias /data/ofm/runs/planet_20231208_091355/mnt_rw/extract; - autoindex on; # Enables listing of directory + autoindex on; # Enables listing of directory } } diff --git a/setup.py b/setup.py index 6c3543c..eba2aa5 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,13 @@ from setuptools import setup -requirements = ['fabric', 'ruff', 'python-dotenv', 'click'] +requirements = [ + 'fabric', + 'ruff', + 'python-dotenv', + 'click', + 'nginxfmt', +] setup( name='openfreemap',