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 📤 [](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 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 @@