Date: Wed, 24 Aug 2016 04:09:45 +0000 (UTC) From: Kurt Jaeger <pi@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r420758 - in head: . www www/ufdbguard www/ufdbguard/files Message-ID: <201608240409.u7O49j9x024863@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pi Date: Wed Aug 24 04:09:45 2016 New Revision: 420758 URL: https://svnweb.freebsd.org/changeset/ports/420758 Log: New port: www/ufdbguard: squidGuard fork compatible with newer squid versions ufdbGuard is a URL filter for the Squid web proxy. Besides blocking access from PCs and smartphones to undesired websites, ufdbGuard has safety features to make browsing safer and to block remote access. ufdbGuard supports configuration of groups with different web access policies, SafeSearch enforcement, SSH tunnel detection, safer HTTPS traffic, time-based access rules and much more. WWW: https://www.urlfilterdb.com/ PR: 212044 Submitted by: Pavel Timofeev <timp87@gmail.com> Added: head/www/ufdbguard/ head/www/ufdbguard/Makefile (contents, props changed) head/www/ufdbguard/distinfo (contents, props changed) head/www/ufdbguard/files/ head/www/ufdbguard/files/patch-src_Makefile.in (contents, props changed) head/www/ufdbguard/files/patch-src_check__config__file (contents, props changed) head/www/ufdbguard/files/patch-src_install__etcfiles.sh.in (contents, props changed) head/www/ufdbguard/files/patch-src_ufdbGuard.conf.in (contents, props changed) head/www/ufdbguard/files/pkg-message.in (contents, props changed) head/www/ufdbguard/files/ufdbguardd.in (contents, props changed) head/www/ufdbguard/pkg-descr (contents, props changed) head/www/ufdbguard/pkg-plist (contents, props changed) Modified: head/GIDs head/UIDs head/www/Makefile Modified: head/GIDs ============================================================================== --- head/GIDs Wed Aug 24 03:26:47 2016 (r420757) +++ head/GIDs Wed Aug 24 04:09:45 2016 (r420758) @@ -839,7 +839,7 @@ graylog:*:848: # free: 895 # free: 896 # free: 897 -# free: 898 +ufdb:*:898: guacamole:*:899: seafile:*:900: fossy:*:901:www Modified: head/UIDs ============================================================================== --- head/UIDs Wed Aug 24 03:26:47 2016 (r420757) +++ head/UIDs Wed Aug 24 04:09:45 2016 (r420758) @@ -844,7 +844,7 @@ graylog:*:848:848::0:0:Graylog user:/non # free: 895 # free: 896 # free: 897 -# free: 898 +ufdb:*:898:898::0:0:ufdb user:/nonexistent:/usr/sbin/nologin guacamole:*:899:899::0:0:Guacamole user:/nonexistent:/usr/sbin/nologin seafile:*:900:900::0:0:Seafile user:/nonexistent:/usr/bin/nologin fossy:*:901:901::0:0:FOSSology user:/usr/local/share/fossology:/usr/local/bin/bash Modified: head/www/Makefile ============================================================================== --- head/www/Makefile Wed Aug 24 03:26:47 2016 (r420757) +++ head/www/Makefile Wed Aug 24 04:09:45 2016 (r420758) @@ -2245,6 +2245,7 @@ SUBDIR += typo3-lts SUBDIR += uchiwa SUBDIR += udmsearch + SUBDIR += ufdbguard SUBDIR += uglifyjs SUBDIR += usermanager SUBDIR += uwsgi Added: head/www/ufdbguard/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/ufdbguard/Makefile Wed Aug 24 04:09:45 2016 (r420758) @@ -0,0 +1,76 @@ +# Created by: Pavel Timofeev <timp87@gmail.com> +# $FreeBSD$ + +PORTNAME= ufdbGuard +PORTVERSION= 1.31 +DISTVERSIONSUFFIX= -16 +CATEGORIES= www +MASTER_SITES= SF/ufdbguard/${PORTVERSION} + +MAINTAINER= timp87@gmail.com +COMMENT= URL filter for the Squid web proxy + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/COPYING + +WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} + +USES= perl5 shebangfix ssl +SHEBANG_FILES= samples/URLblocked.cgi src/ufdb_analyse_urls.pl \ + src/ufdb_top_urls.pl src/ufdb_analyse_users.pl \ + src/ufdb_top_users.pl +GNU_CONFIGURE= yes +USE_RC_SUBR= ufdbguardd + +USERS= ufdb +GROUPS= ${USERS} + +RUNDIR= /var/run/${PORTNAME} +DBDIR= /var/db/${PORTNAME} +LOGDIR= /var/log/${PORTNAME} + +PLIST_SUB= USERS=${USERS} \ + GROUPS=${GROUPS} \ + RUNDIR=${RUNDIR} \ + DBDIR=${DBDIR} \ + LOGDIR=${LOGDIR} + +SUB_LIST= PORTNAME=${PORTNAME} \ + USERS=${USERS} \ + RUNDIR=${RUNDIR} \ + DBDIR=${DBDIR} + +SUB_FILES= pkg-message + +CONFIGURE_ARGS= --with-ssl=${OPENSSLBASE} \ + --with-ssl-lib=${OPENSSLLIB} \ + --with-ssl-inc=${OPENSSLINC} \ + --with-bz2=/usr \ + --with-bz2-lib=/usr/lib \ + --with-bz2-inc=/usr/include \ + --with-ufdb-user=root \ + --with-ufdb-mandir=${MANPREFIX}/man \ + --with-ufdb-logdir=${LOGDIR} \ + --with-ufdb-piddir=${RUNDIR} \ + --with-ufdb-samplesdir=${EXAMPLESDIR} \ + --with-ufdb-config=${ETCDIR} \ + --with-ufdb-dbhome=${DBDIR} \ + --with-ufdb-images_dir=${EXAMPLESDIR}/images + +OPTIONS_DEFINE= UNIXSOCKETS +OPTIONS_DEFAULT= UNIXSOCKETS + +UNIXSOCKETS_CONFIGURE_ON= --with-unix-sockets +UNIXSOCKETS_CONFIGURE_OFF= --without-unix-sockets + +UNIXSOCKETS_DESC= Unix sockets support + +post-install: + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ufdbguardd \ + ${STAGEDIR}${PREFIX}/bin/ufdbgclient \ + ${STAGEDIR}${PREFIX}/bin/ufdbsignal \ + ${STAGEDIR}${PREFIX}/bin/ufdbGenTable \ + ${STAGEDIR}${PREFIX}/bin/ufdbAnalyse \ + ${STAGEDIR}${PREFIX}/bin/ufdbhttpd + +.include <bsd.port.mk> Added: head/www/ufdbguard/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/ufdbguard/distinfo Wed Aug 24 04:09:45 2016 (r420758) @@ -0,0 +1,3 @@ +TIMESTAMP = 1472011754 +SHA256 (ufdbGuard-1.31-16.tar.gz) = 98f491a19a806760374bf2e8441a1cd6a5fb38d168d7ffd576faa81c86db2c83 +SIZE (ufdbGuard-1.31-16.tar.gz) = 1916237 Added: head/www/ufdbguard/files/patch-src_Makefile.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/ufdbguard/files/patch-src_Makefile.in Wed Aug 24 04:09:45 2016 (r420758) @@ -0,0 +1,24 @@ +--- src/Makefile.in.orig 2016-02-18 17:47:07 UTC ++++ src/Makefile.in +@@ -210,7 +210,7 @@ install.bin: ufdbGenTable ufdbAnalyse uf + $(INSTALL_PROGRAM) ufdb_top_urls.pl $(DESTDIR)$(bindir)/ufdb_top_urls + $(INSTALL_PROGRAM) ufdb_top_users.pl $(DESTDIR)$(bindir)/ufdb_top_users + @if [ -f ufdbpeek ] ; then $(INSTALL_PROGRAM) ufdbpeek $(DESTDIR)$(bindir)/ufdbpeek ; fi +- @if [ -f $(DESTDIR)$(cfgdir)/ufdbGuard.conf ] ; then echo "$(DESTDIR)$(cfgdir)/ufdbGuard.conf already exists." ; else $(INSTALL_DATA) ufdbGuard.conf $(DESTDIR)$(cfgdir)/ufdbGuard.conf ; fi ++ @if [ -f $(DESTDIR)$(cfgdir)/ufdbGuard.conf ] ; then echo "$(DESTDIR)$(cfgdir)/ufdbGuard.conf already exists." ; else $(INSTALL_DATA) ufdbGuard.conf $(DESTDIR)$(cfgdir)/ufdbGuard.conf.sample ; fi + + install.pid:: + if [ $(piddir) != /var/tmp ] ; then $(INSTALL) -d $(DESTDIR)$(piddir) ; fi +@@ -221,10 +221,10 @@ install.update:: + + install.security:: + echo "Installing SSL root certificates" +- $(INSTALL_DATA) security/cacerts $(DESTDIR)$(dbhome)/security/cacerts ++ $(INSTALL_DATA) security/cacerts $(DESTDIR)$(dbhome)/security/cacerts.sample + + install.etc:: +- sh ./install_etcfiles.sh $(DESTDIR)$(cfgdir) $(DESTDIR)$(bindir) $(DESTDIR)$(syscfgfile) ++ sh ./install_etcfiles.sh $(DESTDIR)$(cfgdir) $(DESTDIR)$(bindir) + + install.webmin:: + @echo Added: head/www/ufdbguard/files/patch-src_check__config__file ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/ufdbguard/files/patch-src_check__config__file Wed Aug 24 04:09:45 2016 (r420758) @@ -0,0 +1,27 @@ +--- src/check_config_file.orig 2015-06-09 01:03:38 UTC ++++ src/check_config_file +@@ -32,16 +32,6 @@ then + exit 1 + fi + +-if [ ! -f $CONFIG.pre-v1.31 ] +-then +- cp $CONFIG $CONFIG.pre-v1.31 +- if [ ! -f $CONFIG.pre-v1.31 ] +- then +- echo "cannot copy configuration file to $CONFIG.pre-v1.31" +- exit 1 +- fi +-fi +- + if [ ! -w $CONFIG ] + then + chmod u+w $CONFIG +@@ -301,7 +291,6 @@ then + echo "It is recommended to verify all ACLs for the inclusion of these URL categories *****" + fi + +-echo "The original configuration file is saved in $CONFIG.pre-v1.31" + echo + + exit 0 Added: head/www/ufdbguard/files/patch-src_install__etcfiles.sh.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/ufdbguard/files/patch-src_install__etcfiles.sh.in Wed Aug 24 04:09:45 2016 (r420758) @@ -0,0 +1,44 @@ +--- src/install_etcfiles.sh.in.orig 2015-06-09 01:25:36 UTC ++++ src/install_etcfiles.sh.in +@@ -25,15 +25,6 @@ then + DESTDIR=${RPM_BUILD_ROOT:-} + fi + +-if [ "$ID" != root -a $PKGNAME != ufdbGuard ] +-then +- echo +- echo "*** You must be root but you appear to be $ID. ***" +- echo "The ufdb startup script cannot be installed..." +- echo +- exit 1 +-fi +- + CFGDIR="$1" + if [ ! -d "$CFGDIR" ] + then +@@ -335,10 +326,8 @@ fix_piddir_permissions () { + + + case $OS in +- freebsd) install_freebsd ;; + solaris_smf) install_solaris_smf ;; + linux_systemd) install_linux_systemd ;; +- *) install_unix ;; + esac + + +@@ -355,14 +344,3 @@ fi + # TODO: copy parameters from ufdbUpdate to $SYSCFGFILE ************************************************************ + + fix_piddir_permissions +- +-SERVICE=`grep -E -e ufdbguardd /etc/services` +-if [ "$SERVICE" = "" ] +-then +- ( +- echo "" +- echo "# for URLfilterDB daemon : " +- echo "ufdbguardd 3977/tcp" +- ) >> /etc/services +-fi +- Added: head/www/ufdbguard/files/patch-src_ufdbGuard.conf.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/ufdbguard/files/patch-src_ufdbGuard.conf.in Wed Aug 24 04:09:45 2016 (r420758) @@ -0,0 +1,11 @@ +--- src/ufdbGuard.conf.in.orig 2016-02-22 21:37:07 UTC ++++ src/ufdbGuard.conf.in +@@ -28,7 +28,7 @@ logall off + # communicates with Squid using the version-dependent protocol. + # valid version numbers are: 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4 and 3.5 + ## EDIT THE NEXT LINE FOR LOCAL CONFIGURATION: +-squid-version "3.3" ++squid-version "3.5" + + # When a URL database is reloaded/updated, it is not possible to + # perform URL lookups. The next parameters defines what to respond Added: head/www/ufdbguard/files/pkg-message.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/ufdbguard/files/pkg-message.in Wed Aug 24 04:09:45 2016 (r420758) @@ -0,0 +1,13 @@ +Please, note the following statements about %%PORTNAME%% port: + + o it's decided during compilation if ufdbguardd will work through Unix + or TCP socket. It's set to Unix socket by default and if you want it + to work via TCP socket unset UNIXSOCKETS port option and rebuild it. + + o ufdbUpdate script is left in non-working state for now. + The only purpose of this script is to download URLfilterDB updates + using paid subscription and to run it by cron. The script implies on + sysconfig configuration file which is usuall only for linux systems. + To make ufdbUpdate work it should be significantly rewritten for + non-linux systems. It's not worth it due to the fact ufdbUpdate can + be replaced by much more simple script written by local administator. Added: head/www/ufdbguard/files/ufdbguardd.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/ufdbguard/files/ufdbguardd.in Wed Aug 24 04:09:45 2016 (r420758) @@ -0,0 +1,106 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: ufdbguardd +# REQUIRE: LOGIN +# KEYWORD: shutdown +# + +# You can activate this daemon and set its options in any of the following files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/ufdbguardd +# /etc/rc.conf.d/ufdbguardd/${anyfile} +# ${local_startup}/rc.conf.d/ufdbguardd +# ${local_startup}/rc.conf.d/ufdbguardd/${anyfile} +# +# Note: ${local_startup} is usually /usr/local/etc +# +# Variables you can define in one of these files: +# ufdbguardd_enable (str): Activates the daemon. +# Default: NO +# ufdbguardd_flags (str): Additional flags passed to the daemon as cmd args. +# Default: none +# ufdbguardd_conf (str): The configuration file that ufdbguardd should use. +# Default: %%ETCDIR%%/ufdbGuard.conf +# ufdbguardd_user (str): The user that should be used to run the ufdbguardd. +# Default: %%USERS%% +# ufdbguardd_dbdir (str): The dir where ufdbguardd gets URL filter databases. +# Default: %%DBDIR%% + +. /etc/rc.subr + +name=ufdbguardd +rcvar=ufdbguardd_enable + +command="%%PREFIX%%/bin/${name}" + +extra_commands="configtest monitor reload rotatelog" +configtest_cmd=ufdbguardd_configtest +rotatelog_cmd=ufdbguardd_rotatelog +monitor_cmd=ufdbguardd_monitor +reload_precmd=ufdbguardd_configtest +restart_precmd=ufdbguardd_configtest +start_precmd=ufdbguardd_prestart + +ufdbguardd_load_rc_config() +{ + : ${ufdbguardd_dbdir:=%%DBDIR%%} + : ${ufdbguardd_conf:=%%ETCDIR%%/ufdbGuard.conf} + : ${ufdbguardd_enable:=NO} + : ${ufdbguardd_user:=%%USERS%%} + + ufdbguardd_unixsocket="/tmp/ufdbguardd-[0-9]*" + + required_dirs="$ufdbguardd_dbdir %%RUNDIR%%" + required_files="$ufdbguardd_conf" + pidfile="%%RUNDIR%%/${name}.pid" + command_args="-c $ufdbguardd_conf -U $ufdbguardd_user" +} + +ufdbguardd_configtest() +{ + echo "Performing sanity check on $name configuration." + if $command $command_args -C verify; then + echo "Configuration for $name passes." + return 0 + else + return $? + fi +} + +ufdbguardd_checksocket() +{ + echo "Checking if $name unix socket exists." + if test -e $ufdbguardd_unixsocket; then + echo "Unix socket $ufdbguardd_unixsocket exists. Probably stale file after abnormal shutdown. Removing it." + rm -f $ufdbguardd_unixsocket + fi +} + +ufdbguardd_prestart() +{ + ufdbguardd_configtest && \ + ufdbguardd_checksocket +} + +ufdbguardd_rotatelog() +{ + echo "Rotating $name logfiles." + sig_reload=USR1 + unset reload_precmd + run_rc_command "reload" +} + +ufdbguardd_monitor() +{ + echo "Invoking monitor command for $name." + sig_reload=USR2 + unset reload_precmd + run_rc_command "reload" +} + +load_rc_config $name +ufdbguardd_load_rc_config +run_rc_command "$1" Added: head/www/ufdbguard/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/ufdbguard/pkg-descr Wed Aug 24 04:09:45 2016 (r420758) @@ -0,0 +1,8 @@ +ufdbGuard is a URL filter for the Squid web proxy. Besides blocking +access from PCs and smartphones to undesired websites, ufdbGuard +has safety features to make browsing safer and to block remote +access. ufdbGuard supports configuration of groups with different +web access policies, SafeSearch enforcement, SSH tunnel detection, +safer HTTPS traffic, time-based access rules and much more. + +WWW: https://www.urlfilterdb.com/ Added: head/www/ufdbguard/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/ufdbguard/pkg-plist Wed Aug 24 04:09:45 2016 (r420758) @@ -0,0 +1,48 @@ +bin/ufdb-pstack +bin/ufdbAnalyse +bin/ufdbConvertDB +bin/ufdbGenTable +bin/ufdbUpdate +bin/ufdb_analyse_urls +bin/ufdb_analyse_users +bin/ufdb_top_urls +bin/ufdb_top_users +bin/ufdbgclient +bin/ufdbguardd +bin/ufdbhttpd +bin/ufdbsignal +@sample %%ETCDIR%%/ufdbGuard.conf.sample +man/man1/ufdb_analyse_urls.1.gz +man/man1/ufdb_analyse_users.1.gz +man/man1/ufdb_top_urls.1.gz +man/man1/ufdb_top_users.1.gz +man/man8/ufdbgclient.8.gz +man/man8/ufdbguardd.8.gz +man/man8/ufdbhttpd.8.gz +man/man8/ufdbupdate.8.gz +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/URLblocked.cgi +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/execdomainlist.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/execuserlist.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/default.flv +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/default.mp3 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/default.mpeg +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/default.wmv +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/forbidden-normal-de.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/forbidden-normal-en.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/forbidden-normal-es.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/forbidden-normal-fr.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/forbidden-normal-it.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/forbidden-normal-nl.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/forbidden-normal-pl.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/forbidden-normal-pt.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/forbidden-normal-sv.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/forbidden-normal-tr.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/no-ads.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/smallcross.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/square.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/images/transparent.png +@sample %%DBDIR%%/security/cacerts.sample +@dir(%%USERS%%,%%GROUPS%%,750) %%DBDIR%%/security +@dir(%%USERS%%,%%GROUPS%%,750) %%DBDIR%% +@dir(%%USERS%%,%%GROUPS%%,750) %%LOGDIR%% +@dir(%%USERS%%,%%GROUPS%%,750) %%RUNDIR%%
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608240409.u7O49j9x024863>