Forráskód Böngészése

修复ai相关接口放行
修复打包启动脚本运行环境

kindring 2 éve
szülő
commit
502cbfcfd5

+ 1 - 1
package/mysqlDocker/Dockerfile

@@ -4,7 +4,7 @@ EXPOSE 3306
 LABEL version="0.1" description="hfy 国标mysql服务器" by="hfy"
 # 设置docker 内的工作目录
 ENV WORK_PATH /data/mysql
-
+ENV BIND_ADDRESS "0.0.0.0"
 # 先构建镜像,数据库等初始化数据在容器启动时执行
 COPY ./db.sql $WORK_PATH/
 RUN cp $WORK_PATH/db.sql /docker-entrypoint-initdb.d

+ 6 - 4
package/startDockerImage.sh

@@ -70,6 +70,7 @@ if [ "$enable_sql" == "1" ];then
     -p "$sql_port":3306 \
     -v "$SCRIPT_DIR/mysql":/var/lib/mysql \
     -v "$SCRIPT_DIR/sqlBack":/data/sqlBack \
+    --mount type=bind,src="$SCRIPT_DIR/mysqlConf/my.cnf",dst=/etc/mysql/my.cnf \
     -e MYSQL_ROOT_PASSWORD="$sql_root_passwd" \
     hfysql:latest
     if [ $? -ne 0 ]; then
@@ -147,24 +148,25 @@ if [ "$enable_sql" == "1" ];then
 #     -e "ALTER DATABASE gb_db TO $sql_db;"
     # 创建单独用户
     docker exec -it hfysql mysql \
-     -uroot -p"hfy$sql_passwd" \
+     -uroot -p"$sql_root_passwd" \
      -e "CREATE USER '$sql_user'@'%' IDENTIFIED BY '$sql_passwd';"
     # 不限制ip访问
     docker exec -it hfysql mysql \
-      -uroot -p"hfy$sql_passwd" \
+      -uroot -p"$sql_root_passwd" \
       -e "GRANT ALL PRIVILEGES ON $sql_db.* TO '$sql_user'@'%';"
     # 刷新权限
     docker exec -it hfysql mysql \
-      -uroot -p"hfy$sql_passwd" \
+      -uroot -p"$sql_root_passwd" \
       -e "FLUSH PRIVILEGES;"
     echo "等待sql重启,等待15秒"
     sleep 15
     reConnect=0
+    isTrue=1
     while [[ $isTrue == 1 ]]
     do
         # 尝试连接数据库
         docker exec -it hfysql mysql \
-        -uroot -p"hfy$sql_passwd" \
+        -uroot -p"$sql_root_passwd" \
         -e "show databases;"
         if [ $? -eq 0 ]; then
             isTrue=0

+ 2 - 1
src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java

@@ -86,6 +86,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
             matchers.add("/webjars/**");
             matchers.add("/swagger-resources/**");
             matchers.add("/v3/api-docs/**");
+            matchers.add("/aiLib/aialarm");
             matchers.add("/js/**");
             matchers.addAll(userSetting.getInterfaceAuthenticationExcludes());
             // 可以直接访问的静态数据
@@ -124,7 +125,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .authorizeRequests()
                 .requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
                 .antMatchers(userSetting.getInterfaceAuthenticationExcludes().toArray(new String[0])).permitAll()
-                .antMatchers("/api/user/login","/index/hook/**").permitAll()
+                .antMatchers("/api/user/login","/index/hook/**","/aiLib/**","/aiLib/mFile/**").permitAll()
                 .anyRequest().authenticated()
                 // 异常处理器
                 .and()

+ 1 - 1
src/main/resources/application.yml

@@ -196,7 +196,7 @@ user-settings:
     interface-authentication: true
     # 接口鉴权例外的接口, 即不进行接口鉴权的接口,尽量详细书写,尽量不用/**,至少两级目录
     interface-authentication-excludes:
-        - /api/v1/**
+         /aiLib/aialarm
     # 推流直播是否录制
     record-push-live: false
     # 国标是否录制