OPNsense Forum

English Forums => Tutorials and FAQs => Topic started by: mistress on April 24, 2019, 11:56:55 am

Title: Where and how to begin? Starting develop (plugin, using API) opnSense
Post by: mistress on April 24, 2019, 11:56:55 am
Hi, folks!

I'm a newbie in all related to opnSense and firewalls and I try to read up into development / consuming the api (as I like to read and provide some data so I can show or modify them in another application)
I've set up a VM (Virtualbox) with opnSense (19.1.4) and I try to dive in the development. I'm reading the documentation but I don't understand how changes I made affect my installed instance.
I cloned the git repo on my host machine (Windows) as I don't know how to clone it to the VM running my opnSense instance.
Is there any possibility for doing so?
Or how do I link my running instance to use the cloned repo?
Or do I have to make my changes, create an iso of it and use this for running the VM?

That are absolutely trivial questions for you but for me, not very experienced in firewalls, VMs, working with git, the documentation is not able to help me to figure this out.
Thank you in anticipation!
Title: Re: Where and how to begin? Starting develop (plugin, using API) opnSense
Post by: mimugmail on April 24, 2019, 07:49:04 pm
https://www.routerperformance.net/opnsense/plugin-development/

https://docs.opnsense.org/develop.html
Title: Re: Where and how to begin? Starting develop (plugin, using API) opnSense
Post by: mistress on April 25, 2019, 11:07:41 am
Thank you for sharing the link to routerperformance. That's a really good source of information.
And I guess I understand how to deploy code: it's done by using
pkg install work/pkg/os-*.txz

The next step is to figure out where to install it. It's not really clear to me as I'm not able to do this in my VM (there is just the console of opnsense...).
But I think that I have to understand FreeBSD first.
Title: Re: Where and how to begin? Starting develop (plugin, using API) opnSense
Post by: mimugmail on April 25, 2019, 11:24:22 am
instead of using:

make install
pkg install work/pkg/os-*.txz

you could also just type:

make upgrade

Was just to lazy to update all articles :)

What do you mean with where to install? If you build von OPNsense directly you just install it there :)
Title: Re: Where and how to begin? Starting develop (plugin, using API) opnSense
Post by: mistress on April 25, 2019, 11:27:52 am
So I have to rebuild my opnSense instance after making some changes?
I got a VM and installed opnSense with an iso image. When starting the VM, I directly start opnSense. That's why I'm so confused where to deploy the changes.
Title: Re: Where and how to begin? Starting develop (plugin, using API) opnSense
Post by: mimugmail on April 25, 2019, 11:33:38 am
You clone your plugins repo into OPNsense directly, then you can just run "make upgrade" in your code base
Title: Re: Where and how to begin? Starting develop (plugin, using API) opnSense
Post by: mistress on April 25, 2019, 11:41:54 am
Ok. If I understand correctly: I start my VM and choose option "Shell" to clone the git repo of the plugin?
And then I'm able to do magical "make upgrade".
Title: Re: Where and how to begin? Starting develop (plugin, using API) opnSense
Post by: mimugmail on April 25, 2019, 02:35:07 pm
Yep, change in in the correct directory like dns/bind and make upgrade