diff --git a/CHANGELOG.md b/CHANGELOG.md index 449ff64b..5555665b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,113 +1,241 @@ -### v0.7.0 2019 +## 0.8.1 +> Released on 2019.12.12 -- 支持通过cookie、随机数、HTTP method进行拦截过滤 -- 新增取余的方式进行匹配规则 -- 新增kafka、balancer、consul_balancer、persist log、node插件 -- 修复一些已知bug:后台页面展示异常 -- 对后台页面、balancer等模块的代码和文档说明的重构 -- 修复了issue#160,解决balancer开关未打开时出现invalid URL prefix in "" 的错误 -- 修复了issue#162,解决选择器类型为1时continue=false的错误 -- 修复了issue#233,解决proxy read timeout配置无效的问题 -- 修复了issue#236,解决忽略大小写进行匹配鉴权值的问题 -- 修改Makefile - - 使用指定版的依赖 +#### Feature +- Integrated Automation Construction Platform (Travis CI). +- Added basic test framework (Test :: Nginx). +- Add test cases for `headers` plugin. +- Add test cases for the `redirect` plugin. +- Add test cases for `rewrite` plugin. +- Add test cases for `basic_auth` plugin. +- Add test cases for `key_auth` plugin. +- Add test cases for `jwt_auth` plugin. +- Add test cases for `signature_auth` plugin. +- Add test cases for `rate_limiting` plugin. +- Add test cases for `waf` plugin. +- Add test cases for `divide` plugin. -### v0.6.4 2017.05.16 +#### FIX -- 修复issue#110, 解决在添加/删除规则后本地js cache未更新,之后立刻更改选择器配置造成的规则丢失bug -- 修改Makefile, 支持自定义安装路径 - - 自定义安装后,orange命令须手动添加到环境变量 - - 使用诸如start命令时需指定--prefix -- 为github issue添加默认模板 -- 默认的配置文件添加了一些log项 -- 修复了原来pr里的一些拼写问题 -- 移除docs/api里的文档, 更多文档请到[官网](http://orange.sumory.com)查看 +- Fixed `luarocks` installation` api` directory not exists. -### v0.6.3 2017.03.10 +#### Change -- 添加插件: `signature auth plugin` -- 将默认的配置文件做成模板,即`ngingx.conf.example`和`orange.conf.example` +- `lua-resty-consul` dependency library changed from storing in the project to installing using` luarocks`. +- `nginx.conf` The default log level, adjusted from` info` to `error`. +- The `balancer` plugin migrated to` v0.9.0-dev` due to conflicts with existing features. +- The `dynamic_upstream` plugin migrated to` v0.9.0-dev` due to conflicts with existing features. +- The `consul_balancer` plugin migrated to` v0.9.0-dev` due to conflict with existing functions. +- The `persist` plugin migrated to` v0.9.0-dev` due to conflicts with existing features. -### v0.6.2 2017.02.18 +#### Document -- 兼容Orange与最新版本的[lor](https://github.com/sumory/lor), 即lor v0.3.0 +- Added usage documentation for `headers` plugin. +- Added usage documentation for `redirect` plugin. +- Added usage documentation for `rewrite` plugin. +- Added usage documentation for `basic_auth` plugin +- Added usage documentation for `key_auth` plugin. +- Added usage documentation for `jwt_auth` plugin. +- Added usage documentation for `signature_auth` plugin. +- Added usage documentation for `rate_limiting` plugin. +- Added usage documentation for `waf` plugin. +- Added usage documentation for `divide` plugin. +- Added usage documentation for `global_statistics` plugin. -注意: -- 若使用的Orange版本在0.6.2以下,则应安装lor v0.2.*版本, 推荐lor v0.2.6 -- 若使用的Orange版本在0.6.2及以上,可升级lor到v0.3.0+版本 +## 0.8.0 +> Released on 2019.10.18 -### v0.6.1 2017.02.09 +#### Feature -添加property based rate limiting插件,该插件由[@noname007](https://github.com/noname007)贡献 +- Dependency installation changed from `opm` to` luarocks` for dependency installation and environment deployment. -### v0.6.0 2016.11.13 -注意,0.6.*版本与之前的版本并不兼容,主要改动如下: +## 0.7.1 +> Released on 2019.07.09 -- 重构Dashboard -- 新增kvstore插件: 用于通过API存取shared dict数据 -- 重构“规则”设计: 流量筛选时改为分层结构, 通过“选择器”对规则分组 -- 提取插件API公共代码统一维护 +#### Feature -### v0.5.1 2016.11.10 +- Use `opm` to install` Orange` dependencies. -- 修复一个sql bug +#### FIX -### v0.5.0 2016.10.04 +- Fixed `Makefile` installation project dependency issue. +- Fixed the problem of obtaining template variables. +- Fixed the issue that `balancer` cannot be read after adding` divide` shunt plugin. -- 添加`Makefile`安装方式 -- 支持通过命令行`orange store`初始化数据库 -- 添加resty-cli支持 - - 支持orange start/stop/restart/reload/store等命令 -- Break Change: 将*.conf配置移动到conf目录下 +## 0.7.0 +> Released on 2019.04.01 -### v0.4.0 2016.09.24 +#### Feature -- [x] 删除examples -- [x] 添加key auth插件 -- [x] 限流插件rate limiting -- [ ] 防重提交机制(delay) -- [x] 补全新插件API文档 +- Supports request interception filtering through `cookie`,` random number`, and `HTTP Method`. +- Added the method of taking margin for rule matching. +- Added `kafka` plugin. +- Added `balancer` plugin. +- Added `consul_balancer` plugin. +- Added `persist log` plugin. +- Added `node` plugin. -### v0.3.0 2016.07.21 +#### FIX -- 添加HTTP Basic Auth插件 +- Fixed dashboard page display problem. +- Fixed `invalid URL prefix in" "error when` balancer` switch is not turned on. +- Fixed `continue = false` error when selector type is` 1`. +- Fixed invalid proxy read timeout configuration. +- Fixed the problem of ignoring case for matching authentication value. -### v0.2.0 +#### Change -- API Server支持HTTP Basic Authorization -- 变量提取模块增加新类型 - - URL提取器支持一次提取多值 - - 以模板方式使用变量,格式为{{extractor.key}} -- 去除file store支持 -- 提供Restful API及详细描述文档 -- 分离内置的Dashboard,减少与API的耦合 +- Refactored the management code and documentation of `balancer` module. +- Update `Makefile` to specify version for dependencies. -### v0.1.1 2016.05.09 -- 在使用MySQL作为存储时,为dashboard控制台添加账户系统 +## 0.6.4 +> Released on 2017.05.16 +#### Feature -### v0.1.0 2016.05.04 +- Added default template for `github issue`. +- Added `log` configuration to the default configuration file. -特性: +#### FIX -- 配置项支持文件存储和MySQL存储 -- 通过MySQL存储来简单支持集群部署 -- 支持通过自定义插件方式扩展功能 -- 默认内置六个插件 - - 全局状态统计 - - 自定义监控 - - URL重写 - - URI重定向 - - 简单防火墙 - - 代理、ABTesting、分流 -- 提供管理界面用于管理内置插件 +- Fixed the problem of missing rules caused by the local `JavaScript Cache` not being updated after adding and removing rules. +- Fixed spelling issue in `PR`. -### v0.0.2 +#### Change - - 完成监控、redirect/rewrite、WAF、分流等几个插件 - - 仍不推荐生产使用 +- Modify `Makefile` to support custom installation path. +- Remove the documentation in `docs/api`. For more documents, please visit [Official Website](http://orange.sumory.com). + + +## 0.6.3 +> Released on 2017.03.10 + +#### Feature + +- Added `signature auth` plugin. +- Added default configuration file templates `ngingx.conf.example` and` orange.conf.example`. + + +## 0.6.2 +> Released on 2017.02.18 + +#### Feature + +- Compatible with `Orange` and the latest version of` Lor Framework`, ie `lor v0.3.0`. + +#### Note + +- If the `Orange` version is below` 0.6.2`, then `lor v0.2.x` Version should be installed, `lor v0.2.6` is recommended. +- If `Orange` version is` 0.6.2` or above, you can upgrade `lor v0.3.0 +` version. + + +## 0.6.1 +> Released on 2017.02.09 + +#### Feature + +- Added `property based rate limiting` plugin. + + +## 0.6.0 +> Released on 2016.11.13 + +#### Feature + +- Refactored `Dashboard`. +- Added `kvstore` plugin for accessing` shared dict` data via API. +- Refactored rule design, changed to hierarchical structure when filtering traffic, grouped rules by `selector`. +- Extract plug-in API public code so that it can be maintained uniformly. + +#### Note + +- `Orange 0.6.x` Is not compatible with previous versions. + + +## 0.5.1 +> Released on 2016.11.10 + +#### FIX + +- Fixed SQL import issue. + + +## 0.5.0 +> Released on 2016.10.04 + +#### Feature + +- Added `Makefile` installation method. +- Initialize database via command line `orange store`. +- Added `resty-cli` support, command` orange [start | stop | restart | reload | store] `. + +#### Change + +- Move `*.conf` configuration to `conf` directory. + + +## 0.4.0 +> Released on 2016.09.24 + +#### Feature + +- Added `rate limiting`, current limiting plugin. +- Added prevention repeat submit mechanism (delay). +- Added `key auth` plugin. + +#### Change + +- Remove `examples`。 + + +## 0.3.0 +> Released on 2016.07.21 + +#### Feature + +- Added `Basic Auth` plugin. + + +## 0.2.0 +> Released on 2016.07.15 + +#### Feature + +- `API Server` supports` HTTP Basic Authorization`. +- Variable extraction module adds new types, `URL` extractor supports extracting multiple values at once. The template method uses variables in the format `{{extractor.key}}`. +- Provide `Restful API` and detailed description document. +- Separate built-in `Dashboard` to reduce coupling with API. + +#### Change + +- Removed `file store` support. + + +## 0.1.1 +> Released on 2016.05.09 + +#### Feature + +- When using `MySQL` as storage, add user system for` Dashboard`. + + +## 0.1.0 +> Released on 2016.05.04 + +#### Feature + +- Configuration items support `file` and `MySQL` storage. +- Simple support for cluster deployment via `MySQL` storage. +- Support extended functions through custom plugins. +- Added `Global statistics`, global status statistics plugin. +- Added `Custom monitoring`, custom monitoring plugin. +- Added `URL Rewiter`, URL rewrite plugin. +- Added `URL Redirect`, URI redirection plugin. +- Added `WAF`, firewall plugin. +- Added `ABTesting`, shunt plugin. +- Provide management interface for managing built-in plugins. diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md new file mode 100644 index 00000000..6a4f5701 --- /dev/null +++ b/CHANGELOG_CN.md @@ -0,0 +1,241 @@ +## 0.8.1 +> Released on 2019.12.12 + +#### 新功能 + +- 集成自动化构建平台(Travis CI)。 +- 增加基础测试框架(Test::Nginx)。 +- 为 `headers` 插件添加测试用例。 +- 为 `redirect` 插件添加测试用例。 +- 为 `rewrite` 插件添加测试用例。 +- 为 `basic_auth` 插件添加测试用例。 +- 为 `key_auth` 插件添加测试用例。 +- 为 `jwt_auth` 插件添加测试用例。 +- 为 `signature_auth` 插件添加测试用例。 +- 为 `rate_limiting` 插件添加测试用例。 +- 为 `waf` 插件添加测试用例。 +- 为 `divide` 插件添加测试用例。 + +#### 修复 + +- `luarocks` 安装 `api` 目录不存在问题。 + +#### 变更 + +- `lua-resty-consul` 依赖库由项目中存储改为使用 `luarocks` 安装。 +- `nginx.conf` 默认日志级别,由 `info` 调整为 `error`。 +- `balancer` 插件由于与现有功能冲突,迁移至 `v0.9.0-dev`。 +- `dynamic_upstream` 插件由于与现有功能冲突,迁移至 `v0.9.0-dev`。 +- `consul_balancer` 插件由于与现有功能冲突,迁移至 `v0.9.0-dev`。 +- `persist` 插件由于与现有功能冲突,迁移至 `v0.9.0-dev`。 + +#### 文档 + +- 为 `headers` 插件添加使用文档。 +- 为 `redirect` 插件添加使用文档。 +- 为 `rewrite` 插件添加使用文档。 +- 为 `basic_auth` 插件添加使用文档 +- 为 `key_auth` 插件添加使用文档。 +- 为 `jwt_auth` 插件添加使用文档。 +- 为 `signature_auth` 插件添加使用文档。 +- 为 `rate_limiting` 插件添加使用文档。 +- 为 `waf` 插件添加使用文档。 +- 为 `divide` 插件添加使用文档。 +- 为 `global_statistics` 插件添加使用文档。 + + +## 0.8.0 +> Released on 2019.10.18 + +#### 新功能 + +- 依赖安装方式由 `opm` 改为使用 `luarocks` 进行依赖安装和环境部署。 + + +## 0.7.1 +> Released on 2019.07.09 + +#### 新功能 + +- 使用 `opm` 方式进行 `Orange` 的依赖安装。 + +#### 修复 + +- 修复 `Makefile` 安装项目依赖问题。 +- 修复模板变量获取问题。 +- 修复 `divide` 分流插件加args后 `balancer` 无法读取的问题。 + + +## 0.7.0 +> Released on 2019.04.01 + +#### 新功能 + +- 支持通过`cookie`、`随机数`、`HTTP Method`进行请求拦截过滤。 +- 新增取余的方式进行规则匹配。 +- 新增 `kafka` 插件。 +- 新增 `balancer` 插件。 +- 新增 `consul_balancer` 插件。 +- 新增 `persist log` 插件。 +- 新增 `node` 插件。 + +#### 修复 + +- 修复后台页面展示异常问题。 +- 修复 `balancer` 开关未打开时出现 `invalid URL prefix in ""` 的错误。 +- 修复选择器类型为 `1` 时 `continue=false` 的错误。 +- 修复 `proxy read timeout` 配置无效的问题。 +- 修复忽略大小写进行匹配鉴权值的问题。 + +#### 变更 + +- 对 `balancer` 模块的管理后台代码和文档说明规则重构。 +- 更新 `Makefile`,对依赖进行版本指定。 + + +## 0.6.4 +> Released on 2017.05.16 + +#### 新功能 + +- 为 `github issue` 添加默认模板。 +- 默认的配置文件添加 `log` 项。 + +#### 修复 + +- 修复了在添加和删除规则后本地 `JavaScript Cache` 未更新导致选择器配置规则丢失问题。 +- 修复了`PR`中的拼写问题。 + +#### 变更 + +- 修改Makefile,支持自定义安装路径。 +- 移除 `docs/api` 中的文档,更多文档请到[官网](http://orange.sumory.com)查看。 + + +## 0.6.3 +> Released on 2017.03.10 + +#### 新功能 + +- 新增 `signature auth` 插件。 +- 新增默认配置文件模板 `ngingx.conf.example` 和 `orange.conf.example`。 + + +## 0.6.2 +> Released on 2017.02.18 + +#### 新功能 + +- 兼容 `Orange` 与最新版本的 `Lor Framework`,即lor v0.3.0。 + +#### 注意 + +- 若使用的 `Orange` 版本在 `0.6.2` 以下,则应安装 `lor v0.2.x` 版本, 推荐 `lor v0.2.6`。 +- 若使用的 `Orange` 版本在 `0.6.2` 及以上,可升级 `lor v0.3.0+` 版本。 + + +## 0.6.1 +> Released on 2017.02.09 + +#### 新功能 + +- 新增 `property based rate limiting` 插件。 + + +## 0.6.0 +> Released on 2016.11.13 + +#### 新功能 + +- 重构 `Dashboard`。 +- 新增 `kvstore` 插件,用于通过API存取 `shared dict` 数据。 +- 重构规则设计,流量筛选时改为分层结构,通过 `选择器` 对规则分组。 +- 提取插件API公共代码,统一维护。 + +#### 注意 + +- `Orange 0.6.*` 版本与之前的版本并不兼容。 + + +## 0.5.1 +> Released on 2016.11.10 + +#### 修复 + +- 修复SQL导入问题。 + + +## 0.5.0 +> Released on 2016.10.04 + +#### 新功能 + +- 添加`Makefile`安装方式。 +- 支持通过命令行 `orange store` 初始化数据库。 +- 添加 `resty-cli` 支持,命令 `orange [start | stop | restart | reload | store]`。 + +#### 变更 + +- 将 `*.conf` 配置移至 `conf` 目录下。 + + +## 0.4.0 +> Released on 2016.09.24 + +#### 新功能 + +- 新增 `rate limiting` 限流插件。 +- 新增防重提交机制(delay)。 +- 新增 `key auth` 插件。 + +#### 变更 + +- 移除 `examples`。 + + +## 0.3.0 +> Released on 2016.07.21 + +#### 新功能 + +- 新增 `Basic Auth` 插件。 + + +## 0.2.0 +> Released on 2016.07.15 + +#### 新功能 + +- `API Server`支持`HTTP Basic Authorization`。 +- 变量提取模块增加新类型,`URL` 提取器支持一次提取多值。模板方式使用变量,格式为 `{{extractor.key}}`。 +- 提供 `Restful API` 及详细描述文档。 +- 分离内置 `Dashboard`,减少与API的耦合。 + +#### 变更 + +- 去除 `file store` 支持。 + + +## 0.1.1 +> Released on 2016.05.09 + +#### 新功能 + +- 使用 `MySQL` 作为存储时,为 `Dashboard` 添加用户系统。 + + +## 0.1.0 +> Released on 2016.05.04 + +#### 新功能 + +- 配置项支持 `文件` 和 `MySQL` 存储。 +- 通过 `MySQL` 存储来简单支持集群部署。 +- 支持通过自定义插件方式扩展功能。 +- 新增 `Global statistics`,全局状态统计插件。 +- 新增 `Custom monitoring`,自定义监控插件。 +- 新增 `URL Rewiter`,URL重写插件。 +- 新增 `URL Redirect`,URI重定向插件。 +- 新增 `WAF`,防火墙插件。 +- 新增 `ABTesting`,分流插件。 +- 提供管理界面用于管理内置插件。 diff --git a/Makefile b/Makefile index d3db9644..2dd213e9 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ install: $(INSTALL) conf/nginx.conf.example /usr/local/orange/conf/nginx.conf $(INSTALL) conf/orange.conf.example /usr/local/orange/conf/orange.conf $(INSTALL) conf/mime.types /usr/local/orange/conf/mime.types - $(INSTALL) install/orange-v0.8.0.sql /usr/local/orange/conf/orange-v0.8.0.sql + $(INSTALL) install/orange-v0.8.1.sql /usr/local/orange/conf/orange-v0.8.1.sql $(INSTALL) -d $(INST_LUADIR)/orange/dashboard $(INSTALL) -d $(INST_LUADIR)/orange/orange diff --git a/README.md b/README.md index 96da886b..3e246365 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ curl -Lo install.sh https://raw.githubusercontent.com/orlabs/orange/master/insta sudo sh install.sh ``` -After the installation process is completed, the output message `orange 0.8-0 is now installed in /usr/local/orange/deps (license: MIT)` indicates that the installation was successful. +After the installation process is completed, the output message `orange 0.8-1 is now installed in /usr/local/orange/deps (license: MIT)` indicates that the installation was successful. #### 4) Import MySQL @@ -42,7 +42,7 @@ Requirements: MySQL Version 5.5+ - Login to the `MySQL` client, create an `orange` database. - - Import the data table (`/usr/local/orange/conf/orange-v0.8.0.sql`). + - Import the data table (`/usr/local/orange/conf/orange-v0.8.1.sql`). - Modify the `Orange` configuration file (`/usr/local/orange/conf/orange.conf`) `MySQL` related configuration. diff --git a/README_zh.md b/README_zh.md index 15a7983a..7c3fffa7 100644 --- a/README_zh.md +++ b/README_zh.md @@ -39,7 +39,7 @@ curl -Lo install.sh https://raw.githubusercontent.com/orlabs/orange/master/insta sudo sh install.sh ``` -安装过程结束后,输出消息 `orange 0.8-0 is now installed in /usr/local/orange/deps (license: MIT)` 即说明安装成功。 +安装过程结束后,输出消息 `orange 0.8-1 is now installed in /usr/local/orange/deps (license: MIT)` 即说明安装成功。 #### 4) 导入 MySQL @@ -47,7 +47,7 @@ sudo sh install.sh - 登录到 `MySQL` 客户端,创建一个 `orange` 数据库。 - - 导入数据表(`/usr/local/orange/conf/orange-v0.8.0.sql`)。 + - 导入数据表(`/usr/local/orange/conf/orange-v0.8.1.sql`)。 - 修改`Orange`配位置文件中(`/usr/local/orange/conf/orange.conf`)`MySQL`相关配置。 diff --git a/install/orange-v0.8.1.sql b/install/orange-v0.8.1.sql new file mode 100644 index 00000000..3facb5ec --- /dev/null +++ b/install/orange-v0.8.1.sql @@ -0,0 +1,544 @@ +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + + +# Dump of table basic_auth +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `basic_auth`; + +CREATE TABLE `basic_auth` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `basic_auth` WRITE; +/*!40000 ALTER TABLE `basic_auth` DISABLE KEYS */; + +INSERT INTO `basic_auth` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `basic_auth` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table dashboard_user +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `dashboard_user`; + +CREATE TABLE `dashboard_user` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `username` varchar(60) NOT NULL DEFAULT '' COMMENT '用户名', + `password` varchar(255) NOT NULL DEFAULT '' COMMENT '密码', + `is_admin` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否是管理员账户:0否,1是', + `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建或者更新时间', + `enable` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否启用该用户:0否1是', + PRIMARY KEY (`id`), + UNIQUE KEY `unique_username` (`username`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='dashboard users'; + +LOCK TABLES `dashboard_user` WRITE; +/*!40000 ALTER TABLE `dashboard_user` DISABLE KEYS */; + +INSERT INTO `dashboard_user` (`id`, `username`, `password`, `is_admin`, `create_time`, `enable`) +VALUES + (1,'admin','1fe832a7246fd19b7ea400a10d23d1894edfa3a5e09ee27e0c4a96eb0136763d',1,'2016-11-11 11:11:11',1); + +/*!40000 ALTER TABLE `dashboard_user` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table divide +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `divide`; + +CREATE TABLE `divide` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `divide` WRITE; +/*!40000 ALTER TABLE `divide` DISABLE KEYS */; + +INSERT INTO `divide` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `divide` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table key_auth +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `key_auth`; + +CREATE TABLE `key_auth` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `key_auth` WRITE; +/*!40000 ALTER TABLE `key_auth` DISABLE KEYS */; + +INSERT INTO `key_auth` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `key_auth` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table meta +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `meta`; + +CREATE TABLE `meta` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(5000) NOT NULL DEFAULT '', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + + +# Dump of table monitor +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `monitor`; + +CREATE TABLE `monitor` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `monitor` WRITE; +/*!40000 ALTER TABLE `monitor` DISABLE KEYS */; + +INSERT INTO `monitor` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `monitor` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table rate_limiting +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `rate_limiting`; + +CREATE TABLE `rate_limiting` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `rate_limiting` WRITE; +/*!40000 ALTER TABLE `rate_limiting` DISABLE KEYS */; + +INSERT INTO `rate_limiting` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `rate_limiting` ENABLE KEYS */; +UNLOCK TABLES; + +DROP TABLE IF EXISTS `property_rate_limiting`; + +CREATE TABLE `property_rate_limiting` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `property_rate_limiting` WRITE; +/*!40000 ALTER TABLE `property_rate_limiting` DISABLE KEYS */; + +INSERT INTO `property_rate_limiting` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `property_rate_limiting` ENABLE KEYS */; +UNLOCK TABLES; + +# Dump of table signature_auth +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `signature_auth`; + +CREATE TABLE `signature_auth` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `signature_auth` WRITE; +/*!40000 ALTER TABLE `signature_auth` DISABLE KEYS */; + +INSERT INTO `signature_auth` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `signature_auth` ENABLE KEYS */; +UNLOCK TABLES; + +# Dump of table redirect +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `redirect`; + +CREATE TABLE `redirect` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `redirect` WRITE; +/*!40000 ALTER TABLE `redirect` DISABLE KEYS */; + +INSERT INTO `redirect` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `redirect` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table rewrite +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `rewrite`; + +CREATE TABLE `rewrite` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `rewrite` WRITE; +/*!40000 ALTER TABLE `rewrite` DISABLE KEYS */; + +INSERT INTO `rewrite` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `rewrite` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table waf +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `waf`; + +CREATE TABLE `waf` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `waf` WRITE; +/*!40000 ALTER TABLE `waf` DISABLE KEYS */; + +INSERT INTO `waf` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `waf` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table balancer +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `balancer`; + +CREATE TABLE `balancer` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(10240) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `balancer` WRITE; +/*!40000 ALTER TABLE `balancer` DISABLE KEYS */; + +INSERT INTO `balancer` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `balancer` ENABLE KEYS */; +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `persist`; + +CREATE TABLE `persist` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `persist` WRITE; + +INSERT INTO `persist` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1, '1', '{}', 'meta', '2016-11-11 11:11:11'); + +UNLOCK TABLES; + +DROP TABLE IF EXISTS `persist_log`; + +CREATE TABLE `persist_log` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `ip` varchar(20) NOT NULL DEFAULT '', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `stat_time` datetime DEFAULT NULL, + `request_2xx` int(11) DEFAULT '0', + `request_3xx` int(11) DEFAULT '0', + `request_4xx` int(11) DEFAULT '0', + `request_5xx` int(11) DEFAULT '0', + `total_request_count` int(11) DEFAULT '0', + `total_success_request_count` int(11) DEFAULT '0', + `traffic_read` int(11) DEFAULT '0', + `traffic_write` int(11) DEFAULT '0', + `total_request_time` int(11) DEFAULT '0', + PRIMARY KEY (`id`), + KEY `ip` (`ip`), + KEY `op_time` (`op_time`), + KEY `stat_time` (`stat_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `cluster_node`; + +CREATE TABLE `cluster_node` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `ip` varchar(20) NOT NULL DEFAULT '', + `port` smallint(6) DEFAULT '7777', + `api_username` varchar(50) DEFAULT '', + `api_password` varchar(50) DEFAULT '', + `sync_status` varchar(2000) DEFAULT '', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`ip`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `node`; + +CREATE TABLE `node` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `node` WRITE; + +INSERT INTO `node` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1, '1', '{}', 'meta', '2016-11-11 11:11:11'); + +UNLOCK TABLES; + + +# Dump of table consul_balancer +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `consul_balancer`; + +CREATE TABLE `consul_balancer` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `consul_balancer` WRITE; +/*!40000 ALTER TABLE `consul_balancer` DISABLE KEYS */; + +INSERT INTO `consul_balancer` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2017-11-11 11:11:11'); + +/*!40000 ALTER TABLE `consul_balancer` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table hmac_auth +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `hmac_auth`; + +CREATE TABLE `hmac_auth` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `hmac_auth` WRITE; +/*!40000 ALTER TABLE `hmac_auth` DISABLE KEYS */; + +INSERT INTO `hmac_auth` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `hmac_auth` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table dynamic_upstream +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `dynamic_upstream`; + +CREATE TABLE `dynamic_upstream` +( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8; + +LOCK TABLES `dynamic_upstream` WRITE; +/*!40000 ALTER TABLE `dynamic_upstream` DISABLE KEYS */; + +INSERT INTO `dynamic_upstream` (`id`, `key`, `value`, `type`, `op_time`) +VALUES (1, '1', '{}', 'meta', '2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `dynamic_upstream` ENABLE KEYS */; +UNLOCK TABLES; + +# Dump of table jwt_auth +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `jwt_auth`; + +CREATE TABLE `jwt_auth` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `jwt_auth` WRITE; +/*!40000 ALTER TABLE `jwt_auth` DISABLE KEYS */; + +INSERT INTO `jwt_auth` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `jwt_auth` ENABLE KEYS */; +UNLOCK TABLES; + +# Dump of table headers +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `headers`; + +CREATE TABLE `headers` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(255) NOT NULL DEFAULT '', + `value` varchar(2000) NOT NULL DEFAULT '', + `type` varchar(11) DEFAULT '0', + `op_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `headers` WRITE; +/*!40000 ALTER TABLE `headers` DISABLE KEYS */; + +INSERT INTO `headers` (`id`, `key`, `value`, `type`, `op_time`) +VALUES + (1,'1','{}','meta','2016-11-11 11:11:11'); + +/*!40000 ALTER TABLE `headers` ENABLE KEYS */; +UNLOCK TABLES; + + +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/orange/version.lua b/orange/version.lua index b1a3fb20..06949c71 100644 --- a/orange/version.lua +++ b/orange/version.lua @@ -1,2 +1,2 @@ -local version = "0.8.0" +local version = "0.8.1" return version diff --git a/rockspec/orange-0.8-1.rockspec b/rockspec/orange-0.8-1.rockspec new file mode 100644 index 00000000..a016ad3e --- /dev/null +++ b/rockspec/orange-0.8-1.rockspec @@ -0,0 +1,47 @@ +package = "orange" +version = "0.8-1" +supported_platforms = {"linux"} + +source = { + url = "git://github.com/orlabs/orange", + branch = "v0.8.1", +} + +description = { + summary = "Orange is OpenResty/Nginx Gateway for API Monitoring and Management.", + homepage = "https://github.com/orlabs/orange", + license = "MIT", + maintainer = "JinChao Shuai " +} + +dependencies = { + "luafilesystem = 1.7.0-2", + "penlight = 1.5.4-1", + "lrandom = 20180729-1", + "luacrypto = 0.3.2-2", + "luasocket = 3.0rc1-2", + "lua-resty-http = 0.13-0", + "lua-resty-kafka = 0.06-0", + "lua-resty-dns-client = 1.0.0-1", + "lua-resty-jwt = 0.2.0-0", + "lua-resty-consul = 0.2-0", +} + +build = { + type = "make", + build_variables = { + CFLAGS="$(CFLAGS)", + LIBFLAG="$(LIBFLAG)", + LUA_LIBDIR="$(LUA_LIBDIR)", + LUA_BINDIR="$(LUA_BINDIR)", + LUA_INCDIR="$(LUA_INCDIR)", + LUA="$(LUA)", + }, + install_variables = { + INST_PREFIX="$(PREFIX)", + INST_BINDIR="$(BINDIR)", + INST_LIBDIR="$(LIBDIR)", + INST_LUADIR="$(LUADIR)", + INST_CONFDIR="$(CONFDIR)", + }, +}