Skip to content

Commit 11c083a

Browse files
committed
Update email templates
Update .gitignore, README.md Use gitverse for release notes generation Use requirements.txt instead of hard coded pyproject.toml
1 parent ff00de4 commit 11c083a

17 files changed

Lines changed: 78 additions & 120 deletions

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
.env
22
.idea
33
venv
4-
__pycache__/
5-
_build/
6-
fileio
4+
75
dist/
6+
_build/
7+
fileio/
8+
__pycache__/
89
NetSec.egg-info/

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ Clean code with pre-commit hooks: [`flake8`](https://flake8.pycqa.org/en/latest/
5757
## [Release Notes](https://github.com/thevickypedia/NetSec/blob/master/release_notes.rst)
5858
**Requirement**
5959
```shell
60-
python -m pip install changelog-generator
60+
python -m pip install gitverse
6161
```
6262

6363
**Usage**
6464
```shell
65-
changelog reverse -f release_notes.rst -t 'Release Notes'
65+
gitverse-release reverse -f release_notes.rst -t 'Release Notes'
6666
```
6767

6868
## Linting
@@ -87,3 +87,9 @@ pre-commit run --all-files
8787
[![made-with-sphinx-doc](https://img.shields.io/badge/Code%20Docs-Sphinx-1f425f.svg)](https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html)
8888

8989
[https://thevickypedia.github.io/NetSec/](https://thevickypedia.github.io/NetSec/)
90+
91+
## License & copyright
92+
93+
© Vignesh Rao, NetSec
94+
95+
Licensed under the [MIT License](https://github.com/thevickypedia/NetSec/blob/main/LICENSE)

docs/README.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ <h2>Coding Standards<a class="headerlink" href="#coding-standards" title="Permal
9898
<section id="release-notes">
9999
<h2><a class="reference external" href="https://github.com/thevickypedia/NetSec/blob/master/release_notes.rst">Release Notes</a><a class="headerlink" href="#release-notes" title="Permalink to this heading"></a></h2>
100100
<p><strong>Requirement</strong></p>
101-
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>python<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>changelog-generator
101+
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>python<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>gitverse
102102
</pre></div>
103103
</div>
104104
<p><strong>Usage</strong></p>
105-
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>changelog<span class="w"> </span>reverse<span class="w"> </span>-f<span class="w"> </span>release_notes.rst<span class="w"> </span>-t<span class="w"> </span><span class="s1">&#39;Release Notes&#39;</span>
105+
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>gitverse-release<span class="w"> </span>reverse<span class="w"> </span>-f<span class="w"> </span>release_notes.rst<span class="w"> </span>-t<span class="w"> </span><span class="s1">&#39;Release Notes&#39;</span>
106106
</pre></div>
107107
</div>
108108
</section>
@@ -128,6 +128,11 @@ <h2>Runbook<a class="headerlink" href="#runbook" title="Permalink to this headin
128128
<p><a class="reference external" href="https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html"><img alt="made-with-sphinx-doc" src="https://img.shields.io/badge/Code%20Docs-Sphinx-1f425f.svg" /></a></p>
129129
<p><a class="reference external" href="https://thevickypedia.github.io/NetSec/">https://thevickypedia.github.io/NetSec/</a></p>
130130
</section>
131+
<section id="license-copyright">
132+
<h2>License &amp; copyright<a class="headerlink" href="#license-copyright" title="Permalink to this heading"></a></h2>
133+
<p>© Vignesh Rao, NetSec</p>
134+
<p>Licensed under the <a class="reference external" href="https://github.com/thevickypedia/NetSec/blob/main/LICENSE">MIT License</a></p>
135+
</section>
131136
</section>
132137

133138

@@ -148,6 +153,7 @@ <h3><a href="index.html">Table of Contents</a></h3>
148153
<li><a class="reference internal" href="#linting">Linting</a></li>
149154
<li><a class="reference internal" href="#pypi-package">Pypi Package</a></li>
150155
<li><a class="reference internal" href="#runbook">Runbook</a></li>
156+
<li><a class="reference internal" href="#license-copyright">License &amp; copyright</a></li>
151157
</ul>
152158
</li>
153159
</ul>

docs/_sources/README.md.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ Clean code with pre-commit hooks: [`flake8`](https://flake8.pycqa.org/en/latest/
5757
## [Release Notes](https://github.com/thevickypedia/NetSec/blob/master/release_notes.rst)
5858
**Requirement**
5959
```shell
60-
python -m pip install changelog-generator
60+
python -m pip install gitverse
6161
```
6262

6363
**Usage**
6464
```shell
65-
changelog reverse -f release_notes.rst -t 'Release Notes'
65+
gitverse-release reverse -f release_notes.rst -t 'Release Notes'
6666
```
6767

6868
## Linting
@@ -87,3 +87,9 @@ pre-commit run --all-files
8787
[![made-with-sphinx-doc](https://img.shields.io/badge/Code%20Docs-Sphinx-1f425f.svg)](https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html)
8888

8989
[https://thevickypedia.github.io/NetSec/](https://thevickypedia.github.io/NetSec/)
90+
91+
## License & copyright
92+
93+
&copy; Vignesh Rao, NetSec
94+
95+
Licensed under the [MIT License](https://github.com/thevickypedia/NetSec/blob/main/LICENSE)

docs/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ <h1>Welcome to NetSec’s documentation!<a class="headerlink" href="#welcome-to-
5555
<li class="toctree-l2"><a class="reference internal" href="README.html#linting">Linting</a></li>
5656
<li class="toctree-l2"><a class="reference internal" href="README.html#pypi-package">Pypi Package</a></li>
5757
<li class="toctree-l2"><a class="reference internal" href="README.html#runbook">Runbook</a></li>
58+
<li class="toctree-l2"><a class="reference internal" href="README.html#license-copyright">License &amp; copyright</a></li>
5859
</ul>
5960
</li>
6061
</ul>

docs/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

netsec/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
from netsec.modules.models import SupportedModules # noqa: F401
55
from netsec.modules.settings import config # noqa: F401
66

7-
version = "0.9"
7+
version = "0.9.1"

netsec/analyzer.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
from typing import NoReturn
22

3-
import gmailconnector
3+
import gmailconnector as gc
44

55
from netsec.modules import att, models, netgear, settings
66

77

8-
def network_monitor(module: models.SupportedModules, init: bool = True, block: bool = False) -> NoReturn:
8+
def network_monitor(module: models.SupportedModules,
9+
init: bool = True,
10+
block: bool = False) -> NoReturn:
911
"""Monitor devices connected to the network.
1012
1113
Args:
@@ -14,7 +16,7 @@ def network_monitor(module: models.SupportedModules, init: bool = True, block: b
1416
block: Takes a boolean value whether to block the intrusive device.
1517
"""
1618
if settings.config.recipient:
17-
settings.config.recipient = gmailconnector.EmailAddress(address=settings.config.recipient)
19+
settings.config.recipient = gc.EmailAddress(address=str(settings.config.recipient))
1820
if module == models.SupportedModules.netgear:
1921
if not settings.config.router_pass:
2022
raise ValueError(

netsec/modules/att.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
from collections.abc import Generator
55
from typing import Any, NoReturn, Optional, Union
66

7-
import pandas
7+
import pandas as pd
88
import requests
9-
from pandas import DataFrame
109

1110
from netsec.modules.helper import notify
1211
from netsec.modules.settings import LOGGER, config
@@ -57,14 +56,14 @@ def __init__(self, dictionary: dict):
5756
setattr(self, key, dictionary[key])
5857

5958

60-
def generate_dataframe() -> DataFrame:
59+
def generate_dataframe() -> pd.DataFrame:
6160
"""Generate a dataframe using the devices information from router web page.
6261
6362
Returns:
64-
DataFrame:
63+
pd.DataFrame:
6564
Devices list as a data frame.
6665
"""
67-
# pandas.set_option('display.max_rows', None)
66+
# pd.set_option('display.max_rows', None)
6867
try:
6968
response = requests.get(url=SOURCE)
7069
except requests.RequestException as error:
@@ -74,7 +73,7 @@ def generate_dataframe() -> DataFrame:
7473
if response.ok:
7574
html_source = response.text
7675
try:
77-
html_tables = pandas.read_html(html_source)
76+
html_tables = pd.read_html(html_source)
7877
except ImportError:
7978
raise ValueError("No tables found")
8079
return html_tables[0]

netsec/modules/email_template.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ <h3>NetSec Intrusion Alert</h3>
1010
</tr>
1111
{% for key, value in alert.items() %}
1212
<tr>
13-
<td style="height: 30px; horizontal-align: left; vertical-align: bottom; font-weight:bold; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; border-left: 1px solid #ddd; border-right: 1px solid #ddd;"> {{ key }}</td>
14-
<td style="height: 30px; horizontal-align: right; vertical-align: bottom; text-align: right; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; border-left: 1px solid #ddd; border-right: 1px solid #ddd;"> {{ value }}</td>
13+
<td style="text-align:left"> <b>{{ key }}</b></td>
14+
<td style="text-align:right"> {{ value }}</td>
1515
</tr>
1616
{% endfor %}
1717
<br>
1818
{% endfor %}
1919
</tbody>
2020
</table>
21+
<br>
2122
<div style="font-family:'Helvetica Neue';font-size:12px;line-height:20px;margin-bottom:10px;color:#444444;line-height:20px;padding:16px 16px 16px 16px;text-align:center;">
2223
<br><b>Source code:</b> <a href="https://github.com/thevickypedia/JarvisMonitor" target="_bottom">https://github.com/thevickypedia/NetSec</a>
2324
<br><b>Reach out:</b> <a href="https://vigneshrao.com/contact" target="_bottom">https://vigneshrao.com/contact</a>

0 commit comments

Comments
 (0)