Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Add support email to .env to show in client application (#353)
Leendert de Borstec84792034ca
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex a916e43ad..e2dfc848b 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -81,6 +81,7 @@ Here is an example file with the various options explained:{"ApiUrl": "http://localhost:5092","PrivateEmailDomains": ["example.tld"],+ "SupportEmail": "[email protected]","UseDebugEncryptionKey": "true","CryptographyOverrideType" : "Argon2Id","CryptographyOverrideSettings" : "{\"DegreeOfParallelism\":1,\"MemorySize\":1024,\"Iterations\":1}"diff --git a/install.sh b/install.shindex eb9bc6566..955097506 100755--- a/install.sh+++ b/install.sh@@ -245,6 +245,30 @@ set_smtp_tls_enabled() {fi}+# Function to ask for support email+set_support_email() {+ printf "${CYAN}> Setting SUPPORT_EMAIL...${NC}\n"+ if ! grep -q "^SUPPORT_EMAIL=" "$ENV_FILE"; then+ printf "Please enter the support email address that users can contact for issues accessing their vault (press Enter to disable): "+ read -r support_email++ echo "SUPPORT_EMAIL=${support_email}" >> "$ENV_FILE"++ if [ -z "$support_email" ]; then+ printf "${GREEN}> SUPPORT_EMAIL has been left empty in $ENV_FILE.${NC}\n"+ else+ printf "${GREEN}> SUPPORT_EMAIL has been set to '${support_email}' in $ENV_FILE.${NC}\n"+ fi+ else+ support_email=$(grep "^SUPPORT_EMAIL=" "$ENV_FILE" | cut -d '=' -f2)+ if [ -z "$support_email" ]; then+ printf "${GREEN}> SUPPORT_EMAIL already exists in $ENV_FILE but is empty.${NC}\n"+ else+ printf "${GREEN}> SUPPORT_EMAIL already exists in $ENV_FILE with value: ${support_email}${NC}\n"+ fi+ fi+}+# Function to build and run the Docker Compose stack with muted output unless an error occurs, showing progress indicationbuild_and_run_docker_compose() {printf "${CYAN}> Building Docker Compose stack..."@@ -340,6 +364,7 @@ main() {populate_data_protection_cert_pass || exit $?set_private_email_domains || exit $?set_smtp_tls_enabled || exit $?+ set_support_email || exit $?generate_admin_password || exit $?printf "\n${YELLOW}+++ Building Docker containers +++${NC}\n"printf "\n"diff --git a/src/AliasVault.Client/Auth/Pages/ForgotPassword.razor b/src/AliasVault.Client/Auth/Pages/ForgotPassword.razorindex f7df4611a..ae72f2e46 100644--- a/src/AliasVault.Client/Auth/Pages/ForgotPassword.razor+++ b/src/AliasVault.Client/Auth/Pages/ForgotPassword.razor@@ -1,6 +1,7 @@@page "/user/forgot-password"@attribute [AllowAnonymous]@layout Auth.Layout.MainLayout+@inject Config Config<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-2">Lost password@@ -14,7 +15,14 @@</p><div><h3 class="font-medium mb-2 text-gray-900 dark:text-white">Recently changed password</h3>- If you've recently changed your password and are experiencing difficulties signing in with your new password, please note that the server administrator may be able to recover an earlier backup of your vault to assist you.- If this is the case, please contact the server administrator.+ @if (!string.IsNullOrEmpty(Config.SupportEmail))+ {+ <p>If you've recently changed your password and are experiencing difficulties signing in, please contact support at <a href="mailto:@Config.SupportEmail" class="text-blue-600 hover:underline">@Config.SupportEmail</a> for assistance.</p>+ }+ else+ {+ <p>If you've recently changed your password and are experiencing difficulties signing in with your new password, please note that the server administrator may be able to recover an earlier backup of your vault to assist you.+ If this is the case, please contact the server administrator.</p>+ }</div></div>diff --git a/src/AliasVault.Client/Config.cs b/src/AliasVault.Client/Config.csindex b8a057415..1295bd48e 100644--- a/src/AliasVault.Client/Config.cs+++ b/src/AliasVault.Client/Config.cs@@ -57,4 +57,9 @@ public class Config/// For Argon2Id, this includes DegreeOfParallelism, MemorySize, and Iterations./// </summary>public string? CryptographyOverrideSettings { get; set; }++ /// <summary>+ /// Gets or sets the support email address that users can contact for password recovery.+ /// </summary>+ public string? SupportEmail { get; set; }}diff --git a/src/AliasVault.Client/Dockerfile b/src/AliasVault.Client/Dockerfileindex 9c8c3e03f..5d91f479b 100644--- a/src/AliasVault.Client/Dockerfile+++ b/src/AliasVault.Client/Dockerfile@@ -3,6 +3,9 @@ WORKDIR /appFROM mcr.microsoft.com/dotnet/sdk:8.0 AS buildARG BUILD_CONFIGURATION=Release+# Add environment variable for opting out of telemetry which fixes+# "error MSB4166: Child node "8" exited prematurely." issues.+ENV DOTNET_CLI_TELEMETRY_OPTOUT=1WORKDIR /src# Install Python which is required by the WebAssembly toolsdiff --git a/src/AliasVault.Client/entrypoint.sh b/src/AliasVault.Client/entrypoint.shindex 234f20e04..6549e5ffb 100755--- a/src/AliasVault.Client/entrypoint.sh+++ b/src/AliasVault.Client/entrypoint.sh@@ -2,10 +2,12 @@# Set the default API URL for localhost debuggingDEFAULT_API_URL="http://localhost:81"DEFAULT_PRIVATE_EMAIL_DOMAINS="localmail.tld"+DEFAULT_SUPPORT_EMAIL=""# Use the provided API_URL environment variable if it exists, otherwise use the defaultAPI_URL=${API_URL:-$DEFAULT_API_URL}PRIVATE_EMAIL_DOMAINS=${PRIVATE_EMAIL_DOMAINS:-$DEFAULT_PRIVATE_EMAIL_DOMAINS}+SUPPORT_EMAIL=${SUPPORT_EMAIL:-$DEFAULT_SUPPORT_EMAIL}# Replace the default URL with the actual API URLsed -i "s|http://localhost:5092|${API_URL}|g" /usr/share/nginx/html/appsettings.json@@ -19,6 +21,12 @@ json_array=$(echo $PRIVATE_EMAIL_DOMAINS | awk '{split($0,a,","); printf "["; fo# Use sed to update the PrivateEmailDomains field in appsettings.jsonsed -i.bak "s|\"PrivateEmailDomains\": \[.*\]|\"PrivateEmailDomains\": $json_array|" /usr/share/nginx/html/appsettings.json+# Update support email in appsettings.json+if [ ! -z "$SUPPORT_EMAIL" ]; then+ sed -i "s|\"SupportEmail\": \".*\"|\"SupportEmail\": \"$SUPPORT_EMAIL\"|g" /usr/share/nginx/html/appsettings.json+else+ sed -i "s|\"SupportEmail\": \".*\"|\"SupportEmail\": \"\"|g" /usr/share/nginx/html/appsettings.json+fi+# Start the applicationnginx -g "daemon off;"-diff --git a/src/AliasVault.Client/wwwroot/appsettings.json b/src/AliasVault.Client/wwwroot/appsettings.jsonindex db97a6326..83bc6ece5 100644--- a/src/AliasVault.Client/wwwroot/appsettings.json+++ b/src/AliasVault.Client/wwwroot/appsettings.json@@ -1,4 +1,5 @@{"ApiUrl": "http://localhost:5092",- "PrivateEmailDomains": ["example.tld"]+ "PrivateEmailDomains": ["example.tld"],+ "SupportEmail": "[email protected]"}