extras data for ipmi

This commit is contained in:
Devaev Maxim 2019-04-30 01:53:56 +03:00
parent fb9b1b555d
commit 04277a7c52
9 changed files with 417 additions and 37 deletions

View File

@ -3,12 +3,12 @@
# is the name and password with which the user can access to KVMD API. The arrow is used
# as a separator and shows the direction of user registration in the system.
#
# WARNING! IPMI protocol is completly unsafe by design. In short, the authentication
# WARNING! IPMI protocol is completely unsafe by design. In short, the authentication
# process for IPMI 2.0 mandates that the server send a salted SHA1 or MD5 hash of the
# requested user's password to the client, prior to the client authenticating. Never use
# the same passwords for KVMD and IPMI users. This default configuration is shown here
# for example only.
#
# And even better not to use IPMI. Instead, you can directly use KVMD API using curl.
# And even better not to use IPMI. Instead, you can directly use KVMD API via curl.
admin:admin -> admin:admin

0
extras/.gitignore vendored
View File

View File

@ -0,0 +1,7 @@
name: IPMI
description: Show IPMI information
icon: share/svg/ipmi.svg
path: ipmi
keyboard_cap: false
daemon: kvmd-ipmi
place: 20

View File

@ -38,6 +38,7 @@
<link rel="stylesheet" href="share/css/main.css">
<link rel="stylesheet" href="share/css/windows.css">
<link rel="stylesheet" href="share/css/modals.css">
<link rel="stylesheet" href="share/css/start.css">
<link rel="stylesheet" href="share/css/index/index.css">
<script src="share/js/bb.js"></script>
@ -49,8 +50,8 @@
</head>
<body>
<div id="start-box">
<div id="start">
<div class="start-box">
<div class="start">
<table>
<tr>
<td valign="top" class="logo">

72
web/ipmi/index.html Normal file
View File

@ -0,0 +1,72 @@
<!DOCTYPE html>
<!-- =========================================================================
# #
# KVMD - The main Pi-KVM daemon. #
# #
# Copyright (C) 2018 Maxim Devaev <mdevaev@gmail.com> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
# #
========================================================================== -->
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Pi-KVM IPMI Info</title>
<link rel="apple-touch-icon" sizes="180x180" href="/share/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/share/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/share/favicon-16x16.png">
<link rel="manifest" href="/share/site.webmanifest">
<link rel="mask-icon" href="/share/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="../share/css/vars.css">
<link rel="stylesheet" href="../share/css/main.css">
<link rel="stylesheet" href="../share/css/start.css">
<script src="../share/js/tools.js"></script>
<script src="../share/js/ipmi/main.js"></script>
<script>window.onload = main;</script>
</head>
<body>
<div class="start-box">
<div class="start">
<a style="display: inline-block; margin-top: 4px; color:#5c90bc; text-decoration: none;" href="/">
&nbsp;&nbsp;&larr;&nbsp;&nbsp; [ Pi-KVM Index ]
</a>
<hr>
<p class="text">
This Pi-KVM device has running kvmd-ipmi daemon and provides IPMI 2.0 port (default 623)
for some basic BMC operations like on/off/reset for the server.
</p>
<p class="text">
<b>WARNING!</b> We strongly don't recommend you to use IPMI in untrusted networks because
this protocol is completely unsafe by design. In short, the authentication process for IPMI mandates
that the server send a salted SHA1 or MD5 hash of the requested user's password to the client,
prior to the client authenticating.
</p>
<p class="text">
<b>NEVER</b> use the same passwords for KVMD and IPMI users. And even better not to use IPMI.
Instead, you can directly use KVMD API via curl. We gave here some examples for this:
</p>
<div id="ipmi-text" class="code" style="max-height:200px;"></div>
</div>
</div>
</body>
</html>

View File

@ -20,46 +20,24 @@
*****************************************************************************/
div#start-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
min-height: 100vh;
}
div#start {
text-align: left;
outline: none;
word-wrap: break-word;
max-width: 800px;
border: var(--border-window-thin);
border-radius: 8px;
box-sizing: border-box;
box-shadow: var(--shadow-big);
background-color: var(--cs-window-default-bg);
padding: 15px;
}
div#start div#apps-box {
div#apps-box {
display: table;
margin: 0 auto;
}
div#start div#apps-box ul#apps {
div#apps-box ul#apps {
list-style-type: none;
padding: 0;
margin: 0;
}
div#start div#apps-box ul#apps li {
div#apps-box ul#apps li {
float: left;
margin-left: 5px;
margin-right: 5px;
}
div#start div#apps-box ul#apps li div.app {
div#apps-box ul#apps li div.app {
height: 100px;
width: 100px;
text-align: center;
@ -69,19 +47,19 @@ div#start div#apps-box ul#apps li div.app {
border-radius: 8px;
}
div#start div#apps-box ul#apps li div:hover.app {
div#apps-box ul#apps li div:hover.app {
border: var(--border-intensive-thin);
box-shadow: none;
}
div#start div#apps-box ul#apps li div.app img {
div#apps-box ul#apps li div.app img {
display: block;
margin: auto;
height: 50px;
padding-bottom: 5px;
}
div#start div#apps-box ul#apps li div.app a {
div#apps-box ul#apps li div.app a {
display: flex;
flex-direction: column;
justify-content: center;
@ -90,16 +68,16 @@ div#start div#apps-box ul#apps li div.app a {
font-weight: bold;
}
div#start td.logo {
td.logo {
padding-right: 25px;
}
div#start td.title {
td.title {
font-size: 1.2em;
}
div#start td.copyright {
td.copyright {
font-size: 0.8em;
}
div#start tr.server {
tr.server {
font-size: 1.4em;
font-weight: bold;
font-family: monospace;

43
web/share/css/start.css Normal file
View File

@ -0,0 +1,43 @@
/*****************************************************************************
# #
# KVMD - The main Pi-KVM daemon. #
# #
# Copyright (C) 2018 Maxim Devaev <mdevaev@gmail.com> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
# #
*****************************************************************************/
div.start-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
min-height: 100vh;
}
div.start-box div.start {
text-align: left;
outline: none;
word-wrap: break-word;
max-width: 800px;
border: var(--border-window-thin);
border-radius: 8px;
box-sizing: border-box;
box-shadow: var(--shadow-big);
background-color: var(--cs-window-default-bg);
padding: 15px;
}

52
web/share/js/ipmi/main.js Normal file
View File

@ -0,0 +1,52 @@
/*****************************************************************************
# #
# KVMD - The main Pi-KVM daemon. #
# #
# Copyright (C) 2018 Maxim Devaev <mdevaev@gmail.com> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
# #
*****************************************************************************/
function main() {
let host = window.location.hostname;
let site = window.location.protocol + "//" + window.location.host;
$("ipmi-text").innerHTML = `
<span class="code-comment"># Power on the server if it's off:<br>
$</span> ipmitool -I lanplus -U admin -P admin -H ${host} power on<br>
<span class="code-comment">$</span> curl -XPOST -HX-KVMD-User:admin -HX-KVMD-Passwd:admin -k \\<br>
&nbsp;&nbsp;&nbsp;&nbsp;${site}/api/atx/power?action=on<br>
<br>
<span class="code-comment"># Soft power off the server if it's on:<br>
$</span> ipmitool -I lanplus -U admin -P admin -H ${host} power soft<br>
<span class="code-comment">$</span> curl -XPOST -HX-KVMD-User:admin -HX-KVMD-Passwd:admin -k \\<br>
&nbsp;&nbsp;&nbsp;&nbsp;${site}/api/atx/power?action=off<br>
<br>
<span class="code-comment"># Hard power off the server if it's on:<br>
$</span> ipmitool -I lanplus -U admin -P admin -H ${host} power off<br>
<span class="code-comment">$</span> curl -XPOST -HX-KVMD-User:admin -HX-KVMD-Passwd:admin -k \\<br>
&nbsp;&nbsp;&nbsp;&nbsp;${site}/api/atx/power?action=off_hard<br>
<br>
<span class="code-comment"># Hard reset the server if it's on:<br>
$</span> ipmitool -I lanplus -U admin -P admin -H ${host} power reset<br>
<span class="code-comment">$</span> curl -XPOST -HX-KVMD-User:admin -HX-KVMD-Passwd:admin -k \\<br>
&nbsp;&nbsp;&nbsp;&nbsp;${site}/api/atx/power?action=reset_hard<br>
<br>
<span class="code-comment"># Check the power status:<br>
$</span> ipmitool -I lanplus -U admin -P admin -H ${host} power status<br>
<span class="code-comment">$</span> curl -HX-KVMD-User:admin -HX-KVMD-Passwd:admin -k \\<br>
&nbsp;&nbsp;&nbsp;&nbsp;${site}/api/atx
`;
}

227
web/share/svg/ipmi.svg Normal file
View File

@ -0,0 +1,227 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 512.015 512.015"
style="enable-background:new 0 0 512.015 512.015;"
xml:space="preserve"
sodipodi:docname="server-svgrepo-com3.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"><metadata
id="metadata3929"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs3927">
</defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1018"
id="namedview3925"
showgrid="false"
inkscape:zoom="1.6620606"
inkscape:cx="147.70821"
inkscape:cy="256.00751"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<g
id="g3826">
<g
id="g3824">
<circle
cx="69.818"
cy="69.826"
r="11.636"
id="circle3822"
style="stroke-width:20;stroke-miterlimit:4;stroke-dasharray:none;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1" />
</g>
</g>
<g
id="g3832"
transform="translate(20)">
<g
id="g3830">
<circle
cx="116.364"
cy="69.825996"
r="11.636"
id="circle3828"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:20;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
<g
style="fill:#000000;fill-opacity:1"
id="g3836">
<path
inkscape:connector-curvature="0"
style="fill:#000000;fill-opacity:1"
id="path3834"
d="m 290.909,465.462 h -2.141 C 283.951,451.952 271.151,442.189 256,442.189 H 232.727 V 407.28 c 0,-6.423 -5.213,-11.636 -11.636,-11.636 -6.423,0 -11.636,5.213 -11.636,11.636 v 34.909 h -23.273 c -15.151,0 -27.951,9.763 -32.768,23.273 H 81.455 c -6.423,0 -11.636,5.213 -11.636,11.636 0,6.423 5.213,11.636 11.636,11.636 h 71.959 c 4.817,13.51 17.617,23.273 32.768,23.273 H 256 c 15.151,0 27.951,-9.763 32.768,-23.273 h 2.153 c 6.423,0 11.625,-5.213 11.625,-11.636 -10e-4,-6.423 -5.214,-11.636 -11.637,-11.636 z"
sodipodi:nodetypes="scscssscscssscsscscs" />
</g>
<g
id="g3844">
<g
id="g3842">
<path
d="M372.364,58.189H209.455c-6.423,0-11.636,5.213-11.636,11.636s5.213,11.636,11.636,11.636h162.909 c6.435,0,11.636-5.213,11.636-11.636S378.799,58.189,372.364,58.189z"
id="path3840" />
</g>
</g>
<g
id="g3850">
<g
id="g3848">
<circle
cx="69.818"
cy="302.553"
r="11.636"
id="circle3846"
style="stroke-width:20;stroke-miterlimit:4;stroke-dasharray:none;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1" />
</g>
</g>
<g
id="g3856"
transform="translate(20)">
<g
id="g3854">
<circle
cx="116.364"
cy="302.55301"
r="11.636"
id="circle3852"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:20;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
<g
id="g3862">
<g
id="g3860">
<path
d="M325.818,290.917H209.455c-6.423,0-11.636,5.213-11.636,11.636s5.213,11.636,11.636,11.636h116.364 c6.435,0,11.636-5.213,11.636-11.636S332.253,290.917,325.818,290.917z"
id="path3858" />
</g>
</g>
<g
id="g3868">
<g
id="g3866">
<circle
cx="69.818"
cy="186.189"
r="11.636"
id="circle3864"
style="stroke-width:20;stroke-miterlimit:4;stroke-dasharray:none;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1" />
</g>
</g>
<g
id="g3874"
style="stroke:#000000;stroke-opacity:1"
transform="translate(20)">
<g
id="g3872"
style="stroke:#000000;stroke-opacity:1">
<circle
cx="116.364"
cy="186.189"
r="11.636"
id="circle3870"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:20;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
<g
id="g3880">
<g
id="g3878">
<path
d="M372.364,174.553H209.455c-6.423,0-11.636,5.213-11.636,11.636s5.213,11.636,11.636,11.636h162.909 c6.435,0,11.636-5.213,11.636-11.636S378.799,174.553,372.364,174.553z"
id="path3876" />
</g>
</g>
<g
id="g3886">
<g
id="g3884">
<path
d="M430.545,93.098c6.435,0,11.636-5.213,11.636-11.636V34.917c0-19.247-15.663-34.909-34.909-34.909H34.909 C15.663,0.007,0,15.67,0,34.917v93.091v0.012v69.807c0,6.423,5.213,11.636,11.636,11.636s11.636-5.213,11.636-11.636v-58.17 l395.636-0.012v93.091l-407.273,0.012C5.213,232.746,0,237.959,0,244.383v93.079c0,19.247,15.663,34.909,34.909,34.909h232.727 c6.423,0,11.636-5.213,11.636-11.636s-5.213-11.636-11.636-11.636H34.909c-6.412,0-11.636-5.225-11.636-11.636v-81.443 l395.636-0.012v46.545c0,6.423,5.201,11.636,11.636,11.636s11.636-5.213,11.636-11.636v-58.182V128.007 c0-3.084-1.222-6.051-3.409-8.227c-2.188-2.176-5.132-3.409-8.227-3.409l-407.273,0.012V34.917 c0-6.412,5.225-11.636,11.636-11.636h372.364c6.423,0,11.636,5.225,11.636,11.636v46.545 C418.909,87.885,424.111,93.098,430.545,93.098z"
id="path3882" />
</g>
</g>
<path
d="m 459.811,414.553 c 9.367,0 18.723,-3.561 25.856,-10.682 0.012,-0.012 0.023,-0.035 0.035,-0.058 0.012,-0.012 0.012,-0.012 0.023,-0.012 l 22.935,-23.273 c 4.515,-4.573 4.468,-11.939 -0.116,-16.454 -4.596,-4.515 -11.951,-4.468 -16.454,0.128 l -22.842,23.18 c -0.012,0.012 -0.023,0.012 -0.035,0.023 -5.178,5.178 -13.615,5.178 -18.793,0 -2.513,-2.502 -3.898,-5.841 -3.898,-9.391 0,-3.549 1.385,-6.889 3.898,-9.391 l 23.215,-22.877 c 4.585,-4.515 4.62,-11.881 0.116,-16.454 -4.492,-4.585 -11.857,-4.62 -16.454,-0.128 l -23.273,22.935 c -0.012,0.012 -0.012,0.023 -0.023,0.035 -0.012,0.012 -0.023,0.012 -0.035,0.023 -6.912,6.912 -10.717,16.093 -10.717,25.856 0,5.737 1.455,11.194 3.933,16.175 l -15.139,15.139 c -3.584,-1.28 -7.389,-1.827 -11.194,-1.676 l -23.668,-23.645 15.046,-15.046 c 4.55,-4.55 4.55,-11.904 0,-16.454 l -23.273,-23.273 c -4.55,-4.55 -11.904,-4.55 -16.454,0 l -46.545,46.545 c -3.119,3.119 -4.201,7.727 -2.804,11.904 l 11.636,34.909 c 1.268,3.828 4.433,6.714 8.367,7.645 0.884,0.209 1.78,0.314 2.665,0.314 3.049,0 6.028,-1.199 8.227,-3.409 l 26.682,-26.682 18.164,18.164 -44.719,44.719 c -5.388,5.388 -8.355,12.544 -8.355,20.154 0,7.61 2.967,14.778 8.355,20.154 5.388,5.388 12.544,8.355 20.154,8.355 7.61,0 14.778,-2.967 20.143,-8.355 l 44.73,-44.719 49.664,49.664 c 2.269,2.269 5.248,3.409 8.227,3.409 2.979,0 5.958,-1.14 8.227,-3.409 4.55,-4.55 4.55,-11.904 0,-16.454 l -54.912,-54.912 c 0.023,-0.489 0.14,-0.954 0.14,-1.455 0,-3.526 -0.698,-6.935 -1.92,-10.135 l 15.023,-15.023 c 5.096,2.529 10.6,3.937 16.162,3.937 z"
id="path3888"
inkscape:connector-curvature="0"
sodipodi:nodetypes="scccccccccscccccccsccccssssscccscccsscsccsssscsccs" />
<g
id="g3894">
</g>
<g
id="g3896">
</g>
<g
id="g3898">
</g>
<g
id="g3900">
</g>
<g
id="g3902">
</g>
<g
id="g3904">
</g>
<g
id="g3906">
</g>
<g
id="g3908">
</g>
<g
id="g3910">
</g>
<g
id="g3912">
</g>
<g
id="g3914">
</g>
<g
id="g3916">
</g>
<g
id="g3918">
</g>
<g
id="g3920">
</g>
<g
id="g3922">
</g>
<path
style="fill:#000000;fill-opacity:1;stroke-width:0.60166276"
d=""
id="path4738"
inkscape:connector-curvature="0" /></svg>

After

Width:  |  Height:  |  Size: 7.6 KiB