Merge pull request #1202 from PrivateBin/release-prep

1.6.1 release preparations
This commit is contained in:
El RIDO 2023-12-03 17:07:19 +01:00 committed by GitHub
commit 65f289e516
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 37 additions and 43 deletions

View File

@ -2,6 +2,7 @@
## 1.6.1 (not yet released) ## 1.6.1 (not yet released)
* ADDED: Right-To-Left (RTL) support for Arabic & Hebrew (#1174) * ADDED: Right-To-Left (RTL) support for Arabic & Hebrew (#1174)
* CHANGED: Upgrading libraries to: DOMpurify 3.0.6
## 1.6.0 (2023-09-11) ## 1.6.0 (2023-09-11)
* ADDED: Translations for Japanese & Arabic * ADDED: Translations for Japanese & Arabic

View File

@ -18,7 +18,7 @@ coverage-js: ## Run JS unit tests and generate code coverage reports.
coverage-php: ## Run PHP unit tests and generate code coverage reports. coverage-php: ## Run PHP unit tests and generate code coverage reports.
cd tst && phpunit 2> /dev/null cd tst && phpunit 2> /dev/null
cd tst/log/php-coverage-report && sed -i "s#$(CURDIR)##g" *.html */*.html cd tst/log/php-coverage-report && sed -i "s#$(CURDIR)/##g" *.html */*.html
doc: doc-js doc-php ## Generate all code documentation. doc: doc-js doc-php ## Generate all code documentation.
@ -26,7 +26,7 @@ doc-js: ## Generate JS code documentation.
jsdoc -p -d doc/jsdoc js/privatebin.js js/legacy.js jsdoc -p -d doc/jsdoc js/privatebin.js js/legacy.js
doc-php: ## Generate JS code documentation. doc-php: ## Generate JS code documentation.
phpdoc --visibility public,protected,private -t doc/phpdoc -d lib/ phpdoc --visibility=public,protected,private --target=doc/phpdoc --directory=lib/
increment: ## Increment and commit new version number, set target version using `make increment VERSION=1.2.3`. increment: ## Increment and commit new version number, set target version using `make increment VERSION=1.2.3`.
for F in `grep -l -R $(REGEX_CURRENT_VERSION) $(VERSION_FILES) | grep -v -e tst/log/ -e ":0" -e CHANGELOG.md`; \ for F in `grep -l -R $(REGEX_CURRENT_VERSION) $(VERSION_FILES) | grep -v -e tst/log/ -e ":0" -e CHANGELOG.md`; \

View File

@ -23,7 +23,7 @@ new ConfigurationTestGenerator(array(
'tests' => array( 'tests' => array(
array( array(
'conditions' => array('steps' => $vd), 'conditions' => array('steps' => $vd),
'type' => 'RegExp', 'type' => 'MatchesRegularExpression',
'args' => array( 'args' => array(
'#<div[^>]*id="opendiscussionoption"[^>]*>#', '#<div[^>]*id="opendiscussionoption"[^>]*>#',
'$content', '$content',
@ -53,7 +53,7 @@ new ConfigurationTestGenerator(array(
'setting' => false, 'setting' => false,
'tests' => array( 'tests' => array(
array( array(
'type' => 'NotRegExp', 'type' => 'DoesNotMatchRegularExpression',
'args' => array( 'args' => array(
'#<div[^>]*id="opendiscussionoption"[^>]*>#', '#<div[^>]*id="opendiscussionoption"[^>]*>#',
'$content', '$content',
@ -70,7 +70,7 @@ new ConfigurationTestGenerator(array(
'tests' => array( 'tests' => array(
array( array(
'conditions' => array('main/discussion' => true), 'conditions' => array('main/discussion' => true),
'type' => 'RegExp', 'type' => 'MatchesRegularExpression',
'args' => array( 'args' => array(
'#<input[^>]+id="opendiscussion"[^>]*checked="checked"[^>]*>#', '#<input[^>]+id="opendiscussion"[^>]*checked="checked"[^>]*>#',
'$content', '$content',
@ -84,7 +84,7 @@ new ConfigurationTestGenerator(array(
'tests' => array( 'tests' => array(
array( array(
'conditions' => array('main/discussion' => true), 'conditions' => array('main/discussion' => true),
'type' => 'NotRegExp', 'type' => 'DoesNotMatchRegularExpression',
'args' => array( 'args' => array(
'#<input[^>]+id="opendiscussion"[^>]*checked="checked"[^>]*>#', '#<input[^>]+id="opendiscussion"[^>]*checked="checked"[^>]*>#',
'$content', '$content',
@ -100,7 +100,7 @@ new ConfigurationTestGenerator(array(
'setting' => true, 'setting' => true,
'tests' => array( 'tests' => array(
array( array(
'type' => 'RegExp', 'type' => 'MatchesRegularExpression',
'args' => array( 'args' => array(
'#<input[^>]+id="burnafterreading"[^>]*checked="checked"[^>]*>#', '#<input[^>]+id="burnafterreading"[^>]*checked="checked"[^>]*>#',
'$content', '$content',
@ -113,7 +113,7 @@ new ConfigurationTestGenerator(array(
'setting' => false, 'setting' => false,
'tests' => array( 'tests' => array(
array( array(
'type' => 'NotRegExp', 'type' => 'DoesNotMatchRegularExpression',
'args' => array( 'args' => array(
'#<input[^>]+id="burnafterreading"[^>]*checked="checked"[^>]*>#', '#<input[^>]+id="burnafterreading"[^>]*checked="checked"[^>]*>#',
'$content', '$content',
@ -129,7 +129,7 @@ new ConfigurationTestGenerator(array(
'setting' => true, 'setting' => true,
'tests' => array( 'tests' => array(
array( array(
'type' => 'RegExp', 'type' => 'MatchesRegularExpression',
'args' => array( 'args' => array(
'#<div[^>]*id="password"[^>]*>#', '#<div[^>]*id="password"[^>]*>#',
'$content', '$content',
@ -143,7 +143,7 @@ new ConfigurationTestGenerator(array(
'tests' => array( 'tests' => array(
array( array(
'conditions' => array('main/discussion' => true), 'conditions' => array('main/discussion' => true),
'type' => 'NotRegExp', 'type' => 'DoesNotMatchRegularExpression',
'args' => array( 'args' => array(
'#<div[^>]*id="password"[^>]*>#', '#<div[^>]*id="password"[^>]*>#',
'$content', '$content',
@ -159,14 +159,14 @@ new ConfigurationTestGenerator(array(
'setting' => 'page', 'setting' => 'page',
'tests' => array( 'tests' => array(
array( array(
'type' => 'RegExp', 'type' => 'MatchesRegularExpression',
'args' => array( 'args' => array(
'#<link[^>]+type="text/css"[^>]+rel="stylesheet"[^>]+href="css/privatebin\.css\\?\d[\d\.]+\d+"[^>]*/>#', '#<link[^>]+type="text/css"[^>]+rel="stylesheet"[^>]+href="css/privatebin\.css\\?\d[\d\.]+\d+"[^>]*/>#',
'$content', '$content',
'outputs "page" stylesheet correctly', 'outputs "page" stylesheet correctly',
), ),
), array( ), array(
'type' => 'NotRegExp', 'type' => 'DoesNotMatchRegularExpression',
'args' => array( 'args' => array(
'#<link[^>]+type="text/css"[^>]+rel="stylesheet"[^>]+href="css/bootstrap/bootstrap-\d[\d\.]+\d\.css"[^>]*/>#', '#<link[^>]+type="text/css"[^>]+rel="stylesheet"[^>]+href="css/bootstrap/bootstrap-\d[\d\.]+\d\.css"[^>]*/>#',
'$content', '$content',
@ -179,14 +179,14 @@ new ConfigurationTestGenerator(array(
'setting' => 'bootstrap', 'setting' => 'bootstrap',
'tests' => array( 'tests' => array(
array( array(
'type' => 'NotRegExp', 'type' => 'DoesNotMatchRegularExpression',
'args' => array( 'args' => array(
'#<link[^>]+type="text/css"[^>]+rel="stylesheet"[^>]+href="css/privatebin\.css\\?\d[\d\.]+\d+"[^>]*/>#', '#<link[^>]+type="text/css"[^>]+rel="stylesheet"[^>]+href="css/privatebin\.css\\?\d[\d\.]+\d+"[^>]*/>#',
'$content', '$content',
'removes "page" stylesheet correctly', 'removes "page" stylesheet correctly',
), ),
), array( ), array(
'type' => 'RegExp', 'type' => 'MatchesRegularExpression',
'args' => array( 'args' => array(
'#<link[^>]+type="text/css"[^>]+rel="stylesheet"[^>]+href="css/bootstrap/bootstrap-\d[\d\.]+\d\.css"[^>]*/>#', '#<link[^>]+type="text/css"[^>]+rel="stylesheet"[^>]+href="css/bootstrap/bootstrap-\d[\d\.]+\d\.css"[^>]*/>#',
'$content', '$content',
@ -361,7 +361,7 @@ class ConfigurationTestGenerator
} }
// skip if not all test conditions are met // skip if not all test conditions are met
if (array_key_exists('conditions', $test)) { if (array_key_exists('conditions', $test)) {
while (list($path, $setting) = each($test['conditions'])) { foreach ($test['conditions'] as $path => $setting) {
if ($path == 'steps' && !in_array($step, $setting)) { if ($path == 'steps' && !in_array($step, $setting)) {
continue 2; continue 2;
} elseif ($path != 'steps') { } elseif ($path != 'steps') {
@ -591,8 +591,9 @@ EOT;
return $this->_configurations; return $this->_configurations;
} }
echo "generateConfigurations: iteration $this->_iterationCount", PHP_EOL; echo "generateConfigurations: iteration $this->_iterationCount", PHP_EOL;
$continue = list($path, $settings) = each($this->_options); $path = key($this->_options);
if ($continue === false) { $settings = current($this->_options);
if (next($this->_options) === false) {
return $this->_configurations; return $this->_configurations;
} }
list($section, $option) = explode('/', $path); list($section, $option) = explode('/', $path);

View File

@ -21,7 +21,7 @@ $ sudo pear install phpdoc/phpDocumentor
To generate the documentation, change into the main directory and run phpdoc: To generate the documentation, change into the main directory and run phpdoc:
```console ```console
$ cd PrivateBin $ cd PrivateBin
$ phpdoc --visibility public,protected,private -t doc/phpdoc -d lib/ $ phpdoc --visibility=public,protected,private --target=doc/phpdoc --directory=lib/
``` ```
**Note:** When used with PHP 7, the prerelease of phpDocumentator 2.9 needs to be **Note:** When used with PHP 7, the prerelease of phpDocumentator 2.9 needs to be

View File

@ -28,11 +28,6 @@ docker run --rm --read-only -v ~/PrivateBin:/srv:ro privatebin/unit-testing phpu
docker run --rm --read-only -v ~/PrivateBin:/srv:ro privatebin/unit-testing mocha docker run --rm --read-only -v ~/PrivateBin:/srv:ro privatebin/unit-testing mocha
``` ```
We also provide a Janitor image that includes the Cloud9 and Theia WebIDEs as
well as the integrated unit testing utilities. See our [docker wiki
page](https://github.com/PrivateBin/PrivateBin/wiki/Docker#janitor-image-with-cloud9-and-theia-webide-janitortechnologyprivatebin)
for further details on this.
## Running PHP Unit Tests ## Running PHP Unit Tests
In order to run these tests, you will need to install the following packages In order to run these tests, you will need to install the following packages
@ -61,18 +56,15 @@ configurations defined in its constructor, it generates the unit test file
of these configurations and tests for (most of the) valid combinations. Some of of these configurations and tests for (most of the) valid combinations. Some of
combinations can't be tested with this method, i.e. a valid option combined with combinations can't be tested with this method, i.e. a valid option combined with
an invalid one. Other very specific test cases (i.e. to trigger multiple errors) an invalid one. Other very specific test cases (i.e. to trigger multiple errors)
are covered in `tst/PrivateBinTest.php`. Here is how to generate the are covered in `tst/ControllerTest.php`. Here is how to generate the
configuration test and run it: configuration test and run it:
```console ```console
$ cd PrivateBin/tst $ cd PrivateBin/tst
$ php ConfigurationTestGenerator.php $ ../bin/configuration-test-generator
$ phpunit ConfigurationCombinationsTest.php $ phpunit ConfigurationCombinationsTest.php
``` ```
Note that it can take an hour or longer to run the several thousand tests.
## Running JavaScript Unit Tests ## Running JavaScript Unit Tests
In order to run these tests, you will need to install the following packages In order to run these tests, you will need to install the following packages

View File

@ -17,7 +17,7 @@ require('./prettify');
global.prettyPrint = window.PR.prettyPrint; global.prettyPrint = window.PR.prettyPrint;
global.prettyPrintOne = window.PR.prettyPrintOne; global.prettyPrintOne = window.PR.prettyPrintOne;
global.showdown = require('./showdown-2.1.0'); global.showdown = require('./showdown-2.1.0');
global.DOMPurify = require('./purify-3.0.4'); global.DOMPurify = require('./purify-3.0.6');
global.baseX = require('./base-x-4.0.0').baseX; global.baseX = require('./base-x-4.0.0').baseX;
global.Legacy = require('./legacy').Legacy; global.Legacy = require('./legacy').Legacy;
require('./bootstrap-3.4.1'); require('./bootstrap-3.4.1');

View File

@ -80,7 +80,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
/** /**
* CryptoData class * CryptoData class
* *
* bundles helper fuctions used in both paste and comment formats * bundles helper functions used in both paste and comment formats
* *
* @name CryptoData * @name CryptoData
* @class * @class
@ -95,7 +95,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
/** /**
* gets the cipher data (cipher text + adata) * gets the cipher data (cipher text + adata)
* *
* @name Paste.getCipherData * @name CryptoData.getCipherData
* @function * @function
* @return {Array}|{string} * @return {Array}|{string}
*/ */
@ -108,7 +108,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
/** /**
* Paste class * Paste class
* *
* bundles helper fuctions around the paste formats * bundles helper functions around the paste formats
* *
* @name Paste * @name Paste
* @class * @class
@ -171,7 +171,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
/** /**
* Comment class * Comment class
* *
* bundles helper fuctions around the comment formats * bundles helper functions around the comment formats
* *
* @name Comment * @name Comment
* @class * @class
@ -183,7 +183,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
/** /**
* gets the UNIX timestamp of the comment creation * gets the UNIX timestamp of the comment creation
* *
* @name Paste.getCreated * @name Comment.getCreated
* @function * @function
* @return {int} * @return {int}
*/ */
@ -195,7 +195,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
/** /**
* gets the icon of the comment submitter * gets the icon of the comment submitter
* *
* @name Paste.getIcon * @name Comment.getIcon
* @function * @function
* @return {string} * @return {string}
*/ */

File diff suppressed because one or more lines are too long

2
js/purify-3.0.6.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -25,7 +25,7 @@
}; };
let buff; let buff;
if (typeof fetch === 'undefined') { if (typeof fs === 'object') {
buff = fs.readFileSync('zlib-1.2.13.wasm'); buff = fs.readFileSync('zlib-1.2.13.wasm');
} else { } else {
const resp = await fetch('js/zlib-1.2.13.wasm'); const resp = await fetch('js/zlib-1.2.13.wasm');

View File

@ -71,9 +71,9 @@ if ($MARKDOWN) :
<?php <?php
endif; endif;
?> ?>
<script type="text/javascript" data-cfasync="false" src="js/purify-3.0.4.js" integrity="sha512-N7H+3ylaOUeKuTX57cZoa42hqaG5w1rchG/IP9+BHd48W/vESgPDpb5QuDqzJE1dZhrGVCQgU8peIQGHmdGFhQ==" crossorigin="anonymous"></script> <script type="text/javascript" data-cfasync="false" src="js/purify-3.0.6.js" integrity="sha512-N3y6/HOk3pbsw3lFh4O8CKKEVwu1B2CF8kinhjURf8Yqa5OfSUt+/arozxFW+TUPOPw3TsDCRT/0u7BGRTEVUw==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/legacy.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-LYos+qXHIRqFf5ZPNphvtTB0cgzHUizu2wwcOwcwz/VIpRv9lpcBgPYz4uq6jx0INwCAj6Fbnl5HoKiLufS2jg==" crossorigin="anonymous"></script> <script type="text/javascript" data-cfasync="false" src="js/legacy.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-LYos+qXHIRqFf5ZPNphvtTB0cgzHUizu2wwcOwcwz/VIpRv9lpcBgPYz4uq6jx0INwCAj6Fbnl5HoKiLufS2jg==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-ykPMZuZDmyGNik7G5dIeqE/+CJ79OKZ0XzPPVWUwAzp+k8PQoP66J8F8zYtI53dM4ITLojkNKrv4vTv6E3bzFQ==" crossorigin="anonymous"></script> <script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-JHrUjGZA30SBVu4JRp1nYsROnPZpGFazacs12e5rBavFRHSguo2Otu65U25CTsjAMa8R6Zq91u+aFf62M5B5Yw==" crossorigin="anonymous"></script>
<!-- icon --> <!-- icon -->
<link rel="apple-touch-icon" href="<?php echo I18n::encode($BASEPATH); ?>img/apple-touch-icon.png" sizes="180x180" /> <link rel="apple-touch-icon" href="<?php echo I18n::encode($BASEPATH); ?>img/apple-touch-icon.png" sizes="180x180" />
<link rel="icon" type="image/png" href="img/favicon-32x32.png" sizes="32x32" /> <link rel="icon" type="image/png" href="img/favicon-32x32.png" sizes="32x32" />

View File

@ -49,9 +49,9 @@ if ($MARKDOWN):
<?php <?php
endif; endif;
?> ?>
<script type="text/javascript" data-cfasync="false" src="js/purify-3.0.4.js" integrity="sha512-N7H+3ylaOUeKuTX57cZoa42hqaG5w1rchG/IP9+BHd48W/vESgPDpb5QuDqzJE1dZhrGVCQgU8peIQGHmdGFhQ==" crossorigin="anonymous"></script> <script type="text/javascript" data-cfasync="false" src="js/purify-3.0.6.js" integrity="sha512-N3y6/HOk3pbsw3lFh4O8CKKEVwu1B2CF8kinhjURf8Yqa5OfSUt+/arozxFW+TUPOPw3TsDCRT/0u7BGRTEVUw==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/legacy.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-LYos+qXHIRqFf5ZPNphvtTB0cgzHUizu2wwcOwcwz/VIpRv9lpcBgPYz4uq6jx0INwCAj6Fbnl5HoKiLufS2jg==" crossorigin="anonymous"></script> <script type="text/javascript" data-cfasync="false" src="js/legacy.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-LYos+qXHIRqFf5ZPNphvtTB0cgzHUizu2wwcOwcwz/VIpRv9lpcBgPYz4uq6jx0INwCAj6Fbnl5HoKiLufS2jg==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-ykPMZuZDmyGNik7G5dIeqE/+CJ79OKZ0XzPPVWUwAzp+k8PQoP66J8F8zYtI53dM4ITLojkNKrv4vTv6E3bzFQ==" crossorigin="anonymous"></script> <script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-JHrUjGZA30SBVu4JRp1nYsROnPZpGFazacs12e5rBavFRHSguo2Otu65U25CTsjAMa8R6Zq91u+aFf62M5B5Yw==" crossorigin="anonymous"></script>
<!-- icon --> <!-- icon -->
<link rel="apple-touch-icon" href="img/apple-touch-icon.png?<?php echo rawurlencode($VERSION); ?>" sizes="180x180" /> <link rel="apple-touch-icon" href="img/apple-touch-icon.png?<?php echo rawurlencode($VERSION); ?>" sizes="180x180" />
<link rel="icon" type="image/png" href="img/favicon-32x32.png?<?php echo rawurlencode($VERSION); ?>" sizes="32x32" /> <link rel="icon" type="image/png" href="img/favicon-32x32.png?<?php echo rawurlencode($VERSION); ?>" sizes="32x32" />