Skip to content

Commit

Permalink
Merge pull request #151 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 1.26.0+2
  • Loading branch information
andyone authored Jun 2, 2024
2 parents 6faa734 + c3a38bc commit e0037fc
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 156 deletions.
8 changes: 0 additions & 8 deletions .bibop/modules.conf

This file was deleted.

1 change: 0 additions & 1 deletion .bibop/webkaos.conf
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,4 @@ http {
}

include conf.d/*.conf;
include xtra/brotli.conf;
}
29 changes: 5 additions & 24 deletions .bibop/webkaos.recipe
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Bibop recipe for webkaos (EL8/EL9)
# See more: https://kaos.sh/bibop

pkg webkaos webkaos-debug webkaos-nginx webkaos-module-brotli
pkg webkaos webkaos-debug webkaos-nginx

require-root yes
unsafe-actions yes
Expand All @@ -13,8 +13,6 @@ var prefix_dir /etc/webkaos
var config {prefix_dir}/webkaos.conf
var extra_config_dir {prefix_dir}/xtra
var binary /usr/sbin/webkaos
var modules_config {prefix_dir}/modules.conf
var modules_dir /usr/share/webkaos/modules
var pid_file /var/run/webkaos.pid
var ssl_dir {prefix_dir}/ssl
var dh_param {ssl_dir}/dhparam.pem
Expand Down Expand Up @@ -152,10 +150,6 @@ command "nginx -t" "Validate default config using nginx wrapper"

command "-" "Original configuration backup"
backup {config}
backup {modules_config}

command "-" "Add modules configuration"
copy modules.conf {modules_config}

command "-" "Replace original configuration"
copy webkaos.conf {config}
Expand All @@ -179,34 +173,24 @@ command "-" "Clear old log files"
truncate {log_dir}/access.log
truncate {log_dir}/error.log

command "-" "Check brotli module"
exist {extra_config_dir}/brotli.conf
exist {modules_dir}/ngx_http_brotli_filter_module.so
exist {modules_dir}/ngx_http_brotli_static_module.so
mode {extra_config_dir}/brotli.conf 644
mode {modules_dir}/ngx_http_brotli_filter_module.so 755
mode {modules_dir}/ngx_http_brotli_static_module.so 755

command "systemctl start {service_name}" "Start service"
wait-pid {pid_file} 5
service-works {service_name}

command "-" "Make HTTP requests"
http-set-header Accept-Encoding "gzip, deflate, br"
http-set-header Accept-Encoding "gzip, deflate"
http-status GET "http://127.0.0.1" 200
http-header GET "http://127.0.0.1" server webkaos
http-header GET "http://127.0.0.1/mh" server bibop
http-header GET "http://127.0.0.1" Content-Encoding br
http-contains GET "http://127.0.0.1/lua" "LUA MODULE WORKS"
!empty {log_dir}/access.log
truncate {log_dir}/access.log

command "-" "Make HTTPS requests"
http-set-header Accept-Encoding "gzip, deflate, br"
http-set-header Accept-Encoding "gzip, deflate"
http-status GET "https://127.0.0.1" 200
http-header GET "https://127.0.0.1" server webkaos
http-header GET "https://127.0.0.1/mh" server bibop
http-header GET "https://127.0.0.1" Content-Encoding br
http-contains GET "https://127.0.0.1/lua" "LUA MODULE WORKS"
!empty {log_dir}/access.log
truncate {log_dir}/access.log
Expand Down Expand Up @@ -252,21 +236,19 @@ command "systemctl start {service_name}-debug" "Start debug version of service"
service-works {service_name}-debug

command "-" "Make HTTP requests"
http-set-header Accept-Encoding "gzip, deflate, br"
http-set-header Accept-Encoding "gzip, deflate"
http-status GET "http://127.0.0.1" 200
http-header GET "http://127.0.0.1" server webkaos
http-header GET "http://127.0.0.1/mh" server bibop
http-header GET "http://127.0.0.1" Content-Encoding br
http-contains GET "http://127.0.0.1/lua" "LUA MODULE WORKS"
!empty {log_dir}/access.log
truncate {log_dir}/access.log

command "-" "Make HTTPS requests"
http-set-header Accept-Encoding "gzip, deflate, br"
http-set-header Accept-Encoding "gzip, deflate"
http-status GET "https://127.0.0.1" 200
http-header GET "https://127.0.0.1" server webkaos
http-header GET "https://127.0.0.1/mh" server bibop
http-header GET "https://127.0.0.1" Content-Encoding br
http-contains GET "https://127.0.0.1/lua" "LUA MODULE WORKS"
!empty {log_dir}/access.log
truncate {log_dir}/access.log
Expand All @@ -279,7 +261,6 @@ command "systemctl stop {service_name}-debug" "Stop debug version of service"

command:teardown "-" "Configuration restore"
backup-restore {config}
backup-restore {modules_config}

command:teardown "-" "DH param cleanup"
remove {dh_param}
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* TLS 1.3 support (_RFC 8446_)
* [TCP Fast Open](https://en.wikipedia.org/wiki/TCP_Fast_Open) support
* [Lua](https://github.com/openresty/lua-nginx-module) and [Headers More](https://github.com/openresty/headers-more-nginx-module) modules from the box
* [Brotli](https://github.com/eustas/ngx_brotli) as dynamic module
* Improved SysV script
* Well-looking error pages
* Improved design of index pages
Expand All @@ -24,7 +23,7 @@
sudo dnf install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm
sudo dnf install webkaos
# Install optional modules
sudo dnf install webkaos-module-brotli
sudo dnf install
```

#### Using Docker
Expand Down
33 changes: 0 additions & 33 deletions SOURCES/brotli.conf

This file was deleted.

4 changes: 0 additions & 4 deletions SOURCES/modules.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@
# DYNAMIC MODULES #
# #
##############################################################################

# Brotli dynamic module (webkaos-module-brotli)
# load_module modules/ngx_http_brotli_filter_module.so;
# load_module modules/ngx_http_brotli_static_module.so;
88 changes: 4 additions & 84 deletions webkaos.spec
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
%define zlib_ver 1.3.1
%define luajit_ver 2.1-20240314
%define luajit_raw_ver 2.1
%define brotli_ngx_commit a71f9312c2deb28875acc7bacfdd5695a111aa53
%define brotli_commit fe754f3459f4fd60d41aae7e87b5053b2ab3a7a3

# 1. Open https://chromiumdash.appspot.com/releases?platform=Linux and note the latest stable version.
# 2. Open https://chromium.googlesource.com/chromium/src/+/refs/tags/<version>/DEPS and note <boringssl_revision>.
Expand All @@ -44,7 +42,7 @@
Summary: Superb high performance web server
Name: webkaos
Version: %{nginx_version}
Release: 1%{?dist}
Release: 2%{?dist}
License: 2-clause BSD-like license
Group: System Environment/Daemons
URL: https://kaos.sh/webkaos
Expand All @@ -63,7 +61,6 @@ Source20: ssl.conf
Source21: ssl-wildcard.conf
Source22: common.conf
Source23: bots.conf
Source24: brotli.conf
Source25: cloudflare-ips.conf

Source30: %{name}-index.html
Expand All @@ -76,8 +73,6 @@ Source52: https://github.com/openresty/headers-more-nginx-module/archive/v
Source53: https://downloads.sourceforge.net/project/pcre/pcre/%{pcre_ver}/pcre-%{pcre_ver}.tar.gz
Source54: https://zlib.net/zlib-%{zlib_ver}.tar.gz
Source55: https://github.com/openresty/luajit2/archive/v%{luajit_ver}.tar.gz
Source56: https://github.com/google/ngx_brotli/archive/%{brotli_ngx_commit}.tar.gz
Source57: https://github.com/google/brotli/archive/%{brotli_commit}.tar.gz
Source59: https://github.com/openresty/lua-resty-core/archive/v%{lua_resty_core_ver}.tar.gz
Source60: https://github.com/openresty/lua-resty-lrucache/archive/v%{lua_resty_lru_ver}.tar.gz

Expand Down Expand Up @@ -143,20 +138,6 @@ Links for nginx compatibility.

################################################################################

%package module-brotli

Summary: Module for Brotli compression
Version: 0.1.6
Release: 1%{?dist}

Group: System Environment/Daemons
Requires: %{name} = %{nginx_version}

%description module-brotli
Module for Brotli compression.

################################################################################

%prep
%{crc_check}

Expand All @@ -170,8 +151,6 @@ tar xzvf %{SOURCE52}
tar xzvf %{SOURCE53}
tar xzvf %{SOURCE54}
tar xzvf %{SOURCE55}
tar xzvf %{SOURCE56}
tar xzvf %{SOURCE57}
tar xzvf %{SOURCE59}
tar xzvf %{SOURCE60}

Expand Down Expand Up @@ -232,22 +211,6 @@ popd

cp boringssl/build/crypto/libcrypto.a boringssl/build/ssl/libssl.a boringssl/.openssl/lib

# Brotli Build #################################################################

pushd ngx_brotli-%{brotli_ngx_commit}
rm -rf deps/brotli
mv ../brotli-%{brotli_commit} deps/brotli

mkdir deps/brotli/out && pushd deps/brotli/out
cmake3 -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_C_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" \
-DCMAKE_CXX_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" \
-DCMAKE_INSTALL_PREFIX=./installed ..
cmake3 --build . --config Release --target brotlienc
popd
popd

################################################################################

# perfecto:ignore
Expand Down Expand Up @@ -307,38 +270,6 @@ touch boringssl/.openssl/include/openssl/ssl.h

%{__make} %{?_smp_mflags}

# perfecto:ignore
./configure \
--prefix=%{_sysconfdir}/%{name} \
--sbin-path=%{_sbindir}/%{name} \
--modules-path=%{_libdir}/%{name}/modules \
--conf-path=%{_sysconfdir}/%{name}/%{name}.conf \
--error-log-path=%{_logdir}/%{name}/error.log \
--http-log-path=%{_logdir}/%{name}/access.log \
--pid-path=%{_rundir}/%{name}.pid \
--lock-path=%{_rundir}/%{name}.lock \
--http-client-body-temp-path=%{service_home}/client_temp \
--http-proxy-temp-path=%{service_home}/proxy_temp \
--http-fastcgi-temp-path=%{service_home}/fastcgi_temp \
--http-uwsgi-temp-path=%{service_home}/uwsgi_temp \
--http-scgi-temp-path=%{service_home}/scgi_temp \
--user=%{service_user} \
--group=%{service_group} \
--with-zlib=zlib-%{zlib_ver} \
--with-pcre-jit \
--with-pcre=pcre-%{pcre_ver} \
--with-openssl=boringssl \
--add-dynamic-module=ngx_brotli-%{brotli_ngx_commit} \
--with-cc-opt="-I ../boringssl/.openssl/include/" \
--with-ld-opt="-L ../boringssl/.openssl/lib -L ../luajit2-%{luajit_ver}/lib -ldl -lstdc++" \
--with-compat \
$*

# Fix "Error 127" during build with BoringSSL
touch boringssl/.openssl/include/openssl/ssl.h

%{__make} modules

mv %{_builddir}/nginx-%{nginx_version}/objs/nginx \
%{_builddir}/nginx-%{nginx_version}/objs/%{name}.debug

Expand Down Expand Up @@ -504,14 +435,6 @@ cp -rp lua-resty-lrucache-%{lua_resty_lru_ver}/lib/resty/* \

find %{buildroot}%{_datadir}/%{name}/luajit/share/luajit-%{luajit_raw_ver}/ -name '*.md' -delete

# Modules installation
cp -rp %{_builddir}/nginx-%{nginx_version}/objs/*.so \
%{buildroot}%{_datadir}/%{name}/modules/

# Modules configs installation
install -pm 644 %{SOURCE24} \
%{buildroot}%{_sysconfdir}/%{name}/xtra/

# Create links and scripts for compatibility with nginx
install -pm 755 %{SOURCE8} %{buildroot}%{_sbindir}/nginx

Expand Down Expand Up @@ -639,15 +562,12 @@ rm -rf %{buildroot}
%{_unitdir}/nginx.service
%{_unitdir}/nginx-debug.service

%files module-brotli
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/%{name}/xtra/brotli.conf
%{_datadir}/%{name}/modules/ngx_http_brotli_filter_module.so
%{_datadir}/%{name}/modules/ngx_http_brotli_static_module.so

################################################################################

%changelog
* Sun Jun 02 2024 Anton Novojilov <[email protected]> - 1.26.0-2
- ngx_brotli module removed due to serious problems and lack of support

* Fri May 31 2024 Anton Novojilov <[email protected]> - 1.26.0-1
- Brotli updated to the latest commit to fix a bug that caused workers to
shut down
Expand Down

0 comments on commit e0037fc

Please sign in to comment.