Release 2.3.0
A share can now hold a private text (a password, a key, a short note) with its files or on its own. The upload page's new "Private text" card takes up to 100 KB; the browser encrypts the text and sends it through the same chunk pipeline as a file, flagged is_text on share_files, so it gets the share's password, expiry, download limit and cleanup. The recipient sees the text only after pressing "Show text", which counts as their download, so a messenger link preview cannot use up a share limited to one download. The text is left out of the file list, the ZIP and the file counts; the admin dashboard marks shares that hold one with "Text". The website gains a Private text feature card and a fifth phone screenshot; every screenshot is retaken. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
202813a1e6
commit
f9a7839ad3
@@ -25,6 +25,7 @@ class ShareFileFactory extends Factory
|
||||
'stored_path' => 'shares/'.fake()->uuid().'.enc',
|
||||
'file_size' => fake()->numberBetween(1024, 10485760),
|
||||
'mime_type' => 'text/plain',
|
||||
'is_text' => false,
|
||||
'uploaded_chunks' => 1,
|
||||
'completed_at' => now(),
|
||||
];
|
||||
@@ -41,4 +42,17 @@ class ShareFileFactory extends Factory
|
||||
'completed_at' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* A share's private text.
|
||||
*/
|
||||
public function text(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'original_name' => 'text.txt',
|
||||
'relative_path' => null,
|
||||
'file_size' => fake()->numberBetween(1, 1024),
|
||||
'is_text' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* A share's private text is stored as one of its files, encrypted like the others; this flag
|
||||
* keeps it out of the file list, the ZIP and the file counts.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('share_files', function (Blueprint $table) {
|
||||
$table->boolean('is_text')->default(false)->after('mime_type');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('share_files', function (Blueprint $table) {
|
||||
$table->dropColumn('is_text');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user