diff --git a/app/App/HomeController.php b/app/App/HomeController.php index 116f5c8a4..0585e0af5 100644 --- a/app/App/HomeController.php +++ b/app/App/HomeController.php @@ -9,7 +9,6 @@ use BookStack\Entities\Queries\QueryRecentlyViewed; use BookStack\Entities\Queries\QueryTopFavourites; use BookStack\Entities\Tools\PageContent; use BookStack\Http\Controller; -use BookStack\Uploads\FaviconHandler; use BookStack\Util\SimpleListOptions; use Illuminate\Http\Request; @@ -112,48 +111,4 @@ class HomeController extends Controller return view('home.default', $commonData); } - - /** - * Show the view for /robots.txt. - */ - public function robots() - { - $sitePublic = setting('app-public', false); - $allowRobots = config('app.allow_robots'); - - if ($allowRobots === null) { - $allowRobots = $sitePublic; - } - - return response() - ->view('misc.robots', ['allowRobots' => $allowRobots]) - ->header('Content-Type', 'text/plain'); - } - - /** - * Show the route for 404 responses. - */ - public function notFound() - { - return response()->view('errors.404', [], 404); - } - - /** - * Serve the application favicon. - * Ensures a 'favicon.ico' file exists at the web root location (if writable) to be served - * directly by the webserver in the future. - */ - public function favicon(FaviconHandler $favicons) - { - $exists = $favicons->restoreOriginalIfNotExists(); - return response()->file($exists ? $favicons->getPath() : $favicons->getOriginalPath()); - } - - /** - * Serve a PWA application manifest. - */ - public function pwaManifest(PwaManifestBuilder $manifestBuilder) - { - return response()->json($manifestBuilder->build()); - } } diff --git a/app/App/MetaController.php b/app/App/MetaController.php new file mode 100644 index 000000000..3d3a8d2c8 --- /dev/null +++ b/app/App/MetaController.php @@ -0,0 +1,67 @@ +view('misc.robots', ['allowRobots' => $allowRobots]) + ->header('Content-Type', 'text/plain'); + } + + /** + * Show the route for 404 responses. + */ + public function notFound() + { + return response()->view('errors.404', [], 404); + } + + /** + * Serve the application favicon. + * Ensures a 'favicon.ico' file exists at the web root location (if writable) to be served + * directly by the webserver in the future. + */ + public function favicon(FaviconHandler $favicons) + { + $exists = $favicons->restoreOriginalIfNotExists(); + return response()->file($exists ? $favicons->getPath() : $favicons->getOriginalPath()); + } + + /** + * Serve a PWA application manifest. + */ + public function pwaManifest(PwaManifestBuilder $manifestBuilder) + { + return response()->json($manifestBuilder->build()); + } + + /** + * Show license information for the application. + */ + public function licenses() + { + $this->setPageTitle('Licenses'); + + return view('help.licenses', [ + 'license' => file_get_contents(base_path('LICENSE')), + 'phpLibData' => file_get_contents(base_path('dev/licensing/php-library-licenses.txt')), + 'jsLibData' => file_get_contents(base_path('dev/licensing/js-library-licenses.txt')), + ]); + } +} diff --git a/resources/views/help/licenses.blade.php b/resources/views/help/licenses.blade.php new file mode 100644 index 000000000..a87d9e958 --- /dev/null +++ b/resources/views/help/licenses.blade.php @@ -0,0 +1,64 @@ +@extends('layouts.simple') + +@section('body') + +
+ This page details license information for BookStack in addition to the projects & libraries that are used within BookStack. + Many projects listed may only be used in a development context. +
+ + +BookStack® is a UK registered trade mark of Daniel Brown.
+