From 51dad3494062966f992950ce41ae83eb6c3236dc Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Fri, 24 Mar 2023 21:47:54 +0100 Subject: [PATCH] Remove nginx --- Dockerfile | 1 - defaults/nginx.conf | 55 --------------------------------------------- entrypoint.sh | 13 +++++------ 3 files changed, 6 insertions(+), 63 deletions(-) delete mode 100644 defaults/nginx.conf diff --git a/Dockerfile b/Dockerfile index b49ad5d..3db4170 100644 --- a/Dockerfile +++ b/Dockerfile @@ -99,7 +99,6 @@ RUN apt-get update -qq -y &&\ gosu \ busybox-syslogd \ tzdata \ - nginx-light \ -qq -y --no-install-recommends &&\ rm -rf /var/lib/apt/lists/* diff --git a/defaults/nginx.conf b/defaults/nginx.conf deleted file mode 100644 index 8243079..0000000 --- a/defaults/nginx.conf +++ /dev/null @@ -1,55 +0,0 @@ -worker_processes auto; -error_log off; -user weewx; - -events { - worker_connections 1024; -} - -http { - server_tokens off; - access_log off; - - include /etc/nginx/mime.types; - - sendfile on; - tcp_nopush on; - - gzip on; - gzip_vary on; - gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml; - - map $http_x_forwarded_proto $pass_scheme { - default $http_x_forwarded_proto; - '' $scheme; - } - - map $http_x_forwarded_host $pass_host { - default $http_x_forwarded_host; - '' $host; - } - - server { - listen 8000; - - root /data/html/wdc; - index index.html; - - location ~* \.html$ { - expires modified 120s; - } - - location ~* \.(js|css)$ { - expires 1h; - } - - location ~ ^/dwd/(icons|warn_icons)/ { - root /home/weewx/public_html; - expires 7d; - } - - location ~ ^/dwd/[\w]+\.(gif|png) { - expires modified 1h; - } - } -} diff --git a/entrypoint.sh b/entrypoint.sh index 0f820a9..6777f2b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,13 +19,6 @@ if [ "$(id -u)" = 0 ]; then # start the syslog daemon as root /sbin/syslogd -n -S -O - & - # start nginx - if [ -e /data/nginx.conf ]; then - nginx -c /data/nginx.conf - else - nginx -c /defaults/nginx.conf - fi - # setup cron if [ -e /data/cron/dwd ]; then cp /data/cron/dwd /etc/cron.hourly/ @@ -47,6 +40,12 @@ if [ "$(id -u)" = 0 ]; then ln -s /defaults/skin-wdc/skin.conf ./skins/weewx-wdc/skin.conf fi + # skin: move dwd icons + mkdir /data/static_html + cp -r ./public_html/dwd /data/static_html + chown -R "${WEEWX_UID:-weewx}:${WEEWX_GID:-weewx}" /data/static_html + chmod 444 /data/static_html/dwd/{icons,warn_icons}/* + if [ "${WEEWX_UID:-weewx}" != 0 ]; then # drop privileges and restart this script echo "Switching uid:gid to ${WEEWX_UID:-weewx}:${WEEWX_GID:-weewx}"