-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support to communicate with etcd by TLS in command line #3415
Changes from all commits
33cb969
c173c90
add1b78
3ca280c
b4706c5
a94e1ee
6cea405
28a0ed8
9434155
399e2ab
6ffdc49
57e4311
e7591eb
2dfd72a
a48b2d4
7d0ab24
ae645ac
c8efb35
5c52a3a
0820fa8
113adb9
18f2a19
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
# 'make init' operates scripts and related configuration files in the current directory | ||
# The 'apisix' command is a command in the /usr/local/apisix, | ||
# and the configuration file for the operation is in the /usr/local/apisix/conf | ||
|
||
. ./.travis/apisix_cli_test/common.sh | ||
|
||
# Check etcd tls verify failure | ||
git checkout conf/config.yaml | ||
|
||
echo ' | ||
etcd: | ||
host: | ||
- "https://127.0.0.1:12379" | ||
prefix: "/apisix" | ||
' > conf/config.yaml | ||
|
||
out=$(make init 2>&1 || true) | ||
if ! echo "$out" | grep "certificate verify failed"; then | ||
echo "failed: apisix should echo \"certificate verify failed\"" | ||
exit 1 | ||
fi | ||
|
||
echo "passed: Show certificate verify failed info successfully" | ||
|
||
|
||
# Check etcd tls without verification | ||
git checkout conf/config.yaml | ||
|
||
echo ' | ||
etcd: | ||
host: | ||
- "https://127.0.0.1:12379" | ||
tls: | ||
verify: false | ||
prefix: "/apisix" | ||
' > conf/config.yaml | ||
|
||
out=$(make init 2>&1 || true) | ||
if echo "$out" | grep "certificate verify failed"; then | ||
echo "failed: apisix should not echo \"certificate verify failed\"" | ||
exit 1 | ||
fi | ||
|
||
echo "passed: Certificate verification successfully" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ INSTALL ?= install | |
UNAME ?= $(shell uname) | ||
OR_EXEC ?= $(shell which openresty || which nginx) | ||
LUAROCKS_VER ?= $(shell luarocks --version | grep -E -o "luarocks [0-9]+.") | ||
OR_PREFIX ?= $(shell $(OR_EXEC) -V 2>&1 | grep -Eo 'prefix=(.*)/nginx\s+' | grep -Eo '/.*/') | ||
|
||
SHELL := /bin/bash -o pipefail | ||
|
||
|
@@ -54,8 +55,16 @@ help: default | |
.PHONY: deps | ||
deps: default | ||
ifeq ($(LUAROCKS_VER),luarocks 3.) | ||
luarocks install --lua-dir=$(LUAJIT_DIR) rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local | ||
mkdir ~/.luarocks || true | ||
luarocks config variables.OPENSSL_LIBDIR $(addprefix $(OR_PREFIX), openssl/lib) | ||
luarocks config variables.OPENSSL_INCDIR $(addprefix $(OR_PREFIX), openssl/include) | ||
luarocks install rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local | ||
else | ||
@echo "WARN: You're not using LuaRocks 3.x, please add the following items to your LuaRocks config file:" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice warning |
||
@echo "variables = {" | ||
@echo " OPENSSL_LIBDIR=$(addprefix $(OR_PREFIX), openssl/lib)" | ||
@echo " OPENSSL_INCDIR=$(addprefix $(OR_PREFIX), openssl/include)" | ||
@echo "}" | ||
luarocks install rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local | ||
endif | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,19 @@ | |
# limitations under the License. | ||
# | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are we not support luarocks 2.x? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think LuaRocks 3.x is better to use? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agreed. So Apache APISIX not support luarocks 2.x, right? |
||
wget https://github.com/luarocks/luarocks/archive/v2.4.4.tar.gz | ||
tar -xf v2.4.4.tar.gz | ||
cd luarocks-2.4.4 || exit | ||
if [ -z ${OR_PREFIX} ]; then | ||
OR_PREFIX="/usr/local/openresty" | ||
fi | ||
|
||
wget https://github.com/luarocks/luarocks/archive/v3.4.0.tar.gz | ||
tar -xf v3.4.0.tar.gz | ||
cd luarocks-3.4.0 || exit | ||
./configure --prefix=/usr > build.log 2>&1 || (cat build.log && exit 1) | ||
make build > build.log 2>&1 || (cat build.log && exit 1) | ||
sudo make install > build.log 2>&1 || (cat build.log && exit 1) | ||
make install > build.log 2>&1 || (cat build.log && exit 1) | ||
cd .. || exit | ||
rm -rf luarocks-2.4.4 | ||
rm -rf luarocks-3.4.0 | ||
|
||
mkdir ~/.luarocks || true | ||
luarocks config variables.OPENSSL_LIBDIR ${OR_PREFIX}/openssl/lib | ||
luarocks config variables.OPENSSL_INCDIR ${OR_PREFIX}/openssl/include |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still support tengine now?