Skip to content

Commit

Permalink
v0.1.25
Browse files Browse the repository at this point in the history
  • Loading branch information
ji-podhead committed Nov 13, 2024
1 parent cd5e874 commit 4ec6d92
Show file tree
Hide file tree
Showing 40 changed files with 2,692 additions and 315 deletions.
Binary file modified .docs/_build/doctrees/README.doctree
Binary file not shown.
Binary file modified .docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified .docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .docs/_build/doctrees/python_package.doctree
Binary file not shown.
27 changes: 15 additions & 12 deletions .docs/_build/html/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<p class="caption" role="heading"><span class="caption-text">Python API-Dokumentation</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="python_package.html">Opnsense-Helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="python_package.html#coonfig-manager">coonfig_manager</a></li>
<li class="toctree-l1"><a class="reference internal" href="python_package.html#commands">commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="python_package.html#scripts">scripts</a></li>
</ul>
Expand Down Expand Up @@ -118,8 +119,14 @@ <h1>about opnsense-helper<a class="headerlink" href="#about-opnsense-helper" tit
<td>
<img alt="Static Badge" src="https://img.shields.io/badge/Ansible%20Collection-%F0%9F%9A%A7-darkgrey?style=for-the-badge&color=red">
</td>
<td>
<a href="https://github.com/ji-podhead/opnsense-helper/">
<img alt="Static Badge" src="https://img.shields.io/badge/open%20source-blue?style=for-the-badge&logo=github">
</a>
</td>
</tr>
</table>
<p><em><strong>The backend api for opnsense</strong></em></p>
<ul class="simple">
<li><p>create, assign and enable lan / phy interfaces and all the other stuff that is <em><strong>Not enabled</strong></em> in the opnsense api</p></li>
<li><p>use the config_manager to apply all your configs in runtime at once</p></li>
Expand All @@ -128,6 +135,12 @@ <h1>about opnsense-helper<a class="headerlink" href="#about-opnsense-helper" tit
<li><p>around 80 opnsense scripts you can call</p></li>
<li><p>automatically configures your Vlan and Phy Interfaces after applying configuration</p></li>
</ul>
<hr class="docutils" />
<ul class="simple">
<li><p><em><strong><a class="reference external" href="https://pypi.org/project/opnsense-helper">pypy project</a></strong></em></p></li>
<li><p><em><strong><a class="reference external" href="https://ji-podhead.github.io/opnsense-helper/.docs/_build/html/index.html">Api Docs</a></strong></em></p></li>
</ul>
<hr class="docutils" />
</section>
<section id="install">
<h1>install<a class="headerlink" href="#install" title="Link to this heading"></a></h1>
Expand All @@ -143,13 +156,6 @@ <h1>usage<a class="headerlink" href="#usage" title="Link to this heading"></a
<blockquote>
<div><ul class="simple">
<li><p>you can run the provided snippets directly by pulling the <a class="reference external" href="https://github.com/the-pod-shop/opnsense-helper/blob/main/python/examples/add_vlans.py">example file</a></p></li>
<li><p>Please also have a look at:</p>
<ul>
<li><p>the <a class="reference external" href="https://ji-podhead.github.io/opnsense-helper/.docs/_build/html/index.html">Api Docs</a></p></li>
<li><p>the corresponding <a class="reference external" href="https://pypi.org/project/opnsense-helper/">pip package</a></p></li>
<li><p>and soon also the Ansible collection.</p></li>
</ul>
</li>
</ul>
</div></blockquote>
<section id="required-variables">
Expand Down Expand Up @@ -220,8 +226,8 @@ <h3>assign the config<a class="headerlink" href="#assign-the-config" title="Link
<h2>scripts and commands<a class="headerlink" href="#scripts-and-commands" title="Link to this heading"></a></h2>
<blockquote>
<div><ul class="simple">
<li><p>you can run every script fron <code class="docutils literal notranslate"><span class="pre">/usr/local/opnsense/scripts/</span></code></p></li>
<li><p>you can use every <code class="docutils literal notranslate"><span class="pre">pluginctl</span></code> and <code class="docutils literal notranslate"><span class="pre">configctl</span></code> commands</p></li>
<li><p>you can run every script from <code class="docutils literal notranslate"><span class="pre">/usr/local/opnsense/scripts/</span></code></p></li>
<li><p>you can use every <code class="docutils literal notranslate"><span class="pre">pluginctl</span></code> and <code class="docutils literal notranslate"><span class="pre">configctl</span></code> command</p></li>
<li><p>use <code class="docutils literal notranslate"><span class="pre">&lt;command:</span> <span class="pre">str&gt;</span> <span class="pre">&lt;argument:str&gt;</span> <span class="pre">&lt;flags:arr&gt;</span></code></p></li>
<li><p>besides command, argument may be required based on the method</p></li>
</ul>
Expand Down Expand Up @@ -357,9 +363,6 @@ <h1>motivation<a class="headerlink" href="#motivation" title="Link to this headi
<li><p>my opnsense runs in a vm, so it really doesnt matter for me</p></li>
<li><p>i just add the interfaces via libvirt and all i need to do is to enable them, given the /conf/config.xml method
xml has the answer.</p></li>
<li><p>however for phisical interfaces its the god damn conf.rc</p></li>
<li><p>my opnsense runs in a vm, so it really doesnt matter for me</p></li>
<li><p>i just add the interfaces via libvirt and all i need to do is to enable them, given the /conf/config.xml method</p></li>
</ul>
</section>

Expand Down
31 changes: 20 additions & 11 deletions .docs/_build/html/_sources/README.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,40 @@
<td>
<img alt="Static Badge" src="https://img.shields.io/badge/Ansible%20Collection-%F0%9F%9A%A7-darkgrey?style=for-the-badge&color=red">
</td>
<td>
<a href="https://github.com/ji-podhead/opnsense-helper/">
<img alt="Static Badge" src="https://img.shields.io/badge/open%20source-blue?style=for-the-badge&logo=github">
</a>
</td>
</tr>
</table>


***The backend api for opnsense***

- create, assign and enable lan / phy interfaces and all the other stuff that is ***Not enabled*** in the opnsense api
- use the config_manager to apply all your configs in runtime at once
- uses the opnsense backend via shh
- configctl and pluginctl commands
- around 80 opnsense scripts you can call
- automatically configures your Vlan and Phy Interfaces after applying configuration

---

- ***[pypy project](https://pypi.org/project/opnsense-helper)***
- ***[Api Docs](https://ji-podhead.github.io/opnsense-helper/.docs/_build/html/index.html)***

---

## install
### pip

### pip
```bash
pip install opnsense-helper
```

## usage

> - you can run the provided snippets directly by pulling the [example file](https://github.com/the-pod-shop/opnsense-helper/blob/main/python/examples/add_vlans.py)
> - Please also have a look at:
> - the [Api Docs](https://ji-podhead.github.io/opnsense-helper/.docs/_build/html/index.html)
> - the corresponding [pip package](https://pypi.org/project/opnsense-helper/)
> - and soon also the Ansible collection.

### required variables
* import the package and define the needed variables for the main class
Expand Down Expand Up @@ -86,8 +98,8 @@ helper.save(temp_path)
#helper.remove_items()
```
### scripts and commands
> - you can run every script fron `/usr/local/opnsense/scripts/`
> - you can use every `pluginctl` and `configctl` commands
> - you can run every script from `/usr/local/opnsense/scripts/`
> - you can use every `pluginctl` and `configctl` command
> - use `<command: str> <argument:str> <flags:arr>`
> - besides command, argument may be required based on the method
#### Example
Expand Down Expand Up @@ -203,6 +215,3 @@ python setup.py bdist_wheel \
- my opnsense runs in a vm, so it really doesnt matter for me
- i just add the interfaces via libvirt and all i need to do is to enable them, given the /conf/config.xml method
xml has the answer.
- however for phisical interfaces its the god damn conf.rc
- my opnsense runs in a vm, so it really doesnt matter for me
- i just add the interfaces via libvirt and all i need to do is to enable them, given the /conf/config.xml method
2 changes: 1 addition & 1 deletion .docs/_build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Opnsense-Helper
==========================================

**The backend framework for opnsense**
**The backend api for opnsense**

* create, assign and enable lan / phy interfaces and all the other stuff that is ***Not enabled*** in the opnsense api

Expand Down
8 changes: 8 additions & 0 deletions .docs/_build/html/_sources/python_package.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ Api Docs for Opnsense_Helper pip package.
:undoc-members:
:show-inheritance:

coonfig_manager
==========================================
Config_Manager class lets you assign configurations, by passing arrays of the corresponding Instances.
Config_Manager will parse those objects to xml and automatically reconfigure your devices.

.. automodule:: opnsense_helper.config_manager.config_manager
:members:
:undoc-members:
:show-inheritance:

commands
==========================================
Expand Down
65 changes: 60 additions & 5 deletions .docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<p class="caption" role="heading"><span class="caption-text">Python API-Dokumentation</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="python_package.html">Opnsense-Helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="python_package.html#coonfig-manager">coonfig_manager</a></li>
<li class="toctree-l1"><a class="reference internal" href="python_package.html#commands">commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="python_package.html#scripts">scripts</a></li>
</ul>
Expand Down Expand Up @@ -84,6 +85,7 @@ <h1 id="index">Index</h1>
| <a href="#C"><strong>C</strong></a>
| <a href="#D"><strong>D</strong></a>
| <a href="#F"><strong>F</strong></a>
| <a href="#G"><strong>G</strong></a>
| <a href="#H"><strong>H</strong></a>
| <a href="#I"><strong>I</strong></a>
| <a href="#M"><strong>M</strong></a>
Expand All @@ -93,6 +95,7 @@ <h1 id="index">Index</h1>
| <a href="#R"><strong>R</strong></a>
| <a href="#S"><strong>S</strong></a>
| <a href="#U"><strong>U</strong></a>
| <a href="#V"><strong>V</strong></a>
| <a href="#W"><strong>W</strong></a>

</div>
Expand All @@ -107,10 +110,14 @@ <h2 id="A">A</h2>
<h2 id="C">C</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Config_Manager.close_con">close_con() (opnsense_helper.config_manager.config_manager.Config_Manager method)</a>
</li>
<li><a href="python_package.html#opnsense_helper.commands.commands.Commands">Commands (class in opnsense_helper.commands.commands)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Config_Manager">Config_Manager (class in opnsense_helper.config_manager.config_manager)</a>
</li>
<li><a href="python_package.html#opnsense_helper.commands.commands.configctl">configctl (class in opnsense_helper.commands.commands)</a>
</li>
</ul></td>
Expand All @@ -123,6 +130,8 @@ <h2 id="D">D</h2>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Dhcpd">Dhcpd (class in opnsense_helper.config_manager.config_manager)</a>
</li>
<li><a href="python_package.html#opnsense_helper.scripts.scripts.dns">dns (class in opnsense_helper.scripts.scripts)</a>
</li>
</ul></td>
Expand All @@ -140,6 +149,22 @@ <h2 id="F">F</h2>
</ul></td>
</tr></table>

<h2 id="G">G</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Config_Manager.get_all">get_all() (opnsense_helper.config_manager.config_manager.Config_Manager method)</a>
</li>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Config_Manager.get_conf">get_conf() (opnsense_helper.config_manager.config_manager.Config_Manager method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Config_Manager.get_dif">get_dif() (opnsense_helper.config_manager.config_manager.Config_Manager method)</a>
</li>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Config_Manager.get_item">get_item() (opnsense_helper.config_manager.config_manager.Config_Manager method)</a>
</li>
</ul></td>
</tr></table>

<h2 id="H">H</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
Expand All @@ -151,10 +176,22 @@ <h2 id="H">H</h2>
<h2 id="I">I</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_package.html#opnsense_helper.scripts.scripts.interfaces">interfaces (class in opnsense_helper.scripts.scripts)</a>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Config_Manager.initialize">initialize() (opnsense_helper.config_manager.config_manager.Config_Manager method)</a>

<ul>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Dhcpd.initialize">(opnsense_helper.config_manager.config_manager.Dhcpd method)</a>
</li>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Interface.initialize">(opnsense_helper.config_manager.config_manager.Interface method)</a>
</li>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Vlan.initialize">(opnsense_helper.config_manager.config_manager.Vlan method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Interface">Interface (class in opnsense_helper.config_manager.config_manager)</a>
</li>
<li><a href="python_package.html#opnsense_helper.scripts.scripts.interfaces">interfaces (class in opnsense_helper.scripts.scripts)</a>
</li>
<li><a href="python_package.html#opnsense_helper.scripts.scripts.ipsec">ipsec (class in opnsense_helper.scripts.scripts)</a>
</li>
</ul></td>
Expand All @@ -175,7 +212,7 @@ <h2 id="M">M</h2>
</li>
<li><a href="opnsense_helper/opnsense_helper.config_manager.html#module-opnsense_helper.config_manager">opnsense_helper.config_manager</a>
</li>
<li><a href="opnsense_helper/opnsense_helper.config_manager.config_manager.html#module-opnsense_helper.config_manager.config_manager">opnsense_helper.config_manager.config_manager</a>
<li><a href="opnsense_helper/opnsense_helper.config_manager.config_manager.html#module-opnsense_helper.config_manager.config_manager">opnsense_helper.config_manager.config_manager</a>, <a href="python_package.html#module-opnsense_helper.config_manager.config_manager">[1]</a>
</li>
<li><a href="opnsense_helper/opnsense_helper.opnsense_helper.html#module-opnsense_helper.opnsense_helper">opnsense_helper.opnsense_helper</a>
</li>
Expand Down Expand Up @@ -246,7 +283,7 @@ <h2 id="O">O</h2>
opnsense_helper.config_manager.config_manager

<ul>
<li><a href="opnsense_helper/opnsense_helper.config_manager.config_manager.html#module-opnsense_helper.config_manager.config_manager">module</a>
<li><a href="opnsense_helper/opnsense_helper.config_manager.config_manager.html#module-opnsense_helper.config_manager.config_manager">module</a>, <a href="python_package.html#module-opnsense_helper.config_manager.config_manager">[1]</a>
</li>
</ul></li>
<li>
Expand Down Expand Up @@ -314,6 +351,10 @@ <h2 id="P">P</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_package.html#opnsense_helper.commands.commands.pluginctl">pluginctl (class in opnsense_helper.commands.commands)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Config_Manager.put_file">put_file() (opnsense_helper.config_manager.config_manager.Config_Manager method)</a>
</li>
</ul></td>
</tr></table>
Expand All @@ -325,6 +366,8 @@ <h2 id="R">R</h2>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Config_Manager.remove_items">remove_items() (opnsense_helper.config_manager.config_manager.Config_Manager method)</a>
</li>
<li><a href="python_package.html#opnsense_helper.scripts.scripts.routes">routes (class in opnsense_helper.scripts.scripts)</a>
</li>
</ul></td>
Expand All @@ -333,14 +376,18 @@ <h2 id="R">R</h2>
<h2 id="S">S</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Config_Manager.save">save() (opnsense_helper.config_manager.config_manager.Config_Manager method)</a>
</li>
<li><a href="python_package.html#opnsense_helper.scripts.scripts.Scripts">Scripts (class in opnsense_helper.scripts.scripts)</a>
</li>
<li><a href="python_package.html#opnsense_helper.scripts.scripts.shaper">shaper (class in opnsense_helper.scripts.scripts)</a>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Config_Manager.set">set() (opnsense_helper.config_manager.config_manager.Config_Manager method)</a>
</li>
<li><a href="python_package.html#opnsense_helper.scripts.scripts.shell">shell (class in opnsense_helper.scripts.scripts)</a>
<li><a href="python_package.html#opnsense_helper.scripts.scripts.shaper">shaper (class in opnsense_helper.scripts.scripts)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_package.html#opnsense_helper.scripts.scripts.shell">shell (class in opnsense_helper.scripts.scripts)</a>
</li>
<li><a href="python_package.html#opnsense_helper.scripts.scripts.suricata">suricata (class in opnsense_helper.scripts.scripts)</a>
</li>
<li><a href="python_package.html#opnsense_helper.scripts.scripts.syslog">syslog (class in opnsense_helper.scripts.scripts)</a>
Expand All @@ -358,6 +405,14 @@ <h2 id="U">U</h2>
</ul></td>
</tr></table>

<h2 id="V">V</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_package.html#opnsense_helper.config_manager.config_manager.Vlan">Vlan (class in opnsense_helper.config_manager.config_manager)</a>
</li>
</ul></td>
</tr></table>

<h2 id="W">W</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
Expand Down
Loading

0 comments on commit 4ec6d92

Please sign in to comment.