feat: init build release
This commit is contained in:
12
.gitattributes
vendored
Normal file
12
.gitattributes
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
* text=auto
|
||||
*.sh text eol=lf
|
||||
*.md text eol=lf
|
||||
*.yaml text eol=lf
|
||||
*.yml text eol=lf
|
||||
*.sql text eol=lf
|
||||
*.txt text eol=lf
|
||||
*.conf text eol=lf
|
||||
*.xml text eol=lf
|
||||
*.bat text eol=crlf
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
86
.gitignore
vendored
Normal file
86
.gitignore
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
######################################################################
|
||||
# Build Tools
|
||||
|
||||
.gradle
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
######################################################################
|
||||
# IDE
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
*.class
|
||||
|
||||
### JRebel ###
|
||||
rebel.xml
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
|
||||
######################################################################
|
||||
# Others
|
||||
*.log
|
||||
*.xml.versionsBackup
|
||||
*.swp
|
||||
tmp
|
||||
|
||||
# docker
|
||||
build/docker/mysql/data
|
||||
build/docker/redis/data
|
||||
build/docker/mysql/log
|
||||
build/docker/nacos/logs
|
||||
build/docker/mysql/db/*.sql
|
||||
build/docker/wfc/*/jar/*.jar
|
||||
build/docker/wfc/*/*/jar/*.jar
|
||||
|
||||
# Logs
|
||||
logs
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
!.vscode/settings.json
|
||||
!.vscode/launch.json
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
|
||||
.VSCodeCounter
|
||||
|
||||
# release
|
||||
release/debs/*.deb
|
||||
release/tars/*.tar.gz
|
||||
53
README.md
53
README.md
@@ -1 +1,52 @@
|
||||
本项目WANFi计费和用户管理系统
|
||||
# WANFi Controller & Billing System
|
||||
|
||||
## 准备工作
|
||||
|
||||
```text
|
||||
Linux >= Ubuntu 22.04
|
||||
JDK >= 1.8 (Recommended version 1.8)
|
||||
Docker >= 24.0.7, build 24.0.7-0ubuntu2~22.04.1
|
||||
Docker-compose >= 1.29.2
|
||||
```
|
||||
|
||||
## 获取安装包
|
||||
|
||||
安装包名: wfc-1.0.2-20241212.tar.gz
|
||||
说明:
|
||||
|
||||
* 版本号: 1.0.2
|
||||
* 构建日期:20241212
|
||||
|
||||
## 安装软件
|
||||
|
||||
### 创建安装目录
|
||||
|
||||
```sh
|
||||
sudo mkdir /opt/wfc
|
||||
```
|
||||
|
||||
### 解压软件包至安装目录
|
||||
|
||||
```sh
|
||||
sudo tar xvfz wfc-1.0.2-20241212.tar.gz -C /opt/wfc
|
||||
```
|
||||
|
||||
### 配置软件
|
||||
|
||||
```sh
|
||||
cd /opt/wfc/bin
|
||||
sudo ./wfcsetup.sh
|
||||
```
|
||||
|
||||
### 启动/查看/停止/版本软件
|
||||
|
||||
```sh
|
||||
cd /opt/wfc/bin
|
||||
sudo ./wfccontrol.sh start/status/stop/version
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```sh
|
||||
sudo systemctl start/status/stop wfccontrol.service
|
||||
```
|
||||
|
||||
106
bin/build.sh
Normal file
106
bin/build.sh
Normal file
@@ -0,0 +1,106 @@
|
||||
#!/bin/bash
|
||||
ProjectL=wfc
|
||||
ProjectU=WFC
|
||||
RelVersion=1.0.2
|
||||
RelDate=`date +%Y%m%d`
|
||||
GitRootDir=${HOME}/wfc.git
|
||||
BERootDir=${GitRootDir}/be.wfc
|
||||
FERootDir=${GitRootDir}/fe.wfc
|
||||
FEUserRootDir=${GitRootDir}/fe.wfc.user
|
||||
BuildRootDir=${GitRootDir}/build.wfc
|
||||
|
||||
WFCWorkDir=/opt/wfc
|
||||
BuildDockerDir=${BuildRootDir}/build/docker
|
||||
ReleseDir=${BuildRootDir}/release
|
||||
TarFileName=${ProjectL}-${RelVersion}-${RelDate}.tar.gz
|
||||
|
||||
usage() {
|
||||
echo "Usage: sh build.sh [extras|jar|dist|copy|tar|deb|all]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
build-extras(){
|
||||
echo -n "Begin build extras file ... "
|
||||
cd ${BuildRootDir}
|
||||
git pull
|
||||
cd bin
|
||||
javac printJarVer.java
|
||||
echo "done"
|
||||
}
|
||||
|
||||
build-jar(){
|
||||
cd ${BERootDir}
|
||||
git pull
|
||||
mvn clean package -Dmaven.test.skip=true -P prod
|
||||
}
|
||||
|
||||
build-dist(){
|
||||
cd ${FERootDir}
|
||||
git pull
|
||||
pnpm i
|
||||
pnpm build
|
||||
|
||||
cd ${FEUserRootDir}
|
||||
git pull
|
||||
pnpm i
|
||||
pnpm build
|
||||
}
|
||||
|
||||
copy-file(){
|
||||
${BuildRootDir}/bin/copy.sh
|
||||
cp -f ${BuildRootDir}/bin/printJarVer.class ${BuildRootDir}/build/bin/
|
||||
}
|
||||
|
||||
# build tar package
|
||||
build-tar(){
|
||||
echo -n "Begin build tar package ... "
|
||||
cd ${BuildRootDir}/build
|
||||
tar cvfz ${ReleseDir}/tars/${TarFileName} bin docker systemd 1>/dev/null
|
||||
echo "done"
|
||||
}
|
||||
|
||||
# build deb package
|
||||
build-deb(){
|
||||
echo -n "Begin build deb package ... "
|
||||
echo "done"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"extras")
|
||||
build-extras
|
||||
;;
|
||||
"jar")
|
||||
build-jar
|
||||
;;
|
||||
"dist")
|
||||
build-dist
|
||||
;;
|
||||
"copy")
|
||||
copy-file
|
||||
;;
|
||||
"tar")
|
||||
build-extras
|
||||
build-jar
|
||||
build-dist
|
||||
copy-file
|
||||
build-tar
|
||||
;;
|
||||
"deb")
|
||||
build-extras
|
||||
build-jar
|
||||
build-dist
|
||||
copy-file
|
||||
build-deb
|
||||
;;
|
||||
"all")
|
||||
build-extras
|
||||
build-jar
|
||||
build-dist
|
||||
copy-file
|
||||
build-tar
|
||||
build-deb
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
74
bin/copy.sh
Normal file
74
bin/copy.sh
Normal file
@@ -0,0 +1,74 @@
|
||||
#!/bin/bash
|
||||
|
||||
GitRootDir=${HOME}/wfc.git
|
||||
BERootDir=${GitRootDir}/be.wfc
|
||||
FERootDir=${GitRootDir}/fe.wfc
|
||||
FEUserRootDir=${GitRootDir}/fe.wfc.user
|
||||
BuildRootDir=${GitRootDir}/build.wfc
|
||||
|
||||
WFCWorkDir=/opt/wfc
|
||||
BuildDockerDir=${BuildRootDir}/build/docker
|
||||
|
||||
# 复制项目的文件到对应docker路径,便于一键生成镜像。
|
||||
usage() {
|
||||
echo "Usage: sh copy.sh"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# copy sql
|
||||
echo -n "Begin copy sql ... "
|
||||
cp ${BERootDir}/sql/wfc_config_db/wfc_config_db.sql ${BuildDockerDir}/mysql/db
|
||||
cp ${BERootDir}/sql/wfc_system_db/wfc_system_db.sql ${BuildDockerDir}/mysql/db
|
||||
cp ${BERootDir}/sql/wfc_user_db/wfc_user_db.sql ${BuildDockerDir}/mysql/db
|
||||
#ln -sf /tmp ${BuildDockerDir}/mysql/
|
||||
echo "done"
|
||||
|
||||
# copy html
|
||||
echo -n "Begin copy system html ... "
|
||||
mkdir -p ${BuildDockerDir}/nginx/html/dist/sys
|
||||
rm -rf ${BuildDockerDir}/nginx/html/dist/sys/*
|
||||
cp -rf ${FERootDir}/dist/* ${BuildDockerDir}/nginx/html/dist/sys/
|
||||
echo "done"
|
||||
|
||||
echo -n "Begin copy user html ... "
|
||||
mkdir -p ${BuildDockerDir}/nginx/html/dist/u
|
||||
rm -rf ${BuildDockerDir}/nginx/html/dist/u/*
|
||||
cp -rf ${FEUserRootDir}/dist/* ${BuildDockerDir}/nginx/html/dist/u/
|
||||
echo "done"
|
||||
|
||||
# copy jar
|
||||
echo -n "Begin copy wfc-gateway ... "
|
||||
cp ${BERootDir}/wfc-gateway/target/wfc-gateway.jar ${BuildDockerDir}/wfc/gateway/jar
|
||||
echo "done"
|
||||
|
||||
echo -n "Begin copy wfc-auth ... "
|
||||
cp ${BERootDir}/wfc-auth/target/wfc-auth.jar ${BuildDockerDir}/wfc/auth/jar
|
||||
echo "done"
|
||||
|
||||
echo -n "Begin copy wfc-visual ... "
|
||||
cp ${BERootDir}/wfc-visual/wfc-visual-monitor/target/wfc-visual-monitor.jar ${BuildDockerDir}/wfc/visual/monitor/jar
|
||||
echo "done"
|
||||
|
||||
echo -n "Begin copy wfc-modules-system ... "
|
||||
cp ${BERootDir}/wfc-modules/wfc-system/target/wfc-modules-system.jar ${BuildDockerDir}/wfc/modules/system/jar
|
||||
echo "done"
|
||||
|
||||
echo -n "Begin copy wfc-modules-user ... "
|
||||
cp ${BERootDir}/wfc-modules/wfc-modules-user/target/wfc-modules-user.jar ${BuildDockerDir}/wfc/modules/user/jar
|
||||
echo "done"
|
||||
|
||||
echo -n "Begin copy wfc-modules-file ... "
|
||||
cp ${BERootDir}/wfc-modules/wfc-file/target/wfc-modules-file.jar ${BuildDockerDir}/wfc/modules/file/jar
|
||||
echo "done"
|
||||
|
||||
echo -n "Begin copy wfc-modules-job ... "
|
||||
cp ${BERootDir}/wfc-modules/wfc-job/target/wfc-modules-job.jar ${BuildDockerDir}/wfc/modules/job/jar
|
||||
echo "done"
|
||||
|
||||
echo -n "Begin copy wfc-modules-gen ... "
|
||||
cp ${BERootDir}/wfc-modules/wfc-gen/target/wfc-modules-gen.jar ${BuildDockerDir}/wfc/modules/gen/jar
|
||||
echo "done"
|
||||
|
||||
echo -n "Begin copy wfc-modules-payment ... "
|
||||
cp -rf ${BERootDir}/wfc-modules/wfc-payment/target/wfc-modules-payment.jar ${BuildDockerDir}/wfc/modules/payment/jar
|
||||
echo "done"
|
||||
28
bin/printJarVer.java
Normal file
28
bin/printJarVer.java
Normal file
@@ -0,0 +1,28 @@
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.jar.Attributes;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.jar.Manifest;
|
||||
|
||||
public class printJarVer {
|
||||
public static void main(String[] args) {
|
||||
if (args.length == 0) {
|
||||
System.out.println("Please input jars path and file name.");
|
||||
return;
|
||||
}
|
||||
|
||||
for (String jarPath : args) {
|
||||
File jarFile = new File(jarPath);
|
||||
String jarName = jarFile.getName();
|
||||
try (JarFile jar = new JarFile(jarFile)) {
|
||||
Manifest manifest = jar.getManifest();
|
||||
Attributes attributes = manifest.getMainAttributes();
|
||||
String version = attributes.getValue("Implementation-Version");
|
||||
System.out.println(jarName + " version: " + (version != null ? version : "not found version info"));
|
||||
} catch (IOException e) {
|
||||
System.out.println("Can't read " + jarName + " version.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
59
build/bin/wfccontrol.sh
Normal file
59
build/bin/wfccontrol.sh
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
|
||||
WFCWorkDir=/opt/wfc
|
||||
DockerDir=${WFCWorkDir}/docker
|
||||
DockerCompose=/usr/bin/docker-compose
|
||||
|
||||
usage() {
|
||||
echo "Usage: sh wfccontrol.sh [start|stop|status|version]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
start(){
|
||||
cd ${DockerDir}
|
||||
${DockerCompose} up -d
|
||||
}
|
||||
|
||||
stop(){
|
||||
cd ${DockerDir}
|
||||
${DockerCompose} down
|
||||
}
|
||||
|
||||
Jars=" \
|
||||
/opt/wfc/docker/wfc/auth/jar/wfc-auth.jar \
|
||||
/opt/wfc/docker/wfc/gateway/jar/wfc-gateway.jar \
|
||||
/opt/wfc/docker/wfc/modules/system/jar/wfc-modules-system.jar \
|
||||
/opt/wfc/docker/wfc/modules/user/jar/wfc-modules-user.jar \
|
||||
/opt/wfc/docker/wfc/modules/gen/jar/wfc-modules-gen.jar \
|
||||
/opt/wfc/docker/wfc/modules/file/jar/wfc-modules-file.jar \
|
||||
/opt/wfc/docker/wfc/modules/job/jar/wfc-modules-job.jar \
|
||||
/opt/wfc/docker/wfc/modules/payment/jar/wfc-modules-payment.jar \
|
||||
"
|
||||
|
||||
status(){
|
||||
cd ${DockerDir}
|
||||
${DockerCompose} ps
|
||||
}
|
||||
|
||||
# print wfc version
|
||||
version(){
|
||||
java printJarVer ${Jars}
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"start")
|
||||
start
|
||||
;;
|
||||
"stop")
|
||||
stop
|
||||
;;
|
||||
"status")
|
||||
status
|
||||
;;
|
||||
"version")
|
||||
version
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
22
build/bin/wfcsetup.sh
Normal file
22
build/bin/wfcsetup.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
WFCWorkDir=/opt/wfc
|
||||
DockerWorkDir=${WFCWorkDir}/docker
|
||||
SrcServiceDir=${WFCWorkDir}/systemd/system
|
||||
DstServiceDir=/etc/systemd/system
|
||||
|
||||
# prepare directory
|
||||
ln -sf /tmp ${DockerWorkDir}/mysql/
|
||||
chown -R root:root ${DockerWorkDir}/*
|
||||
chown -R mysql:mysql ${DockerWorkDir}/mysql
|
||||
chmod -R 755 ${DockerWorkDir}/mysql/*
|
||||
|
||||
# setup system serivce
|
||||
cp -rf ${SrcServiceDir}/wfccontrol.service ${DstServiceDir}/
|
||||
systemctl daemon-reload
|
||||
systemctl enable wfccontrol.service
|
||||
|
||||
# build docker compose
|
||||
cd ${DockerWorkDir}
|
||||
docker-compose build
|
||||
|
||||
178
build/docker/docker-compose.yml
Normal file
178
build/docker/docker-compose.yml
Normal file
@@ -0,0 +1,178 @@
|
||||
services:
|
||||
wfc-nacos:
|
||||
container_name: wfc-nacos
|
||||
image: nacos/nacos-server
|
||||
build:
|
||||
context: ./nacos
|
||||
environment:
|
||||
- MODE=standalone
|
||||
- NACOS_SERVER_ADDR=192.168.13.128
|
||||
volumes:
|
||||
- ./nacos/logs/:/home/nacos/logs
|
||||
- ./nacos/conf/application.properties:/home/nacos/conf/application.properties
|
||||
ports:
|
||||
- "8848:8848"
|
||||
- "9848:9848"
|
||||
- "9849:9849"
|
||||
depends_on:
|
||||
- wfc-mysql
|
||||
restart: always
|
||||
wfc-mysql:
|
||||
container_name: wfc-mysql
|
||||
image: mysql:5.7
|
||||
build:
|
||||
context: ./mysql
|
||||
ports:
|
||||
- "3306:3306"
|
||||
volumes:
|
||||
- ./mysql/conf:/etc/mysql/conf.d
|
||||
- ./mysql/logs:/logs
|
||||
- ./mysql/data:/var/lib/mysql
|
||||
- ./mysql/tmp:/tmp
|
||||
command: [
|
||||
'mysqld',
|
||||
'--innodb-buffer-pool-size=80M',
|
||||
'--character-set-server=utf8mb4',
|
||||
'--collation-server=utf8mb4_unicode_ci',
|
||||
'--default-time-zone=+8:00',
|
||||
'--lower-case-table-names=1'
|
||||
]
|
||||
environment:
|
||||
MYSQL_DATABASE: 'wfc_system_db'
|
||||
MYSQL_ROOT_PASSWORD: 123456
|
||||
restart: always
|
||||
wfc-redis:
|
||||
container_name: wfc-redis
|
||||
image: redis
|
||||
build:
|
||||
context: ./redis
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- ./redis/conf/redis.conf:/home/wfc/redis/redis.conf
|
||||
- ./redis/data:/data
|
||||
command: redis-server /home/wfc/redis/redis.conf
|
||||
restart: always
|
||||
wfc-gateway:
|
||||
container_name: wfc-gateway
|
||||
build:
|
||||
context: ./wfc/gateway
|
||||
dockerfile: dockerfile
|
||||
ports:
|
||||
- "8080:8080"
|
||||
depends_on:
|
||||
- wfc-redis
|
||||
links:
|
||||
- wfc-redis
|
||||
restart: always
|
||||
wfc-auth:
|
||||
container_name: wfc-auth
|
||||
build:
|
||||
context: ./wfc/auth
|
||||
dockerfile: dockerfile
|
||||
ports:
|
||||
- "9200:9200"
|
||||
depends_on:
|
||||
- wfc-redis
|
||||
links:
|
||||
- wfc-redis
|
||||
restart: always
|
||||
wfc-modules-system:
|
||||
container_name: wfc-modules-system
|
||||
build:
|
||||
context: ./wfc/modules/system
|
||||
dockerfile: dockerfile
|
||||
ports:
|
||||
- "9201:9201"
|
||||
depends_on:
|
||||
- wfc-redis
|
||||
- wfc-mysql
|
||||
links:
|
||||
- wfc-redis
|
||||
- wfc-mysql
|
||||
restart: always
|
||||
wfc-modules-user:
|
||||
container_name: wfc-modules-user
|
||||
build:
|
||||
context: ./wfc/modules/user
|
||||
dockerfile: dockerfile
|
||||
ports:
|
||||
- "9204:9204"
|
||||
depends_on:
|
||||
- wfc-redis
|
||||
- wfc-mysql
|
||||
links:
|
||||
- wfc-redis
|
||||
- wfc-mysql
|
||||
restart: always
|
||||
wfc-modules-gen:
|
||||
container_name: wfc-modules-gen
|
||||
build:
|
||||
context: ./wfc/modules/gen
|
||||
dockerfile: dockerfile
|
||||
ports:
|
||||
- "9202:9202"
|
||||
depends_on:
|
||||
- wfc-mysql
|
||||
links:
|
||||
- wfc-mysql
|
||||
restart: always
|
||||
wfc-modules-job:
|
||||
container_name: wfc-modules-job
|
||||
build:
|
||||
context: ./wfc/modules/job
|
||||
dockerfile: dockerfile
|
||||
ports:
|
||||
- "9203:9203"
|
||||
depends_on:
|
||||
- wfc-mysql
|
||||
links:
|
||||
- wfc-mysql
|
||||
restart: always
|
||||
wfc-modules-file:
|
||||
container_name: wfc-modules-file
|
||||
build:
|
||||
context: ./wfc/modules/file
|
||||
dockerfile: dockerfile
|
||||
ports:
|
||||
- "9300:9300"
|
||||
volumes:
|
||||
- ./wfc/upload:/home/wfc/upload
|
||||
restart: always
|
||||
wfc-modules-payment:
|
||||
container_name: wfc-modules-payment
|
||||
build:
|
||||
context: ./wfc/modules/payment
|
||||
dockerfile: dockerfile
|
||||
ports:
|
||||
- "9306:9306"
|
||||
depends_on:
|
||||
- wfc-mysql
|
||||
links:
|
||||
- wfc-mysql
|
||||
restart: always
|
||||
wfc-visual-monitor:
|
||||
container_name: wfc-visual-monitor
|
||||
build:
|
||||
context: ./wfc/visual/monitor
|
||||
dockerfile: dockerfile
|
||||
ports:
|
||||
- "9100:9100"
|
||||
restart: always
|
||||
wfc-nginx:
|
||||
container_name: wfc-nginx
|
||||
image: nginx
|
||||
build:
|
||||
context: ./nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- ./nginx/html/dist:/home/wfc/portal
|
||||
- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
|
||||
- ./nginx/logs:/var/log/nginx
|
||||
- ./nginx/conf.d:/etc/nginx/conf.d
|
||||
depends_on:
|
||||
- wfc-gateway
|
||||
links:
|
||||
- wfc-gateway
|
||||
restart: always
|
||||
1
build/docker/mysql/db/readme.txt
Normal file
1
build/docker/mysql/db/readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>sqlĿ¼<EFBFBD>µ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>нű<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD>Զ<EFBFBD>ִ<EFBFBD>С<EFBFBD>
|
||||
7
build/docker/mysql/dockerfile
Normal file
7
build/docker/mysql/dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
# 基础镜像
|
||||
FROM mysql:5.7
|
||||
# author
|
||||
MAINTAINER wfc
|
||||
|
||||
# 执行sql脚本
|
||||
ADD ./db/*.sql /docker-entrypoint-initdb.d/
|
||||
33
build/docker/nacos/conf/application.properties
Normal file
33
build/docker/nacos/conf/application.properties
Normal file
@@ -0,0 +1,33 @@
|
||||
spring.datasource.platform=mysql
|
||||
db.num=1
|
||||
db.url.0=jdbc:mysql://wfc-mysql:3306/wfc_config_db?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
|
||||
db.user=root
|
||||
db.password=123456
|
||||
|
||||
nacos.naming.empty-service.auto-clean=true
|
||||
nacos.naming.empty-service.clean.initial-delay-ms=50000
|
||||
nacos.naming.empty-service.clean.period-time-ms=30000
|
||||
nacos.server.ip=${NACOS_SERVER_ADDR}
|
||||
|
||||
management.endpoints.web.exposure.include=*
|
||||
|
||||
management.metrics.export.elastic.enabled=false
|
||||
management.metrics.export.influx.enabled=false
|
||||
|
||||
server.tomcat.accesslog.enabled=true
|
||||
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
|
||||
|
||||
server.tomcat.basedir=/home/wfc/nacos/tomcat/logs
|
||||
|
||||
nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
|
||||
|
||||
nacos.core.auth.system.type=nacos
|
||||
nacos.core.auth.enabled=false
|
||||
nacos.core.auth.default.token.expire.seconds=18000
|
||||
nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||
nacos.core.auth.caching.enabled=true
|
||||
nacos.core.auth.enable.userAgentAuthWhite=false
|
||||
nacos.core.auth.server.identity.key=serverIdentity
|
||||
nacos.core.auth.server.identity.value=security
|
||||
|
||||
nacos.istio.mcp.server.enabled=false
|
||||
7
build/docker/nacos/dockerfile
Normal file
7
build/docker/nacos/dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
# 基础镜像
|
||||
FROM nacos/nacos-server
|
||||
# author
|
||||
MAINTAINER wfc
|
||||
|
||||
# 复制conf文件到路径
|
||||
COPY ./conf/application.properties /home/nacos/conf/application.properties
|
||||
55
build/docker/nginx/conf/nginx.conf
Normal file
55
build/docker/nginx/conf/nginx.conf
Normal file
@@ -0,0 +1,55 @@
|
||||
worker_processes 1;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location /sys {
|
||||
root /home/wfc/portal;
|
||||
try_files $uri $uri/ /index.html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location /sys-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://wfc-gateway:8080/;
|
||||
}
|
||||
|
||||
location /u {
|
||||
root /home/wfc/portal;
|
||||
try_files $uri $uri/ /index.html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location /u-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://wfc-gateway:8080/;
|
||||
}
|
||||
|
||||
# 避免actuator暴露
|
||||
if ($request_uri ~ "/actuator") {
|
||||
return 403;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
}
|
||||
}
|
||||
10
build/docker/nginx/dockerfile
Normal file
10
build/docker/nginx/dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
# 基础镜像
|
||||
FROM nginx
|
||||
# author
|
||||
MAINTAINER wfc
|
||||
# 工作目录
|
||||
WORKDIR /home/wfc/portal
|
||||
# 复制conf文件到路径
|
||||
COPY ./conf/nginx.conf /etc/nginx/nginx.conf
|
||||
# 复制html文件到路径
|
||||
COPY ./html /home/wfc/portal
|
||||
3
build/docker/nginx/html/readme.txt
Normal file
3
build/docker/nginx/html/readme.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
1. 目录./sys存放客户平台(sys portal)前端文件
|
||||
2. 目录./u存放用户平台(user portal)前端文件
|
||||
用于nginx自动执行
|
||||
1
build/docker/redis/conf/redis.conf
Normal file
1
build/docker/redis/conf/redis.conf
Normal file
@@ -0,0 +1 @@
|
||||
# requirepass 123456
|
||||
13
build/docker/redis/dockerfile
Normal file
13
build/docker/redis/dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
# 基础镜像
|
||||
FROM redis
|
||||
# author
|
||||
MAINTAINER wfc
|
||||
|
||||
# 挂载目录
|
||||
VOLUME /home/wfc/redis
|
||||
# 创建目录
|
||||
RUN mkdir -p /home/wfc/redis
|
||||
# 指定路径
|
||||
WORKDIR /home/wfc/redis
|
||||
# 复制conf文件到路径
|
||||
COPY ./conf/redis.conf /home/wfc/redis/redis.conf
|
||||
15
build/docker/wfc/auth/dockerfile
Normal file
15
build/docker/wfc/auth/dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER wfc
|
||||
|
||||
# 挂载目录
|
||||
VOLUME /home/wfc
|
||||
# 创建目录
|
||||
RUN mkdir -p /home/wfc
|
||||
# 指定路径
|
||||
WORKDIR /home/wfc
|
||||
# 复制jar文件到路径
|
||||
COPY ./jar/wfc-auth.jar /home/wfc/wfc-auth.jar
|
||||
# 启动认证服务
|
||||
ENTRYPOINT ["java","-jar","wfc-auth.jar"]
|
||||
1
build/docker/wfc/auth/jar/readme.txt
Normal file
1
build/docker/wfc/auth/jar/readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>
|
||||
15
build/docker/wfc/gateway/dockerfile
Normal file
15
build/docker/wfc/gateway/dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER wfc
|
||||
|
||||
# 挂载目录
|
||||
VOLUME /home/wfc
|
||||
# 创建目录
|
||||
RUN mkdir -p /home/wfc
|
||||
# 指定路径
|
||||
WORKDIR /home/wfc
|
||||
# 复制jar文件到路径
|
||||
COPY ./jar/wfc-gateway.jar /home/wfc/wfc-gateway.jar
|
||||
# 启动网关服务
|
||||
ENTRYPOINT ["java","-jar","wfc-gateway.jar"]
|
||||
1
build/docker/wfc/gateway/jar/readme.txt
Normal file
1
build/docker/wfc/gateway/jar/readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>
|
||||
15
build/docker/wfc/modules/file/dockerfile
Normal file
15
build/docker/wfc/modules/file/dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER wfc
|
||||
|
||||
# 挂载目录
|
||||
VOLUME /home/wfc
|
||||
# 创建目录
|
||||
RUN mkdir -p /home/wfc
|
||||
# 指定路径
|
||||
WORKDIR /home/wfc
|
||||
# 复制jar文件到路径
|
||||
COPY ./jar/wfc-modules-file.jar /home/wfc/wfc-modules-file.jar
|
||||
# 启动文件服务
|
||||
ENTRYPOINT ["java","-jar","wfc-modules-file.jar"]
|
||||
1
build/docker/wfc/modules/file/jar/readme.txt
Normal file
1
build/docker/wfc/modules/file/jar/readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>
|
||||
15
build/docker/wfc/modules/gen/dockerfile
Normal file
15
build/docker/wfc/modules/gen/dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER wfc
|
||||
|
||||
# 挂载目录
|
||||
VOLUME /home/wfc
|
||||
# 创建目录
|
||||
RUN mkdir -p /home/wfc
|
||||
# 指定路径
|
||||
WORKDIR /home/wfc
|
||||
# 复制jar文件到路径
|
||||
COPY ./jar/wfc-modules-gen.jar /home/wfc/wfc-modules-gen.jar
|
||||
# 启动代码生成服务
|
||||
ENTRYPOINT ["java","-jar","wfc-modules-gen.jar"]
|
||||
1
build/docker/wfc/modules/gen/jar/readme.txt
Normal file
1
build/docker/wfc/modules/gen/jar/readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>
|
||||
15
build/docker/wfc/modules/job/dockerfile
Normal file
15
build/docker/wfc/modules/job/dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER wfc
|
||||
|
||||
# 挂载目录
|
||||
VOLUME /home/wfc
|
||||
# 创建目录
|
||||
RUN mkdir -p /home/wfc
|
||||
# 指定路径
|
||||
WORKDIR /home/wfc
|
||||
# 复制jar文件到路径
|
||||
COPY ./jar/wfc-modules-job.jar /home/wfc/wfc-modules-job.jar
|
||||
# 启动定时任务服务
|
||||
ENTRYPOINT ["java","-jar","wfc-modules-job.jar"]
|
||||
1
build/docker/wfc/modules/job/jar/readme.txt
Normal file
1
build/docker/wfc/modules/job/jar/readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD>Ŷ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>
|
||||
15
build/docker/wfc/modules/payment/dockerfile
Normal file
15
build/docker/wfc/modules/payment/dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
LABEL org.wfc.image.authors="wfc@wfc.org"
|
||||
|
||||
# 挂载目录
|
||||
VOLUME /home/wfc
|
||||
# 创建目录
|
||||
RUN mkdir -p /home/wfc
|
||||
# 指定路径
|
||||
WORKDIR /home/wfc
|
||||
# 复制jar文件到路径
|
||||
COPY ./jar/wfc-modules-payment.jar /home/wfc/wfc-modules-payment.jar
|
||||
# 启动系统服务
|
||||
ENTRYPOINT ["java","-jar","wfc-modules-payment.jar"]
|
||||
1
build/docker/wfc/modules/payment/jar/readme.txt
Normal file
1
build/docker/wfc/modules/payment/jar/readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>
|
||||
15
build/docker/wfc/modules/system/dockerfile
Normal file
15
build/docker/wfc/modules/system/dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER wfc
|
||||
|
||||
# 挂载目录
|
||||
VOLUME /home/wfc
|
||||
# 创建目录
|
||||
RUN mkdir -p /home/wfc
|
||||
# 指定路径
|
||||
WORKDIR /home/wfc
|
||||
# 复制jar文件到路径
|
||||
COPY ./jar/wfc-modules-system.jar /home/wfc/wfc-modules-system.jar
|
||||
# 启动系统服务
|
||||
ENTRYPOINT ["java","-jar","wfc-modules-system.jar"]
|
||||
1
build/docker/wfc/modules/system/jar/readme.txt
Normal file
1
build/docker/wfc/modules/system/jar/readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>
|
||||
15
build/docker/wfc/modules/user/dockerfile
Normal file
15
build/docker/wfc/modules/user/dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER wfc
|
||||
|
||||
# 挂载目录
|
||||
VOLUME /home/wfc
|
||||
# 创建目录
|
||||
RUN mkdir -p /home/wfc
|
||||
# 指定路径
|
||||
WORKDIR /home/wfc
|
||||
# 复制jar文件到路径
|
||||
COPY ./jar/wfc-modules-user.jar /home/wfc/wfc-modules-user.jar
|
||||
# 启动系统服务
|
||||
ENTRYPOINT ["java","-jar","wfc-modules-user.jar"]
|
||||
1
build/docker/wfc/modules/user/jar/readme.txt
Normal file
1
build/docker/wfc/modules/user/jar/readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>
|
||||
15
build/docker/wfc/visual/monitor/dockerfile
Normal file
15
build/docker/wfc/visual/monitor/dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER wfc
|
||||
|
||||
# 挂载目录
|
||||
VOLUME /home/wfc
|
||||
# 创建目录
|
||||
RUN mkdir -p /home/wfc
|
||||
# 指定路径
|
||||
WORKDIR /home/wfc
|
||||
# 复制jar文件到路径
|
||||
COPY ./jar/wfc-visual-monitor.jar /home/wfc/wfc-visual-monitor.jar
|
||||
# 启动系统服务
|
||||
ENTRYPOINT ["java","-jar","wfc-visual-monitor.jar"]
|
||||
1
build/docker/wfc/visual/monitor/jar/readme.txt
Normal file
1
build/docker/wfc/visual/monitor/jar/readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD>ż<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>
|
||||
14
build/systemd/system/wfccontrol.service
Normal file
14
build/systemd/system/wfccontrol.service
Normal file
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=WANFi Controller Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
WorkingDirectory=/opt/wfc/docker
|
||||
ExecStart=/opt/wfc/bin/wfccontrol.sh start
|
||||
ExecStop=/opt/wfc/bin/wfccontrol.sh stop
|
||||
TimeoutStartSec=0
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
8
debbuild/DEBIAN/control
Normal file
8
debbuild/DEBIAN/control
Normal file
@@ -0,0 +1,8 @@
|
||||
Package: WFC
|
||||
Version: 1.0.2-YYYYMMDD
|
||||
Section: WFC
|
||||
Prioritt: optional
|
||||
Architecture: amd64
|
||||
Maintainer: wfc
|
||||
Depends:
|
||||
Description: WANFi Controller
|
||||
94
debbuild/DEBIAN/postinst
Normal file
94
debbuild/DEBIAN/postinst
Normal file
@@ -0,0 +1,94 @@
|
||||
# !/bin/bash
|
||||
|
||||
WFCRootDir=/opt/wfc
|
||||
SystemdRootDir=/usr/lib/systemd/system
|
||||
WFCEtcDir=${WFCRootDir}/etc
|
||||
FERootDir=${WFCRootDir}/nginx/html/dist
|
||||
wfcBinDir=${WFCRootDir}/bin
|
||||
UsrLocalBinDir=/usr/local/bin
|
||||
wfcDaemon=wfcd
|
||||
NginxEtcDir=/etc/nginx
|
||||
NginxConfDir=${NginxEtcDir}/conf.d
|
||||
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml wfc.conf"
|
||||
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
||||
|
||||
echo ""
|
||||
echo "* To start/stop/restart/status wfc service, please run:"
|
||||
echo " sudo systemctl start/stop/restart/status restagent.service"
|
||||
echo " or run: "
|
||||
echo " sudo /usr/local/wfc/bin/wfcsvc.sh start/stop/restart/status"
|
||||
echo ""
|
||||
|
||||
chmod +rx ${WFCRootDir}/bin/*
|
||||
chmod +rx ${WFCRootDir}/*
|
||||
chmod +rx ${UsrLocalBinDir}/*
|
||||
chmod -R 755 ${WFCRootDir}/htdocs/front
|
||||
|
||||
for CFile in ${CFileList}; do
|
||||
if [ ! -e "${WFCEtcDir}/${CFile}" ]; then
|
||||
cp -f ${WFCEtcDir}/default/${CFile} ${WFCEtcDir}
|
||||
else
|
||||
# mv -f ${WFCEtcDir}/${CFile} ${WFCEtcDir}/${CFile}.bak
|
||||
# cp -f ${WFCEtcDir}/default/${CFile} ${WFCEtcDir}
|
||||
if [ -e "${WFCBinDir}/upgconf.sh" ]; then
|
||||
${WFCBinDir}/upgconf.sh
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -e "${FERootDir}/config.js" ]; then
|
||||
cp ${FERootDir}/default/config.js ${FERootDir};
|
||||
fi
|
||||
|
||||
for LogoFile in ${LogoFileList}; do
|
||||
if [ ! -e "${WFCStaticDir}/logo/${LogoFile}" ]; then
|
||||
cp ${WFCStaticDir}/wfc.d/logo/${LogoFile} ${WFCStaticDir}/logo;
|
||||
fi
|
||||
done
|
||||
|
||||
if ! id -u wfc >/dev/null 2>&1 ; then
|
||||
useradd -d /opt/wfc -m -s /bin/bash -pwfc123 wfc;
|
||||
mkdir -p /opt/wfc/ftp
|
||||
else
|
||||
echo "user wfc exist";
|
||||
fi
|
||||
|
||||
if [ ! -e "${NginxConfDir}/wfc.conf" ]; then
|
||||
mkdir -p ${NginxConfDir}
|
||||
cp -f ${WFCEtcDir}/nginx/wfc.conf ${NginxConfDir};
|
||||
fi
|
||||
|
||||
systemctl daemon-reload
|
||||
|
||||
# disable auto upgrade
|
||||
systemctl disable --now unattended-upgrades
|
||||
|
||||
systemctl enable restagent.service
|
||||
systemctl enable crontask.service
|
||||
systemctl enable sshsvc.service
|
||||
systemctl enable captrace.service
|
||||
|
||||
systemctl daemon-reload
|
||||
|
||||
# read environment parameter and to do
|
||||
if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
|
||||
echo "M parameter: $M_PARAM"
|
||||
if [ -n "$C_PARAM" ]; then
|
||||
echo "C parameter: $C_PARAM"
|
||||
${WFCRootDir}/bin/setwfc.sh -m $M_PARAM -c $C_PARAM
|
||||
else
|
||||
${WFCRootDir}/bin/setwfc.sh -m $M_PARAM
|
||||
fi
|
||||
# exit while failed to run setwfc.sh
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "setwfc.sh execution failed. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -n "Starting WFC service ... "
|
||||
systemctl start crontask.service
|
||||
systemctl start sshsvc.service
|
||||
systemctl start captrace.service
|
||||
systemctl start restagent.service
|
||||
echo "done"
|
||||
23
debbuild/DEBIAN/postrm
Normal file
23
debbuild/DEBIAN/postrm
Normal file
@@ -0,0 +1,23 @@
|
||||
# !/bin/bash
|
||||
|
||||
#rm -rf /usr/local/omc
|
||||
rm -rf /etc/nginx/conf.d/omc.conf
|
||||
rm -f /usr/local/bin/omcd
|
||||
|
||||
systemctl daemon-reload
|
||||
|
||||
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
||||
echo -n "Stopping OMC service ... "
|
||||
systemctl stop restagent.service
|
||||
systemctl stop crontask.service
|
||||
systemctl stop sshsvc.service
|
||||
systemctl stop captrace.service
|
||||
echo "done"
|
||||
fi
|
||||
|
||||
systemctl disable restagent.service
|
||||
systemctl disable crontask.service
|
||||
systemctl disable sshsvc.service
|
||||
systemctl disable captrace.service
|
||||
|
||||
systemctl daemon-reload
|
||||
16
debbuild/DEBIAN/preinst
Normal file
16
debbuild/DEBIAN/preinst
Normal file
@@ -0,0 +1,16 @@
|
||||
# !/bin/bash
|
||||
|
||||
systemctl daemon-reload
|
||||
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
||||
echo -n "Stopping WFC service ... "
|
||||
systemctl stop restagent.service
|
||||
echo "done"
|
||||
fi
|
||||
|
||||
FERootDir=/usr/local/omc/htdocs/front
|
||||
|
||||
# apt-get install zip
|
||||
# clear front-end old hash js files
|
||||
rm -rf ${FERootDir}/assets
|
||||
rm -rf ${FERootDir}/js
|
||||
rm -rf ${FERootDir}/index.*.js
|
||||
1
release/debs/readme.txt
Normal file
1
release/debs/readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
deb package is here
|
||||
1
release/tars/readme.txt
Normal file
1
release/tars/readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
tar.gz package is here
|
||||
Reference in New Issue
Block a user