Metadata-Version: 2.1
Name: netport
Version: 0.2.0
Summary: Tool for managing resources on a remove machine using openapi
Home-page: https://github.com/IgalKolihman/netport
License: MIT
Keywords: manager,resources,remote,managing,network,networking,openapi
Author: Igal Kolihman
Author-email: igalk.spam@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: Framework :: FastAPI
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Content Management System
Classifier: Topic :: System :: Networking
Classifier: Topic :: System :: Networking :: Monitoring
Requires-Dist: docopt (>=0.6.2,<0.7.0)
Requires-Dist: fastapi (>=0.85.0,<0.86.0)
Requires-Dist: loguru (>=0.6.0,<0.7.0)
Requires-Dist: psutil (>=5.9.2,<6.0.0)
Requires-Dist: redis (>=4.3.4,<5.0.0)
Requires-Dist: requests (>=2.28.1,<3.0.0)
Requires-Dist: uvicorn[standard] (>=0.18.3,<0.19.0)
Project-URL: Repository, https://github.com/IgalKolihman/netport
Description-Content-Type: text/markdown

# Netport

Netport is a resource management solution for single Unix machine. Netport manages the access to
different types ot resources on the OS that cannot be accessed by multiple users.

Today Netport is capable to manage: ports, files, processes and network interfaces.

# Installation

Netport is a python module that communicates with a **Redis** database in order to hold and manage
its resources.

## Netport Server

### pip install

To Install Netport, run the following command in your python virtual environment

```sh
pip install netport
```

> ### development installation
>
> Clone this repository:
> ```sh
> git clone https://github.com/IgalKolihman/netport.git
> ```
> 
> then run:
>
> ```sh
> pip install -r reguirements. ext
> ```

### installing the redis database

Netport integrates with redis, so in order to be able to run the Netport server, a database must be
accessible somewhere in the network.

To install and run a basic Redis database locally on your PC, run the following commands:

```sh
sudo apt install redis
systemctl start redis
```

If Redis is already installed on the machine, run the following command to check the status of the
process:

```sh
systemctl status redis
```

## Netport Client

### pip install

Install the package using pip:

```sh
pip install NetportClient
```

Then import the package in your code:

```python
import netport_client
```

# Running Server

Please follow the [installation procedure](#installation) for how to install the Netport server 
and then run the following command in your terminal:

```sh
netport
```

After running, a link will appear in the terminal to the server's url. The API documentation will
be available at: "http://host_ip:port/docs"

# Configuration

When initialized, Netport tries to connect to the Redis database. Netport connects with his default
values, but it is possible to change them.

Netport will override its default values if specific environment variables are set. The following
table describes those variables and their purpose:

| *Variable*         | **Description**                   | **Defanlt** |
|--------------------|-----------------------------------|-------------|
| NETPORT_REDIS_HOST | Redis's host name to connect      | 0.0.0.0     |
| NETPORT_REDIS_PORT | Redis's DB port to connect        | 6379        |
| NETPORT_REDIS_DB   | The DB number inside redis to use | 0           |

