README 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. selfpaste is a small self hosting paste service.
  2. https://www.bananas-playground.net/projekt/selfpaste/
  3. It is not the aim to replace any other well known paste service.
  4. It is an experiment and build for private use only.
  5. This tool uses PHP fileinfo: https://www.php.net/manual/en/intro.fileinfo.php
  6. > The functions in this module try to guess the content type and encoding of a file
  7. > by looking for certain magic byte sequences at specific positions within the file.
  8. > While this is not a bullet proof approach the heuristics used do a very good job.
  9. It is not really bulletproof, but it does the job.
  10. Everything can be manipulated to look alike something it isn't.
  11. So, here is a friendly REMINDER:
  12. - Use it at own risk.
  13. - Don't open it up to the public
  14. - Check regularly what is added
  15. - Clean everything what you do not know
  16. - You provide the service by hosting it. Your are responsible for it!
  17. - Change your secret often.
  18. # Why json as a response?
  19. In cases the upload is over post_max_size the request will not "arrive".
  20. Meaning the script does not receive enough information to work with.
  21. In this case it returns the start page. Which is a valid HTTP 200 status response.
  22. So the client can not only rely on the HTTP status code alone.
  23. # Third party resources
  24. Link shortening inspired and some code used from: https://www.jwz.org/base64-shortlinks/