Deprecated Documentation

Started by qdrop, October 19, 2020, 10:52:07 AM

Previous topic - Next topic
Hi everyone.

I just tried to implement the following: https://docs.opnsense.org/manual/git-backup.html

-> Unfortunately, there is no such plugin.

Further more, the documentation of a linked page is deprecated too: https://docs.opnsense.org/development/backend/autorun.html

-> Unfortunately, there is no folder "config" to embed scripts which are run upon configuration changes.

Maybe it makes sense to update these HowTos or delete them altogether.

Then only one question remains: How can I trigger a script upon configuration changes? Any help is appreciated.

Interesting note.

Thanks for bringing it up.

I found this:
https://github.com/opnsense/plugins/tree/master/sysutils/git-backup

So it seems that this is a plugin where currently work is going on. My hope is, that it will return soon.

Maybe some dev has something to say about an ETA.
,,The S in IoT stands for Security!" :)

It's not released to stable .. found it's way some weeks ago, but it's working pretty cool.
https://github.com/opnsense/plugins/issues/2049

That means documentation is more bleeding edge instead of deprecated :P

haha, yeah we just invested about 2 hours together to reverse-engineer this syshook mechanic. We failed.

First, we did the following: https://github.com/opnsense/plugins/issues/2049#issuecomment-705397846

Secondly, we tried to simply put a bash script inside /usr/local/etc/rc.syshook.d/config:

/usr/local/etc/rc.syshook.d/config/10-bash-git-backup

#!/usr/local/bin/bash
set -ux
git clone git@ssh.dev.com/v3/opnsense-config /conf/backup/git
cd /conf/backup/git/
mkdir -p $HOST
cp  $1 $HOST/config.xml
git add $HOST/config.xml
git commit -m "Config-Change of $HOST"
git push
cd .. && rm -rf /conf/backup/git


Third, we triggered rc.syshook manually and supplied two variables: config /conf/backup/file.xml

This triggered the script - but we never managed to trigger it from the actual event.

Basically: What is necessary so this syshook triggers properly? https://docs.opnsense.org/development/backend/autorun.html

Best