apisixWeb:基于 Apisix 数据面 API 的 WebUI 管理项目

apisixWeb是一个Apisix的webui界面,该项目使用apisix的管理API(即数据面API)实现了对apisix实例的业务操作!

Branch1Tags0
FilesLast commitLast update
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago

apisixWeb

apisixWeb

description

apisixWeb is a webui interface of Apisix. This project uses the management API of apisix (that is, the data plane API) to realize the business operation of the apisix instance!

The ultimate purpose is using Apisix to take over the traffic ports of the website, 80 and 443. Use best practices for website traffic management, efficiently and conveniently.

Inspired by nginxWebUI.

features

  • Add, delete, modify Routes, StreamRoutes, SSL... based on Apisix management APIs.
  • Multiple Apisix instance management.
  • Batch delete rules.
  • Clear all rules with one click.
  • Rawdata import and export.
  • Implementing DNS-01 certificate application using acme.sh.
  • Implementing HTTP-01 certificate application with acme4j.
  • Self signed certificate management.
  • Automatic renewal of expired certificates.
  • Deploy management based on yaml files.

apisixWeb

apisixWeb

apisixWeb

apisixWeb

docker

# create persistence data directory for apisixWeb
mkdir -p $HOME/apisixWeb
chown -R 1000:1000 $HOME/apisixWeb
# gen a new jwt secret replace default IDP32XTulsVIUZU+srFEUC9Lhu1wV+nd8iCJPoPA2zSFVAtWhCgpMEymxy5wFAZKMB9yROX31UjDzjwL66r1RA==
docker run -it --rm --entrypoint="" dyrnq/apisixweb:latest-jre21 bash -c "java -cp /app/apisixWeb.jar cli jwt"

# rm old apisixweb continer
docker rm -f apisixweb >/dev/null 2>&1

# run new apisixweb continer
docker run \
--name apisixweb \
-d \
--restart always \
-v $HOME/apisixWeb:/app/apisixWeb \
-p 8080:8080 \
-e TZ="Asia/Shanghai" \
-e JAVA_OPTS="-server -Xms512m -Xmx512m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Duser.timezone=Asia/Shanghai -Djava.net.preferIPv4Stack=true --server.port=8080 --server.session.timeout=172800 --jwt.secret=IDP32XTulsVIUZU+srFEUC9Lhu1wV+nd8iCJPoPA2zSFVAtWhCgpMEymxy5wFAZKMB9yROX31UjDzjwL66r1RA==" \
dyrnq/apisixweb:latest-jre21

build

git clone git@gitee.com:dyrnq/apisixWeb.git
cd apisixWeb
./mvnw -s ./settings.xml clean package -Dmaven.test.skip=true

run

install jdk

Ubuntu

apt update
apt install openjdk-8-jdk -y
# apt install openjdk-11-jdk -y

Centos

yum install -y java-1.8.0-openjdk
# yum install -y java-11-openjdk

install apisix

https://apisix.apache.org/docs/apisix/installation-guide/

run apisixWeb

wget https://a.dyrnq.com/apisixWeb/f/latest/apisixWeb.jar
java -jar apisixWeb.jar

run with more cmd-opts

java \
-server \
-Xms512m \
-Xmx512m \
-Djava.awt.headless=true \
-Dfile.encoding=UTF-8 \
-Duser.timezone=Asia/Shanghai \
-Djava.net.preferIPv4Stack=true \
-jar apisixWeb.jar \
--server.port=3333 \
--server.session.timeout=172800

run with systemd

vim /etc/systemd/system/apisixWeb.service
[Unit]
Description=apisixWeb
After=syslog.target network.target

[Service]
Type=simple
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/java/bin"
TimeoutStartSec=30
TimeoutStopSec=20
ExecStart=/usr/bin/java \
  -server \
  -Xms512m \
  -Xmx512m \
  -Dfile.encoding=UTF-8 \
  -Duser.timezone=Asia/Shanghai \
  -Djava.net.preferIPv4Stack=true \
  -jar /data/apisixWeb/apisixWeb.jar \
  --server.port=3333 \
  --server.session.timeout=172800
ExecStop=/bin/kill -s TERM $MAINPID
Restart=always
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
if systemctl is-active apisixWeb &>/dev/null; then
    systemctl restart apisixWeb
else
    systemctl enable --now apisixWeb
fi
systemctl status -l apisixWeb --no-pager

Change default session jwt secret

java -cp apisixWeb.jar cli jwt

Then pass --jwt.secret=your-secret to java -jar.

Parameter description (all are optional)

Parameter Meaning Default
--server.port http server port 8080
--project.home project home dir, storing db, cert, logs, etc. $HOME/apisixWeb
--spring.database.type optional h2, mysql, sqlite, postgresql h2
--spring.datasource.url datasource url
--spring.datasource.username datasource username
--spring.datasource.password datasource password

Introduction

apisixWeb是一个Apisix的webui界面,该项目使用apisix的管理API(即数据面API)实现了对apisix实例的业务操作!

Customize your domain