@@ -219,7 +219,6 @@ class UserController extends Controller
return redirect($response, route('user.index'));
}
-
/**
* @param Request $request
* @param Response $response
@@ -33,8 +33,8 @@ if (isset($argv[1]) && $argv[1] === '--install') {
$db->query("INSERT INTO `users` (`email`, `username`, `password`, `is_admin`, `user_code`) VALUES ('admin@example.com', 'admin', ?, 1, ?)", [password_hash('admin', PASSWORD_DEFAULT), humanRandomString(5)]);
-if (file_exists(__DIR__.'/../install')) {
- removeDirectory(__DIR__.'/../install');
+if (file_exists(__DIR__.'/../install') && (!isset($config['debug']) || !$config['debug'])) {
+ //removeDirectory(__DIR__.'/../install');
echo 'If you are upgrading from a previous version, please run a "php bin\clean".'.PHP_EOL;
@@ -230,7 +230,9 @@ $app->post('/', function (Request $request, Response $response, Filesystem $stor
cleanDirectory(__DIR__.'/../resources/cache');
cleanDirectory(__DIR__.'/../resources/sessions');
+ if (!isset($config['debug']) || !$config['debug']) {
+ removeDirectory(__DIR__.'/../install');
+ }
// Installed successfully, destroy the installer session
$session->destroy();
@@ -0,0 +1,18 @@
+CREATE TABLE IF NOT EXISTS `tags` (
+ `id` INTEGER PRIMARY KEY AUTO_INCREMENT,
+ `name` VARCHAR(32) NOT NULL,
+ `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ INDEX (`name`)
+);
+
+CREATE TABLE IF NOT EXISTS `uploads_tags` (
+ `upload_id` INTEGER,
+ `tag_id` INTEGER,
+ PRIMARY KEY (`upload_id`, `tag_id`),
+ FOREIGN KEY (`upload_id`) REFERENCES `uploads` (`id`)
+ ON UPDATE CASCADE
+ ON DELETE CASCADE,
+ FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`)
+ ON DELETE CASCADE
@@ -0,0 +1,20 @@
+ `id` INTEGER PRIMARY KEY AUTOINCREMENT,
+ `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+CREATE UNIQUE INDEX IF NOT EXISTS `tag_name`
+ ON `tags` (`name`);
@@ -40,7 +40,7 @@
<i class="far {{ mime2font(media.mimetype) }} fa-2x"></i>
{% endif %}
</td>
- <td>{{ media.filename }}</td>
+ <td><span class="text-maxlen">{{ media.filename }}</span></td>
<td>{{ media.size }}</td>
<td id="published_{{ media.id }}">
{% if media.published %}
@@ -130,3 +130,16 @@ body {
.grecaptcha-badge {
top: 5px !important;
+.text-maxlen {
+ display: inline-block;
+ max-width: 330px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.text-maxlen:hover {
+ overflow: auto;
+ text-overflow: unset;