mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-17 00:15:55 +08:00
删除工作流
This commit is contained in:
@@ -1,95 +0,0 @@
|
||||
version: '1.0'
|
||||
name: pipeline-docker
|
||||
displayName: 构建镜像
|
||||
triggers:
|
||||
trigger: auto
|
||||
push:
|
||||
branches:
|
||||
precise:
|
||||
- master
|
||||
commitMessages:
|
||||
include:
|
||||
- ^deploy-docker
|
||||
stages:
|
||||
- name: stage-5ecf171c
|
||||
displayName: 项目打包
|
||||
strategy: naturally
|
||||
trigger: auto
|
||||
executor:
|
||||
- kerwincui
|
||||
steps:
|
||||
- step: build@maven
|
||||
name: build_maven
|
||||
displayName: Maven 构建后端
|
||||
jdkVersion: '8'
|
||||
mavenVersion: 3.6.1
|
||||
commands:
|
||||
- cd ./springboot
|
||||
- mvn -B clean package -Dmaven.test.skip=true
|
||||
artifacts:
|
||||
- name: BUILD_JAVA
|
||||
path:
|
||||
- ./springboot/wumei-admin/target/wumei-admin.jar
|
||||
settings: []
|
||||
strategy:
|
||||
retry: '0'
|
||||
- step: build@nodejs
|
||||
name: build_nodejs
|
||||
displayName: Nodejs 构建前端
|
||||
nodeVersion: 14.16.0
|
||||
commands:
|
||||
- cd ./vue
|
||||
- npm install --registry=https://registry.npm.taobao.org \
|
||||
- '&& rm -rf ./dist && npm run build:prod'
|
||||
artifacts:
|
||||
- name: BUILD_VUE
|
||||
path:
|
||||
- ./vue/dist
|
||||
strategy:
|
||||
retry: '0'
|
||||
- name: stage-f5631c9e
|
||||
displayName: 上传打包文件
|
||||
strategy: naturally
|
||||
trigger: auto
|
||||
executor:
|
||||
- kerwincui
|
||||
steps:
|
||||
- step: publish@general_artifacts
|
||||
name: publish_general_artifacts_java
|
||||
displayName: 上传后端制品
|
||||
dependArtifact: BUILD_JAVA
|
||||
artifactName: springboot
|
||||
strategy:
|
||||
retry: '0'
|
||||
- step: publish@general_artifacts
|
||||
name: publish_general_artifacts_vue
|
||||
displayName: 上传前端制品
|
||||
dependArtifact: BUILD_VUE
|
||||
artifactName: vue
|
||||
strategy:
|
||||
retry: '0'
|
||||
- name: stage-59a550ac
|
||||
displayName: 构建镜像
|
||||
strategy: naturally
|
||||
trigger: auto
|
||||
executor:
|
||||
- kerwincui
|
||||
steps:
|
||||
- step: build@docker
|
||||
name: build_docker
|
||||
displayName: 镜像构建
|
||||
type: cert
|
||||
certificate: kerwincui-docker
|
||||
tag: kerwincui/wumei-smart:1.01
|
||||
dockerfile: ./docker/Dockerfile
|
||||
context: ./docker
|
||||
artifacts:
|
||||
- ${BUILD_JAVA}
|
||||
- ${BUILD_VUE}
|
||||
isCache: true
|
||||
strategy:
|
||||
retry: '0'
|
||||
permissions:
|
||||
- role: admin
|
||||
members:
|
||||
- kerwincui
|
||||
@@ -1,60 +0,0 @@
|
||||
version: '1.0'
|
||||
name: pipeline-java
|
||||
displayName: 部署后端
|
||||
triggers:
|
||||
trigger: auto
|
||||
push:
|
||||
branches:
|
||||
precise:
|
||||
- master
|
||||
commitMessages:
|
||||
include:
|
||||
- ^deploy-server
|
||||
stages:
|
||||
- name: stage-2c3f9607
|
||||
displayName: 构建后端
|
||||
strategy: naturally
|
||||
trigger: auto
|
||||
executor:
|
||||
- kerwincui
|
||||
steps:
|
||||
- step: build@maven
|
||||
name: build_maven
|
||||
displayName: Maven 构建
|
||||
jdkVersion: '8'
|
||||
mavenVersion: 3.6.3
|
||||
commands:
|
||||
- cd ./springboot
|
||||
- mvn -B clean package -Dmaven.test.skip=true
|
||||
artifacts:
|
||||
- name: BUILD_JAVA
|
||||
path:
|
||||
- ./springboot/wumei-admin/target/wumei-admin.jar
|
||||
settings: []
|
||||
strategy:
|
||||
retry: '0'
|
||||
- name: stage-b6625c4a
|
||||
displayName: 部署后端
|
||||
strategy: naturally
|
||||
trigger: auto
|
||||
executor:
|
||||
- kerwincui
|
||||
steps:
|
||||
- step: deploy@agent
|
||||
name: deploy_agent
|
||||
displayName: 主机部署
|
||||
hostGroupID: alicloud
|
||||
deployArtifact:
|
||||
- source: build
|
||||
name: springboot
|
||||
target: ~/gitee_go/deploy
|
||||
dependArtifact: BUILD_JAVA
|
||||
script:
|
||||
- '# 请在此输入部署脚本,如启动Java应用如下'
|
||||
- '# nohup java -jar test.jar > nohup.out &'
|
||||
- ' echo ''Hello Gitee!'''
|
||||
- ' touch springboot'
|
||||
strategy:
|
||||
retry: '0'
|
||||
strategy:
|
||||
blocking: true
|
||||
@@ -1,60 +0,0 @@
|
||||
version: '1.0'
|
||||
name: pipeline-vue
|
||||
displayName: 部署前端
|
||||
triggers:
|
||||
trigger: auto
|
||||
push:
|
||||
branches:
|
||||
precise:
|
||||
- master
|
||||
commitMessages:
|
||||
include:
|
||||
- ^deploy-vue
|
||||
stages:
|
||||
- name: stage-3761fd9a
|
||||
displayName: 构建前端
|
||||
strategy: naturally
|
||||
trigger: auto
|
||||
executor:
|
||||
- kerwincui
|
||||
steps:
|
||||
- step: build@nodejs
|
||||
name: build_nodejs
|
||||
displayName: Nodejs 构建
|
||||
nodeVersion: 14.16.0
|
||||
commands:
|
||||
- cd ./vue
|
||||
- npm install --registry=https://registry.npm.taobao.org \
|
||||
- '&& rm -rf ./dist && npm run build:prod'
|
||||
artifacts:
|
||||
- name: BUILD_VUE
|
||||
path:
|
||||
- ./vue/dist
|
||||
strategy:
|
||||
retry: '0'
|
||||
- name: stage-79a96375
|
||||
displayName: 部署前端
|
||||
strategy: naturally
|
||||
trigger: auto
|
||||
executor:
|
||||
- kerwincui
|
||||
steps:
|
||||
- step: deploy@agent
|
||||
name: deploy_agent
|
||||
displayName: 主机部署
|
||||
hostGroupID: alicloud
|
||||
deployArtifact:
|
||||
- source: build
|
||||
name: vue
|
||||
target: ~/gitee_go/deploy
|
||||
dependArtifact: BUILD_VUE
|
||||
script: |-
|
||||
# 请在此输入部署脚本,如启动Java应用如下
|
||||
# nohup java -jar test.jar > nohup.out &
|
||||
echo 'Hello Gitee!' && touch vuetest
|
||||
touch vue
|
||||
strategy:
|
||||
retry: '0'
|
||||
permissions:
|
||||
- role: admin
|
||||
members: []
|
||||
@@ -12,56 +12,45 @@ ENV DB_USER root
|
||||
ENV DB_PASSWORD admin
|
||||
|
||||
RUN apt-get update && \
|
||||
echo "1. 安装网络工具和设置时区 =====================" && \
|
||||
# 安装网络工具和设置时区
|
||||
apt-get install wget -y --no-install-recommends && \
|
||||
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||
|
||||
echo "2. 更换国内源 =============================" && \
|
||||
# 更换国内源
|
||||
wget http://qiniu.xiwen.online/Debian10.list && \
|
||||
mv Debian10.list /etc/apt/sources.list && \
|
||||
apt update && apt upgrade -y && \
|
||||
|
||||
echo "3. 安装压缩工具 ============================" && \
|
||||
apt install zip -y && \
|
||||
|
||||
echo "4. 安装nginx ==============================" && \
|
||||
# 安装压缩工具
|
||||
apt install zip -y && \
|
||||
# 安装nginx和redis
|
||||
apt-get install nginx -y --no-install-recommends && \
|
||||
|
||||
echo "5. 安装redis ===============================" && \
|
||||
apt-get install redis-server -y --no-install-recommends && \
|
||||
|
||||
echo "6. 修改redis配置 =============================" && \
|
||||
# 安装 emqx
|
||||
apt update && apt install -y \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg-agent \
|
||||
software-properties-common && \
|
||||
curl -fsSL https://repos.emqx.io/gpg.pub | apt-key add - && \
|
||||
add-apt-repository \
|
||||
"deb [arch=amd64] https://repos.emqx.io/emqx-ce/deb/ubuntu/ \
|
||||
./bionic \
|
||||
stable" && \
|
||||
apt update && \
|
||||
apt install emqx=4.0.0 -y --no-install-recommends && \
|
||||
# 修改redis配置
|
||||
sed -i "s/# requirepass foobared/requirepass wumei-smart/g" /etc/redis/redis.conf && \
|
||||
sed -i "s/bind 127.0.0.1/# bind 127.0.0.1/g" /etc/redis/redis.conf
|
||||
|
||||
# echo "6. 安装 emqx =============================" && \
|
||||
# apt update && apt install -y \
|
||||
# apt-transport-https \
|
||||
# ca-certificates \
|
||||
# curl \
|
||||
# gnupg-agent \
|
||||
# software-properties-common && \
|
||||
# echo "6.2 添加EMQX官方GPG秘钥 =============================" && \
|
||||
# curl -fsSL https://repos.emqx.io/gpg.pub | apt-key add - && \
|
||||
# echo "6.3 设置存储库 =============================" && \
|
||||
# add-apt-repository \
|
||||
# "deb [arch=amd64] https://repos.emqx.io/emqx-ce/deb/ubuntu/ \
|
||||
# ./bionic \
|
||||
# stable" && \
|
||||
# echo "6.4 更新apt包索引 =============================" && \
|
||||
# apt update && \
|
||||
# echo "6.5 安装4.0版本 =============================" && \
|
||||
# apt install emqx=4.0.0 -y --no-install-recommends
|
||||
|
||||
# 复制emqx和Nginx的配置文件
|
||||
# COPY ./emqx4.0/emqx.conf /etc/emqx/emqx.conf
|
||||
# COPY ./emqx4.0/emqx_auth_http.conf /etc/emqx/plugins/emqx_auth_http.conf
|
||||
# COPY ./emqx4.0/emqx_web_hook.conf /etc/emqx/plugins/emqx_web_hook.conf
|
||||
# COPY ./emqx4.0/loaded_plugins /var/lib/emqx/loaded_plugins
|
||||
COPY ./emqx4.0/emqx.conf /etc/emqx/emqx.conf
|
||||
COPY ./emqx4.0/emqx_auth_http.conf /etc/emqx/plugins/emqx_auth_http.conf
|
||||
COPY ./emqx4.0/emqx_web_hook.conf /etc/emqx/plugins/emqx_web_hook.conf
|
||||
COPY ./emqx4.0/loaded_plugins /var/lib/emqx/loaded_plugins
|
||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
|
||||
# 解压前端和后端文件并放置到对应位置
|
||||
# 拷贝前后端压缩文件到容器,容器内解压后删除
|
||||
COPY ./wumei-smart.tar /var/
|
||||
RUN cd /var && tar -xvf wumei-smart.tar && rm wumei-smart.tar
|
||||
|
||||
# 启动脚本
|
||||
COPY docker-entrypoint.sh /
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
FROM openjdk:8u322-jre-slim-buster
|
||||
|
||||
ENV VERSION 1.1
|
||||
ENV AUTHOR kerwincui
|
||||
ENV INFO wumei smart open source living iot platform
|
||||
ENV SERVERS nginx:1.14.2, redis-server:5.0.14, emqx:4.0, openjdk:8u322-jre-slim-buster
|
||||
|
||||
# mysql环境变量
|
||||
ENV DB_HOST localhost
|
||||
ENV DB_NAME wumei
|
||||
ENV DB_USER root
|
||||
ENV DB_PASSWORD admin
|
||||
|
||||
RUN apt-get update && \
|
||||
# 安装网络工具和设置时区
|
||||
apt-get install wget -y --no-install-recommends && \
|
||||
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||
# 更换国内源
|
||||
wget http://qiniu.xiwen.online/Debian10.list && \
|
||||
mv Debian10.list /etc/apt/sources.list && \
|
||||
apt update && apt upgrade -y && \
|
||||
# 安装压缩工具
|
||||
apt install zip -y && \
|
||||
# 安装nginx和redis
|
||||
apt-get install nginx -y --no-install-recommends && \
|
||||
apt-get install redis-server -y --no-install-recommends && \
|
||||
# 安装 emqx
|
||||
apt update && apt install -y \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg-agent \
|
||||
software-properties-common && \
|
||||
curl -fsSL https://repos.emqx.io/gpg.pub | apt-key add - && \
|
||||
add-apt-repository \
|
||||
"deb [arch=amd64] https://repos.emqx.io/emqx-ce/deb/ubuntu/ \
|
||||
./bionic \
|
||||
stable" && \
|
||||
apt update && \
|
||||
apt install emqx=4.0.0 -y --no-install-recommends && \
|
||||
# 修改redis配置
|
||||
sed -i "s/# requirepass foobared/requirepass wumei-smart/g" /etc/redis/redis.conf && \
|
||||
sed -i "s/bind 127.0.0.1/# bind 127.0.0.1/g" /etc/redis/redis.conf
|
||||
|
||||
# 复制emqx和Nginx的配置文件
|
||||
COPY ./emqx4.0/emqx.conf /etc/emqx/emqx.conf
|
||||
COPY ./emqx4.0/emqx_auth_http.conf /etc/emqx/plugins/emqx_auth_http.conf
|
||||
COPY ./emqx4.0/emqx_web_hook.conf /etc/emqx/plugins/emqx_web_hook.conf
|
||||
COPY ./emqx4.0/loaded_plugins /var/lib/emqx/loaded_plugins
|
||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
||||
# 拷贝前后端压缩文件到容器,容器内解压后删除
|
||||
COPY ./wumei-smart.tar /var/
|
||||
RUN cd /var && tar -xvf wumei-smart.tar && rm wumei-smart.tar
|
||||
|
||||
# 启动脚本
|
||||
COPY docker-entrypoint.sh /
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
|
||||
# 映射端口
|
||||
EXPOSE 80 1883 8083
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
# 服务启动
|
||||
service nginx start
|
||||
service redis-server start
|
||||
service mysql start
|
||||
emqx start
|
||||
java -jar /var/wumei-smart/app.jar
|
||||
|
||||
# 镜像构建
|
||||
docker build -t wumei-smart:1.0 .
|
||||
# 复制文件到容器
|
||||
docker cp wumei-smart/* container:/var/wumei-smart/
|
||||
# 镜像导出导入
|
||||
docker export container| docker import - kerwincui/wumei-smart:1.0
|
||||
# 镜像推送
|
||||
阿里云镜像:registry.cn-chengdu.aliyuncs.com/kerwincui/wumei-smart:1.0
|
||||
docker tag wumei-smart kerwincui/wumei-smart:1.0
|
||||
docker push kerwinci/wumei-smart:1.0
|
||||
|
||||
# 容器运行
|
||||
docker run \
|
||||
--name wumei-smart \
|
||||
--env DB_HOST=wumei.live:3306 \
|
||||
--env DB_NAME=wumei-smart \
|
||||
--env DB_USER=root \
|
||||
--env DB_PASSWORD=wumei-smart \
|
||||
--publish 80:80 \
|
||||
--publish 1883:1883 \
|
||||
--publish 8083:8083 \
|
||||
--volume /var/wumei-smart/java/uploadPath:/var/wumei-smart/java/uploadPath \
|
||||
--restart unless-stopped \
|
||||
--detach \
|
||||
kerwincui/wumei-smart:1.1
|
||||
|
||||
--publish 18083:18083 \
|
||||
--publish 8084:8084 \
|
||||
--publish 8883:8883 \
|
||||
--publish 8081:8081 \
|
||||
--publish 6379:6379 \
|
||||
--publish 8080:8080 \
|
||||
|
||||
--volume /var/wumei-smart/java/logs:/var/wumei-smart/java/logs \
|
||||
--volume /var/wumei-smart/nginx/nginx.conf:/etc/nginx/nginx.conf \
|
||||
--volume /var/wumei-smart/nginx/error.log:/var/log/nginx/error.log \
|
||||
--volume /var/wumei-smart/redis/redis.conf:/etc/redis/redis.conf \
|
||||
--volume /var/wumei-smart/redis/redis-server.log:/var/log/redis/redis-server.log \
|
||||
--volume /var/wumei-smart/emqx/emqx.conf:/etc/emqx/emqx.conf \
|
||||
--volume /var/wumei-smart/emqx/log:/var/log/emqx \
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# start service
|
||||
startTime=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
echo $startTime : wumei-smart is starting, please waiting ...
|
||||
|
||||
# 提取jar包配置文件
|
||||
cd /var/wumei-smart/java
|
||||
unzip app.jar BOOT-INF/classes/application-druid.yml
|
||||
# 修改mysql配置
|
||||
sed -i "s/{DB_HOST}/$DB_HOST/g" BOOT-INF/classes/application-druid.yml
|
||||
sed -i "s/{DB_NAME}/$DB_NAME/g" BOOT-INF/classes/application-druid.yml
|
||||
sed -i "s/{DB_USER}/$DB_USER/g" BOOT-INF/classes/application-druid.yml
|
||||
sed -i "s/{DB_PASSWORD}/$DB_PASSWORD/g" BOOT-INF/classes/application-druid.yml
|
||||
# 配置文件写入jar包,并删除提取的配置
|
||||
zip app.jar BOOT-INF/classes/application-druid.yml
|
||||
rm -rf BOOT-INF
|
||||
|
||||
service nginx start
|
||||
service redis-server start
|
||||
emqx start
|
||||
java -jar /var/wumei-smart/java/app.jar
|
||||
|
||||
|
||||
while true
|
||||
do
|
||||
time=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
echo $time : wumei-smart is running...
|
||||
sleep 3600
|
||||
done
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,133 +0,0 @@
|
||||
##--------------------------------------------------------------------
|
||||
## HTTP Auth/ACL Plugin
|
||||
##--------------------------------------------------------------------
|
||||
|
||||
|
||||
##------------------------------------------------------------------------------
|
||||
## SSL options
|
||||
|
||||
## Path to the file containing PEM-encoded CA certificates. The CA certificates
|
||||
## are used during server authentication and when building the client certificate chain.
|
||||
##
|
||||
## Value: File
|
||||
## auth.http.ssl.cacertfile = /etc/emqx/certs/ca.pem
|
||||
|
||||
## The path to a file containing the client's certificate.
|
||||
##
|
||||
## Value: File
|
||||
## auth.http.ssl.certfile = /etc/emqx/certs/client-cert.pem
|
||||
|
||||
## Path to a file containing the client's private PEM-encoded key.
|
||||
##
|
||||
## Value: File
|
||||
## auth.http.ssl.keyfile = /etc/emqx/certs/client-key.pem
|
||||
|
||||
##--------------------------------------------------------------------
|
||||
## HTTP Request Headers
|
||||
##
|
||||
## Example: auth.http.header.Accept-Encoding = *
|
||||
##
|
||||
## Value: String
|
||||
## auth.http.header.Accept = */*
|
||||
|
||||
##--------------------------------------------------------------------
|
||||
## Authentication request.
|
||||
##
|
||||
## Variables:
|
||||
## - %u: username
|
||||
## - %c: clientid
|
||||
## - %a: ipaddress
|
||||
## - %r: protocol
|
||||
## - %P: password
|
||||
## - %p: sockport of server accepted
|
||||
## - %C: common name of client TLS cert
|
||||
## - %d: subject of client TLS cert
|
||||
##
|
||||
## Value: URL
|
||||
auth.http.auth_req = http://localhost:8080/iot/tool/mqtt/auth
|
||||
## Value: post | get | put
|
||||
auth.http.auth_req.method = post
|
||||
## Value: Params
|
||||
auth.http.auth_req.params = clientid=%c,username=%u,password=%P
|
||||
|
||||
##--------------------------------------------------------------------
|
||||
## Superuser request.
|
||||
##
|
||||
## Variables:
|
||||
## - %u: username
|
||||
## - %c: clientid
|
||||
## - %a: ipaddress
|
||||
## - %r: protocol
|
||||
## - %P: password
|
||||
## - %p: sockport of server accepted
|
||||
## - %C: common name of client TLS cert
|
||||
## - %d: subject of client TLS cert
|
||||
##
|
||||
## Value: URL
|
||||
# auth.http.super_req = http://127.0.0.1:8991/mqtt/superuser
|
||||
## Value: post | get | put
|
||||
# auth.http.super_req.method = post
|
||||
## Value: Params
|
||||
# auth.http.super_req.params = clientid=%c,username=%u
|
||||
|
||||
##--------------------------------------------------------------------
|
||||
## ACL request.
|
||||
##
|
||||
## Variables:
|
||||
## - %A: 1 | 2, 1 = sub, 2 = pub
|
||||
## - %u: username
|
||||
## - %c: clientid
|
||||
## - %a: ipaddress
|
||||
## - %r: protocol
|
||||
## - %m: mountpoint
|
||||
## - %t: topic
|
||||
##
|
||||
## Value: URL
|
||||
# auth.http.acl_req = http://127.0.0.1:8991/mqtt/acl
|
||||
## Value: post | get | put
|
||||
# auth.http.acl_req.method = get
|
||||
## Value: Params
|
||||
# auth.http.acl_req.params = access=%A,username=%u,clientid=%c,ipaddr=%a,topic=%t,mountpoint=%m
|
||||
|
||||
##------------------------------------------------------------------------------
|
||||
## Http Reqeust options
|
||||
|
||||
## Time-out time for the http request, 0 is never timeout.
|
||||
##
|
||||
## Value: Duration
|
||||
## -h: hour, e.g. '2h' for 2 hours
|
||||
## -m: minute, e.g. '5m' for 5 minutes
|
||||
## -s: second, e.g. '30s' for 30 seconds
|
||||
##
|
||||
## Default: 0
|
||||
## auth.http.request.timeout = 0
|
||||
|
||||
## Connection time-out time, used during the initial request
|
||||
## when the client is connecting to the server
|
||||
##
|
||||
## Value: Duration
|
||||
##
|
||||
## Default is same with the timeout option
|
||||
## auth.http.request.connect_timout = 0
|
||||
|
||||
## Re-send http reuqest times
|
||||
##
|
||||
## Value: integer
|
||||
##
|
||||
## Default: 3
|
||||
auth.http.request.retry_times = 3
|
||||
|
||||
## The interval for re-sending the http request
|
||||
##
|
||||
## Value: Duration
|
||||
##
|
||||
## Default: 1s
|
||||
auth.http.request.retry_interval = 1s
|
||||
|
||||
## The 'Exponential Backoff' mechanism for re-sending request. The actually
|
||||
## re-send time interval is `interval * backoff ^ times`
|
||||
##
|
||||
## Value: float
|
||||
##
|
||||
## Default: 2.0
|
||||
auth.http.request.retry_backoff = 2.0
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
web.hook.api.url = http://localhost:8080/iot/tool/mqtt/webhook
|
||||
|
||||
## Encode message payload field
|
||||
##
|
||||
## Value: base64 | base62
|
||||
##
|
||||
## Default: undefined
|
||||
## web.hook.encode_payload = base64
|
||||
|
||||
# web.hook.rule.client.connect.1 = {"action": "on_client_connect"}
|
||||
# web.hook.rule.client.connack.1 = {"action": "on_client_connack"}
|
||||
web.hook.rule.client.connected.1 = {"action": "on_client_connected"}
|
||||
web.hook.rule.client.disconnected.1 = {"action": "on_client_disconnected"}
|
||||
# web.hook.rule.client.subscribe.1 = {"action": "on_client_subscribe"}
|
||||
# web.hook.rule.client.unsubscribe.1 = {"action": "on_client_unsubscribe"}
|
||||
# web.hook.rule.session.subscribed.1 = {"action": "on_session_subscribed"}
|
||||
# web.hook.rule.session.unsubscribed.1 = {"action": "on_session_unsubscribed"}
|
||||
# web.hook.rule.session.terminated.1 = {"action": "on_session_terminated"}
|
||||
# web.hook.rule.message.publish.1 = {"action": "on_message_publish"}
|
||||
# web.hook.rule.message.delivered.1 = {"action": "on_message_delivered"}
|
||||
# web.hook.rule.message.acked.1 = {"action": "on_message_acked"}
|
||||
@@ -1,8 +0,0 @@
|
||||
{emqx_management,true}.
|
||||
{emqx_recon,true}.
|
||||
{emqx_retainer,true}.
|
||||
{emqx_dashboard,true}.
|
||||
{emqx_rule_engine,true}.
|
||||
{emqx_bridge_mqtt,false}.
|
||||
{emqx_auth_http,true}.
|
||||
{emqx_web_hook,true}.
|
||||
@@ -1,97 +0,0 @@
|
||||
worker_processes 1;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
gzip on;
|
||||
gzip_min_length 1k;
|
||||
gzip_buffers 16 64K;
|
||||
gzip_http_version 1.1;
|
||||
gzip_comp_level 5;
|
||||
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
|
||||
gzip_vary on;
|
||||
gzip_proxied expired no-cache no-store private auth;
|
||||
gzip_disable "MSIE [1-6]\.";
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
location / {
|
||||
rewrite ^(.*) https://$server_name$1 permanent;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
# 侦听443端口
|
||||
listen 443 ssl;
|
||||
# 定义访问域名
|
||||
server_name localhost;
|
||||
#证书文件名称
|
||||
ssl_certificate domain_bundle.crt;
|
||||
#私钥文件名称
|
||||
ssl_certificate_key domain.key;
|
||||
|
||||
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
|
||||
#error_page 404/404.html;
|
||||
#HTTP_TO_HTTPS_START
|
||||
if ($server_port !~ 443){
|
||||
rewrite ^(/.*)$ https://$host$1 permanent;
|
||||
}
|
||||
ssl_session_timeout 10m;
|
||||
#请按照以下协议配置
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
#请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。
|
||||
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
# web端
|
||||
location / {
|
||||
root /var/wumei-smart/vue;
|
||||
try_files $uri $uri/ /index.html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
# 服务端接口
|
||||
location /prod-api/{
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://localhost:8080/;
|
||||
}
|
||||
|
||||
# emqx接口
|
||||
location /api/v4/{
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://localhost:8081/api/v4/;
|
||||
}
|
||||
|
||||
# wss连接
|
||||
location /mqtt {
|
||||
proxy_pass http://localhost:8083/mqtt;
|
||||
proxy_read_timeout 90s;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real_IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-for $remote_addr;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'Upgrade';
|
||||
}
|
||||
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
worker_processes 1;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
gzip on;
|
||||
gzip_min_length 1k;
|
||||
gzip_buffers 16 64K;
|
||||
gzip_http_version 1.1;
|
||||
gzip_comp_level 5;
|
||||
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
|
||||
gzip_vary on;
|
||||
gzip_proxied expired no-cache no-store private auth;
|
||||
gzip_disable "MSIE [1-6]\.";
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
charset utf-8;
|
||||
|
||||
location / {
|
||||
root /var/wumei-smart/vue;
|
||||
try_files $uri $uri/ /index.html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location /prod-api/ {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://localhost:8080/;
|
||||
}
|
||||
|
||||
location /api/v4/ {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://localhost:8081/api/v4/;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user