mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Merge commit '3817b49aef8d8865fe1fe715c88a885a92988970' into 1.5
This commit is contained in:
commit
e974647c91
5 changed files with 56 additions and 9 deletions
13
src/deps/src/lua-resty-lrucache/.travis.yml
vendored
13
src/deps/src/lua-resty-lrucache/.travis.yml
vendored
|
|
@ -1,7 +1,12 @@
|
|||
# vim:st=2 sts=2 sw=2 et:
|
||||
# vim: ts=2 sw=2 et:
|
||||
|
||||
os: linux
|
||||
dist: bionic
|
||||
|
||||
branches:
|
||||
only:
|
||||
- "master"
|
||||
|
||||
sudo: false
|
||||
|
||||
language: c
|
||||
|
|
@ -18,13 +23,13 @@ env:
|
|||
- TEST_NGINX_SLEEP=0.006
|
||||
- TEST_NGINX_RANDOMIZE=1
|
||||
matrix:
|
||||
- NGINX_VERSION=1.19.9
|
||||
- NGINX_VERSION=1.27.0
|
||||
|
||||
install:
|
||||
- export NGX_BUILD_CC=$CC
|
||||
- export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH
|
||||
- sudo apt-get install -qq -y cpanminus axel
|
||||
- sudo cpanm --notest Test::Nginx > build.log 2>&1 || (cat build.log && exit 1)
|
||||
- sudo apt-get install -qq -y axel
|
||||
- cpanm --sudo --notest Test::Nginx > build.log 2>&1 || (cat build.log && exit 1)
|
||||
- git clone https://github.com/openresty/openresty.git ../openresty
|
||||
- git clone https://github.com/openresty/nginx-devel-utils.git
|
||||
- git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module
|
||||
|
|
|
|||
9
src/deps/src/lua-resty-lrucache/Makefile
vendored
9
src/deps/src/lua-resty-lrucache/Makefile
vendored
|
|
@ -5,6 +5,8 @@ LUA_INCLUDE_DIR ?= $(PREFIX)/include
|
|||
LUA_LIB_DIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION)
|
||||
INSTALL ?= install
|
||||
|
||||
SHELL:=/bin/bash
|
||||
|
||||
.PHONY: all test install lint
|
||||
|
||||
all: ;
|
||||
|
|
@ -13,6 +15,13 @@ install: all
|
|||
$(INSTALL) -d $(DESTDIR)/$(LUA_LIB_DIR)/resty/lrucache
|
||||
$(INSTALL) lib/resty/*.lua $(DESTDIR)/$(LUA_LIB_DIR)/resty/
|
||||
$(INSTALL) lib/resty/lrucache/*.lua $(DESTDIR)/$(LUA_LIB_DIR)/resty/lrucache/
|
||||
ifeq ($(LUA_LIB_DIR),/usr/local/lib/lua/)
|
||||
@echo
|
||||
@echo -e "\033[33mPLEASE NOTE: \033[0m"
|
||||
@echo -e "\033[33mThe necessary lua_package_path directive needs to be added to nginx.conf\033[0m"
|
||||
@echo -e "\033[33min the http context, because \"/usr/local/lib/lua/\" is not in LuaJIT’s default search path.\033[0m"
|
||||
@echo -e "\033[33mRefer to the Installation section of README.markdown.\033[0m"
|
||||
endif
|
||||
|
||||
test: all lint
|
||||
PATH=$(OPENRESTY_PREFIX)/nginx/sbin:$$PATH prove -I../test-nginx/lib -r t
|
||||
|
|
|
|||
30
src/deps/src/lua-resty-lrucache/README.markdown
vendored
30
src/deps/src/lua-resty-lrucache/README.markdown
vendored
|
|
@ -291,8 +291,31 @@ LuaJIT when building OpenResty by passing the `--with-luajit` option to its
|
|||
`./configure` script. No extra Nginx configuration is required.
|
||||
|
||||
If you want to use this library with your own Nginx build (with ngx_lua), then
|
||||
you need to ensure you are using ngx_lua 0.8.10 or greater. When not using an
|
||||
OpenResty release, you also need to configure the
|
||||
you need to ensure you are using ngx_lua 0.8.10 or greater.
|
||||
|
||||
By default, ngx_lua will search Lua files in /usr/local/share/lua/5.1/.
|
||||
But `make install` will install this module to /usr/local/lib/lua.
|
||||
So you may find the error like this:
|
||||
|
||||
```text
|
||||
nginx: [alert] failed to load the 'resty.lrucache' module
|
||||
```
|
||||
|
||||
You can install this module with the following command to resolve the above problem.
|
||||
|
||||
```bash
|
||||
cd lua-resty-lrucache
|
||||
sudo make install LUA_LIB_DIR=/usr/local/share/lua/5.1
|
||||
```
|
||||
|
||||
You can also change the installation directory to any other directory you like with the LUA_LIB_DIR argument.
|
||||
|
||||
```bash
|
||||
cd lua-resty-lrucache
|
||||
sudo make install LUA_LIB_DIR=/opt/nginx/lualib
|
||||
```
|
||||
|
||||
When not installed in /usr/local/share/lua/5.1, you also need to configure the
|
||||
[lua_package_path](https://github.com/openresty/lua-nginx-module#lua_package_path)
|
||||
directive to add the path to your lua-resty-lrucache source tree to ngx_lua's
|
||||
Lua module search path, as in:
|
||||
|
|
@ -301,8 +324,7 @@ Lua module search path, as in:
|
|||
# nginx.conf
|
||||
|
||||
http {
|
||||
# only if not using an official OpenResty release
|
||||
lua_package_path "/path/to/lua-resty-lrucache/lib/?.lua;;";
|
||||
lua_package_path "/opt/nginx/lualib/?.lua;;";
|
||||
...
|
||||
}
|
||||
```
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ end
|
|||
-- true module stuffs
|
||||
|
||||
local _M = {
|
||||
_VERSION = '0.13'
|
||||
_VERSION = '0.14'
|
||||
}
|
||||
local mt = { __index = _M }
|
||||
|
||||
|
|
|
|||
|
|
@ -68,3 +68,14 @@
|
|||
fun:ngx_worker_process_init
|
||||
fun:ngx_worker_process_cycle
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: definite
|
||||
fun:malloc
|
||||
fun:ngx_alloc
|
||||
fun:ngx_set_environment
|
||||
fun:ngx_http_lua_post_init_handler
|
||||
fun:ngx_cycle_post_init
|
||||
fun:main
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue