Kong Dashboard 安装

来自Linux78|wiki

Konga 安装

https://github.com/pantsel/konga 功能完善,持续更新中

安装准备

在开始安装之前,需要准备的有:

Nodejs >= 8 (推荐8.11.3 LTS)
npm
npm install -g gulp
npm install -g bower
npm install -g sails
npm config set registry http://registry.cnpmjs.org

Konga是使用NodeJS开发的项目,因此需要下载源码并安装。

git clone https://github.com/pantsel/konga.git
cd konga
npm i

Konga 配置

项目内已经提供了配置文件用例.env_example,复制为.env并修改配置项即可。

cp .env_example .env
vim .env
PORT=1337
NODE_ENV=production
KONGA_HOOK_TIMEOUT=120000
DB_ADAPTER=postgres
DB_URI=postgresql://konga:konga@linux78.com:5432/konga
KONGA_LOG_LEVEL=warn
TOKEN_SECRET=some_secret_token

配置数据库

su - postgres
psql
postgres=# CREATE USER konga WITH PASSWORD 'konga';
postgres=# CREATE DATABASE konga OWNER konga;
postgres=# GRANT ALL PRIVILEGES ON DATABASE konga TO konga;

数据库初始化

node ./bin/konga.js prepare [--adapter postgres --uri postgresql://localhost:5432/konga

启动konga

npm start

pm2启动管理

npm install -g pm2 
cd konga
pm2 start app.js --name konga


访问konga

http://host:1337

Kong Dashboard

官方文档:Kong Dashboard Install

已经长期没有更新,只支持到Kong的0.9版本

1、安装npm kong Dashboard是nodejs写的

sudo yum install nodejs

2、安装 Install Kong Dashboard

npm install -g kong-dashboard

3、Start Kong Dashboard

kong-dashboard start --kong-url http://kong:8001

# Start Kong Dashboard on a custom port
kong-dashboard start \
 --kong-url http://kong:8001 \
 --port [port]

# Start Kong Dashboard with basic auth
kong-dashboard start \
 --kong-url http://kong:8001 \
 --basic-auth user1=password1 user2=password2

# See full list of start options
kong-dashboard start --help


参考

npm WARN lifecycle kongadmin@0.14.7~postinstall: cannot run in wd kongadmin@0.14.7 bower --allow-root install (wd=/root/konga)
npm i --unsafe-perm=true --allow-root

node-sass 安装失败的原因及解决办法