diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/platforms/v1/99-pikvm.conf | 3 | ||||
-rw-r--r-- | os/platforms/v1/nginx.conf | 21 | ||||
-rwxr-xr-x | os/platforms/v1/run.sh | 4 |
3 files changed, 25 insertions, 3 deletions
diff --git a/os/platforms/v1/99-pikvm.conf b/os/platforms/v1/99-pikvm.conf new file mode 100644 index 00000000..71db0efc --- /dev/null +++ b/os/platforms/v1/99-pikvm.conf @@ -0,0 +1,3 @@ +# https://github.com/raspberrypi/linux/issues/1753 +vm.dirty_background_bytes = 5 +vm.dirty_writeback_centisecs = 25 diff --git a/os/platforms/v1/nginx.conf b/os/platforms/v1/nginx.conf index a236b085..9fbd41e5 100644 --- a/os/platforms/v1/nginx.conf +++ b/os/platforms/v1/nginx.conf @@ -18,7 +18,7 @@ http { keepalive_timeout 10; # gzip on; - upstream kvm_ws { + upstream kvmd { server localhost:8081 fail_timeout=0s max_fails=0; } @@ -46,9 +46,26 @@ http { location /kvm/ws { rewrite /kvm/ws /ws break; - proxy_pass http://kvm_ws; + proxy_pass http://kvmd; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; + proxy_connect_timeout 7d; + proxy_send_timeout 7d; + proxy_read_timeout 7d; + } + + location /kvm/msd/write { + rewrite /kvm/msd/write /msd/write break; + proxy_pass http://kvmd; + limit_rate 6250k; + limit_rate_after 50k; + client_max_body_size 0; + proxy_request_buffering off; + } + + location /kvm { + rewrite /kvm/?(.*) /$1 break; + proxy_pass http://kvmd; } location /video { diff --git a/os/platforms/v1/run.sh b/os/platforms/v1/run.sh index 525d7756..4dbc17a0 100755 --- a/os/platforms/v1/run.sh +++ b/os/platforms/v1/run.sh @@ -5,14 +5,16 @@ set -x . ../functions.sh -cp config.txt "$FS/boot/config.txt" pkg_install \ kvmd \ mjpg-streamer-pikvm \ nginx +cp config.txt "$FS/boot/" +cp 99-pikvm.conf "$FS/etc/sysctl.d/" cp index.html "$FS/srv/http/" cp kvmd.yaml "$FS/etc/" cp nginx.conf "$FS/etc/nginx/" + rpi systemctl enable kvmd rpi systemctl enable nginx |