Add environment variable like VYOS_COMMIT_APPROACH to identify which approach used by the configuration changed

add environment variable like VYOS_COMMIT_APPROACH to identify who make the configuration

add export VYOS_COMMIT_APPROACH=script in the commands script, just like the following:

#!/bin/vbash
export VYOS_COMMIT_APPROACH =script

source /opt/vyatta/etc/functions/script-template
configure
# commnds
commit
exit

after execute the script, use show system commit get the commit log, like the following:

 0  2024-08-13 02:56:57  by vyos  via script
 1  2024-08-13 02:47:44  by vyos  via script
 2  2024-08-12 08:40:00  by vyos  via cli
 3  2024-08-12 08:39:45  by vyos  via cli
 4  2024-08-09 08:16:20  by vyos  via cli
 5  2024-08-09 08:16:04  by vyos  via cli
 6  2024-08-09 07:26:05  by vyos  via cli
 7  2024-08-09 07:23:17  by root  via vyos-boot-config-loader

not just vyos-boot-config-loader / cli.

I dont think that should be a changeable global variable but rather something vyos_configd (or whoever is creating those log entries) should figure out on itself.

The commit log should contain trustworthy information. Having a global variable that can override the commit source line (via cli, via vyos-boot-config-loader) may sound like a good idea but security-wise I think it may be an unsound decision.

However, maybe a combination: both what vyos-configd (?) determines by itself (trustworthy) and supplementary information using some sort of variable.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.