PrivateBin / PrivateBin

A minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted in the browser using 256 bits AES.
https://privatebin.info/
Other
6.42k stars 798 forks source link

PHP Fatal error: Uncaught exception 'RainTpl_Exception' #35

Closed chatq closed 8 years ago

chatq commented 8 years ago

PHP Fatal error: Uncaught exception 'RainTpl_Exception' with message 'Cache directory /tmp doesn't have write permission. Set write permission or set RAINTPL_CHECK_TEMPLATE_UPDATE to false. More details on http://www.raintpl.com/Documentation/Documentation-for-PHP-developers/Configuration/'...

i set that check template update to false. i gave write permision to tmp dir. but still same error. i did git clone with latest version of privatebin. how to fix that im tired. it says extract files, set cfg and done. but not so. make default settings more wisely for new users of this script.

also i need paste script which will work on mobile devices without flash support but this script demo didn't work without flash support. can you develop this script for mobile using also?

elrido commented 8 years ago

Let me state upfront that I am really sorry about the installation experience you had with our project! :frowning:

Regarding the error message, the "/tmp" part is indeed a bit misleading. PrivateBin tries to create files and directories inside its main folder and/or the one defined in PATH. Can a "tmp" directory inside of the PrivateBin directory be created by the PHP/webserver user? If necessary please change the ownership of your PrivateBin directory to the PHP/webserver user, so it can create the necessary folders and files inside it.

If you are on a Red Hat / CentOS system you might also need to change the SELinux settings.

I'll take this report as an opportunity to improve the installation documentation and include a part on the paths that need to be writable.

Regarding flash: I am not aware that flash is used anywhere in PrivateBin. At least the bootstrap based themes (e.g. the default one) are optimized for mobile and were tested on Sailfish OS, Android and iOS. You should be able to test this on any of the post version 0.21 URLs in the directory.

Thank you to take the time to send us this report, others might have simply given up after failing to install it and we would have never known.

Note to self: RainTPL.com is down, replace the URL with e.g. a link to a wiki page in this project.

chatq commented 8 years ago

thanks for the tip. i was doing chmod but after seeing your response, i did "chmod www-data:www-data </full path of privatebin/>" and it solved my problem. i had predefined /path as tmp in privatebin's main dir but i see default setting already doing the same, so, i'm using as default setting now. I forgot to mention about broken links of RainTPL on my post but i copied here to let you know that they are broken and i see that you noticed it too.

about flash: isn't bootstrap themes on javascripts which means need flash supported browsers to be able to work. i tested those links in the directory but non of them worked on nonflash supported browsers. but they all worked on flash supported browsers. so, can we have html5 theme please.?

i was searching and testing all pastebin services/scripts and found out that you are continueing to zerobin project by this fork and added good functions to it. but i wasn't be able to run it for this issue and not used it for non-flash support. but yesterday i again decided to try fixing it's issue about running. when i see that you renamed it and moved to PrivateBin project, i see that you are actively maintaining the project and wanted to let you know about the issue. i have 4 questions; 1) when will you add responsive theme or html5 theme? because non-flash browsers on my mobile wasnt be able to use paste service. 2) is there auto highlight syntax or not? probably, i think yes. i did config as defaultformatter = "syntaxhighlighting" and syntaxhighlightingtheme = "sons-of-obsidian" on bootstrap theme. where can i see full list which programming languages syntaxes supported on highlight text? how can add i more? is deprecated on .22 version or not? 3) is it possible to add syntax or text correction feauture to find errors/faults on codes to check? 4) can you give us referance for running our own url shortening with PrivateBin? because links are very long.

also i want to know what Markdown format is doing. i didn't get it.

Thanks you for your time and effort too.

elrido commented 8 years ago

Dear @chatq,

Again, we don't use any flash. You can check it yourself by running a find . -iname *.swf in your repository folders. Also there are no external includes from CDNs or similar.

What we do use is Javascript and you can't run PrivateBin without it, as the idea is to use JS to run all the crypto client-side. So I would assume that your mobile phone has some issue with our JS and I will gladly look into it.

Could you tell us, what type and version of OS your phone runs (iOS, Android, something else) and what browser and version you are using? Or if you don't know could you at least tell us the brand and model number of your device?

On to your questions:

  1. All the themes are HTML5. All the bootstrap* themes are responsive and do not use flash.
  2. If you have syntaxhighlighting listed in the [formatter_options] section of your configuration, you have the option to choose "Source code" as a format in the dropdown (Desktop) or hamburger-menu (mobile). If that is set, then the paste will be automatically formatted using the prettify.js library.
    You can find a list of the automatically detected syntaxes at the libraries start page. But as PrivateBin does not indicate what type of source code you store it will try to guess the language. It works surprisingly well for a most languages.
  3. That would be a new feature, that would need to be developed. I personally don't think we should try make PrivateBin into a full fetched IDE. Its goal is to share text / code / documents easily, but not to act as text / code / document creator.
  4. Simply add the link to create a new URL of your URL shortener into the urlshortener configuration option as documented. Please check the documentation of your URL shortener to find the link you need to configure.

Markdown: It is a shorthand notation to write HTML document. Check out the Wikipedia article on Markdown for more details on it. What can you do with it? Here is an example of this projects README.md rendered as HTML in a PrivateBin.

rugk commented 8 years ago

Markdown is also used on GitHub and you can use it in comments too. Here is the help of GitHub: https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/

You can basically use any URL shortener for PrivateBin and add it to the settings. However note that the security of your bins depends on the URL! Anybody who has the url (also url shorteners "have it") can decrypt your bins and therefore it is recommend to only use URL shorteners where absolutly neccessary and only use them if you run them by yourself. An open-source URL shortener written in PHP is e.g. YOURLS. You have to refer to their installation guide to get it working.

elrido commented 8 years ago

Since we have now removed RainTPL, I'll consider this issue resolved.

chatq commented 8 years ago

Dear @elrido,

Sorry for delay. i havent device to check it and needed others to check for tests.

Yes, you are right. PrivateBin doesn't use flash. Flash player wasn't working when disabled JavaScript on browser and that's mixed my mind. I have SSL paste site which works as i needed now. :)

i have android kitkat and i have latest opera mini browser. i solved the problem by disable to high data saving mode on browser. it was causing privatebin script to not run properly. right now all is fine. my testers checked my paste site by Windows and Linux systems and everything is working fine now. Thanks you. :)

regarding to my earlier questions;

1- yes, all themas are html5 and responsive as you said. i can experience it after disabled data saving mode on my browser. i am very glad for it. thanks. :)

2- my configuration same as you mentioned and i want to add other extensions to support other languages as mentioned on libraries start page at https://github.com/google/code-prettify#for-which-languages-does-it-work . should i open new issue here to ask how to do it?

3- there's an example on http://paste.tclhelp.net about it. would be nice if privatebin had such error check function if it's not hard.

4- ok i will try to handle it. just to add URL shortener link is enough to make it work?

Thanks you for all helping and explanations. i am appreciated.

Dear @rugk,

is it enough to have URL for decryption? it is not encrypted already?

I have checked the YOURLS and found interesting. i will try it. thanks you for the suggestion and helping.

as this issue closed, maybe i should open new issue for my questions. thanks for updates and supports. :)

elrido commented 8 years ago

Regarding 2: We do simply use the library provided by Googles Code-Prettify project. If you would like to add new languages, please send a pull request to their upstream project. Once it is merged there, you can then open an issue back here and we can integrate the change. Please direct any questions regarding the code-prettify formats, etc. to that projects issue tracker.

3: As stated I consider this to be a very complex task. It would need to be done in the code-prettify project or we would need to switch to a different code-syntax library that already has that feature. I do not consider this to something that PrivateBin can or should tackle on its own.

4: Correct, you just need to check your URL shorteners documentation on what URL to use for that purpose. PrivateBin will simply append a URL-encoded version of the pastes URL as the last argument to the given URL.

rugk commented 8 years ago

Regarding the issues with the data savings mode of Opera and Chrome, could you please open a new issue for this? I think users should not have to reconfigure their browser to be able to use PrivateBin. Can you please attach screenshots of an instance and also mention whether these "data saving" mode is activated by default (if you know it)?

is it enough to have URL for decryption?

Yes.

it is not encrypted already?

Yes, it is (end-to-end) encrypted, but the decryption key is included in the URL. That's the only way to do it as the receiver of the message has to get the decryption key somehow. However you can set a password to protect against such attacks. In this case not only the URL, but also the password is needed for decryption.

elrido commented 8 years ago

Is this the data saver? I tested that one on some Android phones, but could not reproduce the issue with it (on non-HTTPS sites, as those with HTTPS won't be affected). If anybody can reproduce this, please open an issue.