diff --git a/CHANGELOG.md b/CHANGELOG.md index 28168ac..d030e0e 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 235aabf..926736a 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 3367ab5..96f8e60 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# XBackBone 📤 [![Build Status](https://travis-ci.org/SergiX44/XBackBone.svg?branch=master)](https://travis-ci.org/SergiX44/XBackBone) +# XBackBone 📤 [![Build Status](https://travis-ci.org/SergiX44/XBackBone.svg?branch=master)](https://travis-ci.org/SergiX44/XBackBone) [![Donations](https://i.imgur.com/bAqVIw8.png?2)](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 b331854..8b10308 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 0000000..0b4ff1f --- /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 437fa1c..f1c5481 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 831a688..84c9888 100644 --- a/resources/templates/base.twig +++ b/resources/templates/base.twig @@ -9,7 +9,7 @@ - + @@ -22,5 +22,11 @@ {% block content %}{% endblock %} +{% block footer %} +

+{% endblock %} diff --git a/resources/templates/comp/footer.twig b/resources/templates/comp/footer.twig deleted file mode 100644 index 03293f3..0000000 --- a/resources/templates/comp/footer.twig +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/resources/templates/comp/navbar.twig b/resources/templates/comp/navbar.twig index 0831779..b3468b1 100644 --- a/resources/templates/comp/navbar.twig +++ b/resources/templates/comp/navbar.twig @@ -7,18 +7,18 @@ - {% include 'comp/footer.twig' %} {% endblock %} \ No newline at end of file diff --git a/resources/templates/dashboard/home.twig b/resources/templates/dashboard/home.twig index 9b490c2..936bee8 100644 --- a/resources/templates/dashboard/home.twig +++ b/resources/templates/dashboard/home.twig @@ -59,5 +59,4 @@
{{ lang('no_media') }}
{% endif %} - {% include 'comp/footer.twig' %} {% endblock %} \ No newline at end of file diff --git a/resources/templates/dashboard/system.twig b/resources/templates/dashboard/system.twig index c887ab7..94b655a 100644 --- a/resources/templates/dashboard/system.twig +++ b/resources/templates/dashboard/system.twig @@ -113,5 +113,4 @@ - {% include 'comp/footer.twig' %} {% endblock %} \ No newline at end of file diff --git a/resources/templates/errors/403.twig b/resources/templates/errors/403.twig index 9612913..b246f32 100644 --- a/resources/templates/errors/403.twig +++ b/resources/templates/errors/403.twig @@ -9,4 +9,6 @@

Access denied to the requested resource.

-{% endblock %} \ No newline at end of file +{% endblock %} + +{% block footer %}{% endblock %} \ No newline at end of file diff --git a/resources/templates/errors/404.twig b/resources/templates/errors/404.twig index 514cac8..74ffab1 100644 --- a/resources/templates/errors/404.twig +++ b/resources/templates/errors/404.twig @@ -12,4 +12,5 @@ -{% endblock %} \ No newline at end of file +{% endblock %} +{% block footer %}{% endblock %} \ No newline at end of file diff --git a/resources/templates/errors/500.twig b/resources/templates/errors/500.twig index 80dc5de..7bbd974 100644 --- a/resources/templates/errors/500.twig +++ b/resources/templates/errors/500.twig @@ -26,4 +26,5 @@ {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} +{% block footer %}{% endblock %} \ No newline at end of file diff --git a/resources/templates/upload/public.twig b/resources/templates/upload/public.twig index a02456b..2d18f88 100644 --- a/resources/templates/upload/public.twig +++ b/resources/templates/upload/public.twig @@ -100,5 +100,4 @@ - {% include 'comp/footer.twig' %} {% endblock %} \ No newline at end of file diff --git a/resources/templates/user/create.twig b/resources/templates/user/create.twig index 7c43ad5..e6fbeaf 100644 --- a/resources/templates/user/create.twig +++ b/resources/templates/user/create.twig @@ -65,5 +65,4 @@ - {% include 'comp/footer.twig' %} {% endblock %} \ No newline at end of file diff --git a/resources/templates/user/edit.twig b/resources/templates/user/edit.twig index 77e005b..b0be519 100644 --- a/resources/templates/user/edit.twig +++ b/resources/templates/user/edit.twig @@ -94,5 +94,4 @@ - {% include 'comp/footer.twig' %} {% endblock %} \ No newline at end of file diff --git a/resources/templates/user/index.twig b/resources/templates/user/index.twig index 69ddb1f..cccff9b 100644 --- a/resources/templates/user/index.twig +++ b/resources/templates/user/index.twig @@ -87,5 +87,4 @@ - {% include 'comp/footer.twig' %} {% endblock %} \ No newline at end of file diff --git a/src/css/app.css b/src/css/app.css index 5e2e52e..0c2064f 100644 --- a/src/css/app.css +++ b/src/css/app.css @@ -82,8 +82,18 @@ body { text-align: right; } -.media-player { - width: 80%; - margin-right: auto; - margin-left: auto; +@media (min-width: 576px) { + .media-player { + width: 100%; + margin-right: auto; + margin-left: auto; + } +} + +@media (min-width: 768px) { + .media-player { + width: 77%; + margin-right: auto; + margin-left: auto; + } } \ No newline at end of file diff --git a/src/js/app.js b/src/js/app.js index 600c5e3..2b0e0b4 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -22,6 +22,8 @@ var app = { }); } + $('.footer').fadeIn(600); + console.log('Application is ready.'); }, modalDelete: function () {