Added fixes ti bunkerweb module
This commit is contained in:
@@ -157,6 +157,22 @@ class BunkerwebWorker < Kernel::ModuleCoreWorker
|
|||||||
hestia_print_array_of_hashes(result, format, "API_USERNAME,API_PASSWORD,ADMIN_USERNAME,ADMIN_PASSWORD")
|
hestia_print_array_of_hashes(result, format, "API_USERNAME,API_PASSWORD,ADMIN_USERNAME,ADMIN_PASSWORD")
|
||||||
ACTION_OK
|
ACTION_OK
|
||||||
when "configure"
|
when "configure"
|
||||||
|
require 'shellwords'
|
||||||
|
param1 = args[1]
|
||||||
|
param2 = args[2]
|
||||||
|
if param1 && param2 && !param1.strip.empty? && !param2.strip.empty?
|
||||||
|
cmd = "/usr/local/hestia/bin/v-bunkerweb-module-install #{Shellwords.escape(param1)} #{Shellwords.escape(param2)}"
|
||||||
|
else
|
||||||
|
cmd = "/usr/local/hestia/bin/v-bunkerweb-module-install"
|
||||||
|
end
|
||||||
|
output = `#{cmd} 2>&1`
|
||||||
|
exit_status = $?.exitstatus
|
||||||
|
if exit_status != 0
|
||||||
|
log_return("#{output}\nCommand failed with status #{exit_status}")
|
||||||
|
else
|
||||||
|
puts output
|
||||||
|
ACTION_OK
|
||||||
|
end
|
||||||
when "help"
|
when "help"
|
||||||
puts "#{$0} bunkerweb_module COMMAND [OPTIONS] [json|csv|plain]"
|
puts "#{$0} bunkerweb_module COMMAND [OPTIONS] [json|csv|plain]"
|
||||||
puts "COMMANDS:"
|
puts "COMMANDS:"
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ $bunkerweb_list = [];
|
|||||||
if ($return_var == 0) {
|
if ($return_var == 0) {
|
||||||
$bunkerweb_list = json_decode(implode("", $output), true);
|
$bunkerweb_list = json_decode(implode("", $output), true);
|
||||||
} else {
|
} else {
|
||||||
$error_message = $output;
|
$error_message = implode("<br/>\n", $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($output);
|
unset($output);
|
||||||
@@ -57,6 +57,21 @@ if ($return_var == 0) {
|
|||||||
|
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
|
//Get UI and API passw
|
||||||
|
// Data
|
||||||
|
exec(
|
||||||
|
HESTIA_CMD . "v-ext-modules-run bunkerweb_module passwd json",
|
||||||
|
$output,
|
||||||
|
$return_var,
|
||||||
|
);
|
||||||
|
|
||||||
|
$pass = [];
|
||||||
|
if ($return_var == 0) {
|
||||||
|
$pass = json_decode(implode("", $output), true);
|
||||||
|
} else {
|
||||||
|
$error_message .= implode("<br/>\n", $output);
|
||||||
|
}
|
||||||
|
|
||||||
// Render page
|
// Render page
|
||||||
render_page($user, $TAB, "extmodules/extmodules_bunkerweb_module");
|
render_page($user, $TAB, "extmodules/extmodules_bunkerweb_module");
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,9 @@
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _(
|
<h1 class="u-text-center u-mt20 u-pr30 u-mb20 u-pl30">
|
||||||
"List of services in bunkerweb",
|
<?= _("List of services in bunkerweb") ?>
|
||||||
) ?></h1>
|
</h1>
|
||||||
|
|
||||||
<div class="units-table js-units-container">
|
<div class="units-table js-units-container">
|
||||||
<div class="units-table-header">
|
<div class="units-table-header">
|
||||||
@@ -69,6 +69,39 @@
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h2 class="u-text-center u-mt20 u-pr30 u-mb20 u-pl30">
|
||||||
|
<?= _("Credentials list for Bunkerweb administration:") ?>
|
||||||
|
</h2>
|
||||||
|
<div class="units-table js-units-container">
|
||||||
|
<div class="units-table-header">
|
||||||
|
<div class="units-table-cell u-text-center"><?= _("Service") ?></div>
|
||||||
|
<div class="units-table-cell u-text-center"><?= _("Username") ?></div>
|
||||||
|
<div class="units-table-cell u-text-center"><?= _("Password") ?></div>
|
||||||
|
</div>
|
||||||
|
<div class="units-table-row js-unit">
|
||||||
|
<div class="units-table-cell u-text-center">
|
||||||
|
API
|
||||||
|
</div>
|
||||||
|
<div class="units-table-cell u-text-center">
|
||||||
|
<?= $pass[0]["API_USERNAME"] ?>
|
||||||
|
</div>
|
||||||
|
<div class="units-table-cell u-text-center">
|
||||||
|
<?= $pass[0]["API_PASSWORD"] ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="units-table-row js-unit">
|
||||||
|
<div class="units-table-cell u-text-center">
|
||||||
|
UI
|
||||||
|
</div>
|
||||||
|
<div class="units-table-cell u-text-center">
|
||||||
|
<?= $pass[0]["ADMIN_USERNAME"] ?>
|
||||||
|
</div>
|
||||||
|
<div class="units-table-cell u-text-center">
|
||||||
|
<?= $pass[0]["ADMIN_PASSWORD"] ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="app-footer">
|
<footer class="app-footer">
|
||||||
|
|||||||
Reference in New Issue
Block a user