From 7aef8dc9e8ef1b9066ba14d1f7efeb530fa6499c Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Wed, 3 Jun 2020 15:56:57 +0800 Subject: [PATCH] 1.0.0.603 Former-commit-id: a43fd30923f651994a591ed80a0b7d692e7a5d48 --- .../Areas/Admin/Views/Shared/_Menu.cshtml | 230 ++++++++++++------ projects/IoTCenter/appsettings.Docker.json | 14 +- projects/JobServer/appsettings.Docker.json | 2 +- projects/UserCenter/appsettings.Docker.json | 6 +- projects/Version.cs | 2 +- publish/exclude.txt | 5 +- publish/src/linux-arm64/publish/install.sh | 2 + publish/src/linux-x64/publish/debug.start.ps1 | 1 - publish/src/linux-x64/publish/debug.stop.ps1 | 1 - .../publish/docker-compose.override.yml | 26 +- .../linux-x64/publish/docker-compose.prod.yml | 74 +++--- .../src/linux-x64/publish/docker-compose.yml | 162 +++++++----- .../publish/docker/conf/nginx/nginx.conf | 18 +- publish/src/linux-x64/publish/start.sh | 2 +- publish/src/linux-x64/publish/stop.sh | 2 +- 15 files changed, 337 insertions(+), 210 deletions(-) delete mode 100644 publish/src/linux-x64/publish/debug.start.ps1 delete mode 100644 publish/src/linux-x64/publish/debug.stop.ps1 diff --git a/projects/IoTCenter/Areas/Admin/Views/Shared/_Menu.cshtml b/projects/IoTCenter/Areas/Admin/Views/Shared/_Menu.cshtml index 598be389..c9d3ba7a 100644 --- a/projects/IoTCenter/Areas/Admin/Views/Shared/_Menu.cshtml +++ b/projects/IoTCenter/Areas/Admin/Views/Shared/_Menu.cshtml @@ -2,92 +2,161 @@ @if (User.IsInRole("Read-Setting")) { - + + } + @if (User.IsInRole("Read-User") || User.IsInRole("Read-Role") || User.IsInRole("Read-Permission")) + { + + } + @if (User.IsInRole("Read-Product") || User.IsInRole("Read-Api") || User.IsInRole("Read-Parameter")) + { + + } + @if (User.IsInRole("Read-Node") || User.IsInRole("Read-Device") || User.IsInRole("Read-Data") || User.IsInRole("Read-Command")) + { + } - @if (User.IsInRole("Read-User")) - { - - } - @if (User.IsInRole("Read-Role")) - { - - } - @if (User.IsInRole("Read-Permission")) - { - - } - @if (User.IsInRole("Read-Product")) - { - - } - @if (User.IsInRole("Read-Api")) - { - - } - @if (User.IsInRole("Read-Parameter")) - { - - } - @if (User.IsInRole("Read-Node")) - { - + + @if (User.IsInRole("Read-Scene") || User.IsInRole("Read-SceneCommand") || User.IsInRole("Read-SceneTimer") || User.IsInRole("Read-SceneTigger")) + { + + } + @if (User.IsInRole("Read-Scene") || User.IsInRole("Read-SceneCommand") || User.IsInRole("Read-SceneTimer") || User.IsInRole("Read-SceneTigger")) + { + } @if (User.IsInRole("Read-NodeCategory")) { - + } @if (User.IsInRole("Read-Organ")) { - - } - @if (User.IsInRole("Read-Device")) - { - - } - @if (User.IsInRole("Read-Data")) - { - + } @if (User.IsInRole("Read-LiveRecord")) { } - @if (User.IsInRole("Read-Command")) - { - - } - @if (User.IsInRole("Read-Scene")) - { - - } - @if (User.IsInRole("Read-SceneCommand")) - { - - } - @if (User.IsInRole("Read-SceneTimer")) - { - - } - @if (User.IsInRole("Read-SceneTigger")) - { - - } - @if (User.IsInRole("Read-Scene")) - { - - } - @if (User.IsInRole("Read-SceneCommand")) - { - - } - @if (User.IsInRole("Read-SceneTimer")) - { - - } - @if (User.IsInRole("Read-SceneTigger")) - { - - } + @functions{ @@ -95,12 +164,17 @@ { if (controllers.Select(o => o.ToLower()).Contains(this.ViewContext.RouteData.Values["controller"].ToString().ToLower())) { - if (controllers.Length > 1) - { - return "active open"; - } return "active"; } return ""; } + + public string GetClass2(params string[] controllers) + { + if (controllers.Select(o => o.ToLower()).Contains(this.ViewContext.RouteData.Values["controller"].ToString().ToLower())) + { + return "menu-open"; + } + return ""; + } } \ No newline at end of file diff --git a/projects/IoTCenter/appsettings.Docker.json b/projects/IoTCenter/appsettings.Docker.json index c52abb0b..5091688a 100644 --- a/projects/IoTCenter/appsettings.Docker.json +++ b/projects/IoTCenter/appsettings.Docker.json @@ -4,23 +4,23 @@ }, "ConnectionStrings": { "postgresql": "User ID=root;Host=postgresql;Port=26257;Database=iotcenter;CommandTimeout=120", - "mysql": "Server=mysql;Port=3306;Database=iotcenter;Uid=root;Pwd=root;", + "mysql": "Server=172.172.0.30;Port=3306;Database=iotcenter;Uid=root;Pwd=root;", "redis": "redis:6379,allowAdmin=true", - "srs": "http://srs:1985", - "JobServer": "http://jobserver/JobServer", - "JobCallBack": "http://iotcenter/IoTCenter/api/v1/Api/ExecTimer" + "srs": "http://172.172.0.60:1985", + "JobServer": "http://172.172.0.10/JobServer", + "JobCallBack": "http://172.172.0.10/IoTCenter/api/v1/Api/ExecTimer" }, "influxdb": { - "url": "http://influxdb:8086", + "url": "http://172.172.0.50:8086", "usr": "admin", "pwd": "admin" }, "logserver": { "influxdb": { - "address": "http://influxdb" + "address": "http://172.172.0.50" } }, "minio": { - "endpoint": "minio:9000" + "endpoint": " 172.172.0.20:9000" } } \ No newline at end of file diff --git a/projects/JobServer/appsettings.Docker.json b/projects/JobServer/appsettings.Docker.json index fb742e24..366da8c2 100644 --- a/projects/JobServer/appsettings.Docker.json +++ b/projects/JobServer/appsettings.Docker.json @@ -1,5 +1,5 @@ { "ConnectionStrings": { - "HangfireConnection": "Server=mysql;Port=3306;Database=jobserver;Uid=root;Pwd=root;Allow User Variables=True;" + "HangfireConnection": "Server=172.172.0.30;Port=3306;Database=jobserver;Uid=root;Pwd=root;Allow User Variables=True;" } } \ No newline at end of file diff --git a/projects/UserCenter/appsettings.Docker.json b/projects/UserCenter/appsettings.Docker.json index 35028232..7bc8eec2 100644 --- a/projects/UserCenter/appsettings.Docker.json +++ b/projects/UserCenter/appsettings.Docker.json @@ -4,10 +4,10 @@ }, "ConnectionStrings": { "postgresql": "User ID=root;Host=postgresql;Port=26257;Database=usercenter;CommandTimeout=120", - "mysql": "Server=mysql;Port=3306;Database=usercenter;Uid=root;Pwd=root;", - "redis": "redis:6379,allowAdmin=true" + "mysql": "Server=172.172.0.30;Port=3306;Database=usercenter;Uid=root;Pwd=root;", + "redis": "172.172.0.40:6379,allowAdmin=true" }, "minio": { - "endpoint": "minio:9000" + "endpoint": "172.172.0.20:9000" } } \ No newline at end of file diff --git a/projects/Version.cs b/projects/Version.cs index 1e67deac..5f0bb916 100644 --- a/projects/Version.cs +++ b/projects/Version.cs @@ -1,4 +1,4 @@ using System.Reflection; [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyInformationalVersion("1.0.0.602")] \ No newline at end of file +[assembly: AssemblyInformationalVersion("1.0.0.603")] \ No newline at end of file diff --git a/publish/exclude.txt b/publish/exclude.txt index 01971801..8d00b772 100644 --- a/publish/exclude.txt +++ b/publish/exclude.txt @@ -3,4 +3,7 @@ log docker\log\ docker\data\ -docker-compose.override.yml \ No newline at end of file +docker-compose.override.yml +debug.start.ps1 +debug.stop.ps1 +nginx.development.conf \ No newline at end of file diff --git a/publish/src/linux-arm64/publish/install.sh b/publish/src/linux-arm64/publish/install.sh index 399b970c..4b8b7370 100644 --- a/publish/src/linux-arm64/publish/install.sh +++ b/publish/src/linux-arm64/publish/install.sh @@ -42,6 +42,8 @@ sudo dpkg -i ~/publish/files/supervisor_3.3.5-1_all.deb #config apps sudo cp -f ~/publish/supervisord.conf /etc/supervisor/supervisord.conf sudo chmod 755 ~/publish/apps/IoTNode/IoTNode +sudo chmod 755 ~/publish/apps/frp/frpc +sudo chmod 755 ~/publish/apps/srs/objs/srs sudo chmod 755 ~/publish/apps/IoTNode/wwwroot/ffmpeg-linux-arm sudo chmod 755 ~/publish/apps/IoTNode/wwwroot/ffmpeg-linux-arm64 diff --git a/publish/src/linux-x64/publish/debug.start.ps1 b/publish/src/linux-x64/publish/debug.start.ps1 deleted file mode 100644 index 26bee6d8..00000000 --- a/publish/src/linux-x64/publish/debug.start.ps1 +++ /dev/null @@ -1 +0,0 @@ -docker-compose up -d --remove-orphans \ No newline at end of file diff --git a/publish/src/linux-x64/publish/debug.stop.ps1 b/publish/src/linux-x64/publish/debug.stop.ps1 deleted file mode 100644 index 58694d08..00000000 --- a/publish/src/linux-x64/publish/debug.stop.ps1 +++ /dev/null @@ -1 +0,0 @@ -docker-compose down \ No newline at end of file diff --git a/publish/src/linux-x64/publish/docker-compose.override.yml b/publish/src/linux-x64/publish/docker-compose.override.yml index 8482b972..c0a70345 100644 --- a/publish/src/linux-x64/publish/docker-compose.override.yml +++ b/publish/src/linux-x64/publish/docker-compose.override.yml @@ -1,26 +1,32 @@ #docker-compose up -d version: "3.8" -services: +services: webmvc: image: nginx:1.18 restart: always - environment: - TZ: "Asia/Shanghai" - ports: + environment: + TZ: "Asia/Shanghai" + ports: - 5001:80 - volumes: + volumes: - ../../../../projects/WebMVC/wwwroot:/usr/share/nginx/html - ./docker/log/webmvc:/var/log/nginx + networks: + default: + ipv4_address: 172.172.0.110 webspa: image: nginx:1.18 restart: always - environment: + environment: TZ: "Asia/Shanghai" - ports: + ports: - 5002:80 - volumes: + volumes: - ../../../../projects/WebSPA/wwwroot:/usr/share/nginx/html - ./docker/log/webspa:/var/log/nginx + networks: + default: + ipv4_address: 172.172.0.120 nginx: - volumes: - - ./docker/conf/nginx/nginx.development.conf:/etc/nginx/nginx.conf \ No newline at end of file + volumes: + - ./docker/conf/nginx/nginx.development.conf:/etc/nginx/nginx.conf diff --git a/publish/src/linux-x64/publish/docker-compose.prod.yml b/publish/src/linux-x64/publish/docker-compose.prod.yml index 161eff1d..97385e62 100644 --- a/publish/src/linux-x64/publish/docker-compose.prod.yml +++ b/publish/src/linux-x64/publish/docker-compose.prod.yml @@ -1,73 +1,89 @@ #docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d +#docker-compose down --remove-orphans version: "3.8" -services: - usercenter: +services: + usercenter: image: mcr.microsoft.com/dotnet/core/runtime-deps:3.1-focal restart: always - environment: + environment: - TZ=Asia/Shanghai - ASPNETCORE_ENVIRONMENT=Docker command: bash -c "chmod +x /UserCenter/UserCenter && cd /UserCenter && ./UserCenter" - depends_on: + depends_on: - mysql - ports: + ports: - 8010:80 - volumes: + volumes: - ./apps/UserCenter:/UserCenter - ./docker/log/UserCenter:/UserCenter/logs - iotcenter: + networks: + default: + ipv4_address: 172.172.0.70 + iotcenter: image: mcr.microsoft.com/dotnet/core/runtime-deps:3.1-focal restart: always - environment: + environment: - TZ=Asia/Shanghai - ASPNETCORE_ENVIRONMENT=Docker command: bash -c "chmod +x /IoTCenter/IoTCenter && cd /IoTCenter && ./IoTCenter" - depends_on: + depends_on: - mysql - redis - ports: + ports: - 8011:80 - volumes: + volumes: - ./apps/IotCenter:/IoTCenter - ./docker/log/IotCenter:/IotCenter/logs - jobserver: + networks: + default: + ipv4_address: 172.172.0.80 + jobserver: image: mcr.microsoft.com/dotnet/core/runtime-deps:3.1-focal restart: always - environment: + environment: - TZ=Asia/Shanghai - ASPNETCORE_ENVIRONMENT=Docker command: bash -c "sleep 3 && chmod +x /JobServer/JobServer && cd /JobServer && ./JobServer" - depends_on: + depends_on: - mysql - ports: + ports: - 8013:80 - volumes: - - ./apps/JobServer:/JobServer + volumes: + - ./apps/JobServer:/JobServer - ./docker/log/JobServer:/JobServer/logs + networks: + default: + ipv4_address: 172.172.0.90 webmvc: image: nginx:1.18 restart: always - environment: - TZ: "Asia/Shanghai" - ports: - - 5001:80 - volumes: + environment: + TZ: "Asia/Shanghai" + ports: + - 5001:80 + volumes: - ./apps/WebMVC/wwwroot:/usr/share/nginx/html - ./docker/log/webmvc:/var/log/nginx + networks: + default: + ipv4_address: 172.172.0.110 webspa: image: nginx:1.18 restart: always - environment: - TZ: "Asia/Shanghai" - ports: - - 5002:80 - volumes: + environment: + TZ: "Asia/Shanghai" + ports: + - 5002:80 + volumes: - ./apps/WebSPA/wwwroot:/usr/share/nginx/html - ./docker/log/webspa:/var/log/nginx + networks: + default: + ipv4_address: 172.172.0.120 nginx: - depends_on: + depends_on: - usercenter - iotcenter - jobserver - webmvc - - webspa \ No newline at end of file + - webspa diff --git a/publish/src/linux-x64/publish/docker-compose.yml b/publish/src/linux-x64/publish/docker-compose.yml index f1eddec3..6277bb4d 100644 --- a/publish/src/linux-x64/publish/docker-compose.yml +++ b/publish/src/linux-x64/publish/docker-compose.yml @@ -1,15 +1,11 @@ version: "3.8" -networks: +networks: default: -services: - portainer: - image: portainer/portainer:1.23.2 - restart: always - ports: - - 9002:9000 - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - ./docker/data/portainer:/data + driver: bridge + ipam: + config: + - subnet: 172.172.0.0/24 +services: minio: image: minio/minio:RELEASE.2020-05-29T14-08-49Z restart: always @@ -17,104 +13,136 @@ services: MINIO_ACCESS_KEY: "admin" MINIO_SECRET_KEY: "12345678" command: server /data - ports: + ports: - 9000:9000 - volumes: + volumes: - ./docker/data/minio:/data + networks: + default: + ipv4_address: 172.172.0.20 mysql: image: mysql:8.0 restart: always - environment: + environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=jobserver command: --default-authentication-plugin=mysql_native_password - healthcheck: - test: "/usr/bin/mysql --user=root --password=root --execute \"SHOW DATABASES;\"" - interval: 3s - timeout: 3s - retries: 10 - ports: + ports: - 3306:3306 - volumes: + volumes: - ./docker/data/mysql:/var/lib/mysql - phpmyadmin: - image: phpmyadmin/phpmyadmin - restart: always - environment: - - PMA_HOST=mysql - - PMA_PORT=3306 - ports: - - 9003:80 - depends_on: - - mysql + networks: + default: + ipv4_address: 172.172.0.30 redis: image: redis:6.0 restart: always ports: - 6379:6379 - phpredisadmin: - image: erikdubbelboer/phpredisadmin - restart: always - environment: - - REDIS_1_HOST=redis - - REDIS_1_PORT=6379 - - ADMIN_USER=admin - - ADMIN_PASS=123456 - ports: - - 9004:80 - depends_on: - - redis - influxdb: + networks: + default: + ipv4_address: 172.172.0.40 + influxdb: image: influxdb:1.8 restart: always - environment: + environment: TZ: "Asia/Shanghai" INFLUXDB_ADMIN_ENABLED: "true" INFLUXDB_ADMIN_USER: admin INFLUXDB_ADMIN_PASSWORD: admin - ports: + ports: - 8086:8086 - volumes: + volumes: - ./docker/data/influxdb:/var/lib/influxdb - influxdb-web: - image: influxdb:1.2.4 - restart: always - environment: - TZ: "Asia/Shanghai" - INFLUXDB_ADMIN_ENABLED: "true" - INFLUXDB_ADMIN_USER: admin - INFLUXDB_ADMIN_PASSWORD: admin - ports: - - 8083:8083 - depends_on: - - influxdb + networks: + default: + ipv4_address: 172.172.0.50 srs: image: ossrs/srs:v4.0.23 - environment: + environment: TZ: "Asia/Shanghai" restart: always ports: - - 1935:1935 + - 1935:1935 - 8080:8080 - 1985:1985 - volumes: + volumes: - ./docker/conf/srs/srs.conf:/usr/local/srs/conf/srs.conf - ./docker/log/srs:/usr/local/srs/objs/log - ./docker/data/srs:/usr/local/srs/objs/nginx/html/video - nginx: + networks: + default: + ipv4_address: 172.172.0.60 + nginx: image: nginx:1.18 restart: always - environment: + environment: TZ: "Asia/Shanghai" - ports: + ports: - 80:80 - 443:443 - volumes: + volumes: - ./docker/conf/nginx/nginx.conf:/etc/nginx/nginx.conf #- ./docker/conf/nginx/edusoa.key:/etc/nginx/edusoa.key #- ./docker/conf/nginx/edusoa.pem:/etc/nginx/edusoa.pem - ./docker/log/nginx:/var/log/nginx - depends_on: + depends_on: - minio - mysql - + networks: + default: + ipv4_address: 172.172.0.10 + portainer: + image: portainer/portainer:1.23.2 + restart: always + ports: + - 9002:9000 + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - ./docker/data/portainer:/data + networks: + default: + ipv4_address: 172.172.0.101 + phpmyadmin: + image: phpmyadmin/phpmyadmin + restart: always + environment: + - PMA_HOST=mysql + - PMA_PORT=3306 + ports: + - 9003:80 + depends_on: + - mysql + networks: + default: + ipv4_address: 172.172.0.102 + phpredisadmin: + image: erikdubbelboer/phpredisadmin + restart: always + environment: + - REDIS_1_HOST=redis + - REDIS_1_PORT=6379 + - ADMIN_USER=admin + - ADMIN_PASS=123456 + ports: + - 9004:80 + depends_on: + - redis + networks: + default: + ipv4_address: 172.172.0.103 + influxdb-web: + image: influxdb:1.2.4 + restart: always + environment: + TZ: "Asia/Shanghai" + INFLUXDB_ADMIN_ENABLED: "true" + INFLUXDB_ADMIN_USER: admin + INFLUXDB_ADMIN_PASSWORD: admin + ports: + - 8083:8083 + depends_on: + - influxdb + networks: + default: + ipv4_address: 172.172.0.104 \ No newline at end of file diff --git a/publish/src/linux-x64/publish/docker/conf/nginx/nginx.conf b/publish/src/linux-x64/publish/docker/conf/nginx/nginx.conf index b1af68af..adb2b84d 100644 --- a/publish/src/linux-x64/publish/docker/conf/nginx/nginx.conf +++ b/publish/src/linux-x64/publish/docker/conf/nginx/nginx.conf @@ -22,44 +22,44 @@ http { location / { if ($http_user_agent ~* "(mobile|android|ipad|iphone|ipod|tablet)") { - proxy_pass http://webspa; + proxy_pass http://172.172.0.120; break; } - proxy_pass http://webmvc/; + proxy_pass http://172.172.0.110/; } location ^~ /dfs/ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_pass http://minio:9000/; + proxy_pass http://172.172.0.20:9000/; } location ^~ /live/ { - proxy_pass http://srs:8080/live/; + proxy_pass http://172.172.0.60:8080/live/; } location ^~ /video/ { - proxy_pass http://srs:8080/video/; + proxy_pass http://172.172.0.60:8080/video/; } location ^~ /UserCenter/ { - proxy_pass http://usercenter/UserCenter/; + proxy_pass http://172.172.0.70/UserCenter/; } location ^~ /IoTCenter/ { - proxy_pass http://iotcenter/IoTCenter/; + proxy_pass http://172.172.0.80/IoTCenter/; } location ^~ /IoTCenter/hub { - proxy_pass http://iotcenter/IoTCenter/hub; + proxy_pass http://172.172.0.80/IoTCenter/hub; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location ^~ /JobServer/ { - proxy_pass http://jobserver/JobServer/; + proxy_pass http://172.172.0.90/JobServer/; } error_page 500 502 503 504 /50x.html; diff --git a/publish/src/linux-x64/publish/start.sh b/publish/src/linux-x64/publish/start.sh index a076283f..ae636a9a 100644 --- a/publish/src/linux-x64/publish/start.sh +++ b/publish/src/linux-x64/publish/start.sh @@ -1 +1 @@ -docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d \ No newline at end of file +docker-compose -f docker-compose.yml -f docker-compose.prod.yml up --remove-orphans -d \ No newline at end of file diff --git a/publish/src/linux-x64/publish/stop.sh b/publish/src/linux-x64/publish/stop.sh index 58694d08..356959e4 100644 --- a/publish/src/linux-x64/publish/stop.sh +++ b/publish/src/linux-x64/publish/stop.sh @@ -1 +1 @@ -docker-compose down \ No newline at end of file +docker-compose down --remove-orphans \ No newline at end of file