Fixed installed bad path check
This commit is contained in:
parent
42883417e8
commit
111f220629
11 changed files with 28 additions and 23 deletions
|
@ -1,5 +1,6 @@
|
||||||
## v2.6.1
|
## v2.6.1
|
||||||
+ Fixed bad redirects on the web installer (#62).
|
+ Fixed bad redirects on the web installer (#62).
|
||||||
|
+ Fixed login page with dark themes.
|
||||||
+ Improved shell commands.
|
+ Improved shell commands.
|
||||||
+ Added alert if required extensions are not loaded.
|
+ Added alert if required extensions are not loaded.
|
||||||
+ Updated translations.
|
+ Updated translations.
|
||||||
|
|
|
@ -38,7 +38,7 @@ class ThemeController extends Controller
|
||||||
return redirect($response, 'system')
|
return redirect($response, 'system')
|
||||||
->withAddedHeader('Cache-Control', 'no-cache, no-store, must-revalidate')
|
->withAddedHeader('Cache-Control', 'no-cache, no-store, must-revalidate')
|
||||||
->withAddedHeader('Pragma', 'no-cache')
|
->withAddedHeader('Pragma', 'no-cache')
|
||||||
->withAddedHeader('Expire', '0');
|
->withAddedHeader('Expire', 'Mon, 26 Jul 1997 05:00:00 GMT');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
(PHP_MAJOR_VERSION >= 7 && PHP_MINOR_VERSION >= 1) ?: die('Sorry, PHP 7.1 or above is required to run XBackBone.');
|
||||||
if (php_sapi_name() !== 'cli') {
|
if (php_sapi_name() !== 'cli') {
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
(PHP_MAJOR_VERSION >= 7 && PHP_MINOR_VERSION >= 1) ?: die('Sorry, PHP 7.1 or above is required to run XBackBone.');
|
||||||
if (php_sapi_name() !== 'cli') {
|
if (php_sapi_name() !== 'cli') {
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
(PHP_MAJOR_VERSION >= 7 && PHP_MINOR_VERSION >= 1) ?: die('Sorry, PHP 7.1 or above is required to run XBackBone.');
|
||||||
if (php_sapi_name() !== 'cli') {
|
if (php_sapi_name() !== 'cli') {
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "sergix44/xbackbone",
|
"name": "sergix44/xbackbone",
|
||||||
"version": "2.6",
|
"version": "2.6.1",
|
||||||
"description": "A lightweight ShareX PHP backend",
|
"description": "A lightweight ShareX PHP backend",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"require": {
|
"require": {
|
||||||
|
|
|
@ -202,7 +202,10 @@ $app->get('/', function (Request $request, Response $response) {
|
||||||
|
|
||||||
$installed = file_exists(__DIR__ . '/../config.php');
|
$installed = file_exists(__DIR__ . '/../config.php');
|
||||||
|
|
||||||
return $this->view->render($response, 'install.twig', ['installed' => $installed]);
|
return $this->view->render($response, 'install.twig', [
|
||||||
|
'installed' => $installed,
|
||||||
|
'default_local' => realpath(__DIR__ . '/../') . DIRECTORY_SEPARATOR . 'storage',
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
$app->post('/', function (Request $request, Response $response) use (&$config) {
|
$app->post('/', function (Request $request, Response $response) use (&$config) {
|
||||||
|
@ -255,17 +258,18 @@ $app->post('/', function (Request $request, Response $response) use (&$config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the storage is valid
|
// check if the storage is valid
|
||||||
|
$storageTestFile = 'storage_test.xbackbone.txt';
|
||||||
try {
|
try {
|
||||||
try {
|
try {
|
||||||
$success = $this->storage->write('storage_test.xbackbone.txt', 'XBACKBONE_TEST_FILE');
|
$success = $this->storage->write($storageTestFile, 'XBACKBONE_TEST_FILE');
|
||||||
} catch (FileExistsException $fileExistsException) {
|
} catch (FileExistsException $fileExistsException) {
|
||||||
$success = $this->storage->update('storage_test.xbackbone.txt', 'XBACKBONE_TEST_FILE');
|
$success = $this->storage->update($storageTestFile, 'XBACKBONE_TEST_FILE');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$success) {
|
if (!$success) {
|
||||||
throw new Exception('The storage is not writable.');
|
throw new Exception('The storage is not writable.');
|
||||||
}
|
}
|
||||||
$this->storage->readAndDelete('test.install.txt');
|
$this->storage->readAndDelete($storageTestFile);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->session->alert("Storage setup error: {$e->getMessage()} [{$e->getCode()}]", 'danger');
|
$this->session->alert("Storage setup error: {$e->getMessage()} [{$e->getCode()}]", 'danger');
|
||||||
return redirect($response, '/install');
|
return redirect($response, '/install');
|
||||||
|
@ -323,7 +327,7 @@ $app->post('/', function (Request $request, Response $response) use (&$config) {
|
||||||
|
|
||||||
// Installed successfully, destroy the installer session
|
// Installed successfully, destroy the installer session
|
||||||
session_destroy();
|
session_destroy();
|
||||||
return redirect($response, '../?afterInstall=true');
|
return redirect($response, '/../?afterInstall=true');
|
||||||
});
|
});
|
||||||
|
|
||||||
$app->run();
|
$app->run();
|
|
@ -80,7 +80,7 @@
|
||||||
<div class="form-group row hook-storage">
|
<div class="form-group row hook-storage">
|
||||||
<label for="storage_path" class="col-sm-3 col-form-label">Storage path root</label>
|
<label for="storage_path" class="col-sm-3 col-form-label">Storage path root</label>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<input type="text" class="form-control hook-storage-input" id="storage_path" name="storage_path" autocomplete="off">
|
<input type="text" class="form-control hook-storage-input" id="storage_path" name="storage_path" autocomplete="off" data-default-local="{{ default_local }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row hook-storage">
|
<div class="form-group row hook-storage">
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
-webkit-box-pack: center;
|
-webkit-box-pack: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding-bottom: 40px;
|
padding-bottom: 40px;
|
||||||
background-color: #f5f5f5;
|
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title>{% block title %}Default{% endblock %} | {{ config.app_name }}</title>
|
<title>{% block title %}Default{% endblock %} | {{ config.app_name }}</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="description" content="XBackBone is a simple and lightweight PHP backend for ShareX">
|
<meta name="description" content="XBackBone File Manager">
|
||||||
<link rel="shortcut icon" href="{{ urlFor('/favicon.ico') }}" type="image/x-icon">
|
<link rel="shortcut icon" href="{{ urlFor('/favicon.ico') }}" type="image/x-icon">
|
||||||
<link rel="icon" href="{{ urlFor('/favicon.ico') }}" type="image/x-icon">
|
<link rel="icon" href="{{ urlFor('/favicon.ico') }}" type="image/x-icon">
|
||||||
<link rel="preload" href="{{ urlFor('/static/bootstrap/css/bootstrap.min.css') }}" as="style">
|
<link rel="preload" href="{{ urlFor('/static/bootstrap/css/bootstrap.min.css') }}" as="style">
|
||||||
|
@ -17,14 +17,6 @@
|
||||||
<link href="{{ urlFor('/static/highlightjs/styles/monokai.css') }}" rel="stylesheet">
|
<link href="{{ urlFor('/static/highlightjs/styles/monokai.css') }}" rel="stylesheet">
|
||||||
<link href="{{ urlFor('/static/videojs/video-js.min.css') }}" rel="stylesheet">
|
<link href="{{ urlFor('/static/videojs/video-js.min.css') }}" rel="stylesheet">
|
||||||
<link href="{{ urlFor('/static/app/app.css') }}" rel="stylesheet">
|
<link href="{{ urlFor('/static/app/app.css') }}" rel="stylesheet">
|
||||||
<script src="{{ urlFor('/static/jquery/jquery.min.js') }}"></script>
|
|
||||||
<script src="{{ urlFor('/static/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
|
|
||||||
<script src="{{ urlFor('/static/fontawesome/js/all.min.js') }}"></script>
|
|
||||||
<script src="{{ urlFor('/static/highlightjs/highlight.pack.min.js') }}"></script>
|
|
||||||
<script src="{{ urlFor('/static/clipboardjs/clipboard.min.js') }}"></script>
|
|
||||||
<script src="{{ urlFor('/static/videojs/video.min.js') }}"></script>
|
|
||||||
<script src="{{ urlFor('/static/app/app.js') }}"></script>
|
|
||||||
<script>hljs.initHighlightingOnLoad();</script>
|
|
||||||
<script>window.AppConfig = {'base_url': '{{ config.base_url }}', 'lang': {'publish': '{{ lang('publish') }}', 'hide': '{{ lang('hide') }}'}}</script>
|
<script>window.AppConfig = {'base_url': '{{ config.base_url }}', 'lang': {'publish': '{{ lang('publish') }}', 'hide': '{{ lang('hide') }}'}}</script>
|
||||||
{% block head %}{% endblock %}
|
{% block head %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
|
@ -33,8 +25,17 @@
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
<div class="container-fluid footer" style="display: none; font-size: 0.8rem">
|
<div class="container-fluid footer" style="display: none; font-size: 0.8rem">
|
||||||
<div class="text-muted">Proudly powered by <a href="https://github.com/SergiX44/XBackBone">XBackBone{% if session.admin %} v{{ PLATFORM_VERSION }}{% endif %}</a>
|
<div class="text-muted">Proudly powered by <a href="https://github.com/SergiX44/XBackBone">XBackBone{% if session.admin %} v{{ PLATFORM_VERSION }}{% endif %}</a>
|
||||||
— <i class="fas fa-fw fa-balance-scale"></i> AGPL v3.0</div>
|
— <i class="fas fa-fw fa-balance-scale"></i> AGPL v3.0
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
<script src="{{ urlFor('/static/jquery/jquery.min.js') }}"></script>
|
||||||
|
<script src="{{ urlFor('/static/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
|
||||||
|
<script src="{{ urlFor('/static/fontawesome/js/all.min.js') }}"></script>
|
||||||
|
<script src="{{ urlFor('/static/highlightjs/highlight.pack.min.js') }}"></script>
|
||||||
|
<script src="{{ urlFor('/static/clipboardjs/clipboard.min.js') }}"></script>
|
||||||
|
<script src="{{ urlFor('/static/videojs/video.min.js') }}"></script>
|
||||||
|
<script src="{{ urlFor('/static/app/app.js') }}"></script>
|
||||||
|
<script>hljs.initHighlightingOnLoad();</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -27,7 +27,7 @@ $(document).ready(function () {
|
||||||
$all_storage_inputs.prop('required', '');
|
$all_storage_inputs.prop('required', '');
|
||||||
switch ($(this).val()) {
|
switch ($(this).val()) {
|
||||||
case 'local':
|
case 'local':
|
||||||
$('#storage_path').val('./storage').prop('required', 'required').parent().parent().show();
|
$('#storage_path').val($('#storage_path').data('default-local')).prop('required', 'required').parent().parent().show();
|
||||||
break;
|
break;
|
||||||
case 'ftp':
|
case 'ftp':
|
||||||
$('#storage_path').val('/storage').prop('required', 'required').parent().parent().show();
|
$('#storage_path').val('/storage').prop('required', 'required').parent().parent().show();
|
||||||
|
|
Loading…
Reference in a new issue