diff --git a/CHANGELOG.md b/CHANGELOG.md index 28168ac8a8aa70e043fd0e1d21bea960ed5fb297..d030e0ed81d99b7dcfbc50e6c9f23c6fb2c74930 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ ## v2.5 -+ Updated project license to GNU AGPLv3. ++ Updated project license to AGPL v3.0 (now releases ships with the new license). + **[BETA]** Added self update feature. + Added partial content implementation (stream seeking on chromium based browsers). + Improved video.js alignment with large videos. + Optimized output zip release size. ++ Templates cleanup and optimizations. ## v2.4.1 + Fixed error message when the file is too large. (#15) diff --git a/Gruntfile.js b/Gruntfile.js index 235aabf4224652c5721e248f587cc605d2086ae2..926736a241ce17dac4c987c5ad2d199ad42ff150 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -68,7 +68,12 @@ module.exports = function (grunt) { src: ['bootstrap.bundle.min.js'], dest: 'static/bootstrap/js' }, - {expand: true, cwd: 'node_modules/clipboard/dist', src: ['clipboard.min.js'], dest: 'static/clipboardjs'}, + { + expand: true, + cwd: 'node_modules/clipboard/dist', + src: ['clipboard.min.js'], + dest: 'static/clipboardjs' + }, { expand: true, cwd: 'node_modules/video.js/dist', @@ -106,15 +111,14 @@ module.exports = function (grunt) { 'config.example.php', 'index.php', 'composer.json', - 'composer.lock' + 'composer.lock', + 'LICENSE', ] } - }); require('load-grunt-tasks')(grunt); grunt.registerTask('default', ['jshint', 'cssmin', 'uglify', 'copy']); grunt.registerTask('test', ['jshint']); grunt.registerTask('build-release', ['default', 'zip']); - }; \ No newline at end of file diff --git a/README.md b/README.md index 3367ab535529f7ac7e67d2c00a68f9a0c72c9482..96f8e60315481b8dc11d6d03b0af9df982b798f2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# XBackBone 📤 [](https://travis-ci.org/SergiX44/XBackBone) +# XBackBone 📤 [](https://travis-ci.org/SergiX44/XBackBone) [](http://bit.ly/XBackBoneDonate) XBackBone is a simple, self-hosted, lightweight PHP backend for the instant sharing tool ShareX. It supports uploading and displaying images, GIF, video, code, formatted text, and file downloading and uploading. Also have a web UI with multi user management and past uploads history. ## Features @@ -105,48 +105,10 @@ The script requires `xclip`, `curl`, and `notify-send`. *Note: XXX is the username of your XBackBone account.* -## Notes +## Web server configuration notes If you do not use Apache, or the Apache `.htaccess` is not enabled, set your web server so that the `static/` folder is the only one accessible from the outside, otherwise even private uploads and logs will be accessible! -The NGINX configuration should be something like this: -``` -# nginx configuration - -location /app { - return 403; -} - -location /bin { - return 403; -} - -location /bootstrap { - return 403; -} - -location /resources { - return 403; -} -location /storage { - return 403; -} - -location /vendor { - return 403; -} - -location /logs { - return 403; -} - -autoindex off; - -location / { - if (!-e $request_filename){ - rewrite ^(.*)$ /index.php break; - } -} -``` +You can find an example configuration nginx.conf in the project repository. ## Screenshots
diff --git a/app/Controllers/UploadController.php b/app/Controllers/UploadController.php
index b331854fd139cea193e1c99a7bf21fe8448fd341..8b103083a42724ba4e89100dc5e2312690d4f351 100644
--- a/app/Controllers/UploadController.php
+++ b/app/Controllers/UploadController.php
@@ -24,7 +24,10 @@ class UploadController extends Controller
public function upload(Request $request, Response $response): Response
{
- $json = ['message' => null];
+ $json = [
+ 'message' => null,
+ 'version' => PLATFORM_VERSION
+ ];
if ($this->settings['maintenance'] && !$this->database->query('SELECT `id`, `is_admin` FROM `users` WHERE `id` = ? LIMIT 1', [$this->session->get('user_id')])->fetch()->is_admin) {
$json['message'] = 'Endpoint under maintenance.';
diff --git a/nginx.conf b/nginx.conf
new file mode 100644
index 0000000000000000000000000000000000000000..0b4ff1fd90350ae77a4fd6d2d9331d9a0905cea3
--- /dev/null
+++ b/nginx.conf
@@ -0,0 +1,43 @@
+autoindex off;
+
+location /app {
+ return 403;
+}
+
+location /bin {
+ return 403;
+}
+
+location /bootstrap {
+ return 403;
+}
+
+location /resources {
+ return 403;
+}
+
+location /storage {
+ return 403;
+}
+
+location /vendor {
+ return 403;
+}
+
+location /logs {
+ return 403;
+}
+
+location / {
+ try_files $uri /index.php$is_args$args;
+}
+
+location ~ \.php {
+ try_files $uri =404;
+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param SCRIPT_NAME $fastcgi_script_name;
+ fastcgi_index index.php;
+ fastcgi_pass 127.0.0.1:9000;
+}
\ No newline at end of file
diff --git a/resources/templates/auth/login.twig b/resources/templates/auth/login.twig
index 437fa1c0208212d173dd42a9c4618f1512685255..f1c5481ff099a6189f63a5fe2d5319817ec538cd 100644
--- a/resources/templates/auth/login.twig
+++ b/resources/templates/auth/login.twig
@@ -49,5 +49,4 @@
- {% include 'comp/footer.twig' %}
{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/base.twig b/resources/templates/base.twig
index 831a6885e3fc97bb7bc3fb9a449b247a35b7b0cb..84c9888ef50f5cf681ad8318535d73ffdf57956d 100644
--- a/resources/templates/base.twig
+++ b/resources/templates/base.twig
@@ -9,7 +9,7 @@
-
+
@@ -22,5 +22,11 @@