Re: Bacularis feature request - keep comments?

Marcin Haba <[email protected]>
Newsgroups gmane.comp.bacula.user
Message-ID <CAOqQBvP=ATsskcqsu=FU9WFxdT96h+baeqC5mpNK_QmtBnsedg@mail.gmail.com>
On Sat, 22 Feb 2025 at 18:03, Rob Gerber <[email protected]> wrote:
> I don't usually use bacularis to edit director or storage resources because it strips out all the comments (baculum also does this, IIRC). I understand why it does that, since it has to parse the configuration and by definition the data after a # sign shouldn't be parsed. Still, this is the main thing that prevents me from using bacularis to edit the director and storage configuration files. Do you think there is any way to change the way bacularis works to at least keep inline comments like this?

Hello Rob,

Thanks for your feature request and ideas for comments.

Yes, I know this stripped comments issue well. The problem here is
that when Bacularis gets configuration from Bacula, the configuration
is already without comments. So, this does not happen on the config
write, but on the config read. To read the Bacula configuration,
Bacularis uses the Bacula JSON tools (b*json binaries) which so far do
not support # (hash) comments. Bacula developers know about it, we
discussed adding the comments support.

I know a few workarounds to not lose comments. The first one is using
the "Description" directive for leaving comments. It is available in
every Bacula configuration resource and can store quite long texts.

The second is using tags. They are available both for all Bacula
configuration resources, for Bacula database resources and Bacularis
resources (users, roles, hosts ...etc.) as well. These tags can
contain spaces, colors, the severity and accessibility properties. It
can be good for shorter comments. You can read about it here:

https://bacularis.app/doc/tags/basic.html

Both workarounds do not replace the inline # hash comments, but maybe
they can be used instead of them.

Best regards,
Marcin Haba (gani)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.