From 37e6de6613c1835fcc666da7b52248d78d366c94 Mon Sep 17 00:00:00 2001 From: sumory Date: Fri, 10 Mar 2017 12:55:25 +0800 Subject: [PATCH] bump version to v0.6.3 --- CHANGELOG.md | 5 + LICENSE | 4 +- README.md | 22 ++- README_zh.md | 11 +- install/orange-v0.6.2.sql | 25 --- install/orange-v0.6.3.sql | 326 ++++++++++++++++++++++++++++++++++++++ orange/version.lua | 2 +- 7 files changed, 350 insertions(+), 45 deletions(-) create mode 100644 install/orange-v0.6.3.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index cffce32e..e3129ef6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### v0.6.3 2017.03.10 + +- 添加插件: `signature auth plugin` +- 将默认的配置文件做成模板,即`ngingx.conf.example`和`orange.conf.example` + ### v0.6.2 2017.02.18 - 兼容Orange与最新版本的[lor](https://github.com/sumory/lor), 即lor v0.3.0 diff --git a/LICENSE b/LICENSE index c31a79ac..58c556ad 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 sumory.wu +Copyright (c) 2016 - 2017 sumory.wu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/README.md b/README.md index f23c13db..16bae41d 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,15 @@ A Gateway based on OpenResty(Nginx+lua) for API Monitoring and Management. - Orange v0.6.1 and versions before v0.6.1 are compatible with lor v0.2.* - Orange v0.6.2+ is compatible with lor v0.3.0+ -Import the SQL file(e.g. install/orange-v0.6.2.sql) which is adapted to your Orange version into MySQL database named `orange`. +Import the SQL file(e.g. install/orange-v0.6.3.sql) which is adapted to your Orange version into MySQL database named `orange`. #### Install -**1) version < 0.5.0** +1) script management -If you use Orange under v0.5.0, there is no need to `install`. +use shell scripts (e.g. `start.sh`) to manage Orange. -**2) version >= 0.5.0** +2) CLI tool In addition to `start.sh` script, a new cli tool could be utilized to manage Orange. You should install the cli first: @@ -38,17 +38,15 @@ make install then, the Orange runtime lua module is installed in `/usr/local/orange` and an executable command named `/usr/local/bin/orange` is generated. - #### Usages Before starting Orange, you should ensure that the `orange.conf` and `nginx.conf` are redefined to satisfy the demands of your project. - -**1) version < 0.5.0** +1) script management Just `sh start.sh` to start Orange. You could rewrite some other shell scripts as you need. -**2) version >= 0.5.0** +2) CLI tool `orange help` to check usages: @@ -79,10 +77,10 @@ Find more about Orange on its [website](http://orange.sumory.com/docs). There is ### Contributors -- 雨帆([@syhily](https://github.com/syhily)) -- lhmwzy([@lhmwzy](https://github.com/lhmwzy)) -- 罗泽轩([@spacewander](https://github.com/spacewander)) -- joke([@noname007](https://github.com/noname007)) +- [@syhily](https://github.com/syhily) +- [@lhmwzy](https://github.com/lhmwzy) +- [@spacewander](https://github.com/spacewander) +- [@noname007](https://github.com/noname007) ### See also diff --git a/README_zh.md b/README_zh.md index f5976b51..fc9fee6a 100644 --- a/README_zh.md +++ b/README_zh.md @@ -28,7 +28,7 @@ Orange是一个基于OpenResty的API网关。除Nginx的基本功能外,它还 #### 数据表导入MySQL - 在MySQL中创建数据库,名为orange -- 将与当前代码版本配套的SQL脚本(如install/orange-v0.6.2.sql)导入到orange库中 +- 将与当前代码版本配套的SQL脚本(如install/orange-v0.6.3.sql)导入到orange库中 #### 修改配置文件 @@ -47,6 +47,7 @@ orange.conf的配置如下,请按需修改: "property_rate_limiting", "basic_auth", "key_auth", + "signature_auth", "waf", "divide", "kvstore" @@ -149,10 +150,10 @@ Orange启动成功后, dashboard和API server也随之启动: ### 贡献者 -- 雨帆([@syhily](https://github.com/syhily)) -- lhmwzy([@lhmwzy](https://github.com/lhmwzy)) -- 罗泽轩([@spacewander](https://github.com/spacewander)) -- joke([@noname007](https://github.com/noname007)) +- [@syhily](https://github.com/syhily) +- [@lhmwzy](https://github.com/lhmwzy) +- [@spacewander](https://github.com/spacewander) +- [@noname007](https://github.com/noname007) ### See also diff --git a/install/orange-v0.6.2.sql b/install/orange-v0.6.2.sql index 4e74d17c..90b3cf19 100644 --- a/install/orange-v0.6.2.sql +++ b/install/orange-v0.6.2.sql @@ -214,31 +214,6 @@ VALUES /*!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 # ------------------------------------------------------------ diff --git a/install/orange-v0.6.3.sql b/install/orange-v0.6.3.sql new file mode 100644 index 00000000..4e74d17c --- /dev/null +++ b/install/orange-v0.6.3.sql @@ -0,0 +1,326 @@ +# ************************************************************ +# Sequel Pro SQL dump +# Version 4096 +# +# http://www.sequelpro.com/ +# http://code.google.com/p/sequel-pro/ +# +# Host: 127.0.0.1 (MySQL 5.6.15) +# Database: orange_test +# Generation Time: 2016-11-13 14:48:35 +0000 +# ************************************************************ + + +/*!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; + + + +/*!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 42910d7c..bcc853e1 100644 --- a/orange/version.lua +++ b/orange/version.lua @@ -1,2 +1,2 @@ -local version = "0.6.2" +local version = "0.6.3" return version