Skip to content
Snippets Groups Projects
Commit 8295feba authored by Jochen Neumeister's avatar Jochen Neumeister
Browse files

net-mgmt/icingaweb2: Update to 2.11.3

Changelog: https://github.com/Icinga/icingaweb2/blob/master/CHANGELOG.md

PR:	263115
Patch from:	flo
Differential Revision:	https://reviews.freebsd.org/D38018
Sponsored by:	Netzkommune GmbH
parent c2b7e5a4
No related branches found
No related tags found
No related merge requests found
PORTNAME= icinga-ipl-i18n
DISTVERSIONPREFIX= v
DISTVERSION= 0.2.0
PORTREVISION= 1
CATEGORIES= net-mgmt www
PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX}
......@@ -20,7 +21,7 @@ GH_PROJECT= ipl-i18n
NO_BUILD= yes
NO_ARCH= yes
WWWDIR?= ${PREFIX}/www/icingaweb2/modules/${PORTNAME:C/^.*-//}
WWWDIR?= ${PREFIX}/www/icingaweb2/icinga-php/${PORTNAME:C/^.*-//}
do-install:
@${MKDIR} ${STAGEDIR}${WWWDIR}
......
PORTNAME= icinga-php-library
DISTVERSIONPREFIX= v
DISTVERSION= 0.10.0
PORTREVISION= 1
CATEGORIES= net-mgmt www
PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX}
......@@ -11,8 +12,6 @@ WWW= https://github.com/Icinga/icinga-php-library
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= icingaweb2${PHP_PKGNAMESUFFIX}>=2.4.1:net-mgmt/icingaweb2@${PHP_FLAVOR}
USES= php:web,flavors
USE_GITHUB= yes
......@@ -21,7 +20,7 @@ GH_ACCOUNT= icinga
NO_BUILD= yes
NO_ARCH= yes
WWWDIR?= ${PREFIX}/www/icingaweb2/modules/${PORTNAME:C/^.*-//}
WWWDIR?= ${PREFIX}/www/icingaweb2/icinga-php/${PORTNAME:C/^.*-//}
do-install:
@${MKDIR} ${STAGEDIR}${WWWDIR}
......
......@@ -11,8 +11,6 @@ WWW= https://github.com/Icinga/icinga-php-thirdparty
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= icingaweb2${PHP_PKGNAMESUFFIX}>=2.4.1:net-mgmt/icingaweb2@${PHP_FLAVOR}
USES= php:web,flavors
USE_GITHUB= yes
......@@ -21,7 +19,7 @@ GH_ACCOUNT= icinga
NO_BUILD= yes
NO_ARCH= yes
WWWDIR?= ${PREFIX}/www/icingaweb2/modules/${PORTNAME:C/^.*-//}
WWWDIR?= ${PREFIX}/www/icingaweb2/icinga-php/${PORTNAME:C/^.*-//}
do-install:
@${MKDIR} ${STAGEDIR}${WWWDIR}
......
This project bundles all 3rd party PHP libraries used by Icinga Web products into one piece,
which can be integrated as library into Icinga Web 2.
This project bundles all 3rd party PHP libraries used by Icinga Web products
into one piece, which can be integrated as library into Icinga Web 2.
PORTNAME= icingaweb2
DISTVERSIONPREFIX= v
DISTVERSION= 2.8.2
PORTREVISION= 1
DISTVERSION= 2.11.3
CATEGORIES= net-mgmt www
PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX}
......@@ -12,6 +11,10 @@ WWW= https://www.icinga.com/products/icinga-web-2
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
RUN_DEPENDS= icinga-php-library${PHP_PKGNAMESUFFIX}>=0.10.0:net-mgmt/icinga-php-library@${PHP_FLAVOR} \
icinga-php-thirdparty${PHP_PKGNAMESUFFIX}>=0.11.0:net-mgmt/icinga-php-thirdparty@${PHP_FLAVOR} \
icingaweb2-module-incubator${PHP_PKGNAMESUFFIX}>=0.18.0:net-mgmt/icingaweb2-module-incubator@${PHP_FLAVOR}
USES= php:build,web,flavors
USE_PHP= bcmath bitset ctype curl dom gd gettext hash iconv json ldap \
mbstring mcrypt memcache memcached opcache openssl pcre pdo \
......@@ -50,10 +53,15 @@ LDAP_USE= PHP=ldap
post-patch:
${REINPLACE_CMD} 's%\(/etc/icingaweb2\)%${PREFIX}\1%g' \
${WRKSRC}/library/Icinga/Application/ApplicationBootstrap.php
${REINPLACE_CMD} 's%/var/lib/icingaweb2%/var/db/icingaweb2%g' \
${WRKSRC}/library/Icinga/Application/ApplicationBootstrap.php
${REINPLACE_CMD} 's%/usr/share/icinga-php%${WWWDIR}/icinga-php%g' \
${WRKSRC}/library/Icinga/Application/ApplicationBootstrap.php
${REINPLACE_CMD} 's%readlink[^)]*)%"${PREFIX}/bin/php"%g' \
${WRKSRC}/application/clicommands/WebCommand.php
do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d/
${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}/
${INSTALL_DATA} ${WRKSRC}/etc/bash_completion.d/icingacli \
${STAGEDIR}${PREFIX}/etc/bash_completion.d
(cd ${WRKSRC} && ${RM} -r .mailmap changelog.py icingaweb2.spec \
......@@ -65,17 +73,5 @@ do-install:
${CHMOD} 755 ${STAGEDIR}${WWWDIR}/bin/icingacli
${RLN} ${STAGEDIR}${WWWDIR}/bin/icingacli ${STAGEDIR}${PREFIX}/bin/icingacli
${MKDIR} ${STAGEDIR}${ETCDIR}
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/
.for webserver in apache nginx
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/${webserver}
# ICINGAWEB_CONFIGDIR is set to /nonexistent to allow staging as user.
# Once installed, ${ETCDIR} is not world-readable, so point icingacli to
# a non existing directory. The config files are generated correctly anyway.
(cd ${STAGEDIR}${WWWDIR} && \
ICINGAWEB_CONFIGDIR=/nonexistent \
./bin/icingacli setup config webserver ${webserver} --path=/icingaweb2 \
--root=${WWWDIR}/public --config=${ETCDIR} \
--file=${STAGEDIR}${EXAMPLESDIR}/${webserver}/icingaweb2.conf)
.endfor
.include <bsd.port.mk>
TIMESTAMP = 1597858223
SHA256 (icinga-icingaweb2-v2.8.2_GH0.tar.gz) = 47d64bc4eeb574ca4ca2f765866a1612ed885d47d53cb3e7dc19adeb10b2b3db
SIZE (icinga-icingaweb2-v2.8.2_GH0.tar.gz) = 8514166
TIMESTAMP = 1672093379
SHA256 (icinga-icingaweb2-v2.11.3_GH0.tar.gz) = d9c6bc452b6ecb1c46713bbb91225e1b5706cbc85c585254ea68d81f85a4fc5f
SIZE (icinga-icingaweb2-v2.11.3_GH0.tar.gz) = 11437384
This diff is collapsed.
diff --git a/library/vendor/JShrink/Minifier.php b/library/vendor/JShrink/Minifier.php
index 171a7b6c22..fad43d2127 100644
--- library/vendor/JShrink/Minifier.php
+++ library/vendor/JShrink/Minifier.php
@@ -38,6 +38,13 @@ class Minifier
*/
protected $input;
+ /**
+ * Length of input javascript.
+ *
+ * @var int
+ */
+ protected $len = 0;
+
/**
* The location of the character (in the input string) that is next to be
* processed.
@@ -77,7 +84,7 @@ class Minifier
/**
* These characters are used to define strings.
*/
- protected $stringDelimiters = ['\'', '"', '`'];
+ protected $stringDelimiters = ['\'' => true, '"' => true, '`' => true];
/**
* Contains the default options for minification. This array is merged with
@@ -86,7 +93,7 @@ class Minifier
*
* @var array
*/
- protected static $defaultOptions = array('flaggedComments' => true);
+ protected static $defaultOptions = ['flaggedComments' => true];
/**
* Contains lock ids which are used to replace certain code patterns and
@@ -94,7 +101,7 @@ class Minifier
*
* @var array
*/
- protected $locks = array();
+ protected $locks = [];
/**
* Takes a string containing javascript and removes unneeded characters in
@@ -105,7 +112,7 @@ class Minifier
* @throws \Exception
* @return bool|string
*/
- public static function minify($js, $options = array())
+ public static function minify($js, $options = [])
{
try {
ob_start();
@@ -157,21 +164,34 @@ protected function minifyDirectToOutput($js, $options)
protected function initialize($js, $options)
{
$this->options = array_merge(static::$defaultOptions, $options);
- $js = str_replace("\r\n", "\n", $js);
- $js = str_replace('/**/', '', $js);
- $this->input = str_replace("\r", "\n", $js);
+ $this->input = str_replace(["\r\n", '/**/', "\r"], ["\n", "", "\n"], $js);
// We add a newline to the end of the script to make it easier to deal
// with comments at the bottom of the script- this prevents the unclosed
// comment error that can otherwise occur.
$this->input .= PHP_EOL;
+ // save input length to skip calculation every time
+ $this->len = strlen($this->input);
+
// Populate "a" with a new line, "b" with the first character, before
// entering the loop
$this->a = "\n";
$this->b = $this->getReal();
}
+ /**
+ * Characters that can't stand alone preserve the newline.
+ *
+ * @var array
+ */
+ protected $noNewLineCharacters = [
+ '(' => true,
+ '-' => true,
+ '+' => true,
+ '[' => true,
+ '@' => true];
+
/**
* The primary action occurs here. This function loops through the input string,
* outputting anything that's relevant and discarding anything that is not.
@@ -183,7 +203,7 @@ protected function loop()
// new lines
case "\n":
// if the next line is something that can't stand alone preserve the newline
- if ($this->b !== false && strpos('(-+[@', $this->b) !== false) {
+ if ($this->b !== false && isset($this->noNewLineCharacters[$this->b])) {
echo $this->a;
$this->saveString();
break;
@@ -226,7 +246,7 @@ protected function loop()
break;
}
- // no break
+ // no break
default:
// check for some regex that breaks stuff
if ($this->a === '/' && ($this->b === '\'' || $this->b === '"')) {
@@ -243,7 +263,7 @@ protected function loop()
// do reg check of doom
$this->b = $this->getReal();
- if (($this->b == '/' && strpos('(,=:[!&|?*+-%', $this->a) !== false)) {
+ if (($this->b == '/' && strpos('(,=:[!&|?', $this->a) !== false)) {
$this->saveRegex();
}
}
@@ -257,6 +277,7 @@ protected function loop()
protected function clean()
{
unset($this->input);
+ $this->len = 0;
$this->index = 0;
$this->a = $this->b = '';
unset($this->c);
@@ -276,7 +297,7 @@ protected function getChar()
unset($this->c);
} else {
// Otherwise we start pulling from the input.
- $char = substr($this->input, $this->index, 1);
+ $char = $this->index < $this->len ? $this->input[$this->index] : false;
// If the next character doesn't exist return false.
if (isset($char) && $char === false) {
@@ -289,7 +310,7 @@ protected function getChar()
// Normalize all whitespace except for the newline character into a
// standard space.
- if ($char !== "\n" && ord($char) < 32) {
+ if ($char !== "\n" && $char < "\x20") {
return ' ';
}
@@ -340,7 +361,7 @@ protected function getReal()
*/
protected function processOneLineComments($startIndex)
{
- $thirdCommentString = substr($this->input, $this->index, 1);
+ $thirdCommentString = $this->index < $this->len ? $this->input[$this->index] : false;
// kill rest of line
$this->getNext("\n");
@@ -429,7 +450,7 @@ protected function getNext($string)
$this->index = $pos;
// Return the first character of that string.
- return substr($this->input, $this->index, 1);
+ return $this->index < $this->len ? $this->input[$this->index] : false;
}
/**
@@ -447,7 +468,7 @@ protected function saveString()
$this->a = $this->b;
// If this isn't a string we don't need to do anything.
- if (!in_array($this->a, $this->stringDelimiters)) {
+ if (!isset($this->stringDelimiters[$this->a])) {
return;
}
@@ -557,7 +578,7 @@ protected function lock($js)
/* lock things like <code>"asd" + ++x;</code> */
$lock = '"LOCK---' . crc32(time()) . '"';
- $matches = array();
+ $matches = [];
preg_match('/([+-])(\s+)([+-])/S', $js, $matches);
if (empty($matches)) {
return $js;
diff --git a/library/vendor/JShrink/SOURCE b/library/vendor/JShrink/SOURCE
index 794856288e..00ccc58ce0 100644
--- library/vendor/JShrink/SOURCE
+++ library/vendor/JShrink/SOURCE
@@ -1,6 +1,6 @@
#!/bin/bash
set -eux
-VERSION=1.3.2
+VERSION=1.4.0
curl -LsS https://github.com/tedious/JShrink/archive/v"$VERSION".tar.gz -o /tmp/JShrink.tar.gz
tar xzf /tmp/JShrink.tar.gz --strip-components 1 JShrink-"$VERSION"/LICENSE
tar xzf /tmp/JShrink.tar.gz --strip-components 3 JShrink-"$VERSION"/src/JShrink/Minifier.php
[
{ type: install
message: <<EOM
Sample configuration files for Apache and NGinx have been installed in:
%%EXAMPLESDIR%%
Sample configuration files for Apache and nginx can be generated by running
one of:
# Apache
cd %%WWWDIR%% && ./bin/icingacli setup config webserver apache \
--path=/icingaweb2 --root=%%WWWDIR%%/public --config=%%ETCDIR%% \
--file=/tmp/apache.conf
# nginx
cd %%WWWDIR%% && ./bin/icingacli setup config webserver nginx \
--path=/icingaweb2 --root=%%WWWDIR%%/public --config=%%ETCDIR%% \
--file=/tmp/nginx.conf
Be sure to enable PHP and rewrite support in your web server.
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment