From f4ab0d39e948514d35932b8054ca711d685aabfd Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Wed, 3 Dec 2025 10:13:12 -0700 Subject: [PATCH 1/4] fix(OpenVPNClientExporter): return empty array if no proxy traits defined #798 --- .../usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc index 68f0a50c..106683d8 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc @@ -377,14 +377,14 @@ class OpenVPNClientExport extends Model { * @return array the proxy configuration array expected by pfSense functions */ private function __get_proxy_config(): array { - return [ + return $this->useproxy->value ? [ 'ip' => $this->proxyaddr->value, 'port' => $this->proxyport->value, 'user' => $this->proxyuser->value, 'password' => $this->proxypass->value, 'proxy_type' => $this->useproxytype->value, 'proxy_authtype' => $this->useproxypass->value, - ]; + ] : []; } private function __get_export_filename(): string { From 6c4370c191d24b0c70c40b201294165d72c1e01a Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Wed, 3 Dec 2025 15:41:06 -0700 Subject: [PATCH 2/4] style: run prettier on changed files --- .../pkg/RESTAPI/Models/OpenVPNClientExport.inc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc index 106683d8..0356f476 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc @@ -377,14 +377,16 @@ class OpenVPNClientExport extends Model { * @return array the proxy configuration array expected by pfSense functions */ private function __get_proxy_config(): array { - return $this->useproxy->value ? [ - 'ip' => $this->proxyaddr->value, - 'port' => $this->proxyport->value, - 'user' => $this->proxyuser->value, - 'password' => $this->proxypass->value, - 'proxy_type' => $this->useproxytype->value, - 'proxy_authtype' => $this->useproxypass->value, - ] : []; + return $this->useproxy->value + ? [ + 'ip' => $this->proxyaddr->value, + 'port' => $this->proxyport->value, + 'user' => $this->proxyuser->value, + 'password' => $this->proxypass->value, + 'proxy_type' => $this->useproxytype->value, + 'proxy_authtype' => $this->useproxypass->value, + ] + : []; } private function __get_export_filename(): string { From 4628ce6dd5eb467747e7823a5bbe5359eb39efde Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Sat, 13 Dec 2025 10:20:16 -0700 Subject: [PATCH 3/4] build: build and release for FreeBSD 16/pfSense Plus 25.11 --- .github/workflows/build.yml | 30 ++++++++++++++++-------------- .github/workflows/release.yml | 18 ++++++++++-------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f9539e2..741a49ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,8 @@ jobs: include: - FREEBSD_VERSION: FreeBSD-15.0-CURRENT FREEBSD_ID: freebsd15 + - FREEBSD_VERSION: FreeBSD-16.0-CURRENT + FREEBSD_ID: freebsd16 steps: - uses: actions/checkout@v6 @@ -35,8 +37,8 @@ jobs: - name: Build pfSense-pkg-RESTAPI on FreeBSD run: | - /usr/bin/ssh -o StrictHostKeyChecking=no -o LogLevel=quiet ${{ matrix.FREEBSD_VERSION }}.jaredhendrickson.com 'sudo pkill ntpd || true && sudo ntpdate pool.ntp.org || true' - /usr/local/bin/python3 tools/make_package.py --host ${{ matrix.FREEBSD_VERSION }}.jaredhendrickson.com --branch ${{ env.COMMIT_ID }} --tag ${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }} + /usr/bin/ssh -o StrictHostKeyChecking=no -o LogLevel=quiet ${{ matrix.FREEBSD_VERSION }}.actions.pfrest.org 'sudo pkill ntpd || true && sudo ntpdate pool.ntp.org || true' + /usr/local/bin/python3 tools/make_package.py --host ${{ matrix.FREEBSD_VERSION }}.actions.pfrest.org --branch ${{ env.COMMIT_ID }} --tag ${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }} - name: Teardown FreeBSD build VM if: "${{ always() }}" @@ -76,17 +78,17 @@ jobs: # This is only necessary until GitHub Actions allows an easier way to get a URL to download the artifact within pfSense - name: Copy pfSense-pkg-RESTAPI build to pfSense run: | - pfsense-vshell --host ${{ matrix.PFSENSE_VERSION }}.jaredhendrickson.com -u admin -p pfsense -c 'pfSsh.php playback enablesshd' -k - pfsense-vshell --host ${{ matrix.PFSENSE_VERSION }}.jaredhendrickson.com -u admin -p pfsense -c "mkdir /root/.ssh/ && echo $(cat ~/.ssh/id_rsa.pub) > /root/.ssh/authorized_keys" -k - scp -o StrictHostKeyChecking=no pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }}.pkg/pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }}.pkg admin@${{ matrix.PFSENSE_VERSION }}.jaredhendrickson.com:/tmp/ + pfsense-vshell --host ${{ matrix.PFSENSE_VERSION }}.actions.pfrest.org -u admin -p pfsense -c 'pfSsh.php playback enablesshd' -k + pfsense-vshell --host ${{ matrix.PFSENSE_VERSION }}.actions.pfrest.org -u admin -p pfsense -c "mkdir /root/.ssh/ && echo $(cat ~/.ssh/id_rsa.pub) > /root/.ssh/authorized_keys" -k + scp -o StrictHostKeyChecking=no pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }}.pkg/pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }}.pkg admin@${{ matrix.PFSENSE_VERSION }}.actions.pfrest.org:/tmp/ - name: Install pfSense-pkg-RESTAPI on pfSense run: | - ssh -o StrictHostKeyChecking=no -o LogLevel=quiet admin@${{ matrix.PFSENSE_VERSION }}.jaredhendrickson.com "pkg -C /dev/null add /tmp/pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }}.pkg" + ssh -o StrictHostKeyChecking=no -o LogLevel=quiet admin@${{ matrix.PFSENSE_VERSION }}.actions.pfrest.org "pkg -C /dev/null add /tmp/pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }}.pkg" sleep 5 - name: Fetch OpenAPI schema from pfSense - run: curl -s -k -u admin:pfsense -X GET https://${{ matrix.PFSENSE_VERSION }}.jaredhendrickson.com/api/v2/schema/openapi > openapi-${{ matrix.PFSENSE_VERSION }}.json + run: curl -s -k -u admin:pfsense -X GET https://${{ matrix.PFSENSE_VERSION }}.actions.pfrest.org/api/v2/schema/openapi > openapi-${{ matrix.PFSENSE_VERSION }}.json - name: Teardown pfSense VM if: "${{ always() }}" @@ -157,20 +159,20 @@ jobs: # This is only necessary until GitHub Actions allows an easier way to get a URL to download the artifact within pfSense - name: Copy pfSense-pkg-RESTAPI build to pfSense run: | - pfsense-vshell --host ${{ matrix.PFSENSE_VERSION }}.jaredhendrickson.com -u admin -p pfsense -c 'pfSsh.php playback enablesshd' -k - pfsense-vshell --host ${{ matrix.PFSENSE_VERSION }}.jaredhendrickson.com -u admin -p pfsense -c "mkdir /root/.ssh/ && echo $(cat ~/.ssh/id_rsa.pub) > /root/.ssh/authorized_keys" -k - pfsense-vshell --host ${{ matrix.PFSENSE_VERSION }}.jaredhendrickson.com -u admin -p pfsense -c "pkill ntpd" -k - pfsense-vshell --host ${{ matrix.PFSENSE_VERSION }}.jaredhendrickson.com -u admin -p pfsense -c "ntpdate pool.ntp.org" -k - scp -o StrictHostKeyChecking=no pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }}.pkg/pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }}.pkg admin@${{ matrix.PFSENSE_VERSION }}.jaredhendrickson.com:/tmp/ + pfsense-vshell --host ${{ matrix.PFSENSE_VERSION }}.actions.pfrest.org -u admin -p pfsense -c 'pfSsh.php playback enablesshd' -k + pfsense-vshell --host ${{ matrix.PFSENSE_VERSION }}.actions.pfrest.org -u admin -p pfsense -c "mkdir /root/.ssh/ && echo $(cat ~/.ssh/id_rsa.pub) > /root/.ssh/authorized_keys" -k + pfsense-vshell --host ${{ matrix.PFSENSE_VERSION }}.actions.pfrest.org -u admin -p pfsense -c "pkill ntpd" -k + pfsense-vshell --host ${{ matrix.PFSENSE_VERSION }}.actions.pfrest.org -u admin -p pfsense -c "ntpdate pool.ntp.org" -k + scp -o StrictHostKeyChecking=no pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }}.pkg/pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }}.pkg admin@${{ matrix.PFSENSE_VERSION }}.actions.pfrest.org:/tmp/ - name: Install pfSense-pkg-RESTAPI on pfSense run: | - ssh -o StrictHostKeyChecking=no -o LogLevel=quiet admin@${{ matrix.PFSENSE_VERSION }}.jaredhendrickson.com "pkg -C /dev/null add /tmp/pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }}.pkg" + ssh -o StrictHostKeyChecking=no -o LogLevel=quiet admin@${{ matrix.PFSENSE_VERSION }}.actions.pfrest.org "pkg -C /dev/null add /tmp/pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.FREEBSD_ID }}.pkg" sleep 5 - name: Run pfSense-pkg-RESTAPI tests run: | - ssh -o StrictHostKeyChecking=no -o LogLevel=quiet admin@${{ matrix.PFSENSE_VERSION }}.jaredhendrickson.com 'pfsense-restapi runtests' + ssh -o StrictHostKeyChecking=no -o LogLevel=quiet admin@${{ matrix.PFSENSE_VERSION }}.actions.pfrest.org 'pfsense-restapi runtests' - name: Teardown pfSense VM if: "${{ always() }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f239ced..d854de0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,6 +36,8 @@ jobs: PFSENSE_VERSION: "25.07" - FREEBSD_VERSION: FreeBSD-15.0-CURRENT PFSENSE_VERSION: "25.07.1" + - FREEBSD_VERSION: FreeBSD-16.0-CURRENT + PFSENSE_VERSION: "25.11" steps: - uses: actions/checkout@v6 @@ -49,8 +51,8 @@ jobs: - name: Build pfSense-pkg-RESTAPI on FreeBSD run: | - /usr/bin/ssh -o StrictHostKeyChecking=no ${{ matrix.FREEBSD_VERSION }}.jaredhendrickson.com 'sudo pkill ntpd || true && sudo ntpdate pool.ntp.org || true' - /usr/local/bin/python3 tools/make_package.py --host ${{ matrix.FREEBSD_VERSION }}.jaredhendrickson.com --branch ${{ github.sha }} --tag ${{ github.ref_name }} --filename pfSense-${{ matrix.PFSENSE_VERSION }}-pkg-RESTAPI.pkg --notests + /usr/bin/ssh -o StrictHostKeyChecking=no ${{ matrix.FREEBSD_VERSION }}.actions.pfrest.org 'sudo pkill ntpd || true && sudo ntpdate pool.ntp.org || true' + /usr/local/bin/python3 tools/make_package.py --host ${{ matrix.FREEBSD_VERSION }}.actions.pfrest.org --branch ${{ github.sha }} --tag ${{ github.ref_name }} --filename pfSense-${{ matrix.PFSENSE_VERSION }}-pkg-RESTAPI.pkg --notests - name: Teardown FreeBSD build VM if: "${{ always() }}" @@ -89,19 +91,19 @@ jobs: # This is only necessary until GitHub Actions allows an easier way to get a URL to download the artifact within pfSense - name: Copy pfSense-pkg-RESTAPI build to pfSense run: | - pfsense-vshell --host pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-RELEASE.jaredhendrickson.com -u admin -p pfsense -c 'pfSsh.php playback enablesshd' -k - pfsense-vshell --host pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-RELEASE.jaredhendrickson.com -u admin -p pfsense -c "mkdir /root/.ssh/ && echo $(cat ~/.ssh/id_rsa.pub) > /root/.ssh/authorized_keys" -k - scp -o StrictHostKeyChecking=no pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-pkg-RESTAPI.pkg/pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-pkg-RESTAPI.pkg admin@pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-RELEASE.jaredhendrickson.com:/tmp/ + pfsense-vshell --host pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-RELEASE.actions.pfrest.org -u admin -p pfsense -c 'pfSsh.php playback enablesshd' -k + pfsense-vshell --host pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-RELEASE.actions.pfrest.org -u admin -p pfsense -c "mkdir /root/.ssh/ && echo $(cat ~/.ssh/id_rsa.pub) > /root/.ssh/authorized_keys" -k + scp -o StrictHostKeyChecking=no pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-pkg-RESTAPI.pkg/pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-pkg-RESTAPI.pkg admin@pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-RELEASE.actions.pfrest.org:/tmp/ - name: Install pfSense-pkg-RESTAPI on pfSense run: | - ssh -o StrictHostKeyChecking=no -o LogLevel=quiet admin@pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-RELEASE.jaredhendrickson.com "pkg -C /dev/null add /tmp/pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-pkg-RESTAPI.pkg" + ssh -o StrictHostKeyChecking=no -o LogLevel=quiet admin@pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-RELEASE.actions.pfrest.org "pkg -C /dev/null add /tmp/pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-pkg-RESTAPI.pkg" sleep 5 - name: Fetch schemas from pfSense run: | - curl -s -k -u admin:pfsense -X GET https://pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-RELEASE.jaredhendrickson.com/api/v2/schema/openapi > openapi.json - curl -s -k -u admin:pfsense -X GET https://pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-RELEASE.jaredhendrickson.com/api/v2/schema/graphql > schema.graphql + curl -s -k -u admin:pfsense -X GET https://pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-RELEASE.actions.pfrest.org/api/v2/schema/openapi > openapi.json + curl -s -k -u admin:pfsense -X GET https://pfSense-${{ env.DEFAULT_PFSENSE_VERSION }}-RELEASE.actions.pfrest.org/api/v2/schema/graphql > schema.graphql - name: Teardown pfSense VM if: "${{ always() }}" From e2baf830ce1fb46f2ad97f34be09e8f90a327542 Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Sat, 13 Dec 2025 10:21:26 -0700 Subject: [PATCH 4/4] docs: update install commands and supported versions --- README.md | 2 +- docs/INSTALL_AND_CONFIG.md | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c96e0300..ca8951e5 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ pkg-static add https://github.com/jaredhendrickson13/pfsense-api/releases/latest Install on pfSense Plus: ```bash -pkg-static -C /dev/null add https://github.com/jaredhendrickson13/pfsense-api/releases/latest/download/pfSense-25.07.1-pkg-RESTAPI.pkg +pkg-static -C /dev/null add https://github.com/jaredhendrickson13/pfsense-api/releases/latest/download/pfSense-25.11-pkg-RESTAPI.pkg ``` > [!WARNING] diff --git a/docs/INSTALL_AND_CONFIG.md b/docs/INSTALL_AND_CONFIG.md index 19a9ca41..811f137e 100644 --- a/docs/INSTALL_AND_CONFIG.md +++ b/docs/INSTALL_AND_CONFIG.md @@ -19,6 +19,7 @@ run pfSense. It's recommended to follow Netgate's [minimum hardware requirements - pfSense Plus 24.11 - pfSense Plus 25.07 - pfSense Plus 25.07.1 +- pfSense Plus 25.11 !!! Warning Installation of the package on unsupported versions of pfSense may result in unexpected behavior and/or system instability. @@ -35,13 +36,13 @@ The pfSense REST API package is built just like any other pfSense package and ca **Install on pfSense CE** ```bash -pkg-static add https://github.com/jaredhendrickson13/pfsense-api/releases/latest/download/pfSense-2.8.0-pkg-RESTAPI.pkg +pkg-static add https://github.com/jaredhendrickson13/pfsense-api/releases/latest/download/pfSense-2.8.1-pkg-RESTAPI.pkg ``` **Install on pfSense Plus** ```bash -pkg-static -C /dev/null add https://github.com/jaredhendrickson13/pfsense-api/releases/latest/download/pfSense-24.11-pkg-RESTAPI.pkg +pkg-static -C /dev/null add https://github.com/jaredhendrickson13/pfsense-api/releases/latest/download/pfSense-25.11-pkg-RESTAPI.pkg ``` !!! Important