diff options
author | Devaev Maxim <[email protected]> | 2018-07-08 01:31:11 +0000 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-07-08 01:31:11 +0000 |
commit | 09cccf0ffba8483923843352f855cf30ea68b550 (patch) | |
tree | d44c998a11acaba71ab6e4601ab414999962d11e /os | |
parent | 8c9441e0a3e676b4f7e36b48da8589dd15b8d125 (diff) |
moved main configs to kvmd package
Diffstat (limited to 'os')
-rw-r--r-- | os/platforms/v1/Dockerfile.part | 6 | ||||
-rw-r--r-- | os/platforms/v1/index.html | 66 | ||||
-rw-r--r-- | os/platforms/v1/kvmd.yaml | 73 | ||||
-rw-r--r-- | os/platforms/v1/nginx.conf | 76 |
4 files changed, 3 insertions, 218 deletions
diff --git a/os/platforms/v1/Dockerfile.part b/os/platforms/v1/Dockerfile.part index 566f229c..16d08ee8 100644 --- a/os/platforms/v1/Dockerfile.part +++ b/os/platforms/v1/Dockerfile.part @@ -6,9 +6,9 @@ RUN pkg-install \ COPY stages/pikvm/config.txt /boot/ COPY stages/pikvm/sysctl.conf /etc/sysctl.d/99-pikvm.conf COPY stages/pikvm/udev.rules /etc/udev/rules.d/pikvm.rules -COPY stages/pikvm/index.html /srv/http/ -COPY stages/pikvm/kvmd.yaml /etc/ -COPY stages/pikvm/nginx.conf /etc/nginx/ + +RUN cp /usr/share/kvmd/configs/nginx/nginx.conf /etc/nginx/ +RUN cp /usr/share/kvmd/configs/kvmd/v1.yaml /etc/kvmd.yaml RUN systemctl enable kvmd RUN systemctl enable nginx diff --git a/os/platforms/v1/index.html b/os/platforms/v1/index.html deleted file mode 100644 index 87281e88..00000000 --- a/os/platforms/v1/index.html +++ /dev/null @@ -1,66 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<title>π-kvm</title> -<style> -body { - text-align: center; -} -.screen, .screen * { - box-sizing: border-box; -} -.screen { - display: inline-block; - background-color: #e5e5f5; - font-family: Arial, Tahoma, Verdana, sans; - font-size: 10pt; - text-align: center; - padding: 1em; - text-align: left; -} -.screen .screen-image { - width: 720px; - height: 576px; - border: 1px solid #77d; - display: inline-block; -} -</style> -</head> - -<script> -function onWsMessage(message) { - console.log(message.data); - if (message.data == "EVENT mjpg_streamer started") { - document.getElementById("stream-image").src = "/streamer/?action=stream&time=" + new Date().getTime(); - } -} - -function onKeyPress(event) { - console.log("key pressed: ", event); - let e = event || window.event || arguments.callee.caller.arguments[0]; -// ws.Send("EVENT press " + e.keyCode); -} - -function onKeyRelease(event) { - console.log("key released: ", event); - let e = event || window.event || arguments.callee.caller.arguments[0]; -// ws.Send("EVENT press " + e.keyCode); -} - -ws = new WebSocket("ws://" + location.host + "/kvmd/ws"); -ws.onmessage = (message) => onWsMessage(message); -ws.onerror = (error) => console.error(error); -ws.onclose = () => console.log("closed"); - -//https://www.codeday.top/2017/05/03/24906.html -document.onkeydown = onKeyPress; -document.onkeyup = onKeyRelease; -</script> - -<body> -<div class="screen"> - <img src="/streamer/?action=stream" id="stream-image" class="screen-image" alt="" /> -</div> -</body> -</html> diff --git a/os/platforms/v1/kvmd.yaml b/os/platforms/v1/kvmd.yaml deleted file mode 100644 index 52890551..00000000 --- a/os/platforms/v1/kvmd.yaml +++ /dev/null @@ -1,73 +0,0 @@ -kvmd: - server: - host: localhost - port: 8081 - heartbeat: 3.0 - - keyboard: - pinout: - clock: 17 - data: 4 - - pulse: 0.0002 - - atx: - pinout: - power_led: 16 - hdd_led: 12 - power_switch: 26 - reset_switch: 20 - - click_delay: 0.1 - long_click_delay: 5.5 - - state_poll: 0.1 - - msd: - device: "/dev/kvmd-msd" - init_delay: 2.0 - write_meta: true - chunk_size: 8192 - - streamer: - pinout: - cap: 21 - conv: 25 - - sync_delay: 1.0 - init_delay: 1.0 - shutdown_delay: 10.0 - - size: - width: 720 - height: 576 - - cmd: - - "/usr/bin/mjpg_streamer" - - "-i" - - "input_uvc.so -d /dev/kvmd-streamer -e 2 -y -n -r {width}x{height}" - - "-o" - - "output_http.so -l localhost -p 8082" - -logging: - version: 1 - disable_existing_loggers: false - - formatters: - console: - (): logging.Formatter - style: "{" - datefmt: "%H:%M:%S" - format: "[{asctime}] {name:20.20} {levelname:>7} --- {message}" - - handlers: - console: - level: DEBUG - class: logging.StreamHandler - stream: ext://sys.stdout - formatter: console - - root: - level: INFO - handlers: - - console diff --git a/os/platforms/v1/nginx.conf b/os/platforms/v1/nginx.conf deleted file mode 100644 index 0cb74801..00000000 --- a/os/platforms/v1/nginx.conf +++ /dev/null @@ -1,76 +0,0 @@ -user http; -worker_processes 4; - -# error_log /tmp/nginx.error.log; -error_log /dev/null crit; - -events { - worker_connections 64; - use epoll; -} - -http { - include mime.types; - default_type application/octet-stream; - charset utf-8; - - sendfile on; - keepalive_timeout 10; - # gzip on; - - upstream kvmd { - server localhost:8081 fail_timeout=0s max_fails=0; - } - - upstream mjpg_streamer { - server localhost:8082 fail_timeout=0s max_fails=0; - } - - server { - # access_log /tmp/nginx.access.log; - access_log off; - - listen 80; - server_name localhost; - - client_body_temp_path /tmp/nginx.client_body_temp; - fastcgi_temp_path /tmp/nginx.fastcgi_temp; - proxy_temp_path /tmp/nginx.proxy_temp; - scgi_temp_path /tmp/nginx.scgi_temp; - uwsgi_temp_path /tmp/nginx.uwsgi_temp; - - location / { - root /srv/http; - index index.html; - } - - location /kvmd/ws { - rewrite /kvmd/ws /ws break; - 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 /kvmd/msd/write { - rewrite /kvmd/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 /kvmd { - rewrite /kvmd/?(.*) /$1 break; - proxy_pass http://kvmd; - } - - location /streamer { - rewrite /streamer/?(.*) /$1 break; - proxy_pass http://mjpg_streamer; - } - } -} |