From: Marcin Haba Date: Fri, 8 Nov 2019 18:10:15 +0000 (+0100) Subject: baculum: Add in API wizard example sudo configuration for bconsole and JSON tools X-Git-Tag: Release-9.6.0~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e9878f562ddcbb4f8ff5e38cb954a28627fb8e9;p=thirdparty%2Fbacula.git baculum: Add in API wizard example sudo configuration for bconsole and JSON tools --- diff --git a/gui/baculum/protected/API/Lang/en/messages.mo b/gui/baculum/protected/API/Lang/en/messages.mo index 5f2c944a5..8b96c5981 100644 Binary files a/gui/baculum/protected/API/Lang/en/messages.mo and b/gui/baculum/protected/API/Lang/en/messages.mo differ diff --git a/gui/baculum/protected/API/Lang/en/messages.po b/gui/baculum/protected/API/Lang/en/messages.po index 59faa6de5..a735851df 100644 --- a/gui/baculum/protected/API/Lang/en/messages.po +++ b/gui/baculum/protected/API/Lang/en/messages.po @@ -511,3 +511,10 @@ msgstr "Use sudo for actions:" msgid "Actions setting:" msgstr "Actions setting:" + +msgid "Note" +msgstr "Note" + +msgid "Please use visudo to add this configuration, otherwise please do remember to add empty line at the end of file." +msgstr "Please use visudo to add this configuration, otherwise please do remember to add empty line at the end of file." + diff --git a/gui/baculum/protected/API/Lang/pl/messages.mo b/gui/baculum/protected/API/Lang/pl/messages.mo index 631790be8..d4cd8d140 100644 Binary files a/gui/baculum/protected/API/Lang/pl/messages.mo and b/gui/baculum/protected/API/Lang/pl/messages.mo differ diff --git a/gui/baculum/protected/API/Lang/pl/messages.po b/gui/baculum/protected/API/Lang/pl/messages.po index dd1facc3d..39edaf435 100644 --- a/gui/baculum/protected/API/Lang/pl/messages.po +++ b/gui/baculum/protected/API/Lang/pl/messages.po @@ -511,3 +511,10 @@ msgstr "Użyj sudo dla akcji:" msgid "Actions setting:" msgstr "Ustawienie akcji:" + +msgid "Note" +msgstr "Note" + +msgid "Please use visudo to add this configuration, otherwise please do remember to add empty line at the end of file." +msgstr "" + diff --git a/gui/baculum/protected/API/Lang/pt/messages.mo b/gui/baculum/protected/API/Lang/pt/messages.mo index e9d2ebef5..14ffd0312 100644 Binary files a/gui/baculum/protected/API/Lang/pt/messages.mo and b/gui/baculum/protected/API/Lang/pt/messages.mo differ diff --git a/gui/baculum/protected/API/Lang/pt/messages.po b/gui/baculum/protected/API/Lang/pt/messages.po index aa0c80194..354918bd6 100644 --- a/gui/baculum/protected/API/Lang/pt/messages.po +++ b/gui/baculum/protected/API/Lang/pt/messages.po @@ -511,3 +511,10 @@ msgstr "Use sudo for actions:" msgid "Actions setting:" msgstr "Actions setting:" + +msgid "Note" +msgstr "Note" + +msgid "Please use visudo to add this configuration, otherwise please do remember to add empty line at the end of file." +msgstr "Please use visudo to add this configuration, otherwise please do remember to add empty line at the end of file." + diff --git a/gui/baculum/protected/API/Pages/Panel/APIInstallWizard.page b/gui/baculum/protected/API/Pages/Panel/APIInstallWizard.page index 13af87270..0b9e0877a 100644 --- a/gui/baculum/protected/API/Pages/Panel/APIInstallWizard.page +++ b/gui/baculum/protected/API/Pages/Panel/APIInstallWizard.page @@ -260,7 +260,8 @@
@@ -318,7 +319,8 @@
@@ -444,7 +446,7 @@
@@ -1157,6 +1159,7 @@ Options.minHeight="200" >

<%[ Please copy appropriate sudo configuration and put it to a new sudoers.d file for example /etc/sudoers.d/baculum-api ]%>

+

<%[ Note ]%> <%[ Please use visudo to add this configuration, otherwise please do remember to add empty line at the end of file. ]%>

<%[ Example sudo configuration for Apache web server user (RHEL, CentOS and others): ]%>


 	

<%[ Example sudo configuration for Lighttpd web server user (RHEL, CentOS and others): ]%>

@@ -1271,21 +1274,33 @@ var actions_hide_test_results = function(action) { result.textContent = ''; }; -function get_sudo_config() { - var fields = [ - '<%=$this->DirStartAction->ClientID%>', - '<%=$this->DirStopAction->ClientID%>', - '<%=$this->DirRestartAction->ClientID%>', - '<%=$this->SdStartAction->ClientID%>', - '<%=$this->SdStopAction->ClientID%>', - '<%=$this->SdRestartAction->ClientID%>', - '<%=$this->FdStartAction->ClientID%>', - '<%=$this->FdStopAction->ClientID%>', - '<%=$this->FdRestartAction->ClientID%>' - ]; +function get_sudo_config(type) { + var bin_fields = { + bconsole: [ + '<%=$this->BconsolePath->ClientID%>' + ], + config: [ + '<%=$this->BDirJSONPath->ClientID%>', + '<%=$this->BSdJSONPath->ClientID%>', + '<%=$this->BFdJSONPath->ClientID%>', + '<%=$this->BBconsJSONPath->ClientID%>', + ], + actions: [ + '<%=$this->DirStartAction->ClientID%>', + '<%=$this->DirStopAction->ClientID%>', + '<%=$this->DirRestartAction->ClientID%>', + '<%=$this->SdStartAction->ClientID%>', + '<%=$this->SdStopAction->ClientID%>', + '<%=$this->SdRestartAction->ClientID%>', + '<%=$this->FdStartAction->ClientID%>', + '<%=$this->FdStopAction->ClientID%>', + '<%=$this->FdRestartAction->ClientID%>' + ] + } var val, pre; var cfg = ''; var users = ['apache', 'lighttpd', 'www-data']; + var fields = bin_fields.hasOwnProperty(type) ? bin_fields[type] : []; for (var i = 0; i < users.length; i++) { var pre = document.getElementById('sudo_config_' + users[i].replace(/-/g, '_')); pre.textContent = 'Defaults:' + users[i] + ' !requiretty' + "\n";