diff --git a/projects/Platform/Data/PlatformDbContext.cs b/projects/Platform/Data/PlatformDbContext.cs index 3408a872..9019e38b 100644 --- a/projects/Platform/Data/PlatformDbContext.cs +++ b/projects/Platform/Data/PlatformDbContext.cs @@ -410,6 +410,7 @@ namespace Platform.Data //初始化建筑 var image = "/images/empty.svg"; + var platformId = db.Set().FirstOrDefault(o => o.Number == "jiaoyuju").Id; var organId = db.Set().FirstOrDefault(o => o.Number == "xuexiao").Id; var buildingRoot = new Building { @@ -428,6 +429,14 @@ namespace Platform.Data Name="默认建筑", Number="1", Children = new List { + new Building{ + Image = image, + Order = order++, + OrganId = platformId, + Type= "建筑", + Name="默认建筑", + Number="1" + }, new Building { Image= image, Order=order++, @@ -590,6 +599,22 @@ namespace Platform.Data } } }); + db.Set().Add(new User + { + UserName = "user", + SecurityStamp = securityStam, + PasswordHash = _encryptionService.CreatePasswordHash("123456", securityStam), + PasswordConfirmed = true, + Email = "user@test.com", + EmailConfirmed = true, + NickName = "普通用户", + OrganUsers = new List { + new OrganUser { + Type= "其他", + OrganId=platformOrganId + } + } + }); db.SaveChanges(); // var set = db.Set(); diff --git a/publish/projects/dslx/linux-x64/publish/apps/IoTCenter/wwwroot/CheckSum.exe b/publish/projects/dslx/linux-x64/publish/apps/IoTCenter/wwwroot/CheckSum.exe deleted file mode 100644 index 055a58c5..00000000 Binary files a/publish/projects/dslx/linux-x64/publish/apps/IoTCenter/wwwroot/CheckSum.exe and /dev/null differ diff --git a/publish/projects/dslx/linux-x64/publish/apps/IoTCenter/wwwroot/IoTNode.zip b/publish/projects/dslx/linux-x64/publish/apps/IoTCenter/wwwroot/IoTNode.zip deleted file mode 100644 index 59ac39a2..00000000 Binary files a/publish/projects/dslx/linux-x64/publish/apps/IoTCenter/wwwroot/IoTNode.zip and /dev/null differ diff --git a/publish/projects/dslx/linux-x64/publish/apps/IoTCenter/wwwroot/iotnode.xml b/publish/projects/dslx/linux-x64/publish/apps/IoTCenter/wwwroot/iotnode.xml deleted file mode 100644 index 4030693c..00000000 --- a/publish/projects/dslx/linux-x64/publish/apps/IoTCenter/wwwroot/iotnode.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 1.0.0.20091601 - 7d5ff4ac251a6e682b85e49a130933d5d0c1dcaf820b7007c9924d55e975a37378ab67fccbc00950c23f2eb730b8bf52b1f454380ee8255d225d72747c84b787 - \ No newline at end of file diff --git a/publish/projects/dslx/linux-x64/publish/apps/WebMVC/wwwroot/apps/XamarinApp.ipa b/publish/projects/dslx/linux-x64/publish/apps/WebMVC/wwwroot/apps/XamarinApp.ipa deleted file mode 100644 index 7a0bc9d9..00000000 Binary files a/publish/projects/dslx/linux-x64/publish/apps/WebMVC/wwwroot/apps/XamarinApp.ipa and /dev/null differ diff --git a/publish/projects/dslx/linux-x64/publish/apps/WebMVC/wwwroot/apps/XamarinApp.plist b/publish/projects/dslx/linux-x64/publish/apps/WebMVC/wwwroot/apps/XamarinApp.plist deleted file mode 100644 index b49058d1..00000000 --- a/publish/projects/dslx/linux-x64/publish/apps/WebMVC/wwwroot/apps/XamarinApp.plist +++ /dev/null @@ -1,41 +0,0 @@ - - - - - items - - - assets - - - kind - software-package - url - https://iot.edusoa.com/apps/XamarinApp.ipa - - - kind - display-image - needs-shine - - url - https://iot.edusoa.com/apps/XamarinApp.png - - - metadata - - bundle-identifier - com.edusoa.iot - bundle-version - 1.0 - kind - software - subtitle - XamarinApp - title - XamarinApp - - - - - \ No newline at end of file diff --git a/publish/projects/dslx/linux-x64/publish/apps/WebMVC/wwwroot/apps/XamarinApp.png b/publish/projects/dslx/linux-x64/publish/apps/WebMVC/wwwroot/apps/XamarinApp.png deleted file mode 100644 index 9457cd7e..00000000 Binary files a/publish/projects/dslx/linux-x64/publish/apps/WebMVC/wwwroot/apps/XamarinApp.png and /dev/null differ diff --git a/publish/projects/dslx/linux-x64/publish/apps/frp/frps b/publish/projects/dslx/linux-x64/publish/apps/frp/frps new file mode 100644 index 00000000..5acdf411 Binary files /dev/null and b/publish/projects/dslx/linux-x64/publish/apps/frp/frps differ diff --git a/publish/projects/dslx/linux-x64/publish/apps/frp/frps.ini b/publish/projects/dslx/linux-x64/publish/apps/frp/frps.ini new file mode 100644 index 00000000..ac941df6 --- /dev/null +++ b/publish/projects/dslx/linux-x64/publish/apps/frp/frps.ini @@ -0,0 +1,7 @@ +[common] +bind_port = 7000 +vhost_http_port = 7001 +dashboard_port = 8003 +dashboard_user = admin +dashboard_pwd = admin +subdomain_host = iot.edusoa.com diff --git a/publish/projects/dslx/linux-x64/publish/conf/website/conf.d/project.conf b/publish/projects/dslx/linux-x64/publish/conf/website/conf.d/project.conf new file mode 100644 index 00000000..67e1bbbf --- /dev/null +++ b/publish/projects/dslx/linux-x64/publish/conf/website/conf.d/project.conf @@ -0,0 +1,22 @@ +server { + listen 443 ssl; + server_name iot.edusoa.com; + + ssl_certificate edusoa.pem; + ssl_certificate_key edusoa.key; + ssl_session_timeout 5m; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM; + ssl_prefer_server_ciphers on; + + location / { + proxy_pass http://127.0.0.1; + } + + location ^~ /platform/hub { + proxy_pass http://127.0.0.1; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } +} \ No newline at end of file diff --git a/publish/projects/dslx/linux-x64/publish/docker/conf/website/edusoa.key b/publish/projects/dslx/linux-x64/publish/conf/website/edusoa.key similarity index 100% rename from publish/projects/dslx/linux-x64/publish/docker/conf/website/edusoa.key rename to publish/projects/dslx/linux-x64/publish/conf/website/edusoa.key diff --git a/publish/projects/dslx/linux-x64/publish/docker/conf/website/edusoa.pem b/publish/projects/dslx/linux-x64/publish/conf/website/edusoa.pem similarity index 100% rename from publish/projects/dslx/linux-x64/publish/docker/conf/website/edusoa.pem rename to publish/projects/dslx/linux-x64/publish/conf/website/edusoa.pem diff --git a/publish/projects/dslx/linux-x64/publish/docker-compose.project.yml b/publish/projects/dslx/linux-x64/publish/docker-compose.project.yml new file mode 100644 index 00000000..08f2003b --- /dev/null +++ b/publish/projects/dslx/linux-x64/publish/docker-compose.project.yml @@ -0,0 +1,7 @@ +#docker-compose up -d +version: "3.8" +services: + website: + volumes: + - ./conf/website/edusoa.pem:/etc/nginx/edusoa.pem + - ./conf/website/edusoa.key:/etc/nginx/edusoa.key \ No newline at end of file diff --git a/publish/projects/dslx/linux-x64/publish/docker/conf/website/nginx.conf b/publish/projects/dslx/linux-x64/publish/docker/conf/website/nginx.conf deleted file mode 100644 index e9ab388b..00000000 --- a/publish/projects/dslx/linux-x64/publish/docker/conf/website/nginx.conf +++ /dev/null @@ -1,76 +0,0 @@ -user root; -worker_processes 4; -#error_log logs/error.log; -#error_log logs/error.log notice; -#error_log logs/error.log info; - -#pid logs/nginx.pid; -events { - worker_connections 1024; -} - -http { - include mime.types; - default_type application/octet-stream; - sendfile on; - keepalive_timeout 65; - types { - application/vnd.android.package-archive apk; - application/iphone pxl ipa; - text/plain plist; - } - - upstream gateway { - server 172.172.0.12; - } - - server { - listen 80; - server_name iot.edusoa.com; - return 301 https://$host$request_uri; - } - - server { - #listen 80; - listen 443; - server_name iot.edusoa.com; - - ssl on; - ssl_certificate edusoa.pem; - ssl_certificate_key edusoa.key; - ssl_session_timeout 5m; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_ciphers HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM; - ssl_prefer_server_ciphers on; - - location /stub_status { - stub_status; - allow 127.0.0.1; - deny all; - } - - location / { - root /root/nginx/html/desktop; - if ($http_user_agent ~* "(mobile|android|ipad|iphone|ipod|tablet)") { - root /root/nginx/html/mobile; - } - index index.html; - } - - location ~* ^/(dfs|live|video|influxdb|UserCenter|IoTCenter|JobServer|portainer|minio|mysqlui|influxui|phpredisadmin|srs)/ { - proxy_pass http://gateway; - } - - location ^~ /IoTCenter/hub { - proxy_pass http://gateway; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root html; - } - } -} diff --git a/publish/src/linux-x64/publish/conf/platform/nginx.dev.conf b/publish/src/linux-x64/publish/conf/platform/nginx.conf similarity index 100% rename from publish/src/linux-x64/publish/conf/platform/nginx.dev.conf rename to publish/src/linux-x64/publish/conf/platform/nginx.conf diff --git a/publish/src/linux-x64/publish/conf/srs/conf/srs.conf b/publish/src/linux-x64/publish/conf/srs/conf/srs.conf index d99ceee0..ab4aa066 100644 --- a/publish/src/linux-x64/publish/conf/srs/conf/srs.conf +++ b/publish/src/linux-x64/publish/conf/srs/conf/srs.conf @@ -22,13 +22,22 @@ stats { network 0; disk sda sdb xvda xvdb; } +rtc_server{ + enabled on; + listen 8000; + candidate *; +} vhost __defaultVhost__ { - tcp_nodelay on - min_latency on; + rtc { + enabled on; + bframe discard; + } + tcp_nodelay on + min_latency on; play { - gop_cache off; - queue_length 10; - mw_latency 100; + gop_cache off; + queue_length 10; + mw_latency 100; } publish { mr off; @@ -92,6 +101,6 @@ vhost __defaultVhost__ { } http_hooks { enabled on; - on_dvr http://172.172.0.80/platform/api/v1/Srs/OnDvr; + on_dvr http://srs/platform/api/v1/Srs/OnDvr; } } diff --git a/publish/src/linux-x64/publish/conf/srs/dev/srs.conf b/publish/src/linux-x64/publish/conf/srs/conf/srs.dev.conf similarity index 98% rename from publish/src/linux-x64/publish/conf/srs/dev/srs.conf rename to publish/src/linux-x64/publish/conf/srs/conf/srs.dev.conf index 5b032dfd..dbda3adf 100644 --- a/publish/src/linux-x64/publish/conf/srs/dev/srs.conf +++ b/publish/src/linux-x64/publish/conf/srs/conf/srs.dev.conf @@ -25,7 +25,7 @@ stats { rtc_server{ enabled on; listen 8000; - candidate $CANDIDATE; + candidate *; } vhost __defaultVhost__ { rtc { diff --git a/publish/src/linux-x64/publish/conf/website/nginx.conf b/publish/src/linux-x64/publish/conf/website/nginx.conf index 9c000b10..dedfc7b0 100644 --- a/publish/src/linux-x64/publish/conf/website/nginx.conf +++ b/publish/src/linux-x64/publish/conf/website/nginx.conf @@ -1,10 +1,6 @@ user root; worker_processes 4; -#error_log logs/error.log; -#error_log logs/error.log notice; -#error_log logs/error.log info; -#pid logs/nginx.pid; events { worker_connections 1024; } @@ -53,4 +49,5 @@ http { root html; } } + include conf.d/*.conf; } \ 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 dfae7791..a75f6cbe 100644 --- a/publish/src/linux-x64/publish/docker-compose.override.yml +++ b/publish/src/linux-x64/publish/docker-compose.override.yml @@ -2,8 +2,14 @@ version: "3.8" services: srs: - volumes: - - ./conf/srs/dev:/usr/local/srs/conf + command: + - /bin/bash + - -c + - | + cat /usr/local/srs/conf/srs.conf > /usr/local/srs/conf/srs.dev.conf + sed -i "s/on_dvr[^;]*;/on_dvr http:\/\/host.docker.internal\/platform\/api\/v1\/Srs\/OnDvr;/g" /usr/local/srs/conf/srs.dev.conf + cd /usr/local/srs + ./objs/srs -c conf/srs.dev.conf website: volumes: - ../../../../projects/Platform/wwwroot:/root/nginx/html/desktop @@ -13,4 +19,4 @@ services: environment: TZ: "Asia/Shanghai" volumes: - - ./conf/platform/nginx.dev.conf:/etc/nginx/nginx.conf \ No newline at end of file + - ./conf/platform/nginx.conf:/etc/nginx/nginx.conf \ No newline at end of file diff --git a/publish/src/linux-x64/publish/docker-compose.prod.yml b/publish/src/linux-x64/publish/docker-compose.prod.yml index 8047af41..b0daa897 100644 --- a/publish/src/linux-x64/publish/docker-compose.prod.yml +++ b/publish/src/linux-x64/publish/docker-compose.prod.yml @@ -1,5 +1,3 @@ -#docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d -#docker-compose down --remove-orphans version: "3.8" services: #monitor diff --git a/publish/src/linux-x64/publish/docker-compose.project.yml b/publish/src/linux-x64/publish/docker-compose.project.yml new file mode 100644 index 00000000..21b92800 --- /dev/null +++ b/publish/src/linux-x64/publish/docker-compose.project.yml @@ -0,0 +1 @@ +version: "3.8" \ No newline at end of file diff --git a/publish/src/linux-x64/publish/docker-compose.yml b/publish/src/linux-x64/publish/docker-compose.yml index 4fdcdf9a..f7243efc 100644 --- a/publish/src/linux-x64/publish/docker-compose.yml +++ b/publish/src/linux-x64/publish/docker-compose.yml @@ -36,8 +36,7 @@ services: - 443:443 volumes: - ./conf/website/nginx.conf:/etc/nginx/nginx.conf -# - ./conf/website/edusoa.pem:/etc/nginx/edusoa.pem -# - ./conf/website/edusoa.key:/etc/nginx/edusoa.key + - ./conf/website/conf.d:/etc/nginx/conf.d - ./log/website:/var/log/nginx - ./apps/WebMVC/wwwroot:/root/nginx/html/desktop - ./apps/WebSPA/wwwroot:/root/nginx/html/mobile @@ -104,8 +103,6 @@ services: srs: image: ossrs/srs:v4.0.84 restart: always - environment: - CANDIDATE: 192.168.100.144 ports: - 1935:1935 - 8080:8080 diff --git a/publish/src/linux-x64/publish/start.cmd b/publish/src/linux-x64/publish/start.cmd index 66705fc5..38c2bc27 100644 --- a/publish/src/linux-x64/publish/start.cmd +++ b/publish/src/linux-x64/publish/start.cmd @@ -1 +1 @@ -docker-compose --compatibility -f docker-compose.yml -f docker-compose.prod.yml up --remove-orphans --force-recreate -d \ No newline at end of file +docker-compose --compatibility -f docker-compose.yml -f docker-compose.prod.yml -f docker-compose.project.yml up --remove-orphans -d \ No newline at end of file diff --git a/publish/src/linux-x64/publish/start.sh b/publish/src/linux-x64/publish/start.sh index 8abd20c8..38c2bc27 100644 --- a/publish/src/linux-x64/publish/start.sh +++ b/publish/src/linux-x64/publish/start.sh @@ -1 +1 @@ -docker-compose --compatibility -f docker-compose.yml -f docker-compose.prod.yml up --remove-orphans -d \ No newline at end of file +docker-compose --compatibility -f docker-compose.yml -f docker-compose.prod.yml -f docker-compose.project.yml up --remove-orphans -d \ No newline at end of file