PrivateBin is a minimalist, open-source online pastebin where the server has zero knowledge of the pasted data. All data is encrypted/decrypted in the browser via 256-bit AES (Galois Counter Mode). The project is a refactored fork of ZeroBin focused on extensibility and additional features.
legacy.js).composer install)Install PHP dependencies:
composer install
vendor/ is writable.Install JS dependencies (for test only):
cd ./js
npm install
legacy.js (which must be designed to run cleanly even on ancient IE4 or Netscape to display the error message that a browser upgrade is necessary). We are trying to avoid jQuery in any new code and would like to eventually drop use of jQuery. We are considering modularizing the JS logic, but need to ensure to do so in a way that will work both in the browser as well as for node JS driven unit tests.PHP Unit Tests:
vendor/bin/phpunit
If vendor/bin/phpunit does not exist, ensure composer install completed without errors.
cd ./js
npm run test
Runs Jasmine-based tests in Node.js context.
Note: Production JS must not use Node-only APIs. Test code may use Node.js features, but main JS logic must remain browser-compatible.
If you encounter ReferenceError for browser features, ensure only test code uses Node.js APIs.
PHP: Run (if phpcs.xml or similar config exists):
vendor/bin/phpcs
JavaScript: If eslint is present:
npm run lint
.eslintrc.* files.composer install, phpunit, and JS tests on PRs and pushes.Root files:
README.md: Project overview (view full).composer.json, composer.lock: PHP dependencies.package.json: JS test/lint dependencies (not for production JS)..github/workflows/: CI configuration.cfg/: Default configuration files.js/: Main client logic (browser JS), including:legacy.js: Must remain compatible with legacy browsers (ES3). Do not use modern JS here.privatebin.js: Core encryption and paste interface logic.tpl/: HTML templates.css/: Stylesheets.Testing & Validation:
tst/: Contains PHP unit tests.js/test: Contains JS unit tests.phpunit.xml: PHPUnit config.JS test files may use Node.js features; browser JS must not.
Encryption: Only client-side in JS with WebCrypto.
Backend: Serves encrypted blobs, never sees plaintext.
Legacy Support: js/legacy.js must remain ES3 for feature detection in old browsers.
Configuration: See cfg/conf.php and wiki for available options.
composer install, phpunit, and JS tests.legacy.js. It must work in very old browsers.composer install before PHP tests, and npm install before JS tests..github/workflows/ for the latest validation pipeline steps.