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 📤 [![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 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 @@ {% 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 03293f3973cbaedba179c07f7041ff67bd14a8af..0000000000000000000000000000000000000000 --- 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 083177965a5aaf96725cc0a94993b0a9d2a42571..b3468b16119e75901945cfda711e292d18453981 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 9b490c297c1b7ac95d4d718d6237ee666e82be04..936bee8bfcffd27af5ad8e484fdb6bb8fbce808e 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 c887ab73b592d78640b60f65bb30660d76e864fe..94b655a2e707fa17d02596e95ce6d14e9d1f3cb0 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 9612913a6b89fa0cb243af76e4ddc5b20121a477..b246f3201692eef124e3e6b76c703a1bdb8711ea 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 514cac8327cc7c6ffe2429a9d35324cd9613bf3e..74ffab1fd7df9fecaec3d92a27dd3c65a59efd17 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 80dc5de76f509cb40d6ecc508013456bea44a673..7bbd974a63d76e1cde6908b8b1fd499b4ba5ee60 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 a02456b8834aab3de09bb9515573c47e32f4da4c..2d18f88fbd39e61491a175299f18a3dbae41bdab 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 7c43ad56ffeeef6af99810adda94b31bc01a8f17..e6fbeaff4260eacb777000aecc1b43970f16f379 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 77e005bb3df38abc638dfeaf86a0a082de9d42fe..b0be519dc42934b29cd80839656179888502bf1b 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 69ddb1f73b6128f55486569fd58ff81ee330c8ba..cccff9b41bcc8310268ae948f8ab1e67232f2d0d 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 5e2e52e66c080242824692979601ecc13cb73a2f..0c2064fa1956e7711b161f6720d182d60bca398e 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 600c5e31d12a063703d2e73945ef08c975d84ecf..2b0e0b48848526cf9c14495cb0b7c251293de3fb 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 () {