Added fixes ti bunkerweb module

This commit is contained in:
Alexey Berezhok
2026-05-01 22:53:57 +03:00
parent f64f034b7b
commit 86bf9fccf5
3 changed files with 68 additions and 4 deletions

View File

@@ -157,6 +157,22 @@ class BunkerwebWorker < Kernel::ModuleCoreWorker
hestia_print_array_of_hashes(result, format, "API_USERNAME,API_PASSWORD,ADMIN_USERNAME,ADMIN_PASSWORD")
ACTION_OK
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"
puts "#{$0} bunkerweb_module COMMAND [OPTIONS] [json|csv|plain]"
puts "COMMANDS:"

View File

@@ -40,7 +40,7 @@ $bunkerweb_list = [];
if ($return_var == 0) {
$bunkerweb_list = json_decode(implode("", $output), true);
} else {
$error_message = $output;
$error_message = implode("<br/>\n", $output);
}
unset($output);
@@ -57,6 +57,21 @@ if ($return_var == 0) {
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($user, $TAB, "extmodules/extmodules_bunkerweb_module");

View File

@@ -20,9 +20,9 @@
<?php } ?>
<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _(
"List of services in bunkerweb",
) ?></h1>
<h1 class="u-text-center u-mt20 u-pr30 u-mb20 u-pl30">
<?= _("List of services in bunkerweb") ?>
</h1>
<div class="units-table js-units-container">
<div class="units-table-header">
@@ -69,6 +69,39 @@
<?php } ?>
</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>
<footer class="app-footer">