Skip to content

Commit

Permalink
Merge branch 'master' of github.com:theweakgod/apisix
Browse files Browse the repository at this point in the history
  • Loading branch information
theweakgod committed Jan 17, 2024
2 parents 326d40d + 2d47b4b commit b3391c7
Show file tree
Hide file tree
Showing 68 changed files with 2,201 additions and 350 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ jobs:
- name: Start Dubbo Backend
if: matrix.os_name == 'linux_openresty' && (steps.test_env.outputs.type == 'plugin' || steps.test_env.outputs.type == 'last')
run: |
sudo apt update
sudo apt install -y maven
cd t/lib/dubbo-backend
mvn package
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/centos7-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ jobs:
- name: Start Dubbo Backend
run: |
sudo apt update
sudo apt install -y maven
cd t/lib/dubbo-backend
mvn package
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/cli-master.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/gm-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ jobs:
- name: Start Dubbo Backend
if: steps.test_env.outputs.type == 'plugin'
run: |
sudo apt update
sudo apt install -y maven
cd t/lib/dubbo-backend
mvn package
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/redhat-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ jobs:
- name: Start Dubbo Backend
run: |
sudo apt update
sudo apt install -y maven
cd t/lib/dubbo-backend
mvn package
Expand Down
21 changes: 10 additions & 11 deletions apisix/core/config_yaml.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ local mt = {


local apisix_yaml
local apisix_yaml_ctime
local apisix_yaml_mtime
local function read_apisix_yaml(premature, pre_mtime)
if premature then
return
Expand All @@ -74,9 +74,8 @@ local function read_apisix_yaml(premature, pre_mtime)
return
end

-- log.info("change: ", json.encode(attributes))
local last_change_time = attributes.change
if apisix_yaml_ctime == last_change_time then
local last_modification_time = attributes.modification
if apisix_yaml_mtime == last_modification_time then
return
end

Expand Down Expand Up @@ -114,7 +113,7 @@ local function read_apisix_yaml(premature, pre_mtime)
end

apisix_yaml = apisix_yaml_new
apisix_yaml_ctime = last_change_time
apisix_yaml_mtime = last_modification_time
log.warn("config file ", apisix_yaml_path, " reloaded.")
end

Expand All @@ -124,12 +123,12 @@ local function sync_data(self)
return nil, "missing 'key' arguments"
end

if not apisix_yaml_ctime then
if not apisix_yaml_mtime then
log.warn("wait for more time")
return nil, "failed to read local file " .. apisix_yaml_path
end

if self.conf_version == apisix_yaml_ctime then
if self.conf_version == apisix_yaml_mtime then
return true
end

Expand All @@ -138,7 +137,7 @@ local function sync_data(self)
if not items then
self.values = new_tab(8, 0)
self.values_hash = new_tab(0, 8)
self.conf_version = apisix_yaml_ctime
self.conf_version = apisix_yaml_mtime
return true
end

Expand All @@ -155,7 +154,7 @@ local function sync_data(self)
self.values_hash = new_tab(0, 1)

local item = items
local conf_item = {value = item, modifiedIndex = apisix_yaml_ctime,
local conf_item = {value = item, modifiedIndex = apisix_yaml_mtime,
key = "/" .. self.key}

local data_valid = true
Expand Down Expand Up @@ -202,7 +201,7 @@ local function sync_data(self)
end

local key = item.id or "arr_" .. i
local conf_item = {value = item, modifiedIndex = apisix_yaml_ctime,
local conf_item = {value = item, modifiedIndex = apisix_yaml_mtime,
key = "/" .. self.key .. "/" .. key}

if data_valid and self.item_schema then
Expand Down Expand Up @@ -236,7 +235,7 @@ local function sync_data(self)
end
end

self.conf_version = apisix_yaml_ctime
self.conf_version = apisix_yaml_mtime
return true
end

Expand Down
8 changes: 8 additions & 0 deletions apisix/core/ctx.lua
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,14 @@ do
end
end

elseif core_str.has_prefix(key, "uri_param_") then
-- `uri_param_<name>` provides access to the uri parameters when using
-- radixtree_uri_with_parameter
if t._ctx.curr_req_matched then
local arg_key = sub_str(key, 11)
val = t._ctx.curr_req_matched[arg_key]
end

elseif core_str.has_prefix(key, "http_") then
key = key:lower()
key = re_gsub(key, "-", "_", "jo")
Expand Down
6 changes: 6 additions & 0 deletions apisix/plugins/brotli.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ function _M.header_filter(conf, ctx)
return
end

local content_encoded = ngx_header["Content-Encoding"]
if content_encoded then
-- Don't compress if Content-Encoding is present in upstream data
return
end

local types = conf.types
local content_type = ngx_header["Content-Type"]
if not content_type then
Expand Down
3 changes: 3 additions & 0 deletions apisix/plugins/openid-connect.lua
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,9 @@ function _M.rewrite(plugin_conf, ctx)
end
end
end
if session then
session:close()
end
end


Expand Down
1 change: 0 additions & 1 deletion ci/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export_version_info() {

export_or_prefix() {
export OPENRESTY_PREFIX="/usr/local/openresty"
export APISIX_MAIN="https://raw.githubusercontent.com/apache/apisix/master/apisix-master-0.rockspec"
export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH
export OPENSSL_PREFIX=$OPENRESTY_PREFIX/openssl3
export OPENSSL_BIN=$OPENSSL_PREFIX/bin/openssl
Expand Down
84 changes: 0 additions & 84 deletions ci/linux_apisix_master_luarocks_runner.sh

This file was deleted.

2 changes: 1 addition & 1 deletion docs/en/latest/certificate.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f13
Send a request to verify:

```shell
curl --resolve 'test.com:9443:127.0.0.1' https://test.com:9443/hello -k -vvv
curl --resolve 'test.com:9443:127.0.0.1' https://test.com:9443/get -k -vvv

* Added test.com:9443:127.0.0.1 to DNS cache
* About to connect() to test.com port 9443 (#0)
Expand Down
17 changes: 17 additions & 0 deletions docs/en/latest/deployment-modes.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,23 @@ routes:

*WARNING*: APISIX will not load the rules into memory from file `conf/apisix.yaml` if there is no `#END` at the end.

Environment variables can also be used like so:

```yaml
routes:
-
uri: /hello
upstream:
nodes:
"${{UPSTREAM_ADDR}}": 1
type: roundrobin
#END
```

*WARNING*: When using docker to deploy APISIX in standalone mode. New environment variables added to `apisix.yaml` while APISIX has been initialized will only take effect after a reload.

More information about using environment variables can be found [here](./admin-api.md#using-environment-variables).

### How to configure Route

Single Route:
Expand Down
8 changes: 2 additions & 6 deletions docs/en/latest/installation-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ sudo yum install apisix
You can also install a specific version of APISIX by specifying it:

```shell
sudo yum install apisix-2.13.1
sudo yum install apisix-3.8.0
```

:::
Expand Down Expand Up @@ -178,14 +178,10 @@ Currently the only DEB repository supported by APISIX is Debian 11 (Bullseye) an

```shell
# amd64
echo "deb http://openresty.org/package/debian bullseye openresty" | sudo tee /etc/apt/sources.list.d/openresty.list
wget -O - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
wget -O - http://repos.apiseven.com/pubkey.gpg | sudo apt-key add -
echo "deb http://repos.apiseven.com/packages/debian bullseye main" | sudo tee /etc/apt/sources.list.d/apisix.list

# arm64
echo "deb http://openresty.org/package/arm64/debian bullseye openresty" | sudo tee /etc/apt/sources.list.d/openresty.list
wget -O - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
wget -O - http://repos.apiseven.com/pubkey.gpg | sudo apt-key add -
echo "deb http://repos.apiseven.com/packages/arm64/debian bullseye main" | sudo tee /etc/apt/sources.list.d/apisix.list
```
Expand All @@ -194,7 +190,7 @@ Then, to install APISIX, run:

```shell
sudo apt update
sudo apt install -y apisix=3.0.0-0
sudo apt install -y apisix=3.8.0-0
```

### Managing APISIX server
Expand Down
Loading

0 comments on commit b3391c7

Please sign in to comment.