From 4d989814853e21ffec00d0b136655d75882ed02a Mon Sep 17 00:00:00 2001 From: isummer Date: Sun, 21 Aug 2022 22:07:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=B9=E5=99=A8=E9=83=A8=E7=BD=B2=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker.md | 3 ++- docker/flyapps/docker-compose.yml | 2 ++ docker/init/clean.sh | 2 +- docker/init/init.sh | 3 ++- fir_admin/src/views/login/index.vue | 2 +- nginx.conf.d/flyapps-vhost.conf | 41 +++++++++++++++++++++++++++++ 6 files changed, 49 insertions(+), 4 deletions(-) diff --git a/docker.md b/docker.md index 50e4914..bde16a4 100644 --- a/docker.md +++ b/docker.md @@ -71,4 +71,5 @@ docker exec -it flyapps python manage.py createsuperuser ``` ##### 测试访问 -在浏览器输入自己配置的域名 https://app.hehelucky.cn/ 进行访问 \ No newline at end of file +- 在浏览器输入自己配置的域名 https://app.hehelucky.cn/ 进行访问 +- 管理后台访问 https://app.hehelucky.cn:3448/ 进行访问 \ No newline at end of file diff --git a/docker/flyapps/docker-compose.yml b/docker/flyapps/docker-compose.yml index 7fd345b..1d47bb1 100644 --- a/docker/flyapps/docker-compose.yml +++ b/docker/flyapps/docker-compose.yml @@ -34,12 +34,14 @@ services: - /etc/localtime:/etc/localtime:ro - ../../data/web:/data - ../../nginx.conf.d:/etc/nginx/conf.d + - ../../data/logs/nginx:/var/log/nginx networks: flyapps: ipv4_address: 172.31.31.200 ports: - 80:80 - 443:443 + - 3448:3448 external_links: - flyapps:flyapps depends_on: diff --git a/docker/init/clean.sh b/docker/init/clean.sh index 569ec2a..c38b099 100644 --- a/docker/init/clean.sh +++ b/docker/init/clean.sh @@ -2,7 +2,7 @@ # # -for i in nginx flyapps mariadb redis buildclient buildshort buildadmin;do echo $i;docker rm -f $i;done +for i in nginx flyapps mariadb redis buildclient buildshort buildadmin build-buildflyapps-1;do echo $i;docker rm -f $i;done docker network rm flyapps diff --git a/docker/init/init.sh b/docker/init/init.sh index 299e32b..e716c6c 100644 --- a/docker/init/init.sh +++ b/docker/init/init.sh @@ -14,7 +14,8 @@ if [ $? -ne 0 ];then fi data_path="$(dirname $(dirname `pwd`))/data" -mkdir -pv ${data_path}/{flyapps,web,mariadb,redis,logs/{mariadb,nginx,flyapps}} +mkdir -pv ${data_path}/{flyapps/files,web,mariadb,redis,logs/{mariadb,nginx,flyapps}} +\cp $(dirname $(dirname `pwd`))/fir_ser/files/head_img.jpeg ${data_path}/flyapps/files/ 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 diff --git a/fir_admin/src/views/login/index.vue b/fir_admin/src/views/login/index.vue index a454a50..328a586 100644 --- a/fir_admin/src/views/login/index.vue +++ b/fir_admin/src/views/login/index.vue @@ -66,7 +66,7 @@ export default { } } const validatePassword = (rule, value, callback) => { - if (value.length < 6) { + if (value.length < 3) { callback(new Error('The password can not be less than 6 digits')) } else { callback() diff --git a/nginx.conf.d/flyapps-vhost.conf b/nginx.conf.d/flyapps-vhost.conf index 03f50f7..a70975d 100644 --- a/nginx.conf.d/flyapps-vhost.conf +++ b/nginx.conf.d/flyapps-vhost.conf @@ -71,4 +71,45 @@ server error_log off; access_log /dev/null; } + access_log /var/log/nginx/flyapps_access.log; + error_log /var/log/nginx/flyapps_error.log; + } + +server +{ + listen 3448 ssl http2; + server_name app.hehelucky.cn; + index index.html index.htm default.htm default.html; + root /data/fir_admin; + + ssl_certificate /etc/nginx/conf.d/app.hehelucky.cn.pem; + ssl_certificate_key /etc/nginx/conf.d/app.hehelucky.cn.key; + ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; + ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; + ssl_prefer_server_ciphers on; + ssl_session_cache shared:SSL:10m; + ssl_session_timeout 10m; + error_page 497 https://$host$request_uri; + + location ~ ^/(api|flower) { + uwsgi_send_timeout 300; # 指定向uWSGI传送请求的超时时间,完成握手后向uWSGI传送请求的超时时间。 + uwsgi_connect_timeout 300; # 指定连接到后端uWSGI的超时时间。 + uwsgi_read_timeout 300; # 指定接收uWSGI应答的超时时间,完成握手后接收uWSGI应答的超时时间。 + include uwsgi_params; + uwsgi_pass flyapps:8898; + uwsgi_param UWSGI_SCRIPT wsgi; + } + + + + location / { + + } + + + access_log /var/log/nginx/fadmin_access.log; + error_log /var/log/nginx/fadmin_error.log; + +} +