+202008xx version 1.2 Carbon
+* Cleanup version only. No new fetures
+
20200530 version 1.1 Boron
* House cleaning
* Added a simple web client
selfpaste is a small self hosting paste service.
https://www.bananas-playground.net/projekt/selfpaste/
-It is not the aim to replace any other well know paste service. It is an experiment
-and build for private use only.
+It is not the aim to replace any other well known paste service.
+It is an experiment and build for private use only.
This tool uses PHP fileinfo: https://www.php.net/manual/en/intro.fileinfo.php
> by looking for certain magic byte sequences at specific positions within the file.
> While this is not a bullet proof approach the heuristics used do a very good job.
-It is not really bulletproof, but it does the job. Everything can be manipulated
-to look alike something it isn't.
+It is not really bulletproof, but it does the job.
+Everything can be manipulated to look alike something it isn't.
So, here is a friendly REMINDER:
- - Use at own risk.
+ - Use it at own risk.
- Don't open it up to the public
- Check regularly what is added
- Clean everything what you do not know
- Change your secret often.
# Why json as a response?
-In cases the upload is over post_max_size the request will not be "arrive".
+In cases the upload is over post_max_size the request will not "arrive".
Meaning the script does not receive enough information to work with.
-In this case we return the start page. Which is a valid HTTP 200 status response.
-So the client can not only rely in the HTTP status code alone.
+In this case it returns the start page. Which is a valid HTTP 200 status response.
+So the client can not only rely on the HTTP status code alone.
# Third party resources
-Link shortening inspired and some code used from: https://www.jwz.org/base64-shortlinks/
\ No newline at end of file
+Link shortening inspired and some code used from: https://www.jwz.org/base64-shortlinks/
-Linux client written in C. Can be build with the added Makefile for linux
+Linux client written in C. Can be build with the added Makefile for linux.
Depends on libcurl (+ssl) https://curl.haxx.se and json-c https://github.com/json-c/json-c
\r
Howto build:\r
- gcc from https://jmeubank.github.io/tdm-gcc/ (build with tdm64-gcc-9.2.0)\r
-Run the makefile.bat in a cmd terminal. \r
-Resulting selfpaste.exe and needed dll are in bin/ directory.
\ No newline at end of file
+- Run the makefile.bat in a cmd terminal. \r
+- Resulting selfpaste.exe and needed dlls are in bin/ directory.\r
The webclient provides a simple web client to add pasties on the go when no client is available.
It is a simple basic auth protected script which will then add the new pasty to your installation.
-To enable the webclient read the details in the index.php and config.default. file.
+To enable the webclient read the details in the index.php and config.default.php file.
Copy config.default.php to config.php and provide a username, password, secret and the selfpaste endpoint url.
Upload it where you want it and go.
* rename this file into a php file and create a cronjob which executes this file as
* php cli command
*
- * example runs very sunday : 0 0 * * 0 php /path/to/this/file.php
+ * example runs every sunday : 0 0 * * 0 php /path/to/this/file.php
*
* you need to change PATH_TO_MANCUBUS_CLASS to find the required PHP class
*/
if($verbose == true) echo "Selfpaste cleanup start\n";
$mancubus = new Mancubus();
$mancubus->cleanupCronjob($verbose);
-if($verbose == true) echo "Selfpaste cleanup end\n";
\ No newline at end of file
+if($verbose == true) echo "Selfpaste cleanup end\n";
A C client is available to be build with makefile. Build and see included
help for more information.
+A C client for windows is also available can be build with the provided
+information in the right folder.
+
Requirements to create a new client are:
- Talk to the selfpaste endpoint over HTTP(S) (your choice)
> by looking for certain magic byte sequences at specific positions within the file.
> While this is not a bullet proof approach the heuristics used do a very good job.
-It is not really bullet proof, but it does the job. Everything can be manipulated
+It is not really bulletproof, but it does the job. Everything can be manipulated
to look alike something it isn't.
To expand or reduce the allowed filetypes, edit the SELFPASTE_ALLOWED_FILETYPES string to your needs.
Again READ the README and security info!
-Read more about filetypes here: https://www.iana.org/assignments/media-types/media-types.xhtml
\ No newline at end of file
+Read more about filetypes here: https://www.iana.org/assignments/media-types/media-types.xhtml
- mod_deflate
- mod_rewrite
- htaccess support AllowOverride All
-Bash, curl and jq for included bash client
\ No newline at end of file
+
+Bash, curl and jq for included bash client.
+
+More dependencies for each client can be found in the individual readmes.
--- /dev/null
+config.php