diff --git a/projects/IoTCenter/appsettings.Development.json b/projects/IoTCenter/appsettings.Development.json index 7a73a41b..f0cd2eae 100644 --- a/projects/IoTCenter/appsettings.Development.json +++ b/projects/IoTCenter/appsettings.Development.json @@ -1,2 +1,5 @@ { + "AppSettings": { + "database": "sqlite" + } } \ No newline at end of file diff --git a/projects/IoTCenter/appsettings.json b/projects/IoTCenter/appsettings.json index eae91cd3..87e4f2c1 100644 --- a/projects/IoTCenter/appsettings.json +++ b/projects/IoTCenter/appsettings.json @@ -50,15 +50,15 @@ "register": "http://localhost/UserCenter/Account/Register" }, "ConnectionStrings": { - "postgresql": "User ID=root;Host=localhost;Port=26257;Database=iotdb;CommandTimeout=120", + "postgresql": "User ID=root;Host=localhost;Port=26257;Database=iotcenter;CommandTimeout=120", "sqlite": "Data Source=iotcenter.db", "mysql": "Server=127.0.0.1;Port=3306;Database=iotcenter;Uid=root;Pwd=root;", "redis": "127.0.0.1:6379,allowAdmin=true", "srs": "http://localhost:1985" }, "AppSettings": { - "database": "sqlite", + "database": "mysql", "cache": "memory", - //"upload": "http://10.10.24.104:8180/group1/upload" + "upload": "" } } \ No newline at end of file diff --git a/projects/UserCenter/appsettings.Development.json b/projects/UserCenter/appsettings.Development.json index 7a73a41b..f0cd2eae 100644 --- a/projects/UserCenter/appsettings.Development.json +++ b/projects/UserCenter/appsettings.Development.json @@ -1,2 +1,5 @@ { + "AppSettings": { + "database": "sqlite" + } } \ No newline at end of file diff --git a/projects/UserCenter/appsettings.json b/projects/UserCenter/appsettings.json index 69c4f106..81338102 100644 --- a/projects/UserCenter/appsettings.json +++ b/projects/UserCenter/appsettings.json @@ -45,8 +45,8 @@ "redis": "127.0.0.1:6379,allowAdmin=true" }, "AppSettings": { - "database": "sqlite", + "database": "mysql", "cache": "memory", - "upload": "http://10.10.24.104:8180/group1/upload" + "upload": "" } } \ No newline at end of file diff --git a/publish/build.cmd b/publish/build.cmd index 452f542c..2bdd452a 100644 --- a/publish/build.cmd +++ b/publish/build.cmd @@ -5,6 +5,8 @@ rd /q/s "./dist/" echo d|xcopy "./src" "./dist/" /s /e /y /f +dotnet publish ../projects/WebMvc/WebMvc.csproj -c Release -r linux-x64 -o ../publish/dist/linux-x64/publish/apps/WebMVC +dotnet publish ../projects/WebSPA/WebSPA.csproj -c Release -r linux-x64 -o ../publish/dist/linux-x64/publish/apps/WebSPA dotnet publish ../projects/UserCenter/UserCenter.csproj -c Release -r linux-x64 -o ../publish/dist/linux-x64/publish/apps/UserCenter dotnet publish ../projects/IoTCenter/IoTCenter.csproj -c Release -r linux-x64 -o ../publish/dist/linux-x64/publish/apps/IoTCenter dotnet publish ../projects/IoTNode/IoTNode.csproj -c Release -r linux-arm64 -o ../publish/dist/linux-arm64/publish/apps/IoTNode diff --git a/publish/src/linux-x64/publish/apps/srs/conf/srs.conf b/publish/src/linux-x64/publish/apps/srs/conf/srs.conf index d281b517..6550e5e0 100644 --- a/publish/src/linux-x64/publish/apps/srs/conf/srs.conf +++ b/publish/src/linux-x64/publish/apps/srs/conf/srs.conf @@ -23,11 +23,11 @@ stats { disk sda sdb xvda xvdb; } vhost __defaultVhost__ { - transcode live { - enabled on; - ffmpeg ./objs/ffmpeg/bin/ffmpeg; + transcode live { + enabled on; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; engine snapshot { - enabled on; + enabled on; iformat flv; vfilter { vf fps=1; @@ -56,14 +56,10 @@ vhost __defaultVhost__ { dvr { enabled on; dvr_apply none; - dvr_path ./objs/nginx/html/[app].[stream].[timestamp].flv;; - dvr_plan session; - dvr_duration 300; - dvr_wait_keyframe on; - time_jitter full; + dvr_path ./objs/nginx/html/video/[app].[stream].[timestamp].mp4; } http_hooks { enabled on; - on_dvr http://localhost/IoTCenter/App/OnDvr; + on_dvr http://localhost/IoTCenter/api/v1/Srs/OnDvr; } } diff --git a/publish/src/linux-x64/publish/apps/seaweedfs/weed b/publish/src/linux-x64/publish/apps/srs/objs/ffmpeg/bin/ffmpeg similarity index 72% rename from publish/src/linux-x64/publish/apps/seaweedfs/weed rename to publish/src/linux-x64/publish/apps/srs/objs/ffmpeg/bin/ffmpeg index 208a5f38..add3792a 100644 Binary files a/publish/src/linux-x64/publish/apps/seaweedfs/weed and b/publish/src/linux-x64/publish/apps/srs/objs/ffmpeg/bin/ffmpeg differ diff --git a/publish/src/linux-x64/publish/install.sh b/publish/src/linux-x64/publish/install.sh index 8cdcace0..5ae2da5d 100644 --- a/publish/src/linux-x64/publish/install.sh +++ b/publish/src/linux-x64/publish/install.sh @@ -8,6 +8,8 @@ mv /etc/supervisor/supervisord.conf /etc/supervisor/supervisord.conf.bk mv /root/publish/supervisord.conf /etc/supervisor/supervisord.conf chmod 777 /root/publish/apps/UserCenter/UserCenter chmod 777 /root/publish/apps/IoTCenter/IoTCenter +chmod 777 /root/publish/apps/WebMVC/WebMVC +chmod 777 /root/publish/apps/WebSPA/WebSPA chmod 777 /root/publish/apps/srs/objs/srs -chmod 777 /root/publish/apps/seaweedfs/weed +chmod 777 /root/publish/apps/srs/objs/ffmpeg/bin/ffmpeg service supervisor restart diff --git a/publish/src/linux-x64/publish/nginx.conf b/publish/src/linux-x64/publish/nginx.conf index 82ffec25..25efbad1 100644 --- a/publish/src/linux-x64/publish/nginx.conf +++ b/publish/src/linux-x64/publish/nginx.conf @@ -1,13 +1,19 @@ -user www-data; -worker_processes auto; -pid /run/nginx.pid; -include /etc/nginx/modules-enabled/*.conf; + +#user nobody; +worker_processes 1; + +#error_log logs/error.log; +#error_log logs/error.log notice; +#error_log logs/error.log info; + +#pid logs/nginx.pid; + events { - worker_connections 768; - # multi_accept on; + worker_connections 1024; } + http { include mime.types; default_type application/octet-stream; @@ -16,35 +22,52 @@ http { keepalive_timeout 65; + upstream go-fastdfs { + server 10.10.24.104:8180; + ip_hash; + } + server { listen 0.0.0.0:80; server_name localhost; - location ^~ /live/ { - proxy_pass http://localhost:8080/live/; + location / { + #proxy_set_header Host $host:$server_port; + if ($http_user_agent ~* "(mobile|android|ipad|iphone|ipod|tablet)") { + proxy_pass http://localhost:5002; + break; + } + proxy_pass http://localhost:5001/; } - location ^~ /video/ { - proxy_pass http://localhost:8080/; - } + 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://go-fastdfs/; + } - location ^~ /UserCenter/ { - proxy_pass http://localhost:8010/; - #add_header 'Access-Control-Allow-Origin' '*'; - #add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE'; - #add_header 'Access-Control-Allow-Headers' 'Content-Type'; + location ^~ /live/ { + proxy_pass http://localhost:8080/live/; + } + + location ^~ /video/ { + proxy_pass http://localhost:8080/video/; + } + + location ^~ /UserCenter/ { + proxy_pass http://localhost:8010/UserCenter/; } location ^~ /IoTCenter/ { - proxy_pass http://localhost:8011/; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_read_timeout 86400; + proxy_pass http://localhost:8011/IoTCenter/; } - location ^~ /IoTCenter/App/ { - proxy_pass http://localhost:8011/App/; + location ^~ /IoTCenter/hub { + proxy_pass http://localhost:8011/IoTCenter/hub; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; } error_page 500 502 503 504 /50x.html; @@ -52,6 +75,4 @@ http { root html; } } - -} - +} \ No newline at end of file diff --git a/publish/src/linux-x64/publish/supervisor/webmvc.conf b/publish/src/linux-x64/publish/supervisor/webmvc.conf new file mode 100644 index 00000000..e48782dc --- /dev/null +++ b/publish/src/linux-x64/publish/supervisor/webmvc.conf @@ -0,0 +1,8 @@ +[program:webmvc] +command=/root/publish/apps/WebMVC/WebMvc +directory=/root/publish/apps/WebMVC/ +autostart=true +autorestart=true +user=root +stdout_logfile=/root/publish/logs/webmvc.log +stderr_logfile=/root/publish/logs/webmvc.err \ No newline at end of file diff --git a/publish/src/linux-x64/publish/supervisor/webspa.conf b/publish/src/linux-x64/publish/supervisor/webspa.conf new file mode 100644 index 00000000..eb368996 --- /dev/null +++ b/publish/src/linux-x64/publish/supervisor/webspa.conf @@ -0,0 +1,8 @@ +[program:webspa] +command=/root/publish/apps/WebSPA/WebSPA +directory=/root/publish/apps/WebSPA/ +autostart=true +autorestart=true +user=root +stdout_logfile=/root/publish/logs/webspa.log +stderr_logfile=/root/publish/logs/webspa.err \ No newline at end of file