Skip to content

Commit 1313860

Browse files
Merge pull request #596 from jaredhendrickson13/next_patch
v2.2.2 Fixes
2 parents 485af21 + 258bd24 commit 1313860

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Build pfSense-pkg-RESTAPI on FreeBSD
4545
run: |
4646
/usr/bin/ssh -o StrictHostKeyChecking=no ${{ matrix.FREEBSD_VERSION }}.jaredhendrickson.com 'sudo pkill ntpd || true && sudo ntpdate pool.ntp.org || true'
47-
/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
47+
/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
4848
4949
- name: Teardown FreeBSD build VM
5050
if: "${{ always() }}"

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/WireGuardPeerAllowedIP.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class WireGuardPeerAllowedIP extends Model {
3535
);
3636
$this->mask = new IntegerField(
3737
required: true,
38-
minimum: 1,
38+
minimum: 0,
3939
maximum: 128,
4040
help_text: 'The subnet mask for this peer IP.',
4141
);

tools/make_package.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ def generate_makefile(self):
6969
}
7070
excluded_files = ["pkg-deinstall.in", "pkg-install.in", "etc", "usr"]
7171

72+
# Remove tests from the package if the user has specified to do so
73+
if self.args.notests:
74+
os.system(f"rm -rf {files_dir.joinpath('usr/local/pkg/RESTAPI/Tests')}")
75+
7276
# Set Jijna2 environment and variables
7377
j2_env = jinja2.Environment(
7478
autoescape=jinja2.select_autoescape([]),
@@ -131,14 +135,15 @@ def build_on_remote_host(self):
131135
"""Runs the build on a remote host using SSH."""
132136
# Automate the process to pull, install dependencies, build and retrieve the package on a remote host
133137
includes_dir = f"~/build/{REPO_NAME}/{PKG_NAME}/files/usr/local/pkg/RESTAPI/.resources/vendor/"
138+
notests = "--notests" if self.args.notests else ""
134139
build_cmds = [
135140
"mkdir -p ~/build/",
136141
f"rm -rf ~/build/{REPO_NAME}",
137142
f"git clone https://github.com/{REPO_OWNER}/{REPO_NAME}.git ~/build/{REPO_NAME}/",
138143
f"git -C ~/build/{REPO_NAME} checkout " + self.args.branch,
139144
f"composer install --working-dir ~/build/{REPO_NAME}",
140145
f"cp -r ~/build/{REPO_NAME}/vendor/* {includes_dir}",
141-
f"python3 ~/build/{REPO_NAME}/tools/make_package.py --tag {self.args.tag}",
146+
f"python3 ~/build/{REPO_NAME}/tools/make_package.py --tag {self.args.tag} {notests}",
142147
]
143148

144149
# Run each command and exit on bad status if failure
@@ -213,6 +218,12 @@ def tag(value_string):
213218
required=False,
214219
help="filename to use for the built package file.",
215220
)
221+
parser.add_argument(
222+
"--notests",
223+
dest="notests",
224+
action="store_true",
225+
help="Exclude tests from the package build.",
226+
)
216227
self.args = parser.parse_args()
217228

218229

0 commit comments

Comments
 (0)