diff --git a/API.md b/API.md index 2b2754f..1c29cc9 100644 --- a/API.md +++ b/API.md @@ -1,14 +1,14 @@ -ZeroBin uses AJAX requests for certain operations. +PrivateBin uses AJAX requests for certain operations. ## As of Version 0.22 -All JSON-API requests need to be sent with the HTTP header `X-Requested-With: JSONHttpRequest`. The query strings below would be appended after the `?` in the URL, i.e. query string `foo` on the site URL of `https://example.com/zerobin/` would become `https://example.com/zerobin/?foo`. +All JSON-API requests need to be sent with the HTTP header `X-Requested-With: JSONHttpRequest`. The query strings below would be appended after the `?` in the URL, i.e. query string `foo` on the site URL of `https://example.com/privatebin/` would become `https://example.com/privatebin/?foo`. Action | Type | Query String | Data to send | Result ([JSON-LD](http://json-ld.org/)) ----------------------------------|------|--------------|--------------|------------------- -retrieve paste (and its comments) | GET | `[pasteID]` | (no data) | [paste.jsonld](https://raw.githubusercontent.com/elrido/ZeroBin/master/js/paste.jsonld) -create paste | PUT | `[pasteID]` | `data=[cipherdata]& expire=[expireID]& formatter=[formatID]& burnafterreading=[1/0]& opendiscussion=[1/0]` | [paste.jsonld](https://raw.githubusercontent.com/elrido/ZeroBin/master/js/paste.jsonld) (including deletetoken) -create paste | POST | (empty query string) | `data=[cipherdata]& expire=[expireID]& formatter=[formatID]& burnafterreading=[1/0]& opendiscussion=[1/0]` | [paste.jsonld](https://raw.githubusercontent.com/elrido/ZeroBin/master/js/paste.jsonld) (including deletetoken) +retrieve paste (and its comments) | GET | `[pasteID]` | (no data) | [paste.jsonld](https://raw.githubusercontent.com/PrivateBin/PrivateBin/master/js/paste.jsonld) +create paste | PUT | `[pasteID]` | `data=[cipherdata]& expire=[expireID]& formatter=[formatID]& burnafterreading=[1/0]& opendiscussion=[1/0]` | [paste.jsonld](https://raw.githubusercontent.com/PrivateBin/PrivateBin/master/js/paste.jsonld) (including deletetoken) +create paste | POST | (empty query string) | `data=[cipherdata]& expire=[expireID]& formatter=[formatID]& burnafterreading=[1/0]& opendiscussion=[1/0]` | [paste.jsonld](https://raw.githubusercontent.com/PrivateBin/PrivateBin/master/js/paste.jsonld) (including deletetoken) create comment | PUT | `[commentID]` | `data=[cipherdata]& parentid=[parentID]& pasteid=[pasteID]& nickname=[cipherdata]` | `{"status":0, "id":"[commentID]"}` create comment |d POST | (empty query string) | `data=[cipherdata]& parentid=[parentID]& pasteid=[pasteID]& nickname=[cipherdata]` | `{"status":0, "id":"[commentID]"}` delete paste (burn after reading) | DELETE | (empty query string) | `pasteid=[pasteID]& deletetoken=burnafterreading` | `{"status":0, "id":"[pasteID]"}` @@ -19,7 +19,7 @@ Error on any of the above | N/A | N/A | N/A | `{"status":1, "message": ## Until Version 0.21.1 -The query strings below would be appended after the `?` in the URL, i.e. query string `foo` on the site URL of `https://example.com/zerobin/` would become `https://example.com/zerobin/?foo`. +The query strings below would be appended after the `?` in the URL, i.e. query string `foo` on the site URL of `https://example.com/privatebin/` would become `https://example.com/privatebin/?foo`. Action | Type | Query String | Data to send (JSON) | Result (JSON) ------------------------------------|------|--------------|---------------------|-------------- @@ -35,7 +35,7 @@ Error on any of the above | N/A | N/A | N/A | `{"status":1, "message": * **parentID:** ID of the comments parent (paste ID or comment ID), 16 characters long, hexadecimal * **commentID:** ID of the comment, 16 characters long, hexadecimal * **cipherdata:** JSON string containing format and base64 encoded data, output of the encryption function -* **expireID:** expiration key as defined in the [configuration file](https://github.com/elrido/ZeroBin/blob/master/cfg/conf.ini#L56) of the service -* **formatID:** format key as defined in the [configuration file](https://github.com/elrido/ZeroBin/blob/master/cfg/conf.ini#L69) of the service -* **metadata:** various properties of the [paste](https://raw.githubusercontent.com/elrido/ZeroBin/master/js/pastemeta.jsonld) or the [comment](https://raw.githubusercontent.com/elrido/ZeroBin/master/js/commentmeta.jsonld). -* **deletetoken:** the delete token is returned only on creation of a paste and can be used to delete it and its comments \ No newline at end of file +* **expireID:** expiration key as defined in the [configuration file](https://github.com/PrivateBin/PrivateBin/blob/master/cfg/conf.ini#L56) of the service +* **formatID:** format key as defined in the [configuration file](https://github.com/PrivateBin/PrivateBin/blob/master/cfg/conf.ini#L69) of the service +* **metadata:** various properties of the [paste](https://raw.githubusercontent.com/PrivateBin/PrivateBin/master/js/pastemeta.jsonld) or the [comment](https://raw.githubusercontent.com/PrivateBin/PrivateBin/master/js/commentmeta.jsonld). +* **deletetoken:** the delete token is returned only on creation of a paste and can be used to delete it and its comments diff --git a/Configuration.md b/Configuration.md index 5261ac7..4a90b83 100644 --- a/Configuration.md +++ b/Configuration.md @@ -1,4 +1,4 @@ -ZeroBin comes with a configuration file to enable/disable features, change themes, etc. +PrivateBin comes with a configuration file to enable/disable features, change themes, etc. ## Structure @@ -38,13 +38,13 @@ The order of the options in this section is preserved in the display of the drop If `syntaxhighlighting` is added to the `[formatter_options]` section, syntax highlighting (format option "Source Code") is available as a possible format. The prettify library used for this feature works well with most programming languages. -If no `syntaxhighlightingtheme` is set, the built in theme is used, which works well with the `bootstrap` ZeroBin template. For the `page`, `bootstrap-dark` and `bootstrap-dark-page` ZeroBin templates we suggest using the `sons-of-obsidian` theme. +If no `syntaxhighlightingtheme` is set, the built in theme is used, which works well with the `bootstrap` PrivateBin template. For the `page`, `bootstrap-dark` and `bootstrap-dark-page` PrivateBin templates we suggest using the `sons-of-obsidian` theme. The `syntaxhighlighting` option in the `[main]` section found in version 0.20 is deprecated and will no longer be required in version 0.21. ### template -ZeroBin template to use, default is `bootstrap`. The templates can be found in the folder `tpl/` and are saved as `html` files, i.e. `tpl/bootstrap.html`. +PrivateBin template to use, default is `bootstrap`. The templates can be found in the folder `tpl/` and are saved as `html` files, i.e. `tpl/bootstrap.html`. ### burnafterreadingselected @@ -76,11 +76,11 @@ The option `dir` controls where the lock file is stored. Note that this director ### base64version -The base64.js library version, defaults to `2.1.9`. Use `1.7` if you are upgrading from a ZeroBin Alpha 0.19 installation for compatibility with your existing pastes. +The base64.js library version, defaults to `2.1.9`. Use `1.7` if you are upgrading from a PrivateBin Alpha 0.19 installation for compatibility with your existing pastes. ### languageselection / languagedefault -By default ZeroBin tries to detect the browser language of the visitors if such a HTTP header is sent and falls back to English language or to the one selected in `languagedefault`, if no such header is present or no matching translation was found. +By default PrivateBin tries to detect the browser language of the visitors if such a HTTP header is sent and falls back to English language or to the one selected in `languagedefault`, if no such header is present or no matching translation was found. Optionally `languageselection` enables drop down can be enabled. It is disabled by default, as it makes use of a session cookie named "lang" to persist the selected language between calls. It is deleted when the browser is closed. @@ -95,10 +95,10 @@ true | set, i.e. to "fr" | set | uses browser language or the ### urlshortener -Optionally Zerobin can offer a link to a URL shortener service after a new paste is created. It is strongly suggested to only use this with self-hosted shortener services as this will leak the pastes encryption key to the service entered here. +Optionally PrivateBin can offer a link to a URL shortener service after a new paste is created. It is strongly suggested to only use this with self-hosted shortener services as this will leak the pastes encryption key to the service entered here. ### model -The sections `[model]` and `[model_options]` control how your pastes are stored. Currently ZeroBin stores its pastes as flat files by default (`[model]` section, `class = zerobin_data`) and the option `dir` in the section `[model_options]` tells it in what folder to store them. Note that this directory needs to be writable for the process running PHP (i.e. your webserver, FPM or CGI process). +The sections `[model]` and `[model_options]` control how your pastes are stored. Currently PrivateBin stores its pastes as flat files by default (`[model]` section, `class = privatebin_data`) and the option `dir` in the section `[model_options]` tells it in what folder to store them. Note that this directory needs to be writable for the process running PHP (i.e. your webserver, FPM or CGI process). -Alternatively you can store the pastes in a relational database. This is tested with MySQL and SQLite and examples for these two databases are provided in commented form. A more detailed explanation of the database feature can be found in the [installation instructions](Installation#using-a-database-instead-of-flat-files). \ No newline at end of file +Alternatively you can store the pastes in a relational database. This is tested with MySQL and SQLite and examples for these two databases are provided in commented form. A more detailed explanation of the database feature can be found in the [installation instructions](Installation#using-a-database-instead-of-flat-files). diff --git a/Development.md b/Development.md index 3dadea5..35f2027 100644 --- a/Development.md +++ b/Development.md @@ -1,10 +1,10 @@ -This fork of the original ZeroBin of Sebsauvage was refactored into an object oriented MVC structure. The `index.php` only includes an autoloader and starts the application by instancing a `zerobin` object. +This fork of the original PrivateBin of Sebsauvage was refactored into an object oriented MVC structure. The `index.php` only includes an autoloader and starts the application by instancing a `privatebin` object. ## Structure -The main code or **controller** is found in `lib/zerobin.php`. +The main code or **controller** is found in `lib/privatebin.php`. -The data storage **models** are in the `lib/zerobin/` folder. +The data storage **models** are in the `lib/privatebin/` folder. The **view** is still implemented using the RainTPL library (`lib/RainTPL.php`) using a template file located in the `tpl/` folder. @@ -28,12 +28,12 @@ Example installation for Debian and Ubuntu: To run the tests, just change into the `tst/` directory and run phpunit: - $ cd ZeroBin/tst + $ cd PrivateBin/tst $ phpunit -Additionally there is the `configGenerator`. Based on the configurations defined in its constructor, it generates the unit test file `tst/configuration.php`, containing all possible combinations of these configurations and test for (most) valid combinations. Some of 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) are covered in `tst/zerobin.php`. Here is how to generate the configuration test and run it: +Additionally there is the `configGenerator`. Based on the configurations defined in its constructor, it generates the unit test file `tst/configuration.php`, containing all possible combinations of these configurations and test for (most) valid combinations. Some of 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) are covered in `tst/privatebin.php`. Here is how to generate the configuration test and run it: - $ cd ZeroBin/tst + $ cd PrivateBin/tst $ php configGenerator.php $ phpunit configuration.php @@ -67,4 +67,4 @@ If you want to create your own data models, you might want to know how the array $comment['meta']['nickname'] // text or null (if anonymous) $comment['meta']['vizhash'] // text or null (if anonymous) $comment['meta']['postdate'] // int UNIX timestamp - } \ No newline at end of file + } diff --git a/Home.md b/Home.md index 32ed99c..e71e5fb 100644 --- a/Home.md +++ b/Home.md @@ -1,16 +1,16 @@ -# ZeroBin +# PrivateBin -ZeroBin is a minimalist, opensource online pastebin where the server has zero +PrivateBin is a minimalist, opensource online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted in the browser using 256 bit AES. -This fork of ZeroBin refactored the source code to allow easier and cleaner -extensions. It is still fully compatible to the original ZeroBin 0.19 data -storage scheme. Therefore such installations can be upgraded to this fork +This fork of ZeroBin refactored the source code to allow easier and cleaner +extensions. It is still fully compatible to the original ZeroBin 0.19 data +storage scheme. Therefore such installations can be upgraded to this fork without loosing any data. -## What ZeroBin provides +## What PrivateBin provides + As a server administrator you don't have to worry if your users post content that is considered illegal in your country. You have no knowledge of any @@ -21,21 +21,22 @@ without loosing any data. + Encryption of data sent to server, even if it does not provide HTTPS. -+ Possibility to set a password which is required to read the paste. It further ++ Possibility to set a password which is required to read the paste. It further protects a paste and prevents people stumbling upon your paste's link from being able to read it without the password. ## What it doesn't provide -- As a user you have to trust the server administrator, your internet provider +- As a user you have to trust the server administrator, your internet provider and any country the traffic passes not to inject any malicious javascript code. - Ideally, the ZeroBin installation used would provide HTTPS, secured by + Ideally, the PrivateBin installation used would provide HTTPS, secured by [HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) and - [HPKP](https://en.wikipedia.org/wiki/HTTP_Public_Key_Pinning) using a - certificate either validated by a trusted third party (check the certificate - when first using a new ZeroBin instance) or self-signed by the server operator, - validated using a - [DNSSEC](https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions) protected + [HPKP](https://en.wikipedia.org/wiki/HTTP_Public_Key_Pinning) using a + certificate either validated by a trusted third party (check the certificate + when first using a new PrivateBin instance) or self-signed by the server + operator, validated using a + [DNSSEC](https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions) + protected [DANE](https://en.wikipedia.org/wiki/DNS-based_Authentication_of_Named_Entities) record. @@ -44,13 +45,13 @@ without loosing any data. Use a password if you want your paste to be private. - A server admin might be forced to hand over access logs to the authorities. - ZeroBin encrypts your text and the discussion contents, but who accessed it + PrivateBin encrypts your text and the discussion contents, but who accessed it first might still be disclosed via such access logs. ## Options Some features are optional and can be enabled or disabled in the [configuration -file](https://github.com/elrido/ZeroBin/wiki/Configuration): +file](https://github.com/PrivateBin/PrivateBin/wiki/Configuration): * Password protection @@ -60,30 +61,33 @@ file](https://github.com/elrido/ZeroBin/wiki/Configuration): * Markdown format support for HTML formatted pastes -* Syntax highlighting for source code using prettify.js, including 4 prettify themes +* Syntax highlighting for source code using prettify.js, including 4 prettify + themes -* File upload support, images get displayed (disabled by default, possibility to adjust size limit) +* File upload support, images get displayed (disabled by default, possibility + to adjust size limit) * Templates: By default there is a bootstrap CSS and a "classic ZeroBin" theme and it is easy to adapt these to your own websites layout or create your own. -* Translation system and automatic browser language detection (if enabled in browser) +* Translation system and automatic browser language detection (if enabled in + browser) * Language selection (disabled by default, as it uses a session cookie) ## Further resources -* [Installation guide](https://github.com/elrido/ZeroBin/wiki/Installation) +* [Installation guide](https://github.com/PrivateBin/PrivateBin/wiki/Installation) -* [Upgrading from 0.19 Alpha](https://github.com/elrido/ZeroBin/wiki/Upgrading-from-ZeroBin-0.19-Alpha) +* [Upgrading from 0.19 Alpha](https://github.com/PrivateBin/PrivateBin/wiki/Upgrading-from-ZeroBin-0.19-Alpha) -* [Configuration guide](https://github.com/elrido/ZeroBin/wiki/Configuration) +* [Configuration guide](https://github.com/PrivateBin/PrivateBin/wiki/Configuration) -* [Templates](https://github.com/elrido/ZeroBin/wiki/Templates) +* [Templates](https://github.com/PrivateBin/PrivateBin/wiki/Templates) -* [Translation guide](https://github.com/elrido/ZeroBin/wiki/Translation) +* [Translation guide](https://github.com/PrivateBin/PrivateBin/wiki/Translation) -* [Developer guide](https://github.com/elrido/ZeroBin/wiki/Development) +* [Developer guide](https://github.com/PrivateBin/PrivateBin/wiki/Development) Run into any issues? Have ideas for further developments? Please -[report](https://github.com/elrido/ZeroBin/issues) them! +[report](https://github.com/PrivateBin/PrivateBin/issues) them! diff --git a/Installation-on-Red-Hat-with-SELinux.md b/Installation-on-Red-Hat-with-SELinux.md index 1b2e19a..1b3c3a5 100644 --- a/Installation-on-Red-Hat-with-SELinux.md +++ b/Installation-on-Red-Hat-with-SELinux.md @@ -1,4 +1,4 @@ -This tutorial on how to install httpd, php70 and ZeroBin on a minimal red hat or CentOS 7 installation was provided by [@pozzo-balbi](https://github.com/pozzo-balbi) and was originally published at [pozzo-balbi.com/help/Zerobin](https://www.pozzo-balbi.com/help/Zerobin) under [Creative Commons Attribution ShareAlike 3.0](https://creativecommons.org/licenses/by-sa/3.0/) license. +This tutorial on how to install httpd, php70 and PrivateBin on a minimal red hat or CentOS 7 installation was provided by [@pozzo-balbi](https://github.com/pozzo-balbi) and was originally published at [pozzo-balbi.com/help/Zerobin](https://www.pozzo-balbi.com/help/Zerobin) under [Creative Commons Attribution ShareAlike 3.0](https://creativecommons.org/licenses/by-sa/3.0/) license. ## Prerequisits @@ -16,7 +16,7 @@ Update php.ini: sed -i 's/;realpath_cache_size = 16k/realpath_cache_size = 256k/' /etc/php.ini sed -i 's/;realpath_cache_ttl = 120/realpath_cache_ttl = 1200/' /etc/php.ini -Now customize httpd. Remove unnecessary modules (for ZeroBin) from `/etc/httpd/conf.modules.d`. Uncomment as needed. +Now customize httpd. Remove unnecessary modules (for PrivateBin) from `/etc/httpd/conf.modules.d`. Uncomment as needed. 00-base.conf: @@ -204,9 +204,9 @@ Last but not least configure Apache httpd itself. ## Installation -Download the [latest version of ZeroBin](https://github.com/elrido/ZeroBin/releases/latest) and extract it to `/var/www/html/paste`. +Download the [latest version of PrivateBin](https://github.com/PrivateBin/PrivateBin/releases/latest) and extract it to `/var/www/html/paste`. -Create directories needed by ZeroBin, update permissions and (re)start httpd: +Create directories needed by PrivateBin, update permissions and (re)start httpd: cd /var/www/html/paste mkdir data @@ -232,4 +232,4 @@ If using nginx with naxsi on your reverse proxy, add these whitelist_rules: BasicRule wl:1009 "mz:$URL:/paste/|$BODY_VAR:data"; BasicRule wl:1009 "mz:$URL:/paste/|$BODY_VAR:nickname"; BasicRule wl:1001 "mz:$URL:/paste/|$BODY_VAR:nickname"; - BasicRule wl:1015 "mz:$URL:/paste/|$BODY_VAR:nickname"; \ No newline at end of file + BasicRule wl:1015 "mz:$URL:/paste/|$BODY_VAR:nickname"; diff --git a/Installation.md b/Installation.md index e99a88f..8621dc1 100644 --- a/Installation.md +++ b/Installation.md @@ -1,7 +1,9 @@ ## Basic installation -**TL;DR:** Download the [latest release archive](https://github.com/elrido/ZeroBin/releases/latest) -and extract it in your web hosts folder were you want to install your ZeroBin instance. +**TL;DR:** Download the +[latest release archive](https://github.com/PrivateBin/PrivateBin/releases/latest) +and extract it in your web hosts folder were you want to install your PrivateBin +instance. ### Requirements @@ -13,18 +15,18 @@ and extract it in your web hosts folder were you want to install your ZeroBin in ### Configuration -In the file `cfg/conf.ini` you can configure ZeroBin. A `cfg/conf.ini.sample` -is provided containing all options on default values. You can copy it to -`cfg/conf.ini` and adapt it as needed. The config file is divided into multiple +In the file `cfg/conf.ini` you can configure PrivateBin. A `cfg/conf.ini.sample` +is provided containing all options on default values. You can copy it to +`cfg/conf.ini` and adapt it as needed. The config file is divided into multiple sections, which are enclosed in square brackets. -In the `[main]` section you can enable or disable the discussion feature, set the -limit of stored pastes and comments in bytes. The `[traffic]` section lets you -set a time limit in seconds. Users may not post more often then this limit to -your ZeroBin installation. +In the `[main]` section you can enable or disable the discussion feature, set +the limit of stored pastes and comments in bytes. The `[traffic]` section lets +you set a time limit in seconds. Users may not post more often then this limit +to your PrivateBin installation. More details can be found in the -[configuration documentation](https://github.com/elrido/ZeroBin/wiki/Configuration). +[configuration documentation](https://github.com/PrivateBin/PrivateBin/wiki/Configuration). ## Advanced installation @@ -37,40 +39,56 @@ root. This new location must still be accessible to your webserver / PHP process ([open_basedir setting](http://php.net/manual/en/ini.core.php#ini.open-basedir)). > #### PATH Example -> Your zerobin installation lives in a subfolder called "paste" inside of your -> document root. The URL looks like this: +> Your PrivateBin installation lives in a subfolder called "paste" inside of +> your document root. The URL looks like this: > http://example.com/paste/ > -> The full path of ZeroBin on your webserver is: +> The full path of PrivateBin on your webserver is: > /home/example.com/htdocs/paste > > When setting the path like this: -> define('PATH', '../../secret/zerobin/'); +> define('PATH', '../../secret/privatebin/'); > -> ZeroBin will look for your includes here: -> /home/example.com/secret/zerobin +> PrivateBin will look for your includes here: +> /home/example.com/secret/privatebin + +### Web server configuration + +A `robots.txt` file is provided in the root dir of PrivateBin. It disallows all +robots from accessing your pastes. It is recommend to place it into the root of +your web directory if you have installed PrivateBin in a subdirectory. Make sure +to adjust it, so that the file paths match your installation. Of course also +adjust the file if you already use a `robots.txt`. + +A `.htaccess.disabled` file is provided in the root dir of PrivateBin. It blocks +some known robots and link-scanning bots. If you use Apache, you can rename the +file to `.htaccess` to enable this feature. If you use another webserver, you +have to configure it manually to do the same. ### Using a database instead of flat files In the configuration file the `[model]` and `[model_options]` sections let you -configure your favourite way of storing the pastes and discussions on your server. +configure your favourite way of storing the pastes and discussions on your +server. -`zerobin_data` is the default model, which stores everything in files in the data -folder. This is the recommended setup for most sites. +`privatebin_data` is the default model, which stores everything in files in the +data folder. This is the recommended setup for most sites. Under high load, in distributed setups or if you are not allowed to store files -locally, you might want to switch to the `zerobin_db` model. This lets you store -your data in a database. Basically all databases that are supported by +locally, you might want to switch to the `privatebin_db` model. This lets you +store your data in a database. Basically all databases that are supported by [PDO](http://php.net/manual/en/book.pdo.php) may be used. Automatic table creation is provided for `pdo_ibm`, `pdo_informix`, `pdo_mssql`, `pdo_mysql`, `pdo_oci`, `pdo_pgsql` and `pdo_sqlite`. You may want to provide a table prefix, -if you have to share the zerobin database with another application or you want -to use a prefix for [security reasons](https://security.stackexchange.com/questions/119510/is-using-a-db-prefix-for-tables-more-secure). The table prefix option is called `tbl`. +if you have to share the PrivateBin database with another application or you want +to use a prefix for +[security reasons](https://security.stackexchange.com/questions/119510/is-using-a-db-prefix-for-tables-more-secure). +The table prefix option is called `tbl`. > #### Note -> The "zerobin_db" model has only been tested with SQLite and MySQL, although it -would not be recommended to use SQLite in a production environment. If you gain -any experience running ZeroBin on other RDBMS, please let us know. +> The "privatebin_db" model has only been tested with SQLite and MySQL, although +it would not be recommended to use SQLite in a production environment. If you +gain any experience running PrivateBin on other RDBMS, please let us know. For reference or if you want to create the table schema for yourself: @@ -103,13 +121,3 @@ For reference or if you want to create the table schema for yourself: id CHAR(16) NOT NULL, value TEXT, PRIMARY KEY (id) ); INSERT INTO prefix_config VALUES('VERSION', '0.22'); - -### Web server configuration - -* A `robots.txt` file is provided in the root dir of ZeroBin. It disallows all robots from accessing your pastes. - It is recommend to place it into the root of your web directory if you have installed ZeroBin in a subdirectory. - Make sure to adjust it, so that the file paths match your installation. Of course also adjust the file if you - already use a `robots.txt`. -* A `.htaccess.disabled` is provided in the root dir of ZeroBin. It blocks some known robots and link-scanning bots. - If you use Apache, you can rename the file to `.htaccess` to enable this feature. If you use another webserver, - you have to configure it manually to do the same. \ No newline at end of file diff --git a/ZeroBin-Directory.md b/PrivateBin-Directory.md similarity index 100% rename from ZeroBin-Directory.md rename to PrivateBin-Directory.md diff --git a/Release-Checklist.md b/Release-Checklist.md index 60b6d75..c769de6 100644 --- a/Release-Checklist.md +++ b/Release-Checklist.md @@ -1,8 +1,8 @@ -This is an internal checklist of things not to forget before releasing a new ZeroBin version. +This is an internal checklist of things not to forget before releasing a new PrivateBin version. ## Preparations -1. update [README.md](https://github.com/elrido/ZeroBin/blob/master/README.md), [INSTALL.md](https://github.com/elrido/ZeroBin/blob/master/INSTALL.md), [CHANGELOG.md](https://github.com/elrido/ZeroBin/blob/master/CHANGELOG.md) and [CREDITS.md](https://github.com/elrido/ZeroBin/blob/master/CREDITS.md) +1. update [README.md](https://github.com/PrivateBin/PrivateBin/blob/master/README.md), [INSTALL.md](https://github.com/PrivateBin/PrivateBin/blob/master/INSTALL.md), [CHANGELOG.md](https://github.com/PrivateBin/PrivateBin/blob/master/CHANGELOG.md) and [CREDITS.md](https://github.com/PrivateBin/PrivateBin/blob/master/CREDITS.md) 1. increment version number (search and replace in all text files) 1. rerun a full phpunit test suite 1. manually retest key functions on a site with the latest code, especially looking for visual glitches. @@ -15,6 +15,6 @@ This is an internal checklist of things not to forget before releasing a new Zer 1. update screenshots for all templates and replace those on the [template](Templates) wiki page 1. update the [stable demo](https://snip.dssr.ch/) site 1. create new paste on the stable demo based on latest README.md and make it the new frontpage of the [project site](https://zerobin.dssr.ch/) -1. test `git archive` generation, it should not contain directories `tst` or `doc`. Things that should be ignored can be configured in [.gitattributes](https://github.com/elrido/ZeroBin/blob/master/.gitattributes) +1. test `git archive` generation, it should not contain directories `tst` or `doc`. Things that should be ignored can be configured in [.gitattributes](https://github.com/PrivateBin/PrivateBin/blob/master/.gitattributes) 1. tag latest release, push it to github and update the release page with the latest CHANGELOG.md entry -1. announce the release \ No newline at end of file +1. announce the release diff --git a/Templates.md b/Templates.md index 7b892f6..1fa0b39 100644 --- a/Templates.md +++ b/Templates.md @@ -1,56 +1,56 @@ -ZeroBin comes with multiple templates and of course you can also create your own to adjust the look of it to your site. +PrivateBin comes with multiple templates and of course you can also create your own to adjust the look of it to your site. ## Creating templates For beginners it is suggested to copy `tpl/bootstrap.html` and adapt it to your design. You can put the HTML of your template into the directory `tpl`, i.e. `tpl/myawesometemplate.html`. -If you don't reuse external resources (CSS, images, etc.) in your ZeroBin template, we suggest to put CSS and fonts into a subfolder at `css/myawesometemplate`, images into a subfolder at `img/myawesometemplate` and javascript libraries into the folder `js` (if these are publicly available libraries, it is suggested to include the version number in the file name, to ensure they are reloaded in your visitors browser when you upgrade them). +If you don't reuse external resources (CSS, images, etc.) in your PrivateBin template, we suggest to put CSS and fonts into a subfolder at `css/myawesometemplate`, images into a subfolder at `img/myawesometemplate` and javascript libraries into the folder `js` (if these are publicly available libraries, it is suggested to include the version number in the file name, to ensure they are reloaded in your visitors browser when you upgrade them). -ZeroBin uses the [RainTPL template engine](http://rainphp.github.io/raintpl/), you can read about its possibilities on their [documentation for webdesigners](https://github.com/rainphp/raintpl3/wiki/Documentation-for-web-designers). +PrivateBin uses the [RainTPL template engine](http://rainphp.github.io/raintpl/), you can read about its possibilities on their [documentation for webdesigners](https://github.com/rainphp/raintpl3/wiki/Documentation-for-web-designers). ## Configuring templates -To enable the use of a template, configure its name (without the `.html` ending) in the [template property](https://github.com/elrido/ZeroBin/wiki/Configuration#template) in the configuration file at `cfg/conf.ini`. +To enable the use of a template, configure its name (without the `.html` ending) in the [template property](https://github.com/PrivateBin/PrivateBin/wiki/Configuration#template) in the configuration file at `cfg/conf.ini`. -## Templates included in ZeroBin +## Templates included in PrivateBin ### page This is the classic ZeroBin template as used until 0.19 Alpha: -![page ZeroBin template](https://zerobin.dssr.ch/img/0.22/page.png) +![page PrivateBin template](https://zerobin.dssr.ch/img/0.22/page.png) ### bootstrap -This is a [bootstrap CSS](http://getbootstrap.com/) based ZeroBin template and the default as of 0.20: +This is a [bootstrap CSS](http://getbootstrap.com/) based PrivateBin template and the default as of 0.20: -![bootstrap ZeroBin template](https://zerobin.dssr.ch/img/0.22/bootstrap.png) +![bootstrap PrivateBin template](https://zerobin.dssr.ch/img/0.22/bootstrap.png) ### bootstrap-compact This is a slightly modified template based on the bootstrap one above. It moves some options into a drop down and the navigation floats fixed to the top, even when scrolling down: -![bootstrap-compact ZeroBin template](https://zerobin.dssr.ch/img/0.22/bootstrap-compact.png) +![bootstrap-compact PrivateBin template](https://zerobin.dssr.ch/img/0.22/bootstrap-compact.png) ### bootstrap-page Not everybody liked the order of the "New" and "Send" buttons so they were switched for usability reasons. For those preferring the order as in the classic "page"-template there is this bootstrap CSS based theme: -![bootstrap ZeroBin template](https://zerobin.dssr.ch/img/0.22/bootstrap-page.png) +![bootstrap PrivateBin template](https://zerobin.dssr.ch/img/0.22/bootstrap-page.png) ### bootstrap-dark -Based on the [darkstrap](https://github.com/danneu/darkstrap) bootstrap CSS theme, this is a dark ZeroBin template: +Based on the [darkstrap](https://github.com/danneu/darkstrap) bootstrap CSS theme, this is a dark PrivateBin template: -![bootstrap ZeroBin template](https://zerobin.dssr.ch/img/0.22/bootstrap-dark.png) +![bootstrap PrivateBin template](https://zerobin.dssr.ch/img/0.22/bootstrap-dark.png) ### bootstrap-dark-page Not everybody liked the order of the "New" and "Send" buttons so they were switched for usability reasons. For those preferring the order as in the classic "page"-template there is this [darkstrap](https://github.com/danneu/darkstrap) based theme: -![bootstrap ZeroBin template](https://zerobin.dssr.ch/img/0.22/bootstrap-dark-page.png) \ No newline at end of file +![bootstrap PrivateBin template](https://zerobin.dssr.ch/img/0.22/bootstrap-dark-page.png) diff --git a/Translation.md b/Translation.md index 7e3ac07..346d20c 100644 --- a/Translation.md +++ b/Translation.md @@ -1,4 +1,4 @@ -As of ZeroBin 0.21 translations are available and ZeroBin is no longer English only. +As of PrivateBin 0.21 translations are available and PrivateBin is no longer English only. The translation concept follows similar concepts as GNU gettext: - Each language has a translation file containing all its translated texts. @@ -11,14 +11,14 @@ The translation concept follows similar concepts as GNU gettext: 2. Copy one of the files into your languages [two-letter ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes#Partial_ISO_639_table), i.e. to `es.json` for a Spanish. 3. Open the file in a text editor and change the messages after the english message ID. 4. Save the file in UTF-8 character encoding. -5. Add your new language code into the array called `supportedLanguages` in `js/zerobin.js` (around line 300). +5. Add your new language code into the array called `supportedLanguages` in `js/privatebin.js` (around line 300). 6. Done (Pull requests highly welcome!) ## Technical Details ### Format -As ZeroBin has to provide a logic for both the server and the client side, the format of choice is JSON. You find these files in the directory `i18n`; They have to be accessible through the webserver. +As PrivateBin has to provide a logic for both the server and the client side, the format of choice is JSON. You find these files in the directory `i18n`; They have to be accessible through the webserver. Each translation file is saved under the name of the languages two-letter ISO code and contains one JSON object. The attributes of the object are the message IDs to be translated from English and the values stored in them are the translated strings. @@ -40,11 +40,11 @@ Some languages can have more then one plural forms. Which form to use depending ### Gotchas -Currently we do not inform the JS part about the available languages on the server, but instead these are statically encoded in the file `js/zerobin.js` in the property `i18n.supportedLanguages` (around line 300). If you add a new language, remember to add it there, too. +Currently we do not inform the JS part about the available languages on the server, but instead these are statically encoded in the file `js/privatebin.js` in the property `i18n.supportedLanguages` (around line 300). If you add a new language, remember to add it there, too. If your new language does use more complex plurals then English, you need to add the [formula](http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html) for it in two places: -* [lib/i18n.php](https://github.com/elrido/ZeroBin/blob/master/lib/i18n.php) in class i18n, method _getPluralForm() -* [js/zerobin.js](https://github.com/elrido/ZeroBin/blob/master/js/zerobin.js) in class i18n, method getPluralForm() +* [lib/i18n.php](https://github.com/PrivateBin/PrivateBin/blob/master/lib/i18n.php) in class i18n, method _getPluralForm() +* [js/privatebin.js](https://github.com/PrivateBin/PrivateBin/blob/master/js/privatebin.js) in class i18n, method getPluralForm() For the language labels displayed in the optional language selection drop down menu, a file called `i18n/languages.json` was created. Most languages should already be included with a translated language label and its English translation. diff --git a/Upgrading-from-ZeroBin-0.19-Alpha.md b/Upgrading-from-ZeroBin-0.19-Alpha.md index ad185a1..59e1bf5 100644 --- a/Upgrading-from-ZeroBin-0.19-Alpha.md +++ b/Upgrading-from-ZeroBin-0.19-Alpha.md @@ -6,7 +6,7 @@ This upgrade guide is intended for installations of ZeroBin version 0.19 Alpha a 2. _Optional:_ If your service is popular and frequently used, it might be nice to announce the service interruption to your users, i.e. by adding a message into the note block of `tpl/page.html`. If you have the possibility you could disable the access to your site in your hosting configuration while you perform the actual upgrade. -3. Download the [latest stable release](https://github.com/elrido/ZeroBin/releases/latest) of ZeroBin. +3. Download the [latest stable release](https://github.com/PrivateBin/PrivateBin/releases/latest) of PrivateBin. 4. _Optional:_ If you don't have the URL of a current paste in your installation, you might want to create one before the upgrade to be able to test if it still works afterwards. @@ -34,4 +34,4 @@ This upgrade guide is intended for installations of ZeroBin version 0.19 Alpha a 10. Test your service, i.e. with a previously created paste. Create a new paste, view it, delete one with the delete-link. Typical problems you might encounter are permission problems: Make sure your webservers user has the permission to write into both the `data` and `tmp` directories in the document root. -11. _Suggested:_ For added security you might consider to move any non necessary folders out of the document root. More details on this can be found in the [advanced installation guide](Installation#changing-the-path). \ No newline at end of file +11. _Suggested:_ For added security you might consider to move any non necessary folders out of the document root. More details on this can be found in the [advanced installation guide](Installation#changing-the-path).