Maintains port forwarding in UPnP compatible routers.
## Install
```
pip install UPnPPort
```
This installs a script called `upnpport`.
## Example use case
With the following configuration file, the daemon will create two
forwarding rules `80 -> 8888` and `22 -> 22`.
```yaml
- port: 8888
external_port: 80
protocol: tcp
- port: 22
protocol: tcp
```
The internal ip used is the one running the daemon.
## Configuration
Configuration files are searched in one of the following
locations. Last configuration file found takes precendence.
* `/etc/upnpport/upnpport.yaml`
* `~/.config/upnpport/upnpport.yaml`
* `./config/upnpport.yaml`
You can override the above list of searched paths by giving the
`--config_files=path[,path,...]` argument.
Adding or removing rules to a configuration file is done by using the
`configure` argument:
```
upnpport <config_file.yaml> add [--protocol {tcp,udp}] [--external_port EXTERNAL_PORT] port
upnpport <config_file.yaml> del [--protocol {tcp,udp}] [--external_port EXTERNAL_PORT] port
```
## Run
Running the daemon is done by using the `run` argument:
```
upnpport run [--config_files CONFIG_FILES]
```
## Using systemd
The daemon can start when the system starts by creating a systemd unit
file like the following one in `/etc/systemd/system/upnpport.service`.
```
[Unit]
Description=UPnPPort service
After=network.target
[Service]
User=upnpport
Group=upnpport
ExecStart=/usr/bin/upnpport run
ExecReload=/bin/kill -s usr1 $MAINPID
[Install]
WantedBy=default.target
```
I advice running the daemon with a non-root user. A system user can be
created with `useradd --system upnpport`.
Metadata
Release files for UPnPPort 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| UPnPPort-0.1.1.tar.gz | 4.1 kB | Without provenance | Details for UPnPPort-0.1.1.tar.gz |
Release files / UPnPPort-0.1.1.tar.gz
| Download URL | UPnPPort-0.1.1.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12efd8fa180ad1389328c791cd1970e8edf9a793d07e0a03ef9a4fe95835a722
|
|
BLAKE2b-256 checksum How to use checksums |
b8cf114e3dfb7b7ceec8400e1910677a8525ffc620a3f69c765186aa9dcf81c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for UPnPPort 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.