Skip to content

Commit

Permalink
Update to 7.1
Browse files Browse the repository at this point in the history
Also update with the UTMFW changes
  • Loading branch information
sonertari committed May 8, 2022
1 parent 9cb88a7 commit 045a8de
Show file tree
Hide file tree
Showing 197 changed files with 980 additions and 541 deletions.
16 changes: 9 additions & 7 deletions Doxyfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# Doxyfile 1.9.1
# Doxyfile 1.9.3

#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "PF Rule Editor"
PROJECT_NUMBER = 7.0
PROJECT_NUMBER = 7.1
PROJECT_BRIEF =
PROJECT_LOGO =
OUTPUT_DIRECTORY = ./docs
CREATE_SUBDIRS = NO
ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
OUTPUT_TEXT_DIRECTION = None
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
Expand Down Expand Up @@ -82,6 +81,7 @@ INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = YES
HIDE_COMPOUND_REFERENCE= NO
SHOW_HEADERFILE = YES
SHOW_INCLUDE_FILES = YES
SHOW_GROUPED_MEMB_INC = NO
FORCE_LOCAL_INCLUDES = NO
Expand Down Expand Up @@ -111,6 +111,7 @@ QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_IF_INCOMPLETE_DOC = YES
WARN_NO_PARAMDOC = NO
WARN_AS_ERROR = NO
WARN_FORMAT = "$file:$line: $text"
Expand Down Expand Up @@ -176,6 +177,7 @@ HTML_DYNAMIC_SECTIONS = NO
HTML_INDEX_NUM_ENTRIES = 100
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_FEEDURL =
DOCSET_BUNDLE_ID = org.doxygen.Project
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
DOCSET_PUBLISHER_NAME = Publisher
Expand All @@ -198,14 +200,17 @@ GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = org.doxygen.Project
DISABLE_INDEX = NO
GENERATE_TREEVIEW = YES
FULL_SIDEBAR = NO
ENUM_VALUES_PER_LINE = 4
TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
OBFUSCATE_EMAILS = YES
HTML_FORMULA_FORMAT = png
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
FORMULA_MACROFILE =
USE_MATHJAX = NO
MATHJAX_VERSION = MathJax_2
MATHJAX_FORMAT = HTML-CSS
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
MATHJAX_EXTENSIONS =
Expand Down Expand Up @@ -236,7 +241,6 @@ PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
LATEX_TIMESTAMP = NO
LATEX_EMOJI_DIRECTORY =
Expand All @@ -249,7 +253,6 @@ COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_SOURCE_CODE = NO
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
Expand All @@ -270,7 +273,6 @@ XML_NS_MEMB_FILE_SCOPE = NO
#---------------------------------------------------------------------------
GENERATE_DOCBOOK = NO
DOCBOOK_OUTPUT = docbook
DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
Expand Down Expand Up @@ -305,7 +307,6 @@ EXTERNAL_PAGES = YES
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
DIA_PATH =
HIDE_UNDOC_RELATIONS = NO
HAVE_DOT = YES
Expand All @@ -327,6 +328,7 @@ CALL_GRAPH = YES
CALLER_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DIR_GRAPH_MAX_DEPTH = 1
DOT_IMAGE_FORMAT = png
INTERACTIVE_SVG = NO
DOT_PATH = /usr/local/bin/
Expand Down
50 changes: 26 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

PFRE is a packet filter rule editor for OpenBSD/pf. PFRE is expected to be used by beginners and system administrators alike.

The [UTMFW](https://github.com/sonertari/UTMFW) and [PFFW](https://github.com/sonertari/PFFW) projects use PFRE on their web administration interfaces. If you don't want to [install PFRE](https://github.com/sonertari/PFRE#how-to-install) yourself, you can download the installation iso file of [UTMFW](https://github.com/sonertari/UTMFW#download) or [PFFW](https://github.com/sonertari/PFFW#download) to test drive PFRE easily.
The [UTMFW](https://github.com/sonertari/UTMFW) and [PFFW](https://github.com/sonertari/PFFW) projects use PFRE on their web administration interfaces. If you don't want to [install PFRE](https://github.com/sonertari/PFRE#how-to-install) yourself, you can download the installation files of [UTMFW](https://github.com/sonertari/UTMFW#download) or [PFFW](https://github.com/sonertari/PFFW#download) to test drive PFRE easily.

## Features

Expand Down Expand Up @@ -58,8 +58,8 @@ You can find a couple of screenshots on the [wiki](https://github.com/sonertari/

Here are the basic steps to obtain a working PFRE installation:

- Install OpenBSD 7.0, perhaps on a VM.
- Install PHP 8.0.10, php-pcntl, and php-cgi.
- Install OpenBSD 7.1, perhaps on a VM.
- Install PHP 8.1.4, php-pcntl, and php-cgi.
- Copy the files in PFRE src folder to /var/www/htdocs/pfre/.
- Configure httpd.conf for PFRE.
- Create admin and user users, and set their passwords.
Expand All @@ -74,9 +74,9 @@ The OpenBSD installation guide is at [faq4](http://www.openbsd.org/faq/faq4.html

Here are a couple of guidelines:

- You can download install69.iso available at OpenBSD mirrors.
- You can download install71.iso available at OpenBSD mirrors.
- It may be easier to install a PFRE test system on a VM of your choice, e.g. VMware or VirtualBox, rather than bare hardware.
- 512MB RAM and 8GB HD should be more than enough.
- 256MB RAM and 8GB HD should be enough.
- If you want to obtain a packet filtering firewall, make sure the VM has at least 2 ethernet interfaces:
+ The external interface may obtain its IP address over DHCP
+ The internal interface should have a static IP address
Expand All @@ -100,18 +100,19 @@ Download the required packages from an OpenBSD mirror and copy them to $PKG\_PAT

argon2-20190702.tgz
bzip2-1.0.8p0.tgz
capstone-4.0.2.tgz
femail-1.0p1.tgz
femail-chroot-1.0p3.tgz
gettext-runtime-0.21p1.tgz
libiconv-1.16p0.tgz
libsodium-1.0.18p1.tgz
libxml-2.9.12.tgz
libxml-2.9.13.tgz
oniguruma-6.9.7.1.tgz
pcre2-10.36.tgz
php-8.0.10p0.tgz
php-cgi-8.0.10p0.tgz
php-pcntl-8.0.10p0.tgz
xz-5.2.5.tgz
pcre2-10.37.tgz
php-8.1.4p1.tgz
php-cgi-8.1.4.tgz
php-pcntl-8.1.4.tgz
xz-5.2.5p0.tgz

Install PHP, php-pcntl, and php-cgi by running the following commands, which should install their dependencies as well:

Expand All @@ -127,18 +128,19 @@ Here is the expected output of that command:

argon2-20190702 C implementation of Argon2 - password hashing function
bzip2-1.0.8p0 block-sorting file compressor, unencumbered
capstone-4.0.2 multi-platform, multi-architecture disassembly framework
femail-1.0p1 simple SMTP client
femail-chroot-1.0p3 simple SMTP client for chrooted web servers
gettext-runtime-0.21p1 GNU gettext runtime libraries and programs
libiconv-1.16p0 character set conversion library
libsodium-1.0.18p1 library for network communications and cryptography
libxml-2.9.12 XML parsing library
libxml-2.9.13 XML parsing library
oniguruma-6.9.7.1 regular expressions library
pcre2-10.36 perl-compatible regular expression library, version 2
php-8.0.10p0 server-side HTML-embedded scripting language
php-cgi-8.0.10p0 php CGI binary
php-pcntl-8.0.10p0 PCNTL extensions for php
xz-5.2.5 LZMA compression and decompression tools
pcre2-10.37 perl-compatible regular expression library, version 2
php-8.1.4p1 server-side HTML-embedded scripting language
php-cgi-8.1.4 php CGI binary
php-pcntl-8.1.4 PCNTL extensions for php
xz-5.2.5p0 LZMA compression and decompression tools

### Install PFRE

Expand Down Expand Up @@ -216,19 +218,19 @@ However, you are advised to pick a better password than soner123.
Go to /usr/local/bin/ and create a link to php executable:

# cd /usr/local/bin
# ln -s php-8.0 php
# ln -s php-8.1 php

Edit the /etc/php-8.0.ini file to write error messages to syslog, otherwise they may disturb pfctl test reports:
Edit the /etc/php-8.1.ini file to write error messages to syslog, otherwise they may disturb pfctl test reports:

error_log = syslog

Also, edit the /etc/php-fpm.conf file to write error messages to syslog:

error_log = syslog

To enable pcntl, go to /etc/php-8.0/ and create the pcntl.ini file:
To enable pcntl, go to /etc/php-8.1/ and create the pcntl.ini file:

# cd /etc/php-8.0/
# cd /etc/php-8.1/
# touch pcntl.ini

And add the following line to pcntl.ini:
Expand Down Expand Up @@ -267,9 +269,9 @@ If you want the web server to be started automatically after a reboot, first cop

Then add the following lines to it:

if [ -x /usr/local/sbin/php-fpm-8.0 ]; then
if [ -x /usr/local/sbin/php-fpm-8.1 ]; then
echo 'PHP CGI server'
/usr/local/sbin/php-fpm-8.0
/usr/local/sbin/php-fpm-8.1
fi

Create the rc.conf.local file under /etc/
Expand All @@ -294,7 +296,7 @@ And uncomment the line which enables forwarding of IPv4 packets:

Now you can either reboot the system or start the php cgi server and the web server manually using the following commands:

# /usr/local/sbin/php-fpm-8.0
# /usr/local/sbin/php-fpm-8.1
# /usr/sbin/httpd

Finally, if you point your web browser to the IP address of PFRE, you should see the login page. And you should be able to log in by entering admin:soner123 as user and password.
2 changes: 1 addition & 1 deletion src/Controller/ctlr.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of UTMFW.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/lib.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of UTMFW.
*
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/sh.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of UTMFW.
*
Expand Down Expand Up @@ -90,7 +90,7 @@
$cwd= dirname(__FILE__);

// Run the ctlr using doas and passing -n for no arg validation, as we have already done that above
exec("/usr/bin/doas $cwd/ctlr.php -n '$args' 2>&1", $encoded, $retval);
exec("/usr/bin/doas $cwd/ctlr.php -n ".escapeshellarg($args)." 2>&1", $encoded, $retval);
// There must be only one element in $encoded array, but do not miss the others if any
$encoded= implode(' ', $encoded);
echo $encoded;
Expand Down
2 changes: 1 addition & 1 deletion src/Model/include.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of UTMFW.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/lib/AfTo.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of PFRE.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/lib/Anchor.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of PFRE.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/lib/Antispoof.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of PFRE.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/lib/BinatTo.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of PFRE.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/lib/Blank.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of PFRE.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/lib/Comment.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of PFRE.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/lib/DivertPacket.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of PFRE.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/lib/DivertTo.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of PFRE.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/lib/Filter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of PFRE.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/lib/FilterBase.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of PFRE.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/lib/Include.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of PFRE.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/lib/Limit.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of PFRE.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/lib/LoadAnchor.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2004-2021 Soner Tari
* Copyright (C) 2004-2022 Soner Tari
*
* This file is part of PFRE.
*
Expand Down
Loading

0 comments on commit 045a8de

Please sign in to comment.