diff --git a/CHANGELOG.md b/CHANGELOG.md
index ef0f4fc..c455c4f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Added
+
+- The admin dashboard shows the installed SealShare version, with links to its release notes, the SealShare website and noNameWEB.
+
### Fixed
- Docker installs updated from 2.0 answered every upload with "409 Conflict". The example `docker-compose.yml` mounted the SQLite volume over all of `/app/database`, which hid the image's new migration, so it never ran. The container now adds the migrations the volume is missing before migrating, so existing compose files keep working.
diff --git a/app/Livewire/Admin/AdminDashboard.php b/app/Livewire/Admin/AdminDashboard.php
index af0e804..aa5d15d 100644
--- a/app/Livewire/Admin/AdminDashboard.php
+++ b/app/Livewire/Admin/AdminDashboard.php
@@ -77,6 +77,7 @@ class AdminDashboard extends Component
'totalFiles' => ShareFile::query()->whereHas('share', fn ($query) => $query->whereNotNull('completed_at'))->count(),
'usedSpace' => $shareService->getTotalUsedSpace(),
'maxQuota' => $shareService->getMaxStorageQuota(),
+ 'version' => config('app.version'),
]);
}
}
diff --git a/config/app.php b/config/app.php
index ba7f372..aa7fb98 100644
--- a/config/app.php
+++ b/config/app.php
@@ -15,6 +15,19 @@ return [
'name' => env('APP_NAME', 'SealShare'),
+ /*
+ |--------------------------------------------------------------------------
+ | SealShare Version
+ |--------------------------------------------------------------------------
+ |
+ | The release this code is, shown on the admin dashboard. Bump it together
+ | with the release's heading in CHANGELOG.md: tests/Feature/AppVersionTest
+ | fails while the two differ.
+ |
+ */
+
+ 'version' => '2.1.0',
+
/*
|--------------------------------------------------------------------------
| Application Environment
diff --git a/resources/views/livewire/admin/admin-dashboard.blade.php b/resources/views/livewire/admin/admin-dashboard.blade.php
index 5d9ac91..2f780e6 100644
--- a/resources/views/livewire/admin/admin-dashboard.blade.php
+++ b/resources/views/livewire/admin/admin-dashboard.blade.php
@@ -63,6 +63,14 @@
+ {{-- Page chrome, not content, so a quiet line instead of a card: the installed version, its release notes and who makes SealShare. --}}
+
+
{{ __('Are you sure you want to delete this share?') }}
diff --git a/tests/Feature/Admin/AdminDashboardTest.php b/tests/Feature/Admin/AdminDashboardTest.php
index ae19b7f..c8fa545 100644
--- a/tests/Feature/Admin/AdminDashboardTest.php
+++ b/tests/Feature/Admin/AdminDashboardTest.php
@@ -44,6 +44,18 @@ test('admin dashboard shows stats', function () {
$response->assertSee('Disk Usage');
});
+test('admin dashboard shows the installed version with its release notes and links to the website and noNameWEB', function () {
+ $admin = User::query()->where('is_admin', true)->first();
+ config(['app.version' => '9.8.7']);
+
+ $response = $this->actingAs($admin)->get(route('admin.dashboard'));
+
+ $response->assertSee('SealShare 9.8.7');
+ $response->assertSee('href="https://gitea.nonameweb.ch/noNameWEB/SealShare/releases/tag/v9.8.7"', false);
+ $response->assertSee('href="https://sealshare.nonameweb.ch"', false);
+ $response->assertSee('href="https://nonameweb.ch"', false);
+});
+
test('admin can delete share', function () {
Storage::fake('shares');
diff --git a/tests/Feature/AppVersionTest.php b/tests/Feature/AppVersionTest.php
new file mode 100644
index 0000000..937a663
--- /dev/null
+++ b/tests/Feature/AppVersionTest.php
@@ -0,0 +1,12 @@
+toBe($release[1]);
+});