diff --git a/Doxyfile b/Doxyfile index 0644aa7..d3f30ad 100644 --- a/Doxyfile +++ b/Doxyfile @@ -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" \ @@ -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 @@ -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" @@ -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 @@ -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 = @@ -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 = @@ -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 #--------------------------------------------------------------------------- @@ -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 #--------------------------------------------------------------------------- @@ -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 @@ -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/ diff --git a/README.md b/README.md index e93cb22..257d371 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. @@ -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 @@ -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: @@ -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 @@ -216,9 +218,9 @@ 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 @@ -226,9 +228,9 @@ 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: @@ -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/ @@ -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. diff --git a/src/Controller/ctlr.php b/src/Controller/ctlr.php index ed56a7d..813281f 100755 --- a/src/Controller/ctlr.php +++ b/src/Controller/ctlr.php @@ -1,7 +1,7 @@ #!/usr/bin/env php &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; diff --git a/src/Model/include.php b/src/Model/include.php index e274b0f..872b510 100644 --- a/src/Model/include.php +++ b/src/Model/include.php @@ -1,6 +1,6 @@ str= preg_replace('/{/', ' { ', $this->str); $this->str= preg_replace('/}/', ' } ', $this->str); - $this->str= preg_replace('/\(/', ' ( ', $this->str); - $this->str= preg_replace('/\)/', ' ) ', $this->str); $this->str= preg_replace('/,/', ' , ', $this->str); $this->str= preg_replace('/=/', ' = ', $this->str); $this->str= preg_replace('/"/', '', $this->str); @@ -92,4 +90,4 @@ function generate() return $this->str; } } -?> \ No newline at end of file +?> diff --git a/src/Model/lib/NatBase.php b/src/Model/lib/NatBase.php index 30e0112..0ea5558 100644 --- a/src/Model/lib/NatBase.php +++ b/src/Model/lib/NatBase.php @@ -1,6 +1,6 @@