Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Update admin first login message (#1181)

Leendert de Borstb6e7a2e77a3d
diff --git a/apps/server/AliasVault.Admin/Auth/Pages/Login.razor b/apps/server/AliasVault.Admin/Auth/Pages/Login.razor
index 7f3754cf8..3853a9afc 100644
--- a/apps/server/AliasVault.Admin/Auth/Pages/Login.razor
+++ b/apps/server/AliasVault.Admin/Auth/Pages/Login.razor
@@ -1,4 +1,5 @@
@page "/user/login"
+@using AliasVault.RazorComponents.Alerts
@using AliasVault.Shared.Models.Enums
<LayoutPageTitle>Log in</LayoutPageTitle>
@@ -11,29 +12,14 @@
@if (!IsAdminConfigured)
{
- <div class="mt-8 p-6 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg">
- <div class="flex items-start">
- <div class="flex-shrink-0">
- <svg class="w-5 h-5 text-yellow-600 dark:text-yellow-400" fill="currentColor" viewBox="0 0 20 20">
- <path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
- </svg>
- </div>
- <div class="ml-3">
- <h3 class="text-sm font-medium text-yellow-800 dark:text-yellow-200">
- Admin User Not Configured
- </h3>
- <div class="mt-2 text-sm text-yellow-700 dark:text-yellow-300">
- <p class="mb-3">The admin user has not been configured yet. To set up admin access:</p>
- <ol class="list-decimal list-inside space-y-1 mb-3">
- <li>Connect to your Docker container: <code class="bg-yellow-100 dark:bg-yellow-800 px-1 py-0.5 rounded text-xs">docker exec -it [container-name] /bin/bash</code></li>
- <li>Run the password reset script: <code class="bg-yellow-100 dark:bg-yellow-800 px-1 py-0.5 rounded text-xs">reset-admin-password.sh</code></li>
- <li>Restart the container to apply changes: <code class="bg-yellow-100 dark:bg-yellow-800 px-1 py-0.5 rounded text-xs">docker restart [container-name]</code></li>
- </ol>
- <p class="text-xs">Replace <code class="bg-yellow-100 dark:bg-yellow-800 px-1 py-0.5 rounded">[container-name]</code> with your actual container name, e.g. "aliasvault".</p>
- </div>
- </div>
- </div>
- </div>
+ <MessageInfo Title="Admin User Not Configured">
+ The admin user has not been configured yet. To set up admin access:
+ <ol class="list-decimal list-inside space-y-1 mb-3">
+ <li>Connect to your Docker container: <code class="bg-orange-300 px-1 py-0.5 rounded text-xs">$ docker compose exec -it aliasvault /bin/bash</code></li>
+ <li>Run the password reset script: <code class="bg-orange-300 px-1 py-0.5 rounded text-xs">$ aliasvault reset-admin-password</code></li>
+ <li>Restart the container to apply changes: <code class="bg-orange-300 px-1 py-0.5 rounded text-xs">$ docker compose restart</code></li>
+ </ol>
+ </MessageInfo>
}
else
{
diff --git a/apps/server/AliasVault.Admin/StartupTasks.cs b/apps/server/AliasVault.Admin/StartupTasks.cs
index ec77361d0..af727672d 100644
--- a/apps/server/AliasVault.Admin/StartupTasks.cs
+++ b/apps/server/AliasVault.Admin/StartupTasks.cs
@@ -48,7 +48,7 @@ public static class StartupTasks
if (string.IsNullOrEmpty(config.AdminPasswordHash))
{
Console.WriteLine("Admin password hash not configured - skipping admin user creation.");
- Console.WriteLine("Run 'reset-admin-password.sh' to configure the admin password.");
+ Console.WriteLine("Run '$ aliasvault reset-admin-password' to configure the admin password.");
return;
}
diff --git a/apps/server/AliasVault.Admin/wwwroot/css/tailwind.css b/apps/server/AliasVault.Admin/wwwroot/css/tailwind.css
index 4ecd3328d..932c15ea6 100644
--- a/apps/server/AliasVault.Admin/wwwroot/css/tailwind.css
+++ b/apps/server/AliasVault.Admin/wwwroot/css/tailwind.css
@@ -665,10 +665,6 @@ video {
z-index: 1000;
}
-.col-span-2 {
- grid-column: span 2 / span 2;
-}
-
.col-span-full {
grid-column: 1 / -1;
}
@@ -1080,10 +1076,6 @@ video {
gap: 1.5rem;
}
-.gap-8 {
- gap: 2rem;
-}
-
.space-x-1 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(0.25rem * var(--tw-space-x-reverse));
@@ -1370,6 +1362,11 @@ video {
background-color: rgb(21 128 61 / var(--tw-bg-opacity));
}
+.bg-orange-100 {
+ --tw-bg-opacity: 1;
+ background-color: rgb(255 237 213 / var(--tw-bg-opacity));
+}
+
.bg-orange-400 {
--tw-bg-opacity: 1;
background-color: rgb(251 146 60 / var(--tw-bg-opacity));
@@ -1450,10 +1447,29 @@ video {
background-color: rgb(234 179 8 / var(--tw-bg-opacity));
}
+.bg-yellow-400 {
+ --tw-bg-opacity: 1;
+ background-color: rgb(250 204 21 / var(--tw-bg-opacity));
+}
+
+.bg-orange-200 {
+ --tw-bg-opacity: 1;
+ background-color: rgb(254 215 170 / var(--tw-bg-opacity));
+}
+
+.bg-orange-300 {
+ --tw-bg-opacity: 1;
+ background-color: rgb(253 186 116 / var(--tw-bg-opacity));
+}
+
.bg-opacity-50 {
--tw-bg-opacity: 0.5;
}
+.fill-current {
+ fill: currentColor;
+}
+
.fill-primary-600 {
fill: #d68338;
}
@@ -1774,11 +1790,21 @@ video {
color: rgb(22 101 52 / var(--tw-text-opacity));
}
+.text-orange-500 {
+ --tw-text-opacity: 1;
+ color: rgb(249 115 22 / var(--tw-text-opacity));
+}
+
.text-orange-600 {
--tw-text-opacity: 1;
color: rgb(234 88 12 / var(--tw-text-opacity));
}
+.text-orange-700 {
+ --tw-text-opacity: 1;
+ color: rgb(194 65 12 / var(--tw-text-opacity));
+}
+
.text-primary-600 {
--tw-text-opacity: 1;
color: rgb(214 131 56 / var(--tw-text-opacity));
@@ -2255,6 +2281,16 @@ video {
background-color: rgb(113 63 18 / 0.2);
}
+.dark\:bg-yellow-400:is(.dark *) {
+ --tw-bg-opacity: 1;
+ background-color: rgb(250 204 21 / var(--tw-bg-opacity));
+}
+
+.dark\:bg-orange-300:is(.dark *) {
+ --tw-bg-opacity: 1;
+ background-color: rgb(253 186 116 / var(--tw-bg-opacity));
+}
+
.dark\:bg-opacity-80:is(.dark *) {
--tw-bg-opacity: 0.8;
}
@@ -2359,11 +2395,6 @@ video {
color: rgb(254 240 138 / var(--tw-text-opacity));
}
-.dark\:text-yellow-300:is(.dark *) {
- --tw-text-opacity: 1;
- color: rgb(253 224 71 / var(--tw-text-opacity));
-}
-
.dark\:text-yellow-400:is(.dark *) {
--tw-text-opacity: 1;
color: rgb(250 204 21 / var(--tw-text-opacity));
@@ -2519,18 +2550,10 @@ video {
margin-right: 0.5rem;
}
- .sm\:inline {
- display: inline;
- }
-
.sm\:flex {
display: flex;
}
- .sm\:hidden {
- display: none;
- }
-
.sm\:w-auto {
width: auto;
}
@@ -2609,18 +2632,10 @@ video {
margin-right: 1.5rem;
}
- .md\:ml-2 {
- margin-left: 0.5rem;
- }
-
.md\:block {
display: block;
}
- .md\:inline-block {
- display: inline-block;
- }
-
.md\:inline {
display: inline;
}
@@ -2653,10 +2668,6 @@ video {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
- .md\:grid-cols-4 {
- grid-template-columns: repeat(4, minmax(0, 1fr));
- }
-
.md\:flex-row {
flex-direction: row;
}
diff --git a/apps/server/AliasVault.Client/Auth/Pages/Start.razor b/apps/server/AliasVault.Client/Auth/Pages/Start.razor
index 75b220d3b..4ebccb32f 100644
--- a/apps/server/AliasVault.Client/Auth/Pages/Start.razor
+++ b/apps/server/AliasVault.Client/Auth/Pages/Start.razor
@@ -32,19 +32,9 @@
</p>
@if (_isHttpWarning)
{
- <div class="bg-orange-100 border-l-4 border-orange-500 text-orange-700 p-4 mb-6" role="alert">
- <div class="flex">
- <div class="py-1">
- <svg class="fill-current h-6 w-6 text-orange-500 mr-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
- <path d="M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM9 11V9h2v6H9v-4zm0-6h2v2H9V5z"/>
- </svg>
- </div>
- <div>
- <p class="font-bold">@Localizer["HttpsWarningTitle"]</p>
- <p class="text-sm">@Localizer["HttpsWarningMessage"]</p>
- </div>
- </div>
- </div>
+ <MessageInfo Title="@Localizer["HttpsWarningTitle"]">
+ @Localizer["HttpsWarningMessage"]
+ </MessageInfo>
}
<div class="space-y-4">
@if (Config.PublicRegistrationEnabled)
diff --git a/apps/server/Shared/AliasVault.RazorComponents/Alerts/MessageInfo.razor b/apps/server/Shared/AliasVault.RazorComponents/Alerts/MessageInfo.razor
new file mode 100644
index 000000000..e1d1c1a11
--- /dev/null
+++ b/apps/server/Shared/AliasVault.RazorComponents/Alerts/MessageInfo.razor
@@ -0,0 +1,35 @@
+@inherits ComponentBase
+
+@if (ChildContent != null)
+{
+ <div class="bg-orange-100 border-l-4 border-orange-500 text-orange-700 p-4 mb-6" role="alert">
+ <div class="flex">
+ <div class="py-1">
+ <svg class="fill-current h-6 w-6 text-orange-500 mr-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
+ <path d="M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM9 11V9h2v6H9v-4zm0-6h2v2H9V5z"/>
+ </svg>
+ </div>
+ <div>
+ @if (!string.IsNullOrEmpty(Title))
+ {
+ <p class="font-bold">@Title</p>
+ }
+ <div class="text-sm">@ChildContent</div>
+ </div>
+ </div>
+ </div>
+}
+
+@code {
+ /// <summary>
+ /// Gets or sets the title to display.
+ /// </summary>
+ [Parameter]
+ public string? Title { get; set; }
+
+ /// <summary>
+ /// Gets or sets the child content to display.
+ /// </summary>
+ [Parameter]
+ public RenderFragment? ChildContent { get; set; }
+}