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
@@ -27,6 +27,9 @@ final class DemoData
|
||||
/** The share the desktop upload creates, so its link and QR code read the same on every run. */
|
||||
public const CREATED_TOKEN = 'Tf8gH2jK4mN6pQ3r';
|
||||
|
||||
/** The share holding only a private text, shown on the phone once the recipient asks for it. */
|
||||
public const TEXT_TOKEN = 'Vx9bN4mQ7kR2tW5s';
|
||||
|
||||
public static function admin(): User
|
||||
{
|
||||
return User::factory()->admin()->create([
|
||||
@@ -36,8 +39,8 @@ final class DemoData
|
||||
}
|
||||
|
||||
/**
|
||||
* Eight shares of different ages, sizes and states: one expired, two password-protected, some
|
||||
* with a download limit, some never expiring.
|
||||
* Nine shares of different ages, sizes and states: one expired, two password-protected, some
|
||||
* with a download limit, some never expiring, and one holding only a private text.
|
||||
*/
|
||||
public static function shares(): void
|
||||
{
|
||||
@@ -58,6 +61,8 @@ final class DemoData
|
||||
'files' => ['Onboarding/Welcome.pdf' => 520, 'Onboarding/Handbook.pdf' => 2900, 'Onboarding/IT checklist.docx' => 130]],
|
||||
['token' => 'Ae6fG7hJ8kL9mN1p', 'daysAgo' => 40, 'expiresAfterDays' => 10, 'downloads' => 12, 'options' => [],
|
||||
'files' => ['Event photos.zip' => 15700]],
|
||||
['token' => self::TEXT_TOKEN, 'daysAgo' => 3, 'expiresAfterDays' => 7, 'downloads' => 0, 'options' => ['max_downloads' => 1],
|
||||
'files' => [], 'text' => "Guest Wi-Fi for the workshop\n\nNetwork: Harbour-Guest\nPassword: maple-lantern-8127\n\nIt works in meeting rooms 2 and 3."],
|
||||
];
|
||||
|
||||
foreach ($shares as $share) {
|
||||
@@ -69,7 +74,7 @@ final class DemoData
|
||||
* @param array{password?: string, max_downloads?: int} $options
|
||||
* @param array<string, int> $files relative path => size in kilobytes
|
||||
*/
|
||||
private static function share(string $token, int $daysAgo, ?int $expiresAfterDays, int $downloads, array $options, array $files): void
|
||||
private static function share(string $token, int $daysAgo, ?int $expiresAfterDays, int $downloads, array $options, array $files, ?string $text = null): void
|
||||
{
|
||||
$createdAt = Carbon::now()->subDays($daysAgo)->subHours(2);
|
||||
|
||||
@@ -82,6 +87,7 @@ final class DemoData
|
||||
'relativePath' => str_contains($path, '/') ? $path : null,
|
||||
])->values()->all(),
|
||||
[...$options, 'expires_at' => $expiresAfterDays === null ? null : $createdAt->copy()->addDays($expiresAfterDays)],
|
||||
$text,
|
||||
);
|
||||
} finally {
|
||||
Str::createRandomStringsNormally();
|
||||
|
||||
Reference in New Issue
Block a user