Skip to content

Commit

Permalink
- Remove AMI_ID from mandatory args
Browse files Browse the repository at this point in the history
- Retrieve AMI_ID automatically
- Setup AWS defaults
- Update docs
  • Loading branch information
dormant-user committed Jan 10, 2022
1 parent 618ac8f commit a46741a
Show file tree
Hide file tree
Showing 16 changed files with 321 additions and 160 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ venv
OpenVPN.pem

# Instance information stored as a json file
server_info.json
vpn_info.json

# Generated by Sphinx Autodoc
_build
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change Log
==========

0.4.7 (01/09/2022)
------------------
- Remove AMI_ID from mandatory args
- Retrieve AMI_ID automatically
- Setup AWS defaults
- Update docs

0.4.6 (01/09/2022)
------------------
- Make `vpn-server` a package and onboard to pypi
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ Usage:

[Runbook](https://thevickypedia.github.io/vpn-server/)

[Package](https://pypi.org/project/vpn-server/)

## License & copyright

© Vignesh Sivanandha Rao
Expand Down
12 changes: 10 additions & 2 deletions doc_generator/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,27 @@ Welcome to VPN Server's documentation!
VPN Server
==========

.. automodule:: vpn
.. automodule:: vpn.controller
:members:
:private-members:
:undoc-members:

VPN Server - Helper Functions
=============================

.. automodule:: helper
.. automodule:: vpn.helper
:members:
:private-members:
:undoc-members:

VPN Server - AWS Defaults
=========================

.. automodule:: vpn.defaults
:members:
:undoc-members:
:exclude-members: AMI_NAME, IMAGE_MAP, REGIONS

Indices and tables
==================

Expand Down
41 changes: 23 additions & 18 deletions docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h3>Navigation</h3>
<div class="bodywrapper">
<div class="body" role="main">

<br><p><a class="reference external" href="https://www.python.org/downloads/release/python-385/"><img alt="Python 3.8" src="https://img.shields.io/badge/python-3.8-orange.svg" /></a>
<p><a class="reference external" href="https://www.python.org/downloads/release/python-385/"><img alt="Python 3.8" src="https://img.shields.io/badge/python-3.8-orange.svg" /></a>
<a class="reference external" href="https://www.python.org/downloads/release/python-391/"><img alt="Python 3.9" src="https://img.shields.io/badge/python-3.9-blue.svg" /></a></p>
<section id="platform-supported">
<h1>Platform Supported<a class="headerlink" href="#platform-supported" title="Permalink to this headline"></a></h1>
Expand Down Expand Up @@ -88,22 +88,25 @@ <h2>ENV Variables<a class="headerlink" href="#env-variables" title="Permalink to
</ul>
<p>Optionally <code class="docutils literal notranslate"><span class="pre">env</span> <span class="pre">vars</span></code> for AWS config (<code class="docutils literal notranslate"><span class="pre">ACCESS_KEY</span></code>, <code class="docutils literal notranslate"><span class="pre">SECRET_KEY</span></code>, <code class="docutils literal notranslate"><span class="pre">REGION_NAME</span></code>) can be setup.</p>
</details></section>
<section id="setup-and-configuration">
<h2>Setup and Configuration<a class="headerlink" href="#setup-and-configuration" title="Permalink to this headline"></a></h2>
<ol class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">clone</span> <span class="pre">https://github.com/thevickypedia/vpn-server.git</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cd</span> <span class="pre">vpn-server</span> <span class="pre">&amp;&amp;</span> <span class="pre">python3</span> <span class="pre">-m</span> <span class="pre">venv</span> <span class="pre">venv</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">source</span> <span class="pre">venv/bin/activate</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">-r</span> <span class="pre">requirements.txt</span></code></p></li>
<li><p>Trigger VPN Server - Can be run only via <code class="docutils literal notranslate"><span class="pre">commandline</span></code> since, the script requires arguments as follows.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">vpn.py</span> <span class="pre">START</span></code> to initiate the <code class="docutils literal notranslate"><span class="pre">VPN</span> <span class="pre">Server</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">vpn.py</span> <span class="pre">STOP</span></code> to delete all resource spun up for the <code class="docutils literal notranslate"><span class="pre">VPN</span> <span class="pre">Server</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">vpn.py</span> <span class="pre">CONFIG</span></code> to reconfigure an existing <code class="docutils literal notranslate"><span class="pre">VPN</span> <span class="pre">Server</span></code>.</p></li>
</ul>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Runtime:</span> <span class="pre">~2</span> <span class="pre">minutes</span></code></p></li>
</ol>
<section id="install">
<h2>Install<a class="headerlink" href="#install" title="Permalink to this headline"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">vpn-server</span></code></p>
</section>
<section id="usage">
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">vpn.controller</span> <span class="kn">import</span> <span class="n">VPNServer</span>

<span class="n">vpn_server</span> <span class="o">=</span> <span class="n">VPNServer</span><span class="p">()</span>

<span class="n">vpn_server</span><span class="o">.</span><span class="n">create_vpn_server</span><span class="p">()</span> <span class="c1"># Create a VPN Server</span>

<span class="n">vpn_server</span><span class="o">.</span><span class="n">reconfigure_vpn</span><span class="p">()</span> <span class="c1"># Re-configure an existing VPN Server</span>

<span class="n">vpn_server</span><span class="o">.</span><span class="n">test_vpn</span><span class="p">()</span> <span class="c1"># Test an existing VPN Server</span>

<span class="n">vpn_server</span><span class="o">.</span><span class="n">delete_vpn_server</span><span class="p">()</span> <span class="c1"># Delete the VPN Server</span>
</pre></div>
</div>
<details>
<summary><strong>Manual Configuration</strong></summary><ol class="simple">
<li><p>Are you sure you want to continue connecting (yes/no)? <code class="docutils literal notranslate"><span class="pre">yes</span></code></p></li>
Expand Down Expand Up @@ -154,6 +157,7 @@ <h2>Linting<a class="headerlink" href="#linting" title="Permalink to this headli
<h2>Links<a class="headerlink" href="#links" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="https://github.com/thevickypedia/vpn-server">Repository</a></p>
<p><a class="reference external" href="https://thevickypedia.github.io/vpn-server/">Runbook</a></p>
<p><a class="reference external" href="https://pypi.org/project/vpn-server/">Package</a></p>
</section>
<section id="license-copyright">
<h2>License &amp; copyright<a class="headerlink" href="#license-copyright" title="Permalink to this headline"></a></h2>
Expand All @@ -176,7 +180,8 @@ <h3><a href="index.html">Table of Contents</a></h3>
<li><a class="reference internal" href="#deployments">Deployments</a></li>
<li><a class="reference internal" href="#vpn-server">VPN Server</a><ul>
<li><a class="reference internal" href="#env-variables">ENV Variables</a></li>
<li><a class="reference internal" href="#setup-and-configuration">Setup and Configuration</a></li>
<li><a class="reference internal" href="#install">Install</a></li>
<li><a class="reference internal" href="#usage">Usage</a></li>
<li><a class="reference internal" href="#aws-resources-used">AWS Resources Used</a></li>
<li><a class="reference internal" href="#linting">Linting</a></li>
<li><a class="reference internal" href="#links">Links</a></li>
Expand Down
31 changes: 19 additions & 12 deletions docs/_sources/README.md.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<br>

[![Python 3.8](https://img.shields.io/badge/python-3.8-orange.svg)](https://www.python.org/downloads/release/python-385/)
[![Python 3.9](https://img.shields.io/badge/python-3.9-blue.svg)](https://www.python.org/downloads/release/python-391/)

Expand Down Expand Up @@ -47,16 +45,23 @@ Defaults to `openvpn`
Optionally `env vars` for AWS config (`ACCESS_KEY`, `SECRET_KEY`, `REGION_NAME`) can be setup.
</details>

### Setup and Configuration
1. `git clone https://github.com/thevickypedia/vpn-server.git`
2. `cd vpn-server && python3 -m venv venv`
3. `source venv/bin/activate`
4. `pip install -r requirements.txt`
5. Trigger VPN Server - Can be run only via `commandline` since, the script requires arguments as follows.
- `python vpn.py START` to initiate the `VPN Server`
- `python vpn.py STOP` to delete all resource spun up for the `VPN Server`
- `python vpn.py CONFIG` to reconfigure an existing `VPN Server`.
6. `Runtime: ~2 minutes`
### Install
`pip install vpn-server`

### Usage
```python
from vpn.controller import VPNServer

vpn_server = VPNServer()

vpn_server.create_vpn_server() # Create a VPN Server

vpn_server.reconfigure_vpn() # Re-configure an existing VPN Server

vpn_server.test_vpn() # Test an existing VPN Server

vpn_server.delete_vpn_server() # Delete the VPN Server
```

<details>
<summary><strong>Manual Configuration</strong></summary>
Expand Down Expand Up @@ -106,6 +111,8 @@ Usage:

[Runbook](https://thevickypedia.github.io/vpn-server/)

[Package](https://pypi.org/project/vpn-server/)

## License & copyright

&copy; Vignesh Sivanandha Rao
Expand Down
12 changes: 10 additions & 2 deletions docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,27 @@ Welcome to VPN Server's documentation!
VPN Server
==========

.. automodule:: vpn
.. automodule:: vpn.controller
:members:
:private-members:
:undoc-members:

VPN Server - Helper Functions
=============================

.. automodule:: helper
.. automodule:: vpn.helper
:members:
:private-members:
:undoc-members:

VPN Server - AWS Defaults
=========================

.. automodule:: vpn.defaults
:members:
:undoc-members:
:exclude-members: AMI_NAME, IMAGE_MAP, REGIONS

Indices and tables
==================

Expand Down
Loading

0 comments on commit a46741a

Please sign in to comment.