summaryrefslogtreecommitdiff
path: root/configs
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-11-18 08:11:18 +0300
committerDevaev Maxim <[email protected]>2018-11-18 08:11:18 +0300
commit9762c82d0a6c49f052e2d499a6e54585fde4b0a0 (patch)
treeb9a5e844e4656f77deefe5faa6c46ab5d6fde312 /configs
parent51dd9a7428fc0249dd605397ccc955a9fd1cd5cd (diff)
moved lua crutch to kvmd
Diffstat (limited to 'configs')
-rw-r--r--configs/kvmd/platforms/kvmd.v1-hdmi.yaml3
-rw-r--r--configs/kvmd/platforms/kvmd.v1-vga.yaml3
-rw-r--r--configs/nginx/apps/.gitignore0
-rw-r--r--configs/nginx/apps/kvm/manifest.json8
-rw-r--r--configs/nginx/nginx.conf35
5 files changed, 11 insertions, 38 deletions
diff --git a/configs/kvmd/platforms/kvmd.v1-hdmi.yaml b/configs/kvmd/platforms/kvmd.v1-hdmi.yaml
index 46cbbd37..e62790d1 100644
--- a/configs/kvmd/platforms/kvmd.v1-hdmi.yaml
+++ b/configs/kvmd/platforms/kvmd.v1-hdmi.yaml
@@ -1,5 +1,5 @@
# Don't touch this file otherwise your device may stop working.
-# You can find a workable configuration in /usr/share/kvmd/configs/kvmd.
+# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd.
kvmd:
server:
@@ -9,6 +9,7 @@ kvmd:
info:
meta: /etc/kvmd/meta.yaml
+ extras: /usr/share/kvmd/extras
hid:
pinout:
diff --git a/configs/kvmd/platforms/kvmd.v1-vga.yaml b/configs/kvmd/platforms/kvmd.v1-vga.yaml
index dd3ef4db..42baee7a 100644
--- a/configs/kvmd/platforms/kvmd.v1-vga.yaml
+++ b/configs/kvmd/platforms/kvmd.v1-vga.yaml
@@ -1,5 +1,5 @@
# Don't touch this file otherwise your device may stop working.
-# You can find a workable configuration in /usr/share/kvmd/configs/kvmd.
+# You can find a workable configuration in /usr/share/kvmd/configs.default/kvmd.
kvmd:
server:
@@ -9,6 +9,7 @@ kvmd:
info:
meta: /etc/kvmd/meta.yaml
+ extras: /usr/share/kvmd/extras
hid:
pinout:
diff --git a/configs/nginx/apps/.gitignore b/configs/nginx/apps/.gitignore
deleted file mode 100644
index e69de29b..00000000
--- a/configs/nginx/apps/.gitignore
+++ /dev/null
diff --git a/configs/nginx/apps/kvm/manifest.json b/configs/nginx/apps/kvm/manifest.json
deleted file mode 100644
index ed19dc67..00000000
--- a/configs/nginx/apps/kvm/manifest.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "name": "KVM",
- "description": "Open KVM session in a web browser",
- "icon": "/svg/kvm.svg",
- "path": "/kvm.html",
- "place": 0,
- "keyboard_cap": true
-}
diff --git a/configs/nginx/nginx.conf b/configs/nginx/nginx.conf
index 22271d20..ae2703ec 100644
--- a/configs/nginx/nginx.conf
+++ b/configs/nginx/nginx.conf
@@ -6,7 +6,7 @@ worker_processes 4;
# error_log /tmp/nginx.error.log;
error_log stderr;
-include /etc/nginx/apps/*/main-ctx.conf;
+include /usr/share/kvmd/extras/*/nginx.main-ctx.conf;
events {
worker_connections 1024;
@@ -40,26 +40,12 @@ http {
server 127.0.0.1:8082 fail_timeout=0s max_fails=0;
}
- include /etc/nginx/apps/*/http-ctx.conf;
+ include /usr/share/kvmd/extras/*/nginx.http-ctx.conf;
- lua_shared_dict WS_TOKENS 10m;
- init_by_lua_block {
- WS_TOKEN_EXPIRES = 10;
-
- local cjson = require("cjson");
- local io = require("io");
-
- local apps = {};
- local apps_dir_path = "/etc/nginx/apps";
- for app in io.popen("ls " .. apps_dir_path):lines() do
- local manifest_file = assert(io.open(apps_dir_path .. "/" .. app .. "/manifest.json", "r"));
- local manifest = cjson.decode(manifest_file:read("*all"));
- manifest_file:close();
- apps[app] = manifest;
- end
-
- APPS_JSON = cjson.encode(apps);
- }
+#PROD lua_shared_dict WS_TOKENS 10m;
+#PROD init_by_lua_block {
+#PROD WS_TOKEN_EXPIRES = 10;
+#PROD }
#PROD server {
#PROD listen 80;
@@ -98,13 +84,6 @@ http {
}
}
- location /get_apps {
- default_type "application/json";
- content_by_lua_block {
- ngx.say(APPS_JSON);
- }
- }
-
location /kvmd/ws {
#PROD auth_basic off;
#PROD access_by_lua_block {
@@ -165,6 +144,6 @@ http {
proxy_ignore_headers X-Accel-Buffering;
}
- include /etc/nginx/apps/*/server-ctx.conf;
+ include /usr/share/kvmd/extras/*/nginx.server-ctx.conf;
}
}