summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kvmd/Makefile8
-rw-r--r--kvmd/configs/nginx/nginx.conf.example22
-rw-r--r--kvmd/testenv/nginx.conf76
-rw-r--r--os/platforms/v1/Dockerfile.part2
4 files changed, 17 insertions, 91 deletions
diff --git a/kvmd/Makefile b/kvmd/Makefile
index fa47bdbc..fd98dc4b 100644
--- a/kvmd/Makefile
+++ b/kvmd/Makefile
@@ -4,7 +4,8 @@ TESTENV_VIDEO ?= /dev/video0
TESTENV_LOOP ?= /dev/loop7
TESTENV_CMD ?= /bin/bash -c " \
(socat PTY,link=$(TESTENV_HID) PTY,link=/dev/ttyS11 &) \
- && nginx -c /testenv/nginx.conf \
+ && cp /configs/nginx/nginx.conf.example /etc/nginx/nginx.conf \
+ && nginx -c /etc/nginx/nginx.conf \
&& ln -s $(TESTENV_VIDEO) /dev/kvmd-streamer \
&& (losetup -d /dev/kvmd-msd || true) \
&& losetup /dev/kvmd-msd /root/loop.img \
@@ -21,11 +22,12 @@ run:
docker build --rm --tag $(TESTENV_IMAGE) -f testenv/Dockerfile .
- docker run --rm \
--volume `pwd`/kvmd:/kvmd:ro \
- --volume `pwd`/web:/web:ro \
+ --volume `pwd`/web:/usr/share/kvmd/web:ro \
--volume `pwd`/testenv:/testenv:ro \
+ --volume `pwd`/configs:/configs:ro \
--device $(TESTENV_LOOP):/dev/kvmd-msd \
--device $(TESTENV_VIDEO):$(TESTENV_VIDEO) \
- --publish 8080:8080/tcp \
+ --publish 8080:80/tcp \
--publish 8081:8081/tcp \
--publish 8082:8082/tcp \
-it $(TESTENV_IMAGE) $(TESTENV_CMD)
diff --git a/kvmd/configs/nginx/nginx.conf.example b/kvmd/configs/nginx/nginx.conf.example
index cd30f572..f88e9726 100644
--- a/kvmd/configs/nginx/nginx.conf.example
+++ b/kvmd/configs/nginx/nginx.conf.example
@@ -25,11 +25,11 @@ http {
scgi_temp_path /tmp/nginx.scgi_temp;
uwsgi_temp_path /tmp/nginx.uwsgi_temp;
- server {
- listen 80;
- server_name localhost;
- return 301 https://$host$request_uri;
- }
+#PROD server {
+#PROD listen 80;
+#PROD server_name localhost;
+#PROD return 301 https://$host$request_uri;
+#PROD }
upstream kvmd {
server localhost:8081 fail_timeout=0s max_fails=0;
@@ -40,15 +40,15 @@ http {
}
server {
- listen 443 ssl http2;
+#PROD listen 443 ssl http2;
server_name localhost;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
- ssl_certificate ssl/server.crt;
- ssl_certificate_key ssl/server.key;
+#PROD ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+#PROD ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
+#PROD ssl_certificate ssl/server.crt;
+#PROD ssl_certificate_key ssl/server.key;
- add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
+#PROD add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
location / {
root /usr/share/kvmd/web;
diff --git a/kvmd/testenv/nginx.conf b/kvmd/testenv/nginx.conf
deleted file mode 100644
index ed6698cf..00000000
--- a/kvmd/testenv/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 {
- access_log off;
-
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
- charset utf-8;
-
- sendfile on;
- keepalive_timeout 10;
-
- 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;
-
- upstream kvmd {
- server localhost:8081 fail_timeout=0s max_fails=0;
- }
-
- upstream mjpg_streamer {
- server localhost:8082 fail_timeout=0s max_fails=0;
- }
-
- server {
- listen 8080;
- server_name localhost;
-
- location / {
- root /web;
- 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;
- proxy_buffering off;
- proxy_ignore_headers X-Accel-Buffering;
- }
- }
-}
diff --git a/os/platforms/v1/Dockerfile.part b/os/platforms/v1/Dockerfile.part
index b317eb84..73fb762e 100644
--- a/os/platforms/v1/Dockerfile.part
+++ b/os/platforms/v1/Dockerfile.part
@@ -19,7 +19,7 @@ RUN sed -i -e "s/console=ttyAMA0\,115200//g" /boot/cmdline.txt \
&& sed -i -e "s/kgdboc=ttyAMA0\,115200//g" /boot/cmdline.txt
RUN systemctl mask [email protected]
-RUN cp /usr/share/kvmd/configs/nginx/nginx.conf.example /etc/nginx/nginx.conf
+RUN sed -e "s/^#PROD//g" /usr/share/kvmd/configs/nginx/nginx.conf.example > /etc/nginx/nginx.conf
RUN cp /usr/share/kvmd/configs/kvmd/v1.yaml /etc/kvmd.yaml
ARG NEW_HTTPS_CERT