diff --git a/GIDs b/GIDs index 5c1c3a79d65a..45dc556da5f7 100644 --- a/GIDs +++ b/GIDs @@ -371,7 +371,7 @@ drweb:*:426: # free: 428 varnish:*:429: # free: 430 -# free: 431 +vinyl:*:431: # free: 432 # free: 433 # free: 434 diff --git a/UIDs b/UIDs index 62bc4668a26a..5f807e6bd9a2 100644 --- a/UIDs +++ b/UIDs @@ -377,8 +377,8 @@ drweb:*:426:426::0:0:Dr.Web Mail Scanner:/nonexistent:/usr/sbin/nologin # free: 428 varnish:*:429:429::0:0:Varnish Cache User:/nonexistent:/usr/sbin/nologin varnishlog:*:430:429::0:0:Varnish Log User:/nonexistent:/usr/sbin/nologin -# free: 431 -# free: 432 +vinyl:*:431:431::0:0:Vinyl Cache User:/nonexistent:/usr/sbin/nologin +vinyllog:*:432:431::0:0:Vinyl Log User:/nonexistent:/usr/sbin/nologin # free: 433 # free: 434 # free: 435 diff --git a/www/Makefile b/www/Makefile index a7c9fd45a42d..e04b64aaf7cc 100644 --- a/www/Makefile +++ b/www/Makefile @@ -2673,6 +2673,7 @@ SUBDIR += vger SUBDIR += vigil SUBDIR += vimb + SUBDIR += vinyl09 SUBDIR += visitors SUBDIR += volta SUBDIR += vultr-cli diff --git a/www/vinyl09/Makefile b/www/vinyl09/Makefile new file mode 100644 index 000000000000..3212c0383252 --- /dev/null +++ b/www/vinyl09/Makefile @@ -0,0 +1,55 @@ +PORTNAME= vinyl +DISTVERSION= 9.0.0 +CATEGORIES= www +MASTER_SITES= https://vinyl-cache.org/downloads/ +PKGNAMESUFFIX= 09 +DISTNAME= vinyl-cache-${PORTVERSION} + +MAINTAINER= dbaio@FreeBSD.org +COMMENT= High-performance HTTP accelerator +WWW= https://vinyl-cache.org/ + +LICENSE= BSD2CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= rst2man:textproc/py-docutils@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}sphinx>=0,1:textproc/py-sphinx@${PY_FLAVOR} +LIB_DEPENDS= libpcre2-8.so:devel/pcre2 + +USES= cpe libedit libtool localbase ncurses pathfix \ + pkgconfig python:build shebangfix tar:tgz +CPE_VENDOR= vinyl-cache +CPE_PRODUCT= vinyl_cache +GNU_CONFIGURE= yes +GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share +SHEBANG_FILES= lib/libvcc/*.py lib/libvsc/*.py +USE_LDCONFIG= yes +USE_RC_SUBR= vinyld vinyllog vinylncsa + +USERS= vinyl vinyllog +GROUPS= vinyl + +INSTALL_TARGET= install-strip +TEST_TARGET= check +TEST_ARGS= TESTS_PARALLELISM=1 + +CONFIGURE_ARGS= --localstatedir=${PREFIX} --without-dot +# Needed for clang 15 (#268814) +CONFIGURE_ENV+= ax_cv_check_cflags___Werror=no + +.if defined(NO_INET6) || defined(WITHOUT_INET6) +BAD_TESTS= r00832 +EXTRA_PATCHES= ${FILESDIR}/no-inet6.patch +.endif + +OPTIONS_DEFINE= DOCS + +post-patch: +.if defined(BAD_TESTS) + ${RM} ${BAD_TESTS:C|.+|${WRKSRC}/bin/vinyltest/tests/\0.vtc|} +.endif + +pre-install: + ${MKDIR} ${STAGEDIR}${PREFIX}/vinyl-cache + +.include diff --git a/www/vinyl09/distinfo b/www/vinyl09/distinfo new file mode 100644 index 000000000000..1892b7e9b73d --- /dev/null +++ b/www/vinyl09/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1773711858 +SHA256 (vinyl-cache-9.0.0.tgz) = 9740c210c2a77627d50fd0ad6c759dc3ca094fcb4e6555ba55fca71cf483bd17 +SIZE (vinyl-cache-9.0.0.tgz) = 6353519 diff --git a/www/vinyl09/files/no-inet6.patch b/www/vinyl09/files/no-inet6.patch new file mode 100644 index 000000000000..ca758ba327e9 --- /dev/null +++ b/www/vinyl09/files/no-inet6.patch @@ -0,0 +1,8 @@ +--- bin/vinyltest/tests/c00005.vtc 2012-08-20 05:20:39.000000000 -0400 ++++ bin/vinyltest/tests/c00005.vtc 2012-09-26 12:09:59.000000000 -0400 +@@ -32,5 +32,4 @@ + ! "localhost"; + "0.0.0.0" / 0; +- "::" / 0; + } + diff --git a/www/vinyl09/files/vinyld.in b/www/vinyl09/files/vinyld.in new file mode 100644 index 000000000000..27e60874a17f --- /dev/null +++ b/www/vinyl09/files/vinyld.in @@ -0,0 +1,125 @@ +#!/bin/sh + +# PROVIDE: vinyld +# REQUIRE: DAEMON +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable vinyld: +# +# vinyld_enable="YES" +# +# Configuration variables and their default values: +# +# vinyld_pidfile - full path to the PID file. +# default: "/var/run/vinyld.pid" +# +# vinyld_listen - address and port at which vinyld will listen for +# client requests. +# default: ":80" +# +# vinyld_admin - address and port at which vinyld will listen for +# administrative commands. +# default: "localhost:81" +# +# vinyld_backend - address of the backend server. +# default: "localhost:8080" +# +# vinyld_config - name of the vinyld config file. +# default: unset. +# +# vinyld_hash - hash algorithm +# default: "critbit" +# +# vinyld_storage - storage method and parameters. +# default: "file,/tmp,100M" +# +# vinyld_jailuser - unprivileged user for the child process. +# default: "vinyl" +# +# vinyld_flags - complete command line arguments. +# default if vinyld_config is unset: "-j unix,user=${vinyld_jailuser} -P ${vinyld_pidfile} -a ${vinyld_listen} -T ${vinyld_admin} -b ${vinyld_backend} -s ${vinyld_storage} -h ${vinyld_hash} ${vinyld_extra_flags}" +# default if vinyld_config is set: "-j unix,user=${vinyld_jailuser} -P ${vinyld_pidfile} -a ${vinyld_listen} -T ${vinyld_admin} -f ${vinyld_config} -s ${vinyld_storage} -h ${vinyld_hash} ${vinyld_extra_flags}" +# +# See vinyld(1) for a detailed overview of command-line options. +# + +. /etc/rc.subr + +name=vinyld +rcvar=vinyld_enable + +load_rc_config ${name} + +: ${vinyld_enable:=NO} +: ${vinyld_pidfile=/var/run/${name}.pid} +: ${vinyld_listen=:80} +: ${vinyld_admin=localhost:81} +: ${vinyld_backend=localhost:8080} +: ${vinyld_storage=file,/tmp,100M} +: ${vinyld_hash=critbit} +: ${vinyld_jailuser=vinyl} + +command="%%PREFIX%%/sbin/${name}" +pidfile="${vinyld_pidfile}" +configtest_cmd="vinyld_checkconfig" +reload_cmd="vinyld_reload" +restart_precmd="vinyld_checkconfig" +start_precmd="vinyld_precmd" +extra_commands="status reload configtest" + +if [ -n "${vinyld_config}" ] ; then + : ${vinyld_flags:="-j unix,user=${vinyld_jailuser} -P ${vinyld_pidfile} -a ${vinyld_listen} -T ${vinyld_admin} -f ${vinyld_config} -s ${vinyld_storage} -h ${vinyld_hash} ${vinyld_extra_flags}"} +else + : ${vinyld_flags:="-j unix,user=${vinyld_jailuser} -P ${vinyld_pidfile} -a ${vinyld_listen} -T ${vinyld_admin} -b ${vinyld_backend} -s ${vinyld_storage} -h ${vinyld_hash} ${vinyld_extra_flags}"} +fi + +vinyld_checkconfig() +{ + if [ -z "${vinyld_config}" ]; then + echo "${name}: nothing to check, no configuration file defined, builtin VCL used" + else + echo "Performing sanity check on ${name} configuration:" + if eval ${command} -s ${vinyld_storage} ${vinyld_extra_flags} -C -f "${vinyld_config}" 2> /dev/null ; then + echo "${name}: the configuration file ${vinyld_config} syntax is ok" + else + err 1 "${name}: the configuration file ${vinyld_config} syntax is NOT ok" + fi + fi +} + +# Adapted from work done by Ingvar Hagelund (see redhat/vinyl_reload_vcl) +vinyld_reload() +{ + local _current_config_name _new_config_name _vinyladm_cmd + + if [ -z "${vinyld_config}" ]; then + echo "${name}: nothing to reload, no configuration file defined, builtin VCL used" + else + _new_config_name="reloaded_$(date +%Y%m%d%H%M%S)" + _vinyladm_cmd="%%PREFIX%%/bin/vinyladm ${vinyl_cli_flags}" + if ! eval ${_vinyladm_cmd} vcl.list > /dev/null; then + err 1 "${name}: can't connect to vinyladm" + fi + _current_config_name=$(${_vinyladm_cmd} vcl.list | awk ' /^active/ { print $3 } ') + if ! eval ${_vinyladm_cmd} vcl.load ${_new_config_name} ${vinyld_config} > /dev/null; then + err 1 "${name}: vcl.load failed, you're still using previous rules (${_current_config_name})" + fi + if eval ${_vinyladm_cmd} vcl.use ${_new_config_name} > /dev/null; then + echo "VCL file \"${vinyld_config}\" has been successfully loaded as \"${_new_config_name}\"" + echo "To remove previous loaded configurations, you should run \"${_vinyladm_cmd} vcl.discard \" by yourself" + else + err 1 "${name}: vcl.use failed, you're still using previous rules (${_current_config_name})" + fi + fi + + return 0 +} + +vinyld_precmd() +{ + # Check config before starting + vinyld_checkconfig +} + +run_rc_command "$1" diff --git a/www/vinyl09/files/vinyllog.in b/www/vinyl09/files/vinyllog.in new file mode 100644 index 000000000000..d0cb92d03429 --- /dev/null +++ b/www/vinyl09/files/vinyllog.in @@ -0,0 +1,62 @@ +#!/bin/sh + +# PROVIDE: vinyllog +# REQUIRE: DAEMON vinyld +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable vinyllog: +# +# vinyllog_enable="YES" +# +# Configuration variables and their default values: +# +# vinyllog_pidfile - full path to the PID file. +# default: "/var/run/vinyllog.pid" +# +# vinyllog_file - full path to the log file. +# default: "/var/log/vinyl.log" +# +# vinyllog_flags - command line arguments. +# default: "-t off -P ${vinyllog_pidfile} -D -a -A -w ${vinyllog_file}" +# +# Add the following line to /etc/newsyslog.conf to rotate the log file +# once a day: +# +# /var/log/vinyl.log vinyllog:vinyl 640 7 * @T00 JB /var/run/vinyllog.pid +# +# See vinyllog(1) for a detailed overview of command-line options. +# + +. /etc/rc.subr + +name=vinyllog +rcvar=vinyllog_enable + +load_rc_config ${name} +: ${vinyllog_enable:=NO} +: ${vinyllog_pidfile=/var/run/${name}.pid} +: ${vinyllog_file=/var/log/vinyl.log} +: ${vinyllog_flags="-t off -P ${vinyllog_pidfile} -D -a -A -w ${vinyllog_file}"} + +procname="%%PREFIX%%/bin/${name}" +command="/usr/sbin/daemon" +command_args="-f -u vinyllog ${procname} ${vinyllog_flags}" +pidfile=${vinyllog_pidfile} +start_precmd=precmd + +precmd() +{ + # vinyllog_flags gets applied too early if we don't do this. + rc_flags="" + + if [ ! -e ${pidfile} ]; then + install -o vinyllog -g vinyl -m 644 /dev/null ${pidfile}; + fi + + if [ ! -e ${vinyllog_file} ]; then + install -o vinyllog -g vinyl -m 640 /dev/null ${vinyllog_file}; + fi +} + +run_rc_command "$1" diff --git a/www/vinyl09/files/vinylncsa.in b/www/vinyl09/files/vinylncsa.in new file mode 100644 index 000000000000..f177c6809f50 --- /dev/null +++ b/www/vinyl09/files/vinylncsa.in @@ -0,0 +1,77 @@ +#!/bin/sh + +# PROVIDE: vinylncsa +# REQUIRE: DAEMON vinyld +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable vinylncsa: +# +# vinylncsa_enable="YES" +# +# Configuration variables and their default values: +# +# vinylncsa_pidfile - full path to the PID file. +# default: "/var/run/vinylncsa.pid" +# +# vinylncsa_file - full path to the log file. +# default: "/var/log/vinylncsa.log" +# +# vinylncsa_log_method - log to file or syslog +# default: "-D -a -w ${vinylncsa_file}" +# vinylncsa_syslog="YES": '| /usr/bin/logger -t vinyl -p daemon.info &' +# +# vinylncsa_flags - command line arguments. +# default: "-t off -P ${vinylncsa_pidfile} ${vinylncsa_logformat:+ -F \"$vinylncsa_logformat\"} ${vinylncsa_log_method}" +# +# vinylncsa_logformat - log file format. +# default: "" (uses vinylncsa's default format) +# example: "%h %l %u %t %r %s %b %{Referer}i %{User-agent}i" +# +# Add the following line to /etc/newsyslog.conf to rotate the log file +# once a day: +# +# /var/log/vinylncsa.log vinyllog:vinyl 640 7 * @T00 JB /var/run/vinylncsa.pid +# +# See vinylncsa(1) for a detailed overview of command-line options. +# + +. /etc/rc.subr + +name=vinylncsa +rcvar=vinylncsa_enable + +load_rc_config ${name} + +: ${vinylncsa_enable:=NO} +: ${vinylncsa_pidfile=/var/run/${name}.pid} +: ${vinylncsa_file=/var/log/${name}.log} +: ${vinylncsa_flags="-t off -P ${vinylncsa_pidfile} ${vinylncsa_logformat:+-F \"$vinylncsa_logformat\"}"} +: ${vinylncsa_syslog:=NO} + +if checkyesno vinylncsa_syslog; then + vinylncsa_log_method='| /usr/bin/logger -t vinyl -p daemon.info &' +else + vinylncsa_log_method="-D -a -w ${vinylncsa_file}" +fi + +command="%%PREFIX%%/bin/${name}" +command_args="${vinylncsa_flags} ${vinylncsa_log_method}" +pidfile=${vinylncsa_pidfile} +start_precmd=precmd + +precmd() +{ + # $vinylncsa_flags gets applied too early if we don't do this. + rc_flags="" + + if [ ! -e ${pidfile} ]; then + install -o vinyllog -g vinyl -m 644 /dev/null ${pidfile}; + fi + + if [ ! -e ${vinylncsa_file} ]; then + install -o vinyllog -g vinyl -m 640 /dev/null ${vinylncsa_file}; + fi +} + +run_rc_command "$1" diff --git a/www/vinyl09/pkg-descr b/www/vinyl09/pkg-descr new file mode 100644 index 000000000000..71e62f808754 --- /dev/null +++ b/www/vinyl09/pkg-descr @@ -0,0 +1,11 @@ +Vinyl Cache, formerly known as Varnish Cache, is a web application accelerator +also known as a caching HTTP reverse proxy. You install it in front of any +server that speaks HTTP and configure it to cache the contents. Vinyl Cache is +really, really fast. It typically speeds up delivery by a factor of 300-1000x, +depending on your architecture. + +Documentation and additional information about vinyl is available on +https://vinyl-cache.org/docs/index.html + +Technical questions about vinyl and this release should be addressed +to diff --git a/www/vinyl09/pkg-message b/www/vinyl09/pkg-message new file mode 100644 index 000000000000..d126deda2a44 --- /dev/null +++ b/www/vinyl09/pkg-message @@ -0,0 +1,18 @@ +[ +{ type: install + message: <