From 3ff8d251104ea6d8d80a64aaf68c87d39531c8a0 Mon Sep 17 00:00:00 2001 From: Banana Date: Mon, 18 May 2020 20:19:46 +0200 Subject: [PATCH] adding a simple webclient. --- TODO | 1 + client/webclient/.gitignore | 1 + client/webclient/README | 7 ++++ client/webclient/index.php | 73 +++++++++++++++++++++++++++++++++++++ documentation/clients.txt | 2 +- webroot/index.php | 2 +- 6 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 client/webclient/.gitignore create mode 100644 client/webclient/README create mode 100644 client/webclient/index.php diff --git a/TODO b/TODO index 32384d7..b0f30d6 100644 --- a/TODO +++ b/TODO @@ -1 +1,2 @@ + Option outputfile in c client not implemented ++ Small web interface to add files without client diff --git a/client/webclient/.gitignore b/client/webclient/.gitignore new file mode 100644 index 0000000..4f4773f --- /dev/null +++ b/client/webclient/.gitignore @@ -0,0 +1 @@ +config.php diff --git a/client/webclient/README b/client/webclient/README new file mode 100644 index 0000000..f8d4a19 --- /dev/null +++ b/client/webclient/README @@ -0,0 +1,7 @@ +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. +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. diff --git a/client/webclient/index.php b/client/webclient/index.php new file mode 100644 index 0000000..beb4bdd --- /dev/null +++ b/client/webclient/index.php @@ -0,0 +1,73 @@ + + + + selfpaste - add a new one + + +
+ +

+ +

+

+

+
+ + + diff --git a/documentation/clients.txt b/documentation/clients.txt index 90b01cc..7bf24a6 100644 --- a/documentation/clients.txt +++ b/documentation/clients.txt @@ -7,7 +7,7 @@ help for more information. Requirements to create a new client are: - - Talk to the selfpaste endpoint over HTTP(S) + - Talk to the selfpaste endpoint over HTTP(S) (your choice) - Make a POST with multipart/form-data - The post must have field pasty and field dl -- pasty=File to upload diff --git a/webroot/index.php b/webroot/index.php index ff0ae72..2f252e7 100644 --- a/webroot/index.php +++ b/webroot/index.php @@ -124,4 +124,4 @@ else { error_log('Content body file missing. '.var_export($_SERVER,true),3,ERROR_LOG_FILE); http_response_code(400); die('Well, something went wrong...'); -} \ No newline at end of file +} -- 2.39.5