# PfCLI
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
[![Build](https://github.com/edeckers/pfcli/actions/workflows/release.yml/badge.svg?branch=develop)](https://github.com/edeckers/pfcli/actions/workflows/release.yml)
[![PyPI](https://img.shields.io/pypi/v/pfcli.svg?maxAge=3600)](https://pypi.org/project/pfcli)
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
:warning: **No guarantees of any kind: this is a work in progress, only a few features are implemented, and none of them are under automated testing. The application depends on private pfSense API functionality, so the application might break, or mess up your pfSense appliance's config**
Allows you to access PfSense machines through CLI, which _should_ make headless management easier. The application uses the XML-RPC interface provided natively by PfSense.
## Requirements
- Python >= 3.11 - older versions might work, but are not supported
- Netgate pfSense Plus, 23.09-RELEASE :warning: this is the only version that I tested
## Installation
```bash
pipx install pfcli
```
## Configuration
The following environment variables are available to configure the application:
| Name | Default | Description |
| ------------------------ | ----------- | ---------------------------------------------------------------------- |
| `PFCLI_PFSENSE_SCHEME` | https | What scheme does the pfSense web interface listen on? |
| `PFCLI_PFSENSE_HOSTNAME` | 192.168.0.1 | To what hostname or IP address does the pfSense web interface respond? |
| `PFCLI_PFSENSE_USERNAME` | admin | What is the username for your pfSense web interface? |
| `PFCLI_PFSENSE_PASSWORD` | pfsense | What is the password for your pfSense web interface? |
Want to use config from a file instead?
**Step 1** Create a file `.env`, with contents as described below - adjust for your situation
```text
PFCLI_PFSENSE_SCHEME=https
PFCLI_PFSENSE_HOSTNAME=192.168.0.1
PFCLI_PFSENSE_USERNAME=admin
PFCLI_PFSENSE_PASSWORD=pfsense
```
**Step 2** Load the variables from `.env`
```bash
export $(xargs < .env)
```
## Examples
**List all domain overrides**
```bash
pfcli unbound list-host-overrides --output json
```
Example output:
```json
[
{
"domain": "yourdomain.tld",
"host": "yourhost",
"ip": "x.x.x.x",
"aliases": [
{
"host": "youraliashost",
"domain": "somedomain.tld",
"description": "your host override alias description"
}
],
"description": "your host override description"
}
]
```
**Print version information**
```bash
pfcli firmware version --output text
```
Example output:
```
config:
version: 23.3
kernel:
version: 14.0
platform: Netgate pfSense Plus
version: 23.09-RELEASE
```
## Contributing
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## Code of Conduct
[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
# License
MPL-2.0
Raw data
{
"_id": null,
"home_page": "https://pfcli.readthedocs.io",
"name": "pfcli",
"maintainer": "Ely Deckers",
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "cli, configuration, dns, networking, pfsense, unbound",
"author": "Ely Deckers",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/9a/44/769347959cebf89e76f4828b6f5c00cadd7501eef87ad6c68202215aa707/pfcli-0.1.2.tar.gz",
"platform": null,
"description": "# PfCLI\n\n[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)\n[![Build](https://github.com/edeckers/pfcli/actions/workflows/release.yml/badge.svg?branch=develop)](https://github.com/edeckers/pfcli/actions/workflows/release.yml)\n[![PyPI](https://img.shields.io/pypi/v/pfcli.svg?maxAge=3600)](https://pypi.org/project/pfcli)\n[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)\n\n:warning: **No guarantees of any kind: this is a work in progress, only a few features are implemented, and none of them are under automated testing. The application depends on private pfSense API functionality, so the application might break, or mess up your pfSense appliance's config**\n\nAllows you to access PfSense machines through CLI, which _should_ make headless management easier. The application uses the XML-RPC interface provided natively by PfSense.\n\n## Requirements\n\n- Python >= 3.11 - older versions might work, but are not supported\n- Netgate pfSense Plus, 23.09-RELEASE :warning: this is the only version that I tested\n\n## Installation\n\n```bash\npipx install pfcli\n```\n\n## Configuration\n\nThe following environment variables are available to configure the application:\n\n| Name | Default | Description |\n| ------------------------ | ----------- | ---------------------------------------------------------------------- |\n| `PFCLI_PFSENSE_SCHEME` | https | What scheme does the pfSense web interface listen on? |\n| `PFCLI_PFSENSE_HOSTNAME` | 192.168.0.1 | To what hostname or IP address does the pfSense web interface respond? |\n| `PFCLI_PFSENSE_USERNAME` | admin | What is the username for your pfSense web interface? |\n| `PFCLI_PFSENSE_PASSWORD` | pfsense | What is the password for your pfSense web interface? |\n\nWant to use config from a file instead?\n\n**Step 1** Create a file `.env`, with contents as described below - adjust for your situation\n\n```text\nPFCLI_PFSENSE_SCHEME=https\nPFCLI_PFSENSE_HOSTNAME=192.168.0.1\nPFCLI_PFSENSE_USERNAME=admin\nPFCLI_PFSENSE_PASSWORD=pfsense\n```\n\n**Step 2** Load the variables from `.env`\n\n```bash\nexport $(xargs < .env)\n```\n\n## Examples\n\n**List all domain overrides**\n\n```bash\npfcli unbound list-host-overrides --output json\n```\n\nExample output:\n\n```json\n[\n {\n \"domain\": \"yourdomain.tld\",\n \"host\": \"yourhost\",\n \"ip\": \"x.x.x.x\",\n \"aliases\": [\n {\n \"host\": \"youraliashost\",\n \"domain\": \"somedomain.tld\",\n \"description\": \"your host override alias description\"\n }\n ],\n \"description\": \"your host override description\"\n }\n]\n```\n\n**Print version information**\n\n```bash\npfcli firmware version --output text\n```\n\nExample output:\n\n```\nconfig:\n version: 23.3\n\nkernel:\n version: 14.0\n\nplatform: Netgate pfSense Plus\n\nversion: 23.09-RELEASE\n```\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## Code of Conduct\n\n[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.\n\n# License\n\nMPL-2.0\n",
"bugtrack_url": null,
"license": "MPL-2.0",
"summary": "A CLI for managing pfSense configurations",
"version": "0.1.2",
"project_urls": {
"Documentation": "https://github.com/edeckers/pfcli",
"Homepage": "https://pfcli.readthedocs.io",
"Repository": "https://github.com/edeckers/pfcli.git"
},
"split_keywords": [
"cli",
" configuration",
" dns",
" networking",
" pfsense",
" unbound"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f5725657c554b193bb1e59d4a66d05e7b51ecaedaa582d4f3a3fa1360993523a",
"md5": "c62f654d3c6e4f1554f4e495d9955c2d",
"sha256": "b0d4988c97c39d0c49b3ed5ec4b7ba88f3bffe57eb89efc68a42764eb83e2d34"
},
"downloads": -1,
"filename": "pfcli-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c62f654d3c6e4f1554f4e495d9955c2d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 27405,
"upload_time": "2024-11-17T11:19:17",
"upload_time_iso_8601": "2024-11-17T11:19:17.163201Z",
"url": "https://files.pythonhosted.org/packages/f5/72/5657c554b193bb1e59d4a66d05e7b51ecaedaa582d4f3a3fa1360993523a/pfcli-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9a44769347959cebf89e76f4828b6f5c00cadd7501eef87ad6c68202215aa707",
"md5": "0e2086f3363a1783dac76f41af60f132",
"sha256": "73d691f8657ef3ac0e1a85ca75c2c60ba45c8d654e080ea11fd9d5162d8ebcbe"
},
"downloads": -1,
"filename": "pfcli-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "0e2086f3363a1783dac76f41af60f132",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 16142,
"upload_time": "2024-11-17T11:19:18",
"upload_time_iso_8601": "2024-11-17T11:19:18.525224Z",
"url": "https://files.pythonhosted.org/packages/9a/44/769347959cebf89e76f4828b6f5c00cadd7501eef87ad6c68202215aa707/pfcli-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-17 11:19:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "edeckers",
"github_project": "pfcli",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pfcli"
}