pfstats/README.md

1.7 KiB

pfstats

Description

dataviz projet to view the images created by pfstat project.

BSD Licensed 2-Clause

⇒ pfstat.conf: personnal config files for IPv4, IPv6 (no Queue), for pfstat

⇒ pfstat.html: Responsive web page for project pfstat

  • CSS: pure-min.css, styles.css
  • JS: ui.js — short JS to manipulate UI correctly.
  • based on PureCSS Framework

⇒ convert-img.sh: script sh to convert JPEG image to Webp and Avif format (tested on pdksh, on OpenBSD 6.9)


Installation

  1. Install pfstat package: # pkg_add pfstat
  2. Copy pfstat.conf to /etc
  3. Set and active httpd
  4. Set crontab
  5. Install needed packages for convert-img.sh: # pkg_add libavif libwebp

Configuration

httpd

⇒ create need directory to publish the pfstat images:

# mkdir -p /var/www/htdocs/pfstat/

⇒ create/copy httpd.conf file into /etc:

types {
    include "/usr/share/misc/mime.types"

    image/avif	avif
}

server "pfstat" {
	listen on 127.0.0.1 port 80
 
	location "/pfstat/" {
		directory auto index
		root "/htdocs/"
	}

}

⇒ check file config and start the daemon:

# httpd -n && rcctl start httpd

pfstat.(conf,html)

⇒ copy file config to /etc

⇒ copy files html and css on the httpd directory.

  • Yearly views:

It's possible to obtain and see yearly views. Uncomment blocks view on both pfstat* files.

crontab

### pfstat
*  * * * * /usr/local/bin/pfstat -q -d /var/db/pfstat/pfstat.db
15 * * * * /usr/local/bin/pfstat -p -d /var/db/pfstat/pfstat.db; /dir/convert-img.sh ; chown -R www /var/www/htdocs/pfstat
30 0 * * * /usr/local/bin/pfstat -t 30 -d /var/db/pfstat/pfstat.db

convert-img.sh

  1. chmod 0700

Enjoy-ID! Enjoy-IT!