{"id":18295965,"url":"https://github.com/petergrace/py_backup_pfsense","last_synced_at":"2025-09-04T05:34:27.056Z","repository":{"id":145479126,"uuid":"39301351","full_name":"PeterGrace/py_backup_pfsense","owner":"PeterGrace","description":"automate backups of pfsense configs and commit to git","archived":false,"fork":false,"pushed_at":"2015-07-18T15:59:47.000Z","size":132,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T02:44:36.456Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PeterGrace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-18T14:44:26.000Z","updated_at":"2021-12-28T21:49:27.000Z","dependencies_parsed_at":"2023-04-01T04:32:13.778Z","dependency_job_id":null,"html_url":"https://github.com/PeterGrace/py_backup_pfsense","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterGrace%2Fpy_backup_pfsense","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterGrace%2Fpy_backup_pfsense/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterGrace%2Fpy_backup_pfsense/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterGrace%2Fpy_backup_pfsense/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeterGrace","download_url":"https://codeload.github.com/PeterGrace/py_backup_pfsense/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008388,"owners_count":21032553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T14:38:57.995Z","updated_at":"2025-04-09T08:42:07.299Z","avatar_url":"https://github.com/PeterGrace.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"py_backup_pfsense\n===============\nThis program will login to your pfSense router and download the latest backup of your configuration file.  It then will attempt to git commit/git push that file, should your directory where the file is saved be a git repository.\n\nThis program is an adaptation of Nextraztus's most excellent port of my original shell script to do pfSense backups from the command line.  As of the latest pfSense, they now use CSRF validation which meant that the earlier method of saving cookies via curl would not work properly.  This script properly works around the issue.\n\nSyntax\n======\nThis command expects four arguments, in the following order:\n\n`py_backup_pfsense username password router_ip_port filepath`\n\nWhere:\n  - username - user that you log into pfSense with\n  - password - password for aforementioned user\n  - router_ip_port - The ip and port of your https service on the pfSense system\n  - filepath - path and filename to where you want the xml backup saved.\n  \nExample: `py_backup_pfsense admin adminpass 10.0.0.1:443 /opt/pfSense_Backup/mybackup.xml`\n\n**Don't like your password to show in the command line?**  You can opt to define these arguments as environment variables instead:\n  - PBP_USER - analog for username\n  - PBP_PASS - analog for password\n  - PBP_ROUTER - analog for router ip and port\n  - PBP_FILEPATH - analog for filepath\n\nIn the below example, `top`/`ps` will not show any of the arguments for the program call, saving your password from a casual discovery via those commands:\n\n```\n#!/bin/bash\nPBP_USER=myuser\nPBP_PASS=mypass\nPBP_ROUTER=10.0.0.1:443\nPBP_FILEPATH=/opt/pfSense_Backup/mybackup.xml\npy_backup_pfsense\n```\n\n\nRequirements\n============\nThis script installs the following required modules:\n\n  - requests (used to abstract the ssl communication with the pfSense router)\n  - sh (a more self-documenting way to instantiate shell commands inside python)\n\n\nThanks\n======\n[Nextraztus](https://github.com/nextraztus) for providing a port of the original shell script into python.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetergrace%2Fpy_backup_pfsense","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetergrace%2Fpy_backup_pfsense","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetergrace%2Fpy_backup_pfsense/lists"}