Installation
This document describe how to install edge-cli.
Prepare
We will need to access the following public network addresses. If your network has a firewall, you need to add proper rules to white list them.
openresty.com 443
openresty.org 443
pkg.openresty.com 443
api.openresty.com 443
We need to prepare the files openresty-edge-config-VERSION.rpm
or openresty-edge-config-VERSION.deb
.
Installation
Please login openresty website.
Go to OpenResty Download Center.
Download the
openresty-edge-config
packageIf your system is debian, ubuntu, you should download
openresty-edge-config-VERSION.deb
.If your system is centos, fedora, rhel, you should download
openresty-edge-config-VERSION.rpm
.Copy
openresty-edge-config
to the current directory.Download the installation script:
curl -O https://openresty.com/client/oredge/install-edge-cli.sh
If you got a message like the following:
curl: command not found
It is possible that
curl
is not installed on the system or that the system shell program does not contain a search path forcurl
.You can use the absolute path to retry.
/usr/bin/curl -O https://openresty.com/client/oredge/install-edge-cli.sh
Your system’s path may be different, contact your webmaster or use a command such as
which bash
to check the path to correct the situation.Execute the installation script:
Note, you should put
install-edge-cli.sh
andopenresty-edge-config
package in the same directory.sudo /bin/bash install-edge-cli.sh
Set path
please set PATH environment in ~/.bash_profile
.
export PATH=/usr/local/oredge-admin/bin:$PATH
Add config file
If you don’t know how to get api_token, please goto API Token document.
Add config to ~/.oredge/config
.
mkdir ~/.oredge
cat << EOF > ~/.oredge/config
[admin]
host=domain.of.your.admin
port=443
verify_ssl=true
api_token=xxxxxxxxxxxxxxxxxxxxxx
EOF
The cli should be installed. Try it by:
oredge --help
Docker image of edge-cli
We provide edge-cli docker image to make use it more easily.
Download
You can download edge-cli use the command below.
docker pull registry.openresty.com/edge-cli/fedora32/openresty-edge-cli:latest
or
docker pull registry.openresty.com/edge-cli/fedora32/openresty-edge-cli:0.1.2-1
To specify edge-cli version by docker image’s tag. You can list all docker image’s tags use the command below.
# curl -s "https://registry.openresty.com/v2/edge-cli/fedora32/openresty-edge-cli/tags/list" | json_pp
{
"name" : "edge-cli/fedora32/openresty-edge-cli",
"tags" : [
"0.1.2-1",
"latest"
]
}
Usage
You can run the container use the command below.
docker run -ti --rm \
-v ~/.oredge/config:/root/.oredge/config \
registry.openresty.com/edge-cli/fedora32/openresty-edge-cli:latest /bin/bash
Now you can use oredge command.
Use -v /path/to/your/config:/root/.oredge/config to mount your edge-cli configuration.
Here are the example contents of the configuration.
[admin]
host=domain.of.your.admin
port=443
verify_ssl=true
api_token=xxxxxxxxxxxxxxxxxxxxxx
If you don’t know how to get api_token, please goto API Token document.