initial code comit
This commit is contained in:
32
system/help/css/about.css
Normal file
32
system/help/css/about.css
Normal file
@@ -0,0 +1,32 @@
|
||||
.hidden {display: none;}
|
||||
.centered {text-align: center;}
|
||||
|
||||
.help_title {font-weight: bold;}
|
||||
|
||||
.help_ver, .span_ver,
|
||||
.span_ver_date {font-style: italic;}
|
||||
|
||||
.span_author,
|
||||
.span_author_ru {}
|
||||
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 5px 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
height: 1px;
|
||||
background-image: -webkit-linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.25),rgba(0,0,0,0));
|
||||
background-image: -moz-linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.25),rgba(0,0,0,0));
|
||||
background-image: -ms-linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.25),rgba(0,0,0,0));
|
||||
background-image: -o-linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.25),rgba(0,0,0,0));
|
||||
background: linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.25),rgba(0,0,0, 0));
|
||||
}
|
||||
|
||||
article {
|
||||
margin: 10px;
|
||||
}
|
||||
89
system/help/css/help.css
Normal file
89
system/help/css/help.css
Normal file
@@ -0,0 +1,89 @@
|
||||
.hidden {display: none;}
|
||||
.centered {text-align: center;}
|
||||
|
||||
.help_title {font-weight: bold;}
|
||||
|
||||
.help_ver, .span_ver,
|
||||
.span_ver_date {font-style: italic;}
|
||||
|
||||
.tbl_wide {
|
||||
width: 100%;
|
||||
border: solid 1px #ccc;
|
||||
}
|
||||
.tbl_wide .tbl_header {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
background-color: #ccc;
|
||||
}
|
||||
.tbl_wide td {
|
||||
padding: 5px;
|
||||
border: solid 1px #ccc;
|
||||
}
|
||||
|
||||
.mnu_selected {
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.scrollable {overflow: auto;}
|
||||
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 5px 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
height: 1px;
|
||||
background-image: -webkit-linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.25),rgba(0,0,0,0));
|
||||
background-image: -moz-linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.25),rgba(0,0,0,0));
|
||||
background-image: -ms-linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.25),rgba(0,0,0,0));
|
||||
background-image: -o-linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.25),rgba(0,0,0,0));
|
||||
background: linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.25),rgba(0,0,0, 0));
|
||||
}
|
||||
|
||||
nav {
|
||||
width: 200px;
|
||||
box-shadow: 5px 5px 5px #ccc;
|
||||
position: fixed;
|
||||
padding: 2px;
|
||||
margin-left: 10px;
|
||||
border: solid 1px #ccc;
|
||||
}
|
||||
nav ul {
|
||||
padding: 0;
|
||||
margin: 2px;
|
||||
list-style: none;
|
||||
transition: all 0.5s ease-out 0.1s;
|
||||
}
|
||||
nav ul li {
|
||||
cursor: pointer;
|
||||
}
|
||||
nav ul li ul {
|
||||
padding: 0 0 0 2px;
|
||||
}
|
||||
nav ul li div {
|
||||
padding: 2px 2px 2px 4px;
|
||||
}
|
||||
nav ul li div:hover {
|
||||
background-color: #ddd;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
article {
|
||||
margin: 2px 2px 2px 225px;
|
||||
transition: all 0.5s ease-out 0.1s;
|
||||
}
|
||||
|
||||
a, a:visited, a:hover {
|
||||
color: #555;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {text-decoration: underline;}
|
||||
|
||||
#div_license {
|
||||
height: 150px;
|
||||
}
|
||||
13
system/help/index.html
Normal file
13
system/help/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CAI CP: Help</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="css/help.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
Loading...
|
||||
<script src="js/help.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
201
system/help/js/help.js
Normal file
201
system/help/js/help.js
Normal file
@@ -0,0 +1,201 @@
|
||||
// MIT License:
|
||||
//
|
||||
// Copyright (c) 2016-2017, Alexander I. Chebykin
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
/**
|
||||
* CAI CP v.1
|
||||
*
|
||||
* @module : Help subsystem
|
||||
* @author : Alexander I. Chebykin <alex.chebykin@gmail.com>
|
||||
* @copyright : Copyright (c) 2016-2017 Alexander I. Chebykin
|
||||
* @version : 0.9
|
||||
* @build date : 2017-06-16
|
||||
* @license : MIT
|
||||
* @link : https://github.com/CAI79/CAI-CP
|
||||
******************************************************************/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Return GET parameter
|
||||
*
|
||||
* @param {string} key Key name
|
||||
*
|
||||
* returns {string}
|
||||
*/
|
||||
function $_GET(key) {
|
||||
var s = window.location.search;
|
||||
|
||||
s = s.match(new RegExp(key + '=([^&=]+)'));
|
||||
|
||||
return s ? s[1] : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* HelpSystem constructor
|
||||
*
|
||||
* @returns {undefined}
|
||||
*/
|
||||
function HelpSystem() {
|
||||
this.locale = 'en';
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {int} init_level Initialization level: 1 - select locale
|
||||
* 2 - redirect to localized resource
|
||||
* 3 - load version info
|
||||
* 4 - set event handlers
|
||||
*
|
||||
* @returns {undefined}
|
||||
*/
|
||||
HelpSystem.prototype.init = function (init_level) {
|
||||
var help_instance = this;
|
||||
|
||||
switch (init_level) {
|
||||
case 1:
|
||||
if ($_GET('lang') !== '') {
|
||||
this.locale = $_GET('lang');
|
||||
} else {
|
||||
var request = new XMLHttpRequest(),
|
||||
res_data;
|
||||
|
||||
if (!~location.href.indexOf('locale')) {
|
||||
request.open('GET', '../json/settings.json');
|
||||
} else {
|
||||
request.open('GET', '../../../json/settings.json');
|
||||
}
|
||||
request.send();
|
||||
|
||||
request.onreadystatechange = function () {
|
||||
if (this.readyState === 4) {
|
||||
if (this.status === 200) {
|
||||
res_data = JSON.parse(this.responseText);
|
||||
|
||||
help_instance.locale = res_data.lang;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
this.init(2);
|
||||
break;
|
||||
case 2:
|
||||
if (!~location.href.indexOf('locale')) {
|
||||
location.href = 'locale/' + this.locale + location.hash;
|
||||
return;
|
||||
} else {
|
||||
this.init(3);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
var request = new XMLHttpRequest(),
|
||||
res_data;
|
||||
|
||||
if (!~location.href.indexOf('locale')) {
|
||||
request.open('GET', '../json/version.json');
|
||||
} else {
|
||||
request.open('GET', '../../../json/version.json');
|
||||
}
|
||||
request.send();
|
||||
|
||||
request.onreadystatechange = function (e) {
|
||||
if (this.readyState === 4) {
|
||||
if (this.status === 200) {
|
||||
res_data = JSON.parse(this.responseText);
|
||||
|
||||
var vers = document.getElementsByClassName('span_ver'),
|
||||
ver_dates = document.getElementsByClassName('span_ver_date');
|
||||
|
||||
for (var i = 0; i < vers.length; i++) {
|
||||
vers[i].textContent = res_data.version;
|
||||
}
|
||||
for (var i = 0; i < ver_dates.length; i++) {
|
||||
ver_dates[i].textContent = new Date(res_data.build_date).toLocaleDateString();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
this.init(4);
|
||||
break;
|
||||
case 4:
|
||||
var nav_list = document.getElementsByTagName('nav'),
|
||||
toc_lis = document.getElementById('menu_toc').getElementsByTagName('li');
|
||||
|
||||
// Show menu
|
||||
for (var i = 0; i < nav_list.length; i++) {
|
||||
nav_list[i].classList.remove('hidden');
|
||||
}
|
||||
|
||||
// Add event listeners
|
||||
for (var i = 0; i < toc_lis.length; i++) {
|
||||
toc_lis[i].getElementsByTagName('div')[0].addEventListener('click', function (event) {
|
||||
help_instance.select_topic(this.parentElement.id.substr(4));
|
||||
});
|
||||
}
|
||||
|
||||
if (location.hash !== '') {
|
||||
help_instance.select_topic(location.hash.substr(1));
|
||||
} else {
|
||||
help_instance.select_topic('start');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} topic_id Topic identifier
|
||||
*
|
||||
* @returns {undefined}
|
||||
*/
|
||||
HelpSystem.prototype.select_topic = function (topic_id) {
|
||||
var articles = document.getElementsByTagName('article'),
|
||||
toc_divs = document.getElementsByClassName('div_toc');
|
||||
|
||||
for (var j = 0; j < toc_divs.length; j++) {
|
||||
toc_divs[j].classList.remove('mnu_selected');
|
||||
}
|
||||
|
||||
document.getElementById('mnu_' + topic_id).getElementsByTagName('div')[0].classList.add('mnu_selected');
|
||||
|
||||
for (var j = 0; j < articles.length; j++) {
|
||||
if (articles[j].id === 'art_' + topic_id) {
|
||||
articles[j].classList.remove('hidden');
|
||||
} else {
|
||||
articles[j].classList.add('hidden');
|
||||
}
|
||||
}
|
||||
location.hash = topic_id;
|
||||
};
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Initialize help object
|
||||
*/
|
||||
var help = new HelpSystem();
|
||||
|
||||
help.init(1);
|
||||
|
||||
});
|
||||
|
||||
}());
|
||||
230
system/help/locale/en/index.html
Normal file
230
system/help/locale/en/index.html
Normal file
@@ -0,0 +1,230 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CAI CP: Help</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="../../css/help.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<nav class="hidden">
|
||||
<ul id="menu_toc">
|
||||
<li id="mnu_start"><div class="div_toc mnu_selected">Tips and ticks</div><hr></li>
|
||||
<li id="mnu_sys_req"><div class="div_toc mnu_selected">System requirements</div><hr></li>
|
||||
<li id="mnu_setup"><div class="div_toc">Setting up</div><hr>
|
||||
<ul>
|
||||
<li id="mnu_security"><div class="div_toc">Security</div><hr></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li id="mnu_about"><div class="div_toc">About</div></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article id="art_start" class="hidden">
|
||||
<h1>Tips and ticks</h1>
|
||||
<ul>
|
||||
<li>Table witgets can be maximized by double click on header.</li>
|
||||
<li>You can switch between information widgets blocks with
|
||||
following hotkeys:
|
||||
<ul>
|
||||
<li><i>Ctrl + 1</i>: System</li>
|
||||
<li><i>Ctrl + 2</i>: System pulse</li>
|
||||
<li><i>Ctrl + 3</i>: Storage</li>
|
||||
<li><i>Ctrl + 4</i>: Network</li>
|
||||
<li><i>Ctrl + 5</i>: SMB</li>
|
||||
<li><i>Ctrl + Left arrow</i>: Previous block</li>
|
||||
<li><i>Ctrl + Right arrow</i>: Next block</li>
|
||||
</ul>
|
||||
Also You can use left or right swipe on header on devices
|
||||
with touchscreen.
|
||||
<hr>
|
||||
<ul>
|
||||
<li><i>Ctrl + F1</i>: This help</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</article>
|
||||
<article id="art_sys_req" class="hidden">
|
||||
<h1>System requirements</h1>
|
||||
<p>Control panel core uses following commands and utilities:</p>
|
||||
<ul>
|
||||
<li>gawk (GNU awk)</li>
|
||||
<li>grep</li>
|
||||
<li>hddtemp</li>
|
||||
<li>lsb-release</li>
|
||||
<li>sed</li>
|
||||
<li>smartmontools (smartctl)</li>
|
||||
<li>sysstat (iostat)</li>
|
||||
<li>php7</li>
|
||||
</ul>
|
||||
<p>
|
||||
Applications may have other dependencies.
|
||||
</p>
|
||||
</article>
|
||||
<article id="art_setup" class="hidden">
|
||||
<h1>Setting up</h1>
|
||||
<p>S.M.A.R.T. and HDD temperature monitoring widgets requires super
|
||||
user priviledges. You need to add webserver account to sudoers.
|
||||
Just run visudo command and add to User privilege specification
|
||||
section next lines:
|
||||
<pre>
|
||||
wwwrun ALL=NOPASSWD: /usr/sbin/smartctl
|
||||
wwwrun ALL=NOPASSWD: /usr/sbin/hddtemp
|
||||
</pre>
|
||||
</p>
|
||||
<p>SMB monitoring widgets requires super user priveledges. You need
|
||||
to add webserver account to sudoers. Just run visudo command and
|
||||
add to User privilege specification section next lines:
|
||||
<pre>
|
||||
wwwrun ALL=NOPASSWD: /usr/bin/smbstatus
|
||||
</pre>
|
||||
</p>
|
||||
<p>
|
||||
Control panel configuration file is /system/json/settings.json.<br>
|
||||
Available options:
|
||||
<table class="tbl_wide">
|
||||
<tr class="tbl_header">
|
||||
<td>Option</td>
|
||||
<td>Possible values</td>
|
||||
<td>Description</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>lang</td>
|
||||
<td>ru<br>en<br>...</td>
|
||||
<td>Default languag. You can specify one of installed
|
||||
languages.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>langs</td>
|
||||
<td>"en" : "English"<br>
|
||||
"ru" : "Русский"<br>
|
||||
...
|
||||
</td>
|
||||
<td>Available languages.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dim_on_create</td>
|
||||
<td>true<br>false</td>
|
||||
<td>Widgets runs semi-transparent until data is loaded.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>check_files_rights</td>
|
||||
<td>true<br>false</td>
|
||||
<td>Check files and directories rights on startup.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>check_hdd_temp_interval</td>
|
||||
<td>0 .. 86400</td>
|
||||
<td>HDD temperature checking interval (in seconds).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>check_smart_interval</td>
|
||||
<td>0 .. 86400</td>
|
||||
<td>HDD S.M.A.R.T checking interval (in seconds).</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
You can find applications list in /system/apps/apps.json.
|
||||
Control panel checks dependencies and run applications if they
|
||||
are ok. You can manually disable application by removing string
|
||||
with it from this file.
|
||||
</p>
|
||||
</article>
|
||||
<article id="art_security" class="hidden">
|
||||
<h1>Security</h1>
|
||||
<ol>
|
||||
<li><p>You need to set owner to control panel files to wwwrun:www,
|
||||
all directories and .sh files must have 550 mask, other
|
||||
directories - 440 mask.</p>
|
||||
<p>You need to set 640 mask to /system/json/settings.json if
|
||||
You want to change some settings from WebUI.</p>
|
||||
<p>You can set rights by executing following commands:<br>
|
||||
<code>
|
||||
$ chown -R wwwrun:www /path/to/base/dir<br>
|
||||
$ chmod 440 $(find /path/to/base/dir -type f)<br>
|
||||
$ chmod 550 $(find /path/to/base/dir -type d)<br>
|
||||
$ chmod 550 $(find /path/to/base/dir -type f | grep .sh$)<br>
|
||||
$ chmod 640 /path/to/base/dir/system/json/settings.json<br>
|
||||
$ chmod 640 /path/to/base/dir/system/apps/apps.json
|
||||
</code>
|
||||
</p>
|
||||
</li>
|
||||
<li>Deny accss to .sh files by adding next options to
|
||||
<pre><span><</span>Directory><span><</span>/Directory></pre>
|
||||
block of Apache settings:
|
||||
<pre>
|
||||
<span><</span>FilesMatch "\.(sh)$">
|
||||
Require all denied
|
||||
<span><</span>/FilesMatch>
|
||||
</pre>
|
||||
</li>
|
||||
<li>Set password to restrict access. Basic autorization example:
|
||||
run Apache's utility htpasswd to generate password file
|
||||
.htpasswd. Add next lines to Apache's config file into
|
||||
<pre><span><</span>Directory><span><</span>/Directory></pre>
|
||||
section:
|
||||
<pre>
|
||||
AuthName "Restricted zone"
|
||||
AuthType Basic
|
||||
AuthUserFile [Путь к файлу .htpasswd]
|
||||
Require valid-user
|
||||
</pre>
|
||||
<p>Restart Apache.</p>
|
||||
<p>
|
||||
Attention! Basic authorization uses plain text to send
|
||||
passwords. Consider to use HTTPS to avoid password leak.
|
||||
</p>
|
||||
</li>
|
||||
<li><p>You need to add wwwrun user to sudoers if to enable
|
||||
shutdown or reboot server functions. Be carefully with this
|
||||
option!</p>
|
||||
<p>Run <code># visudo</code> and add following line to
|
||||
"User privilege specification":
|
||||
<code>wwwrun ALL=NOPASSWD: /sbin/shutdown</code>
|
||||
</p>
|
||||
</li>
|
||||
</ol>
|
||||
</article>
|
||||
<article id="art_about" class="hidden">
|
||||
<h1>About</h1>
|
||||
<div class="help_title">CAI CP</div>
|
||||
<div class="help_ver">Version <span class="span_ver">_._</span>. Build date <span class="span_ver_date">__.__.____</span></div>
|
||||
<div>Author: <span class="span_author_ru">Alexander Chebykin</span></div>
|
||||
<div>License: MIT
|
||||
<div id="div_license" class="scrollable">
|
||||
<pre>
|
||||
MIT License
|
||||
-----------
|
||||
|
||||
Copyright (c) 2016-2017, Alexander I. Chebykin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
<p>This product partially based on
|
||||
<a href="https://github.com/afaqurk/linux-dash" target="_blank">
|
||||
Linux Dash
|
||||
</a> project.
|
||||
</p>
|
||||
</article>
|
||||
<script src="../../js/help.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
268
system/help/locale/ru/index.html
Normal file
268
system/help/locale/ru/index.html
Normal file
@@ -0,0 +1,268 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CAI CP: Help</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="../../css/help.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<nav class="hidden">
|
||||
<ul id="menu_toc">
|
||||
<li id="mnu_start"><div class="div_toc mnu_selected">Советы по использованию</div><hr></li>
|
||||
<li id="mnu_sys_req"><div class="div_toc">Системные требования</div><hr></li>
|
||||
<li id="mnu_setup"><div class="div_toc">Настройка</div><hr>
|
||||
<ul>
|
||||
<li id="mnu_security"><div class="div_toc">Безопасность</div><hr></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li id="mnu_about"><div class="div_toc">О панели управления</div></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article id="art_start" class="hidden">
|
||||
<h1>Советы по использованию</h1>
|
||||
<ul>
|
||||
<li>Табличные виджеты можно распахнуть на весь экран двойным
|
||||
щелчком по заголовку.</li>
|
||||
<li>Для переключения по информационным блокам используйте
|
||||
следующие комбинации клавиш:
|
||||
<ul>
|
||||
<li><i>Ctrl + 1</i>: Система</li>
|
||||
<li><i>Ctrl + 2</i>: Пульс системы</li>
|
||||
<li><i>Ctrl + 3</i>: Файловое хранилище</li>
|
||||
<li><i>Ctrl + 4</i>: Сеть</li>
|
||||
<li><i>Ctrl + 5</i>: SMB</li>
|
||||
<li><i>Ctrl + Влево</i>: Предыдущий блок</li>
|
||||
<li><i>Ctrl + Вправо</i>: Следующий блок</li>
|
||||
</ul>
|
||||
Также вы можете переключаться между блоками, проведя влево
|
||||
или вправо по заголовку на устройствах с сенсорным экраном.
|
||||
<hr>
|
||||
<ul>
|
||||
<li><i>Ctrl + F1</i>: Справка</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</article>
|
||||
<article id="art_sys_req" class="hidden">
|
||||
<h1>Системные требования</h1>
|
||||
<p>Ядро системы использует следующие команды и утилиты:</p>
|
||||
<ul>
|
||||
<li>gawk (GNU awk)</li>
|
||||
<li>grep</li>
|
||||
<li>hddtemp</li>
|
||||
<li>lsb-release</li>
|
||||
<li>sed</li>
|
||||
<li>smartmontools (smartctl)</li>
|
||||
<li>sysstat (iostat)</li>
|
||||
<li>php7</li>
|
||||
</ul>
|
||||
<p>
|
||||
Различные приложения могут требовать наличие других программ и утилит.
|
||||
</p>
|
||||
</article>
|
||||
<article id="art_setup" class="hidden">
|
||||
<h1>Настройка</h1>
|
||||
<p>Для мониторинга S.M.A.R.T. и температуры дисков требуется
|
||||
разрешить выполнение smartctl и hddtemp веб-сервером. Для этого
|
||||
запустите редактор sudo командой visudo и добавьте в раздел User
|
||||
privilege specification следующие строки:
|
||||
<pre>
|
||||
wwwrun ALL=NOPASSWD: /usr/sbin/smartctl
|
||||
wwwrun ALL=NOPASSWD: /usr/sbin/hddtemp
|
||||
</pre>
|
||||
</p>
|
||||
<p>Для мониторинга ресурсов SMB требуется разрешить выполнение
|
||||
smbstatus веб-сервером. Для этого запустите редактор sudo
|
||||
командой visudo и добавьте в раздел User privilege specification
|
||||
следующие строки:
|
||||
<pre>
|
||||
wwwrun ALL=NOPASSWD: /usr/bin/smbstatus
|
||||
</pre>
|
||||
</p>
|
||||
<p>
|
||||
Конфигурация панели управления задаётся в файле /system/json/settings.json.<br>
|
||||
Параметры:
|
||||
<table class="tbl_wide">
|
||||
<tr class="tbl_header">
|
||||
<td>Параметр</td>
|
||||
<td>Возможные значения</td>
|
||||
<td>Описание</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>lang</td>
|
||||
<td>ru<br>en<br>...</td>
|
||||
<td>Язык по умолчанию. Может быть указан один из
|
||||
доступных языков.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>langs</td>
|
||||
<td>"en" : "English"<br>
|
||||
"ru" : "Русский"<br>
|
||||
...
|
||||
</td>
|
||||
<td>Доступные языки.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dim_on_create</td>
|
||||
<td>true<br>false</td>
|
||||
<td>Виджеты отображаются полупрозрачными пока не
|
||||
загрузятся данные.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>check_files_rights</td>
|
||||
<td>true<br>false</td>
|
||||
<td>При запуске проводится проверка правильности
|
||||
установленных прав на файлы и каталоги.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>check_hdd_temp_interval</td>
|
||||
<td>0 .. 86400</td>
|
||||
<td>Интервал (в секундах) проверки температуры жёстких
|
||||
дисков.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>check_smart_interval</td>
|
||||
<td>0 .. 86400</td>
|
||||
<td>Интервал (в секундах) проверки состояния S.M.A.R.T.
|
||||
жёстких дисков.</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
Список загружаемых приложений находится в файле /system/apps/apps.json.
|
||||
Панель управления проверяет зависимости приложений и отключает
|
||||
те, что не могут быть запущены на данном сервере. Если вы хотите
|
||||
принудительно отключить какое-либо приложение, удалите строку
|
||||
с его названием из данного файла.
|
||||
</p>
|
||||
</article>
|
||||
<article id="art_security" class="hidden">
|
||||
<h1>Безопасность</h1>
|
||||
<ol>
|
||||
<li><p>Назначьте владельцем файлов и каталогов wwwrun:www, всем
|
||||
каталогам и файлам .sh назначьте права по маске 550,
|
||||
остальным файлам - 440.</p>
|
||||
<p>Если хотите иметь возможность управлять некоторыми
|
||||
параметрами из веб-интерфейса, установите маску 640 файлу
|
||||
/system/json/settings.json.</p>
|
||||
<p>Для этого выполните следующие команды:<br>
|
||||
<code>
|
||||
$ chown -R wwwrun:www /path/to/base/dir<br>
|
||||
$ chmod 440 $(find /path/to/base/dir -type f)<br>
|
||||
$ chmod 550 $(find /path/to/base/dir -type d)<br>
|
||||
$ chmod 550 $(find /path/to/base/dir -type f | grep .sh$)<br>
|
||||
$ chmod 640 /path/to/base/dir/system/json/settings.json<br>
|
||||
$ chmod 640 /path/to/base/dir/system/apps/apps.json
|
||||
</code>
|
||||
</p>
|
||||
</li>
|
||||
<li>Запретите доступ через веб к файлам с расширением .sh, для
|
||||
этого в конфигурационный файл Apache в блок
|
||||
<pre><span><</span>Directory><span><</span>/Directory></pre>
|
||||
добавьте следующие строки:
|
||||
<pre>
|
||||
<span><</span>FilesMatch "\.(sh)$">
|
||||
Require all denied
|
||||
<span><</span>/FilesMatch>
|
||||
</pre>
|
||||
</li>
|
||||
<li>Установите пароль на доступ к панели управления. Пример для
|
||||
настройки базовой аутентификации: с помощью утилиты htpasswd
|
||||
(входит в комплект сервера Apache) создайте содержащий пароль
|
||||
файл .htpasswd. В конфигурационный файл Apache добавьте в блок
|
||||
<pre><span><</span>Directory><span><</span>/Directory></pre> следующие строки:
|
||||
<pre>
|
||||
AuthName "Restricted zone"
|
||||
AuthType Basic
|
||||
AuthUserFile [Путь к файлу .htpasswd]
|
||||
Require valid-user
|
||||
</pre>
|
||||
<p>После этого перезагрузите сервер Apache.</p>
|
||||
<p>
|
||||
Обратите внимание, что в рассмотренном случае используется
|
||||
базовая аутентификация, при её использовании пароль
|
||||
передаётся в открытом виде, для защиты передаваемой
|
||||
информации настройте доступ по протоколу HTTPS.
|
||||
</p>
|
||||
</li>
|
||||
<li><p>Если хотите включить возможность перезагрузки и отключения
|
||||
сервера, следует добавить пользователя wwwrun в sudoers.
|
||||
Будьте осторожны с данной возможностью!</p>
|
||||
<p>Запустите <code># visudo</code> и добавьте следующую
|
||||
строку в блок "User privilege specification":
|
||||
<code>wwwrun ALL=NOPASSWD: /sbin/shutdown</code>
|
||||
</p>
|
||||
</li>
|
||||
</ol>
|
||||
</article>
|
||||
<article id="art_about" class="hidden">
|
||||
<h1>О панели управления</h1>
|
||||
<div class="help_title">CAI CP</div>
|
||||
<div class="help_ver">Версия <span class="span_ver">_._</span> от <span class="span_ver_date">__.__.____</span></div>
|
||||
<div>Автор: <span class="span_author_ru">Александр Чебыкин</span></div>
|
||||
<div>Лицензия: MIT
|
||||
<div id="div_license" class="scrollable">
|
||||
<pre>
|
||||
Лицензия MIT
|
||||
------------
|
||||
|
||||
Copyright (c) 2016-2017, Александр Чебыкин
|
||||
|
||||
Данная лицензия разрешает лицам, получившим копию данного программного
|
||||
обеспечения и сопутствующей документации (в дальнейшем именуемыми
|
||||
«Программное Обеспечение»), безвозмездно использовать Программное Обеспечение
|
||||
без ограничений, включая неограниченное право на использование, копирование,
|
||||
изменение, слияние, публикацию, распространение, сублицензирование и/или
|
||||
продажу копий Программного Обеспечения, а также лицам, которым предоставляется
|
||||
данное Программное Обеспечение, при соблюдении следующих условий:
|
||||
|
||||
Указанное выше уведомление об авторском праве и данные условия должны быть
|
||||
включены во все копии или значимые части данного Программного Обеспечения.
|
||||
|
||||
ДАННОЕ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ «КАК ЕСТЬ», БЕЗ КАКИХ-ЛИБО
|
||||
ГАРАНТИЙ, ЯВНО ВЫРАЖЕННЫХ ИЛИ ПОДРАЗУМЕВАЕМЫХ, ВКЛЮЧАЯ ГАРАНТИИ ТОВАРНОЙ
|
||||
ПРИГОДНОСТИ, СООТВЕТСТВИЯ ПО ЕГО КОНКРЕТНОМУ НАЗНАЧЕНИЮ И ОТСУТСТВИЯ НАРУШЕНИЙ,
|
||||
НО НЕ ОГРАНИЧИВАЯСЬ ИМИ. НИ В КАКОМ СЛУЧАЕ АВТОРЫ ИЛИ ПРАВООБЛАДАТЕЛИ НЕ НЕСУТ
|
||||
ОТВЕТСТВЕННОСТИ ПО КАКИМ-ЛИБО ИСКАМ, ЗА УЩЕРБ ИЛИ ПО ИНЫМ ТРЕБОВАНИЯМ, В ТОМ
|
||||
ЧИСЛЕ, ПРИ ДЕЙСТВИИ КОНТРАКТА, ДЕЛИКТЕ ИЛИ ИНОЙ СИТУАЦИИ, ВОЗНИКШИМ ИЗ-ЗА
|
||||
ИСПОЛЬЗОВАНИЯ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ ИЛИ ИНЫХ ДЕЙСТВИЙ С ПРОГРАММНЫМ
|
||||
ОБЕСПЕЧЕНИЕМ.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
MIT License
|
||||
-----------
|
||||
|
||||
Copyright (c) 2016-2017, Alexander I. Chebykin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
<p>Данный продукт частично основан на
|
||||
<a href="https://github.com/afaqurk/linux-dash" target="_blank">
|
||||
Linux Dash
|
||||
</a>.
|
||||
</p>
|
||||
</article>
|
||||
<script src="../../js/help.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user