summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configs/nginx/nginx.conf28
-rw-r--r--web/index.html2
-rw-r--r--web/share/js/index/main.js4
-rw-r--r--web/share/js/kvm/atx.js2
-rw-r--r--web/share/js/kvm/hid.js2
-rw-r--r--web/share/js/kvm/main.js2
-rw-r--r--web/share/js/kvm/msd.js6
-rw-r--r--web/share/js/kvm/session.js6
-rw-r--r--web/share/js/kvm/stream.js4
-rw-r--r--web/share/js/login/main.js2
10 files changed, 29 insertions, 29 deletions
diff --git a/configs/nginx/nginx.conf b/configs/nginx/nginx.conf
index 8cfde430..444d5aab 100644
--- a/configs/nginx/nginx.conf
+++ b/configs/nginx/nginx.conf
@@ -55,9 +55,9 @@ http {
server_name localhost;
#PROD include /etc/kvmd/nginx/ssl.conf;
- auth_request /auth;
+ auth_request /auth_check;
- location = /auth {
+ location = /auth_check {
internal;
proxy_pass http://kvmd/auth/check;
proxy_pass_request_body off;
@@ -95,18 +95,18 @@ http {
auth_request off;
}
- location /kvmd/ws {
- rewrite ^/kvmd/ws$ /ws break;
- rewrite ^/kvmd/ws\?(.*)$ /ws?$1 break;
+ location /api/ws {
+ rewrite ^/api/ws$ /ws break;
+ rewrite ^/api/ws\?(.*)$ /ws?$1 break;
proxy_pass http://kvmd;
include /etc/kvmd/nginx/loc-proxy.conf;
include /etc/kvmd/nginx/loc-websocket.conf;
auth_request off;
}
- location /kvmd/msd/write {
- rewrite ^/kvmd/msd/write$ /msd/write break;
- rewrite ^/kvmd/msd/write\?(.*)$ /msd/write?$1 break;
+ location /api/msd/write {
+ rewrite ^/api/msd/write$ /msd/write break;
+ rewrite ^/api/msd/write\?(.*)$ /msd/write?$1 break;
proxy_pass http://kvmd;
include /etc/kvmd/nginx/loc-proxy.conf;
limit_rate 6250k;
@@ -116,9 +116,9 @@ http {
auth_request off;
}
- location /kvmd/log {
- rewrite ^/kvmd/log$ /log break;
- rewrite ^/kvmd/log\?(.*)$ /log?$1 break;
+ location /api/log {
+ rewrite ^/api/log$ /log break;
+ rewrite ^/api/log\?(.*)$ /log?$1 break;
proxy_pass http://kvmd;
include /etc/kvmd/nginx/loc-proxy.conf;
proxy_read_timeout 7d;
@@ -128,9 +128,9 @@ http {
auth_request off;
}
- location /kvmd {
- rewrite ^/kvmd$ / break;
- rewrite ^/kvmd/(.*)$ /$1 break;
+ location /api {
+ rewrite ^/api$ / break;
+ rewrite ^/api/(.*)$ /$1 break;
proxy_pass http://kvmd;
include /etc/kvmd/nginx/loc-proxy.conf;
auth_request off;
diff --git a/web/index.html b/web/index.html
index e7ab8f3d..755880c1 100644
--- a/web/index.html
+++ b/web/index.html
@@ -72,7 +72,7 @@
<table>
<tr class="server">
<td>Server:</td>
- <td><a id="kvmd-meta-server-host" target="_blank" href="/kvmd/info"></a></td>
+ <td><a id="kvmd-meta-server-host" target="_blank" href="/api/info"></a></td>
</tr>
</table>
<hr>
diff --git a/web/share/js/index/main.js b/web/share/js/index/main.js
index beb6fbd9..9b3780aa 100644
--- a/web/share/js/index/main.js
+++ b/web/share/js/index/main.js
@@ -45,7 +45,7 @@ function __setAppText() {
}
function __loadKvmdInfo() {
- let http = tools.makeRequest("GET", "/kvmd/info", function() {
+ let http = tools.makeRequest("GET", "/api/info", function() {
if (http.readyState === 4) {
if (http.status === 200) {
let info = JSON.parse(http.responseText).result;
@@ -101,7 +101,7 @@ function __makeApp(id, path, icon, name) {
}
function __logout() {
- let http = tools.makeRequest("POST", "/kvmd/auth/logout", function() {
+ let http = tools.makeRequest("POST", "/api/auth/logout", function() {
if (http.readyState === 4) {
if (http.status === 200 || http.status === 401 || http.status === 403) {
document.location.href = "/login";
diff --git a/web/share/js/kvm/atx.js b/web/share/js/kvm/atx.js
index b0da761e..b718b99c 100644
--- a/web/share/js/kvm/atx.js
+++ b/web/share/js/kvm/atx.js
@@ -56,7 +56,7 @@ function Atx() {
var __clickButton = function(button, confirm_msg) {
wm.confirm(confirm_msg).then(function(ok) {
if (ok) {
- let http = tools.makeRequest("POST", "/kvmd/atx/click?button=" + button, function() {
+ let http = tools.makeRequest("POST", "/api/atx/click?button=" + button, function() {
if (http.readyState === 4) {
if (http.status === 409) {
wm.error("Performing another ATX operation for other client.<br>Please try again later");
diff --git a/web/share/js/kvm/hid.js b/web/share/js/kvm/hid.js
index 17b21ca9..345b28eb 100644
--- a/web/share/js/kvm/hid.js
+++ b/web/share/js/kvm/hid.js
@@ -215,7 +215,7 @@ function Hid() {
var __clickResetButton = function() {
wm.confirm("Are you sure you want to reset HID (keyboard & mouse)?").then(function(ok) {
if (ok) {
- let http = tools.makeRequest("POST", "/kvmd/hid/reset", function() {
+ let http = tools.makeRequest("POST", "/api/hid/reset", function() {
if (http.readyState === 4) {
if (http.status !== 200) {
wm.error("HID reset error:<br>", http.responseText);
diff --git a/web/share/js/kvm/main.js b/web/share/js/kvm/main.js
index 308b34c0..dcbb1eeb 100644
--- a/web/share/js/kvm/main.js
+++ b/web/share/js/kvm/main.js
@@ -35,7 +35,7 @@ function main() {
tools.setOnClick($("show-about-button"), () => wm.showWindow($("about-window")));
tools.setOnClick($("show-keyboard-button"), () => wm.showWindow($("keyboard-window")));
tools.setOnClick($("show-stream-button"), () => wm.showWindow($("stream-window")));
- tools.setOnClick($("open-log-button"), () => window.open("/kvmd/log?seek=3600&follow=1", "_blank"));
+ tools.setOnClick($("open-log-button"), () => window.open("/api/log?seek=3600&follow=1", "_blank"));
wm.showWindow($("stream-window"));
diff --git a/web/share/js/kvm/msd.js b/web/share/js/kvm/msd.js
index 09dfd7bf..d8059cab 100644
--- a/web/share/js/kvm/msd.js
+++ b/web/share/js/kvm/msd.js
@@ -57,7 +57,7 @@ function Msd() {
form_data.append("image_data", __image_file);
__upload_http = new XMLHttpRequest();
- __upload_http.open("POST", "/kvmd/msd/write", true);
+ __upload_http.open("POST", "/api/msd/write", true);
__upload_http.upload.timeout = 5000;
__upload_http.onreadystatechange = __uploadStateChange;
__upload_http.upload.onprogress = __uploadProgress;
@@ -74,7 +74,7 @@ function Msd() {
};
var __clickSwitchButton = function(to) {
- let http = tools.makeRequest("POST", "/kvmd/msd/connect?to=" + to, function() {
+ let http = tools.makeRequest("POST", "/api/msd/connect?to=" + to, function() {
if (http.readyState === 4) {
if (http.status !== 200) {
wm.error("Switch error:<br>", http.responseText);
@@ -101,7 +101,7 @@ function Msd() {
var __clickResetButton = function() {
wm.confirm("Are you sure you want to reset Mass Storage Device?").then(function(ok) {
if (ok) {
- let http = tools.makeRequest("POST", "/kvmd/msd/reset", function() {
+ let http = tools.makeRequest("POST", "/api/msd/reset", function() {
if (http.readyState === 4) {
if (http.status !== 200) {
wm.error("MSD reset error:<br>", http.responseText);
diff --git a/web/share/js/kvm/session.js b/web/share/js/kvm/session.js
index adeb330e..b01fbe34 100644
--- a/web/share/js/kvm/session.js
+++ b/web/share/js/kvm/session.js
@@ -46,7 +46,7 @@ function Session() {
let text = JSON.stringify(state.meta, undefined, 4).replace(/ /g, "&nbsp;").replace(/\n/g, "<br>");
$("about-meta").innerHTML = `
<span class="code-comment">// The Pi-KVM metadata.<br>
- // You can get this json using handle <a target="_blank" href="/kvmd/info">/kvmd/info</a>.<br>
+ // You can get this json using handle <a target="_blank" href="/api/info">/api/info</a>.<br>
// In the standard configuration this data<br>
// is specified in the file /etc/kvmd/meta.yaml.</span><br>
<br>
@@ -69,11 +69,11 @@ function Session() {
$("link-led").className = "led-yellow";
$("link-led").title = "Connecting...";
- let http = tools.makeRequest("GET", "/kvmd/auth/check", function() {
+ let http = tools.makeRequest("GET", "/api/auth/check", function() {
if (http.readyState === 4) {
if (http.status === 200) {
let proto = (location.protocol === "https:" ? "wss" : "ws");
- __ws = new WebSocket(`${proto}://${location.host}/kvmd/ws`);
+ __ws = new WebSocket(`${proto}://${location.host}/api/ws`);
__ws.onopen = __wsOpenHandler;
__ws.onmessage = __wsMessageHandler;
__ws.onerror = __wsErrorHandler;
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js
index e34fc7dc..0a0de313 100644
--- a/web/share/js/kvm/stream.js
+++ b/web/share/js/kvm/stream.js
@@ -187,7 +187,7 @@ function Streamer() {
var __clickResetButton = function() {
wm.confirm("Are you sure you want to reset stream?").then(function (ok) {
if (ok) {
- let http = tools.makeRequest("POST", "/kvmd/streamer/reset", function() {
+ let http = tools.makeRequest("POST", "/api/streamer/reset", function() {
if (http.readyState === 4) {
if (http.status !== 200) {
wm.error("Can't reset stream:<br>", http.responseText);
@@ -199,7 +199,7 @@ function Streamer() {
};
var __sendParam = function(name, value) {
- let http = tools.makeRequest("POST", `/kvmd/streamer/set_params?${name}=${value}`, function() {
+ let http = tools.makeRequest("POST", `/api/streamer/set_params?${name}=${value}`, function() {
if (http.readyState === 4) {
if (http.status !== 200) {
wm.error("Can't configure stream:<br>", http.responseText);
diff --git a/web/share/js/login/main.js b/web/share/js/login/main.js
index bf185bf0..cd0746fc 100644
--- a/web/share/js/login/main.js
+++ b/web/share/js/login/main.js
@@ -45,7 +45,7 @@ function __login() {
} else {
let passwd = $("passwd-input").value;
let body = `user=${encodeURIComponent(user)}&passwd=${encodeURIComponent(passwd)}`;
- let http = tools.makeRequest("POST", "/kvmd/auth/login", function() {
+ let http = tools.makeRequest("POST", "/api/auth/login", function() {
if (http.readyState === 4) {
if (http.status === 200) {
document.location.href = "/";