优化docker部署方式

pull/26/merge
isummer 2 years ago
parent 42478f21d9
commit 6439824468
  1. 2
      .gitignore
  2. 34
      README.md
  3. 12
      build.sh
  4. 7
      build_client.sh
  5. 59
      docker.md
  6. 67
      docker/build/docker-compose.yml
  7. 45
      docker/flyapps/docker-compose.yml
  8. 9
      docker/init/clean.sh
  9. 27
      docker/init/init.sh
  10. 1
      docker/init/timezone
  11. 43
      docker/mariadb/docker-compose.yml
  12. 108
      docker/mariadb/server.cnf
  13. 25
      docker/redis/docker-compose.yml
  14. 13
      docker/scripts/build.sh
  15. 9
      docker/scripts/start_all.sh
  16. 10
      docker/scripts/stop_all.sh
  17. 2
      fir_admin/.env.production
  18. 1
      fir_client/package.json
  19. 3
      fir_client/src/components/FirLogin.vue
  20. 4
      fir_client/src/components/user/FirSuperSignBase.vue
  21. 20
      fir_client/src/restful/download.js
  22. 72
      fir_client/src/restful/index.js
  23. 2
      fir_client/src/utils/index.js
  24. 47
      fir_client/vue.config.js
  25. 2
      fir_ser/api/management/commands/services/command.py
  26. 5
      fir_ser/config.py
  27. 4
      nginx.conf.d/flyapps-vhost.conf
  28. 41
      start.sh

2
.gitignore vendored

@ -12,3 +12,5 @@ fir_client/src/assets/down_right.png
mailhtml/build/
mailhtml/node_modules/
mailhtml/.idea/
fir_client/dist_index/
fir_client/dist_short/

@ -30,6 +30,40 @@
- 需要阿里云OSS存储和阿里云CDN,并且OSS存储和阿里云服务器部署同一个地区
- 可以申请一个极验进行滑动验证,或者开启验证码验证
- 阿里云备案域名:api和前端可以使用一个域名,下载页单独域名
#### 部署必备资料
- 域名证书
- web域名和证书
- api域名和证书
- 下载页域名(可配置证书)
- 存储域名和证书
- 本地存储,则该域名和证书可以和api域名证书一致
- 阿里云oss存储
- 开启cdn,需要新域名和证书
- 不开启,无需域名和证书
- Centos8Stream 服务器
#### 修改配置文件
##### fir_ser配置文件 config.py
```python
class DOMAINCONF(object):
API_DOMAIN = "https://app.hehelucky.cn" # 用与开启本地存储,上传应用配置
WEB_DOMAIN = "https://app.hehelucky.cn" # 用于超级签跳转配置,该域名一般为前端页面域名
MOBILEPROVISION = "https://static.hehejoy.cn/embedded3.mobileprovision" # 用于苹果包企业签信任企业跳转
```
##### fir_client配置文件 vue.confjg.js
```javascript
const pro_base_env = {
baseUrl: '/', //该选项可以填写web-api的域名,类似 https://api.xxx.com/
index_static: '/', //若配置cdn等加速,可以填写cdn加速域名
baseShortUrl: '/', //该选项可以填写short-api的域名,也可以和web-api域名一样,类似 https://api.xxx.com/
short_static: '/short/', //若配置cdn等加速,可以填写cdn加速域名
version: version,
};
```
##### 从git上面下载源码
```shell
cd /data/

@ -1,12 +0,0 @@
#!/bin/bash
#
#
# shellcheck disable=SC2006
s_path=`pwd`
#first build fir_client
docker pull node:14.17.3
\cp -a build_client.sh fir_client/
docker run --rm --privileged=true -v "${s_path}"/fir_client:/fir_client -it node:14.17.3 sh /fir_client/build_client.sh
cd "${s_path}"/fir_ser/ && docker build . -t flyapps

@ -1,7 +0,0 @@
#!/bin/bash
#
#
cd /fir_client/ && yarn config set registry https://registry.npm.taobao.org && yarn install && yarn build

@ -4,48 +4,65 @@ cd /data/
git clone https://github.com/nineaiyu/FlyApps
```
#### docker环境安装 [centos7]
#### docker环境安装 [centos8]
```
yum install epel-release -y
yum clean all && yum makecache
yum install docker -y
cd /data/FlyApps/docker/init
sh init.sh
```
#### 域名证书准备
- 域名: app.hehelucky.cn
- 证书(nginx)
- app.hehelucky.cn.key
- app.hehelucky.cn.pem
#### 配置域名和证书,如果有cdn或者oss,也要进行配置
```shell script
nginx.conf.d/app.hehelucky.cn.key
nginx.conf.d/app.hehelucky.cn.pem
nginx.conf.d/flyapps-vhost.conf
```
### api服务需要修改api和web域名,短信,邮箱,geetest,存储等信息
```shell script
vim fir_ser/config.py
API_DOMAIN = "https://app.hehelucky.cn"
WEB_DOMAIN = "https://app.hehelucky.cn"
MOBILEPROVISION = "https://ali-static.jappstore.com/embedded.mobileprovision"
#### api服务需要修改api和web域名,短信,邮箱,geetest,存储等信息
##### fir_ser配置文件 config.py
```python
class DOMAINCONF(object):
API_DOMAIN = "https://app.hehelucky.cn" # 用与开启本地存储,上传应用配置
WEB_DOMAIN = "https://app.hehelucky.cn" # 用于超级签跳转配置,该域名一般为前端页面域名
```
### web页面需要修改指定api域名
```vuejs
vim fir_client/vue.config.js
##### fir_client配置文件 vue.confjg.js
```javascript
const pro_base_env = {
baseUrl: 'https://flyapps.cn',
index_static: 'https://static.flyapps.cn/index/',
baseShortUrl: 'https://flyapps.top',
short_static: 'https://static.flyapps.top/short/',
baseUrl: '/', //该选项可以填写web-api的域名,类似 https://api.xxx.com/
index_static: '/', //若配置cdn等加速,可以填写cdn加速域名
baseShortUrl: '/', //该选项可以填写short-api的域名,也可以和web-api域名一样,类似 https://api.xxx.com/
short_static: '/short/', //若配置cdn等加速,可以填写cdn加速域名
version: version,
};
```
##### 构建静态资源和api服务
```
cd /data/FlyApps/docker/scripts
sh build.sh
```
##### 启动所有服务
```
sh start.sh
cd /data/FlyApps/docker/scripts
sh start_all.sh
```
##### 关闭所有服务
```
cd /data/FlyApps/docker/scripts
sh stop_all.sh
```
##### 根据提示创建默认管理用户
```shell
docker exec -it flyapps python manage.py createsuperuser
```
##### 测试访问
在浏览器输入自己配置的域名 https://app.hehelucky.cn/ 进行访问

@ -0,0 +1,67 @@
version: '3.2'
services:
buildflyapps:
image: 'flyapps'
build:
context: ../../fir_ser
dockerfile: Dockerfile
command:
- echo
- success
buildclient:
container_name: buildclient
image: 'node:14.17.3'
working_dir: /fir_client
volumes:
- /etc/localtime:/etc/localtime:ro
- ../../fir_client:/fir_client
- ../../data/web/:/web
command:
- bash
- -c
- yarn config set registry https://registry.npm.taobao.org && yarn install && yarn build index && yarn build short && ([ ! -e /web/fir_client ] && \cp -a dist_index /web/fir_client || \cp -a dist_index/* /web/fir_client/) && ([ ! -e /web/fir_client/short ] && \cp -a dist_short /web/fir_client/short || \cp -a dist_short/* /web/fir_client/short/) && echo build success
buildindex:
container_name: buildindex
image: 'node:14.17.3'
working_dir: /fir_client
volumes:
- /etc/localtime:/etc/localtime:ro
- ../../fir_client:/fir_client
- ../../data/web/:/web
command:
- bash
- -c
- yarn config set registry https://registry.npm.taobao.org && yarn install && yarn build index && ([ ! -e /web/fir_client ] && \cp -a dist_index /web/fir_client || \cp -a dist_index/* /web/fir_client/) && echo build success
buildshort:
container_name: buildshort
image: 'node:14.17.3'
working_dir: /fir_client
volumes:
- /etc/localtime:/etc/localtime:ro
- ../../fir_client:/fir_client
- ../../data/web/:/web
command:
- sh
- -c
- yarn config set registry https://registry.npm.taobao.org && yarn install && yarn build short && ([ ! -e /web/fir_short ] && \cp -a dist_short /web/fir_short || \cp -a dist_short/* /web/fir_short/) && echo build success
buildadmin:
container_name: buildadmin
image: 'node:14.17.3'
working_dir: /fir_admin
volumes:
- /etc/localtime:/etc/localtime:ro
- ../../fir_admin:/fir_admin
- ../../data/web/:/web
command:
- sh
- -c
- yarn config set registry https://registry.npm.taobao.org && yarn install && yarn build:prod && ([ ! -e /web/fir_admin ] && \cp -a dist /web/fir_admin || \cp -a dist/* /web/fir_admin/) && echo build success

@ -0,0 +1,45 @@
version: '3'
networks:
flyapps:
external: true
name: flyapps
services:
flyapps:
container_name: flyapps
restart: always
image: 'flyapps'
working_dir: /data/fir_ser
volumes:
- /etc/localtime:/etc/localtime:ro
- ../../fir_ser:/data/fir_ser
- ../../data/flyapps/files:/data/fir_ser/files
- ../../data/logs/flyapps/:/data/fir_ser/logs
- ../../data/flyapps/supersign/:/data/fir_ser/supersign
networks:
flyapps:
ipv4_address: 172.31.31.100
external_links:
- mariadb:mariadb
- redis:redis
sysctls:
- net.core.somaxconn=4096
nginx:
container_name: nginx
restart: always
image: 'nginx:1.21.3'
volumes:
- /etc/localtime:/etc/localtime:ro
- ../../data/web:/data
- ../../nginx.conf.d:/etc/nginx/conf.d
networks:
flyapps:
ipv4_address: 172.31.31.200
ports:
- 80:80
- 443:443
external_links:
- flyapps:flyapps
depends_on:
- flyapps

@ -0,0 +1,9 @@
#!/bin/bash
#
#
for i in flyapps mariadb redis buildclient buildshort buildadmin;do echo $i;docker rm -f $i;done
docker network rm flyapps

@ -0,0 +1,27 @@
#!/bin/bash
#
#
which dockerd
if [ $? -ne 0 ];then
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
dnf install docker-ce -y
fi
which docker-compose
if [ $? -ne 0 ];then
curl -L https://get.daocloud.io/docker/compose/releases/download/v2.5.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
fi
data_path="$(dirname $(dirname `pwd`))/data"
mkdir -pv ${data_path}/{flyapps,web,mariadb,redis,logs/{mariadb,nginx,flyapps}}
chown 1001.1001 -R ${data_path}/{flyapps,web,mariadb,redis,logs/{mariadb,nginx,flyapps}}
systemctl start docker && docker network create flyapps --driver bridge --subnet=172.31.31.0/24
systemctl enable docker
systemctl status docker
#docker pull 'bitnami/mariadb:10.7.3'
#docker pull 'bitnami/redis:6.2.7'
#docker pull 'nginx:1.21.3'
#docker pull 'node:14.17.3'

@ -0,0 +1 @@
Asia/Shanghai

@ -0,0 +1,43 @@
version: '3.2'
networks:
flyapps:
external: true
name: flyapps
services:
mariadb:
image: bitnami/mariadb:10.7.3
container_name: mariadb
restart: always
environment:
- MARIADB_ROOT_PASSWORD=rootIPD.xx2.19
- MARIADB_DATABASE=flyappnew
- MARIADB_USER=flyuser
- MARIADB_PASSWORD=KGzKjZpWBp4R4RSa
#- ALLOW_EMPTY_PASSWORD=yes
- MARIADB_ENABLE_SLOW_QUERY=1
- MARIADB_LONG_QUERY_TIME=3
- MARIADB_SKIP_TEST_DB=yes
- MARIADB_EXTRA_FLAGS=--max-connect-errors=3000 --max_connections=30000
ports:
- 3306:3306
networks:
flyapps:
ipv4_address: 172.31.31.90
volumes:
- ../init/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- ../../data/mariadb:/bitnami/mariadb/data
- ../../data/logs/mariadb:/data/logs/mariadb
- ./server.cnf:/opt/bitnami/mariadb/conf/my_custom.cnf:ro
# adminer:
# image: adminer
# ports:
# - 8080:8080
# networks:
# - fungame

@ -0,0 +1,108 @@
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is only for the mysqld standalone daemon
[mysqld]
binlog_cache_size = 192K
thread_stack = 384K
join_buffer_size = 4096K
query_cache_type = 1
max_heap_table_size = 1024M
default_storage_engine = InnoDB
performance_schema_max_table_instances = 400
table_definition_cache = 400
skip-external-locking
key_buffer_size = 512M
max_allowed_packet = 1G
table_open_cache = 1024
sort_buffer_size = 2048K
net_buffer_length = 4K
read_buffer_size = 2048K
read_rnd_buffer_size = 1024K
myisam_sort_buffer_size = 16M
thread_cache_size = 192
query_cache_size = 256M
tmp_table_size = 1024M
sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
max_connections = 30000
max_connect_errors = 1000
open_files_limit = 65535
expire_logs_days = 10
#log_queries_not_using_indexes=on
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_general_ci
init_connect='SET NAMES utf8mb4'
#character-set-server=utf8
skip_name_resolve
event_scheduler=1
#skip-grant-tables
#innodb_data_home_dir = /var/lib/mysql/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql/
#innodb_buffer_pool_size = 1024M
#innodb_log_file_size = 128M
#innodb_log_buffer_size = 32M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
#innodb_max_dirty_pages_pct = 90
#innodb_read_io_threads = 4
#innodb_write_io_threads = 4
#
# Allow server to accept connections on all interfaces.
#
#bind-address=0.0.0.0
#
# this is only for embedded server
# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
#autoset_open_files_limit
#enable_slow_query_log
#audit
plugin_load_add=server_audit
server_audit_logging=on
server_audit_events=connect,query
server_audit=force_plus_permanent
server_audit_events=QUERY_DDL,QUERY_DML,CONNECT
server_audit_output_type=file
server_audit_file_rotate_now=on
server_audit_file_rotations=9
server_audit_file_rotate_size=1G
server_audit_file_path=/data/logs/mariadb
log_error=/data/logs/mariadb/mariadb.err.log
log_output=FILE
slow_query_log
long_query_time=3
slow_query_log_file=/data/logs/mariadb/mariadb-slow.log
log_queries_not_using_indexes=ON #Logging Queries That Don't Use Indexes
#server_id=2
log-bin=/data/logs/mariadb/mysql-bin
# This group is only read by MariaDB-10.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand

@ -0,0 +1,25 @@
version: '3.2'
networks:
flyapps:
external: true
name: flyapps
services:
redis:
image: 'bitnami/redis:6.2.7'
container_name: redis
restart: always
volumes:
- ../init/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- ../../data/redis:/bitnami/redis/data
environment:
#- REDIS_REPLICATION_MODE=master
#- ALLOW_EMPTY_PASSWORD=yes
- REDIS_PASSWORD=nineven
networks:
- flyapps
#ports:
# - 6379:6379

@ -0,0 +1,13 @@
#!/bin/bash
#
#
cd ../build/
for i in buildclient buildadmin;do
docker-compose up ${i}
done
docker-compose build

@ -0,0 +1,9 @@
#!/bin/bash
#
#
cd ../mariadb/ && docker-compose up -d
cd ../redis/ && docker-compose up -d
cd ../flyapps/ && docker-compose up -d

@ -0,0 +1,10 @@
#!/bin/bash
#
#
cd ../flyapps/ && docker-compose down
cd ../redis/ && docker-compose down
cd ../mariadb/ && docker-compose down

@ -2,5 +2,5 @@
ENV = 'production'
# base api
VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = '/api/v3/fir/server'

@ -36,7 +36,6 @@
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"html-webpack-plugin": "^5.3.1",
"image-webpack-loader": "^7.0.1",
"script-ext-html-webpack-plugin": "^2.1.5",
"uglifyjs-webpack-plugin": "^2.2.0",
"vue-template-compiler": "^2.6.10",

@ -125,7 +125,7 @@
</template>
<script>
import {loginFun, set_auth_token, wxLoginFun} from "@/restful";
import {loginFun, wxLoginFun} from "@/restful";
import {geetest} from "@/utils";
import {checkEmail, checkphone, getRandomStr} from "@/utils/base/utils";
@ -177,7 +177,6 @@ export default {
this.$cookies.set("username", data.userinfo.username, 3600 * 24 * 30);
this.$cookies.set("first_name", data.userinfo.first_name, 3600 * 24 * 30);
this.$store.dispatch("doUserinfo", data.userinfo);
set_auth_token();
this.$router.push({name: 'FirApps'})
},
loop_get_wx_info(wx_login_ticket, c_count = 1, unique_key = getRandomStr()) {

@ -1808,7 +1808,7 @@ import {
personalConfigInfo,
signoperatemessage
} from "@/restful";
import {format_choices, getUserInfoFun, removeAaary} from "@/utils";
import {format_choices, getUserInfoFun, removeArray} from "@/utils";
import AppleDeveloperBindApp from "@/components/base/AppleDeveloperBindApp";
import {format_time} from "@/utils/base/utils";
@ -2730,7 +2730,7 @@ export default {
this.pagination.total = data.count;
} else if (action === "DELETE") {
if (scope) {
this.app_udid_lists = removeAaary(this.app_udid_lists, scope.row)
this.app_udid_lists = removeArray(this.app_udid_lists, scope.row)
}
} else if (action === 'POST') {
this.$message.success("操作成功");

@ -1,11 +1,17 @@
import Axios from 'axios'
import {geetestbase} from "@/utils/base/utils";
Axios.defaults.withCredentials = true;
const DOMAIN = process.env.base_env.baseShortUrl;
const APIPATH = '/api/v1/fir/server';
let USERSEVER = DOMAIN + APIPATH;
const USERSEVER = 'api/v1/fir/server';
// create an axios instance
const service = Axios.create({
baseURL: DOMAIN, // url = base url + request url
withCredentials: true, // send cookies when cross-domain requests
timeout: 120000 // request timeout
})
function ErrorMsg(error, callBack) {
if (error && error.response) {
@ -42,7 +48,7 @@ function responseMiddleware(data, callBack) {
function getData(methods = 'GET', url, params = {}, callBack) {
if (methods === "PUT") {
Axios
service
.put(url, params)
.then(function (response) {
responseMiddleware(response.data, callBack);
@ -51,7 +57,7 @@ function getData(methods = 'GET', url, params = {}, callBack) {
ErrorMsg(error, callBack);
});
} else if (methods === 'POST') {
Axios
service
.post(url, params)
.then(function (response) {
responseMiddleware(response.data, callBack);
@ -60,7 +66,7 @@ function getData(methods = 'GET', url, params = {}, callBack) {
ErrorMsg(error, callBack);
});
} else
Axios
service
.get(url, {params: params})
.then(function (response) {
responseMiddleware(response.data, callBack);

@ -4,8 +4,8 @@ import router from "@/router";
import {geetestbase} from "@/utils/base/utils";
const Base64 = require('js-base64').Base64;
Axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
Axios.defaults.withCredentials = true;
// Axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
// Axios.defaults.withCredentials = true;
// Axios.defaults.httpsAgent = new https.Agent({
// keepAlive: true
// });
@ -19,8 +19,14 @@ export function requestAbort() {
console.log("flyapps js version:" + process.env.base_env.version);
const DOMAIN = process.env.base_env.baseUrl;
const APIPATH = '/api/v1/fir/server';
let USERSEVER = DOMAIN + APIPATH;
const USERSEVER = 'api/v1/fir/server';
// create an axios instance
const service = Axios.create({
baseURL: DOMAIN, // url = base url + request url
withCredentials: true, // send cookies when cross-domain requests
timeout: 120000 // request timeout
})
export function convertRes2Blob(response) {
// 提取文件名
@ -53,31 +59,25 @@ export function convertRes2Blob(response) {
}
}
export function set_auth_token() {
Axios.interceptors.request.use(function (config) {
// 在发送请求之前做些什么
if (VueCookies.get('token')) {
// Axios.defaults.headers.common['Authorization'] = localStorage.getItem('access_token');
// console.log(config.headers);
if (VueCookies.get('auth_token')) {
config.headers.Authorization = VueCookies.get('auth_token')
} else {
let token = VueCookies.get('token');
let username = VueCookies.get('username');
VueCookies.set("auth_token", Base64.encode(token + ':' + username), 3600 * 24 * 30);
}
service.interceptors.request.use(config => {
if (VueCookies.get('token')) {
// Axios.defaults.headers.common['Authorization'] = localStorage.getItem('access_token');
// console.log(config.headers);
if (!VueCookies.get('auth_token')) {
let token = VueCookies.get('token');
let username = VueCookies.get('username');
VueCookies.set("auth_token", Base64.encode(token + ':' + username), 3600 * 24 * 30);
}
// 更改加载的样式
return config;
}, function (error) {
// 对请求错误做些什么
return Promise.reject(error);
});
}
config.headers.Authorization = VueCookies.get('auth_token')
}
return config;
}, function (error) {
// 对请求错误做些什么
// eslint-disable-next-line no-console
console.log(error)
return Promise.reject(error);
});
set_auth_token();
function ErrorMsg(error, callBack) {
if (error && error.response) {
@ -141,7 +141,7 @@ function responseMiddleware(data, callBack) {
function getData(methods, url, params = {}, callBack) {
if (methods === "DELETE") {
Axios
service
.delete(url, {params: params, signal: controller.signal})
.then(function (response) {
responseMiddleware(response.data, callBack);
@ -151,7 +151,7 @@ function getData(methods, url, params = {}, callBack) {
});
} else if (methods === "PUT") {
Axios
service
.put(url, params, {signal: controller.signal})
.then(function (response) {
responseMiddleware(response.data, callBack);
@ -161,7 +161,7 @@ function getData(methods, url, params = {}, callBack) {
});
} else if (methods === 'POST') {
Axios
service
.post(url, params, {signal: controller.signal})
.then(function (response) {
responseMiddleware(response.data, callBack);
@ -170,7 +170,7 @@ function getData(methods, url, params = {}, callBack) {
ErrorMsg(error, callBack);
});
} else if (methods === 'FILE') {
Axios
service
.get(url, {params: params, responseType: 'blob', signal: controller.signal})
.then(function (response) {
convertRes2Blob(response)
@ -179,7 +179,7 @@ function getData(methods, url, params = {}, callBack) {
ErrorMsg(error, callBack);
});
} else {
Axios
service
.get(url, {params: params, signal: controller.signal})
.then(function (response) {
responseMiddleware(response.data, callBack);
@ -447,10 +447,10 @@ export function getapppicurl(app_id) {
}
export function getuploadurl(domain_name = null) {
if (domain_name) {
return domain_name + APIPATH + '/upload'
if (domain_name && !domain_name.match('http[s?]:///$')) {
return domain_name + '/' +USERSEVER + '/upload'
} else {
return USERSEVER + '/upload';
return DOMAIN + USERSEVER + '/upload';
}
}
@ -722,7 +722,7 @@ export function geetest(self, uid, params, callback) {
/** 超级签名************************************************相关api */
let SIGNSEVER = DOMAIN + '/api/v1/fir/xsign';
let SIGNSEVER = '/api/v1/fir/xsign';
/** 超级签名--检测该账户是否可开启超级签名 */
export function checkCanSign(callBack, params) {

@ -242,7 +242,7 @@ export function uploadlocalstorage(file, certinfo, app, successcallback, process
}
export function removeAaary(_arr, _obj) {
export function removeArray(_arr, _obj) {
let length = _arr.length;
for (let i = 0; i < length; i++) {
if (_arr[i] == _obj) {

@ -28,6 +28,7 @@ const compress = new CompressionWebpackPlugin(
);
const index = {
outputDir:'dist_index',
// page 的入口
entry: 'src/main.js',
// 模板来源
@ -43,6 +44,7 @@ const index = {
};
// eslint-disable-next-line no-unused-vars
const mshort = {
outputDir:'dist_mshort',
// page 的入口
entry: 'src/main.short.js',
// 模板来源
@ -57,6 +59,7 @@ const mshort = {
chunks: ['chunk-vendors', 'chunk-common', 'mshort', 'chunk-elementUI', 'runtime']
};
const short = {
outputDir:'dist_short',
// page 的入口
entry: 'src/short.js',
// 模板来源
@ -71,32 +74,36 @@ const short = {
chunks: ['chunk-vendors', 'chunk-common', 'short', 'chunk-commons', 'runtime']
};
let pages = {index, short, mshort};
const page = argv[3];
if (page) {
for (const key of Object.keys(pages)) {
if (key === page) {
const tmp = pages[key];
pages = {};
pages[key] = tmp;
}
let outputDir = 'dist'
let page = argv[3];
if (!page) {
page = 'index'
}
for (const key of Object.keys(pages)) {
if (key === page) {
const tmp = pages[key];
pages = {};
pages[key] = tmp;
outputDir = tmp.outputDir
}
}
const version='2.3.8';
const pro_base_env = {
baseUrl: 'https://flyapps.cn',
index_static: 'https://static.flyapps.cn/index/',
baseShortUrl: 'https://flyapps.top',
short_static: 'https://static.flyapps.top/short/',
baseUrl: '/', //该选项可以填写web-api的域名,类似 https://api.xxx.com/
index_static: '/', //若配置cdn等加速,可以填写cdn加速域名
baseShortUrl: '/', //该选项可以填写short-api的域名,也可以和web-api域名一样,类似 https://api.xxx.com/
short_static: '/short/', //若配置cdn等加速,可以填写cdn加速域名
version: version,
};
const dev_base_env = {
baseUrl: 'https://app.hehelucky.cn',
baseShortUrl: 'https://app.hehelucky.cn',
short_static: '/',
baseUrl: 'https://app.hehelucky.cn/',
index_static: '/',
baseShortUrl: 'https://app.hehelucky.cn/',
short_static: 'https://app.hehelucky.cn/short/',
version: version,
};
let base_evn = dev_base_env;
@ -131,9 +138,9 @@ function get_public_path(pages) {
}
let publicPath = get_public_path(pages);
module.exports = {
pages: pages,
outputDir: outputDir,
productionSourceMap: false, //去除生产环境的productionSourceMap
assetsDir: "static", //静态文件存储位置
lintOnSave: true,
@ -248,7 +255,11 @@ module.exports = {
priority: 23, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?ali-oss(.*)/ // in order to adapt to cnpm
},
appinfo: {
name: 'appinfo', // split elementUI into a single package
priority: 23, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?app-info-parser(.*)/ // in order to adapt to cnpm
},
qrcodejs2: {
name: 'qrcodejs2', // split elementUI into a single package
priority: 23, // the weight needs to be larger than libs and app or it will be packaged into libs or app
@ -261,7 +272,7 @@ module.exports = {
},
common: {
name: 'chunk-commons',
test: resolve(resolve('src/components')), // can customize your rules
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true

@ -102,7 +102,7 @@ class BaseActionCommand(BaseCommand):
parser.add_argument('-d', '--daemon', nargs="?", const=True)
parser.add_argument('-up', '--uwsgi_processes', type=int, nargs="?", default=get_sys_process_num())
parser.add_argument('-ut', '--uwsgi_threads', type=int, nargs="?", default=get_sys_thread_num())
parser.add_argument('-cn', '--celery_num', type=int, nargs="?", default=20)
parser.add_argument('-cn', '--celery_num', type=int, nargs="?", default=8)
parser.add_argument('-usm', '--uwsgi_socket_mode', nargs="?", const=True,
help='run to bind socket mode, default http mode, only uwsgi service')
parser.add_argument('-f', '--force', nargs="?", const=True)

@ -28,8 +28,7 @@ class BASECONF(object):
SECRET_KEY = 'j!g@^bc(z(a3*i&kp$_@bgb)bug&^#3=amch!3lz&1x&s6ss6t'
ALLOWED_HOSTS = ['127.0.0.1', 'synchrotron', '172.16.133.34', 'ali.cdn.flyapp.dvcloud.xin',
'api.src.flyapp.dvcloud.xin', 'app.hehelucky.cn']
ALLOWED_HOSTS = ['*']
# When Django start it will bind this host and port
# ./manage.py runserver 127.0.0.1:8080
@ -72,7 +71,7 @@ class DBCONF(object):
port = '3306'
password = 'KGzKjZpWBp4R4RSa'
user = 'flyuser'
name = 'flyappnew'
name = 'flyapps'
class CACHECONF(object):

@ -41,13 +41,13 @@ server
uwsgi_param UWSGI_SCRIPT wsgi;
}
location ~ ^/(index|apps|user|login|register|supersign|home) {
location ~ ^/(index|apps|user|login|register|supersign|home|reset) {
try_files $uri $uri/ /index.html;
}
location / {
try_files $uri $uri/ /short.html;
try_files $uri $uri/ /short/short.html;
}

@ -1,41 +0,0 @@
#!/bin/bash
#
#
# shellcheck disable=SC2006
s_path=`pwd`
docker network create flyapps
docker run --net flyapps --name redis -d redis:6.2.5 redis-server --requirepass nineven --bind '0.0.0.0'
docker run --net flyapps --name mariadb -e MARIADB_ROOT_PASSWORD=root -v "${s_path}"/data/mysql:/var/lib/mysql -d mariadb:10.5
sleep 3
code=1
count=1
while [ ${code} -ne 0 ];do
docker exec -it mariadb mysql -proot -e 'show databases;'
code=$?
((count+=1))
if [ "$count" -gt 30 ];then
echo "30s away, but mysql service is not available"
exit 1
fi
sleep 2
echo "check whether mysql service is ready..."
done
docker exec -it mariadb mysql -proot -e 'create database flyappnew default character set utf8 COLLATE utf8_general_ci;'
docker exec -it mariadb mysql -proot -e "grant all on flyappnew.* to flyuser@'%' identified by 'KGzKjZpWBp4R4RSa';"
docker run --sysctl net.core.somaxconn=4096 --net flyapps \
-v "${s_path}"/fir_ser:/data/fir_ser \
-v "${s_path}"/data/files:/data/fir_ser/files \
-v "${s_path}"/data/supersign:/data/fir_ser/supersign \
--name flyapps -d flyapps
docker run --net flyapps --name nginx -d -p 80:80 -p 443:443 \
-v "${s_path}"/fir_client/dist:/data/fir_client \
-v "${s_path}"/nginx.conf.d:/etc/nginx/conf.d nginx:1.21.3
Loading…
Cancel
Save