]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Add in API wizard example sudo configuration for bconsole and JSON tools
authorMarcin Haba <marcin.haba@bacula.pl>
Fri, 8 Nov 2019 18:10:15 +0000 (19:10 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 14 Dec 2019 14:59:53 +0000 (15:59 +0100)
gui/baculum/protected/API/Lang/en/messages.mo
gui/baculum/protected/API/Lang/en/messages.po
gui/baculum/protected/API/Lang/pl/messages.mo
gui/baculum/protected/API/Lang/pl/messages.po
gui/baculum/protected/API/Lang/pt/messages.mo
gui/baculum/protected/API/Lang/pt/messages.po
gui/baculum/protected/API/Pages/Panel/APIInstallWizard.page

index 5f2c944a5c306ec41e0fb21eb4423ee69aaeb8b4..8b96c598173201720d753f73a8931ac9905e4475 100644 (file)
Binary files a/gui/baculum/protected/API/Lang/en/messages.mo and b/gui/baculum/protected/API/Lang/en/messages.mo differ
index 59faa6de5fb8cc307432232f76d64d650f5b9001..a735851dfd02455716e02b031e5af6b423de4a90 100644 (file)
@@ -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."
+
index 631790be8bb1ae7d3e55060512b79226cdfb29b9..d4cd8d140af69b6ce3576a6f14dba74c49a4455d 100644 (file)
Binary files a/gui/baculum/protected/API/Lang/pl/messages.mo and b/gui/baculum/protected/API/Lang/pl/messages.mo differ
index dd1facc3d1945dbbe013b5b9d9bea57fe63d1c5f..39edaf4358db19a4d1be25bd3deb00c9e4c5d0da 100644 (file)
@@ -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 ""
+
index e9d2ebef5ffd5ba3df4b8db6dd867c4c268f5dfe..14ffd0312be42213311244a8db50bbe3d63c196e 100644 (file)
Binary files a/gui/baculum/protected/API/Lang/pt/messages.mo and b/gui/baculum/protected/API/Lang/pt/messages.mo differ
index aa0c801941c01938616c791a87d0775e0b6a9b86..354918bd6a13626edef3d2e8dfc777c33b12d7c8 100644 (file)
@@ -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."
+
index 13af87270a2f9353f5ac14f97cbee7c983411c48..0b9e0877aed24e818a5aa40573665a3ea916ba44 100644 (file)
                                <div class="line">
                                        <div class="text"><com:TLabel ForControl="UseSudo" Text="<%[ Use sudo: ]%>" /></div>
                                        <div class="field">
-                                               <com:TCheckBox ID="UseSudo" />
+                                               <com:TCheckBox ID="UseSudo" /> <a href="javascript:void(0)" onclick="get_sudo_config('bconsole');"><%[ Get sudo configuration ]%></a>
+
                                        </div>
                                </div>
                                <div class="line">
                                                        <div class="line left">
                                                                <div class="text"><com:TLabel ForControl="BJSONUseSudo" Text="<%[ Use sudo: ]%>" /></div>
                                                                <div class="field">
-                                                                       <com:TCheckBox ID="BJSONUseSudo" />
+                                                                       <com:TCheckBox ID="BJSONUseSudo" /> <a href="javascript:void(0)" onclick="get_sudo_config('config');"><%[ Get sudo configuration ]%></a>
+
                                                                </div>
                                                        </div>
                                                </div>
                                                        <div class="line left">
                                                                <div class="text"><com:TLabel ForControl="ActionsUseSudo" Text="<%[ Use sudo: ]%>" /></div>
                                                                <div class="field">
-                                                                       <com:TCheckBox ID="ActionsUseSudo" /> <a href="javascript:void(0)" onclick="get_sudo_config();"><%[ Get sudo configuration ]%></a>
+                                                                       <com:TCheckBox ID="ActionsUseSudo" /> <a href="javascript:void(0)" onclick="get_sudo_config('actions');"><%[ Get sudo configuration ]%></a>
                                                                </div>
                                                        </div>
                                                </div>
        Options.minHeight="200"
 >
        <p><%[ Please copy appropriate sudo configuration and put it to a new sudoers.d file for example /etc/sudoers.d/baculum-api ]%></p>
+       <p><strong><%[ Note ]%></strong> <%[ Please use visudo to add this configuration, otherwise please do remember to add empty line at the end of file. ]%>
        <p><%[ Example sudo configuration for Apache web server user (RHEL, CentOS and others): ]%></p>
        <pre id="sudo_config_apache"></pre>
        <p><%[ Example sudo configuration for Lighttpd web server user (RHEL, CentOS and others): ]%></p>
@@ -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";