wolfi-dev / os

Main package repository for production Wolfi images
Other
828 stars 257 forks source link

[Wolfi Package Request]: Nginx: add modules `http-dav-ext` & `http-headers-more` #29706

Open sando38 opened 1 month ago

sando38 commented 1 month ago

What software would you like us to add to wolfi-os. Ideally include a URL to the project and its source.

Dear wolfi-team, would it be possible to add the following two additional modules to the nginx package?

_add_module "http-dav-ext" "v3.0.0" "https://github.com/arut/nginx-dav-ext-module" (https://nginx.org/en/docs/http/ngx_http_dav_module.html)

_add_module "http-headers-more" "v0.37" "https://github.com/openresty/headers-more-nginx-module"
_http_headers_more_so="ngx_http_headers_more_filter_module.so"

I can do it myself by creating a PR, but wanted to double check with you in advance :)

which versions of the software should we include?

No response

Add some justification for why this specific package and versions are important.

This will allow me to use wolfi-based images supporting WebDAV 👍

Please check all that apply

tuananh commented 1 month ago

related: https://github.com/wolfi-dev/os/issues/29340

devopsmatt commented 1 month ago

+1 to that!

Currently we're using this process to get http-headers-more:


# Define NGINX and additional compatible module versions
# https://github.com/openresty/headers-more-nginx-module/?tab=readme-ov-file#compatibility
ARG NGINX_VERSION=1.27.1
ARG MORE_HEADERS_VERSION=0.37

WORKDIR /usr/src/

# Download NGINX and headers-more-nginx-module sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
    wget "https://github.com/openresty/headers-more-nginx-module/archive/v${MORE_HEADERS_VERSION}.tar.gz" -O extra_module.tar.gz

# Make dirs for nginx + addititional module and extract sources
RUN mkdir -p /usr/src/nginx /usr/src/extra_module /var/log/nginx /etc/nginx/conf.d /var/cache/nginx /var/lib/nginx/modules && chown -R nginx:nginx /var/lib/nginx/ && \
    tar -xzf nginx.tar.gz -C /usr/src/nginx --strip-components=1 && \
    tar -xzf extra_module.tar.gz -C /usr/src/extra_module --strip-components=1

# Compile and install NGINX with additional module
WORKDIR /usr/src/nginx
RUN ./configure --prefix=/usr/local/nginx \
    --with-compat \
    --add-dynamic-module=/usr/src/extra_module && \
    make -j$(nproc) modules && \
    make -j$(nproc) install

# Clean up
RUN rm -rf nginx nginx.tar.gz extra_module extra_module.tar.gz

# Switch back to non-root user
USER nginx```