Skip to content

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

Add deployment mode markers (#2243)

Leendert de Borstbd208f7d5123
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 3a5805028..235191ea7 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -509,6 +509,9 @@ jobs:
context: .
file: dockerfiles/all-in-one/Dockerfile
platforms: linux/amd64,linux/arm64/v8
+ # Mark this as the official published image (local builds default to "aio-build").
+ build-args: |
+ DEPLOYMENT_MODE=aio
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
diff --git a/apps/server/AliasVault.Client/Config.cs b/apps/server/AliasVault.Client/Config.cs
index 27ec22789..936566501 100644
--- a/apps/server/AliasVault.Client/Config.cs
+++ b/apps/server/AliasVault.Client/Config.cs
@@ -79,4 +79,11 @@ public class Config
/// "Recently Deleted" trash before being permanently pruned.
/// </summary>
public int TrashRetentionDays { get; set; } = 30;
+
+ /// <summary>
+ /// Gets or sets how this AliasVault instance was deployed (e.g. "install", "build", "aio").
+ /// Injected into appsettings.json at container startup and shown in the footer to make it
+ /// easy to tell deployments apart. Empty when unknown (e.g. local development).
+ /// </summary>
+ public string DeploymentMode { get; set; } = string.Empty;
}
diff --git a/apps/server/AliasVault.Client/Main/Layout/Footer.razor b/apps/server/AliasVault.Client/Main/Layout/Footer.razor
index fba77ae86..d346be6aa 100644
--- a/apps/server/AliasVault.Client/Main/Layout/Footer.razor
+++ b/apps/server/AliasVault.Client/Main/Layout/Footer.razor
@@ -1,5 +1,6 @@
@inject NavigationManager NavigationManager
@inject IStringLocalizerFactory LocalizerFactory
+@inject Config Config
@using AliasVault.Shared.Core
@using Microsoft.Extensions.Localization
@implements IDisposable
@@ -8,7 +9,8 @@
<div class="container mx-auto px-4 py-4">
<div class="flex flex-col lg:flex-row justify-between items-center">
<p class="text-sm text-center text-gray-500 mb-4 lg:mb-0">
- © @(DateTime.Now.Year) <span>@AppInfo.ApplicationName v@(AppInfo.GetFullVersion())</span>. @Localizer["CopyrightText"]
+ © @(DateTime.Now.Year) <span>@AppInfo.ApplicationName v@(AppInfo.GetFullVersion())</span>@if (!string.IsNullOrEmpty(Config.DeploymentMode))
+ {<text> <span class="text-gray-400 dark:text-gray-600">(@Config.DeploymentMode)</span></text>}. @Localizer["CopyrightText"]
</p>
<div class="hidden lg:block text-center text-gray-400 text-sm">@_randomQuote</div>
</div>
diff --git a/apps/server/AliasVault.Client/Main/Layout/FooterLogin.razor b/apps/server/AliasVault.Client/Main/Layout/FooterLogin.razor
index cbabcde4c..d5f4656c1 100644
--- a/apps/server/AliasVault.Client/Main/Layout/FooterLogin.razor
+++ b/apps/server/AliasVault.Client/Main/Layout/FooterLogin.razor
@@ -1,11 +1,13 @@
@inject IStringLocalizerFactory LocalizerFactory
+@inject Config Config
@using AliasVault.Shared.Core
@using Microsoft.Extensions.Localization
<footer class="fixed -z-10 bottom-0 left-0 right-0 dark:bg-gray-900">
<div class="container mx-auto px-4 py-4">
<p class="text-sm text-center text-gray-400 dark:text-gray-500 mb-4 lg:mb-0">
- © @(DateTime.Now.Year) <span>@AppInfo.ApplicationName v@(AppInfo.GetFullVersion())</span>. @Localizer["CopyrightText"]
+ © @(DateTime.Now.Year) <span>@AppInfo.ApplicationName v@(AppInfo.GetFullVersion())</span>@if (!string.IsNullOrEmpty(Config.DeploymentMode))
+ {<text> <span class="text-gray-400 dark:text-gray-600">(@Config.DeploymentMode)</span></text>}. @Localizer["CopyrightText"]
</p>
</div>
</footer>
diff --git a/apps/server/AliasVault.Client/entrypoint.sh b/apps/server/AliasVault.Client/entrypoint.sh
index 9bd6bd324..718807570 100755
--- a/apps/server/AliasVault.Client/entrypoint.sh
+++ b/apps/server/AliasVault.Client/entrypoint.sh
@@ -68,5 +68,14 @@ fi
# Update public registration enabled in appsettings.json
sed -i "s|\"PublicRegistrationEnabled\": \".*\"|\"PublicRegistrationEnabled\": \"$PUBLIC_REGISTRATION_ENABLED\"|g" /usr/share/nginx/html/appsettings.json
+# Update deployment mode (install / build / aio) so the footer can show how this
+# instance was deployed. Comes from .env via install.sh; defaults to empty.
+DEPLOYMENT_MODE=${DEPLOYMENT_MODE:-}
+if grep -q "DeploymentMode" /usr/share/nginx/html/appsettings.json; then
+ sed -i "s|\"DeploymentMode\": \".*\"|\"DeploymentMode\": \"$DEPLOYMENT_MODE\"|g" /usr/share/nginx/html/appsettings.json
+else
+ sed -i "s|\"PublicRegistrationEnabled\": \"$PUBLIC_REGISTRATION_ENABLED\"|\"PublicRegistrationEnabled\": \"$PUBLIC_REGISTRATION_ENABLED\",\n \"DeploymentMode\": \"$DEPLOYMENT_MODE\"|g" /usr/share/nginx/html/appsettings.json
+fi
+
# Start the application
nginx -g "daemon off;"
diff --git a/apps/server/AliasVault.Client/wwwroot/appsettings.json b/apps/server/AliasVault.Client/wwwroot/appsettings.json
index ad62722be..39b9960eb 100644
--- a/apps/server/AliasVault.Client/wwwroot/appsettings.json
+++ b/apps/server/AliasVault.Client/wwwroot/appsettings.json
@@ -3,5 +3,6 @@
"PrivateEmailDomains": ["example.tld", "example2.tld", "aliasvault.net", "disabled.tld"],
"HiddenPrivateEmailDomains": ["disabled.tld"],
"SupportEmail": "[email protected]",
- "PublicRegistrationEnabled": "true"
+ "PublicRegistrationEnabled": "true",
+ "DeploymentMode": ""
}
diff --git a/apps/server/AliasVault.Client/wwwroot/css/tailwind.css b/apps/server/AliasVault.Client/wwwroot/css/tailwind.css
index 65be67da4..d1f54dcd6 100644
--- a/apps/server/AliasVault.Client/wwwroot/css/tailwind.css
+++ b/apps/server/AliasVault.Client/wwwroot/css/tailwind.css
@@ -2345,6 +2345,10 @@ video {
padding-top: 4rem;
}
+.pt-2 {
+ padding-top: 0.5rem;
+}
+
.pt-4 {
padding-top: 1rem;
}
@@ -2361,10 +2365,6 @@ video {
padding-top: 2rem;
}
-.pt-2 {
- padding-top: 0.5rem;
-}
-
.text-left {
text-align: left;
}
@@ -2684,11 +2684,6 @@ video {
color: rgb(133 77 14 / var(--tw-text-opacity));
}
-.text-amber-500 {
- --tw-text-opacity: 1;
- color: rgb(245 158 11 / var(--tw-text-opacity));
-}
-
.underline {
text-decoration-line: underline;
}
diff --git a/apps/server/entrypoint.sh b/apps/server/entrypoint.sh
index 24153373e..081e9cb3f 100644
--- a/apps/server/entrypoint.sh
+++ b/apps/server/entrypoint.sh
@@ -14,11 +14,12 @@ else
cp /etc/nginx/nginx-443.conf /etc/nginx/nginx.conf
fi
-# Substitute MAX_UPLOAD_SIZE placeholder in the active nginx config.
-# Default to 100MB when unset (suitable for all-in-one images without explicit config).
MAX_UPLOAD_SIZE_MB_VALUE="${MAX_UPLOAD_SIZE_MB:-100}"
sed -i "s|__MAX_UPLOAD_SIZE__|${MAX_UPLOAD_SIZE_MB_VALUE}|g" /etc/nginx/nginx.conf
+DEPLOYMENT_MODE_VALUE="${DEPLOYMENT_MODE:-unknown}"
+sed -i "s|__DEPLOYMENT_MODE__|${DEPLOYMENT_MODE_VALUE}|g" /etc/nginx/nginx.conf
+
# Build the geo-block rules for the /admin IP allowlist from ADMIN_IP_ALLOWLIST.
# Empty -> "default 0;" (everyone allowed). "private" -> default-deny with
# loopback + RFC1918 carved out. Anything else is treated as a comma-separated
diff --git a/apps/server/nginx-443.conf b/apps/server/nginx-443.conf
index 4c036dcc0..f3a6bdeb2 100644
--- a/apps/server/nginx-443.conf
+++ b/apps/server/nginx-443.conf
@@ -84,6 +84,9 @@ http {
add_header Cross-Origin-Resource-Policy "same-origin" always;
add_header Content-Security-Policy "frame-ancestors 'self'" always;
+ # Deployment type marker (install / build / aio) for observability
+ add_header X-AliasVault-Deployment "__DEPLOYMENT_MODE__" always;
+
# Root for static files
root /usr/share/nginx/html;
diff --git a/apps/server/nginx-80-443.conf b/apps/server/nginx-80-443.conf
index b1713ede9..622f58bbc 100644
--- a/apps/server/nginx-80-443.conf
+++ b/apps/server/nginx-80-443.conf
@@ -65,6 +65,9 @@ http {
add_header Cross-Origin-Resource-Policy "same-origin" always;
add_header Content-Security-Policy "frame-ancestors 'self'" always;
+ # Deployment type marker (install / build / aio) for observability
+ add_header X-AliasVault-Deployment "__DEPLOYMENT_MODE__" always;
+
# Root for static files
root /usr/share/nginx/html;
diff --git a/dockerfiles/all-in-one/Dockerfile b/dockerfiles/all-in-one/Dockerfile
index f272f9472..d55f9e6fc 100644
--- a/dockerfiles/all-in-one/Dockerfile
+++ b/dockerfiles/all-in-one/Dockerfile
@@ -210,8 +210,14 @@ RUN cp -r /app/installcli /usr/local/bin/aliasvault-cli && \
# Remove InstallCLI from /app since we copied it to /usr/local/bin
rm -rf /app/installcli
+# Deployment type marker shown in the web app footer and the X-AliasVault-Deployment
+# response header (for observability / troubleshooting). Defaults to "aio-build",
+# the official release pipeline overrides it to "aio" via --build-arg DEPLOYMENT_MODE=aio.
+ARG DEPLOYMENT_MODE=aio-build
+
# Set environment variables
-ENV ALIASVAULT_VERBOSITY=0 \
+ENV DEPLOYMENT_MODE=${DEPLOYMENT_MODE} \
+ ALIASVAULT_VERBOSITY=0 \
PUBLIC_REGISTRATION_ENABLED=true \
IP_LOGGING_ENABLED=true \
SUPPORT_EMAIL="" \
diff --git a/dockerfiles/all-in-one/config/nginx-443.conf b/dockerfiles/all-in-one/config/nginx-443.conf
index 3a11ce6dc..e71a36e9b 100644
--- a/dockerfiles/all-in-one/config/nginx-443.conf
+++ b/dockerfiles/all-in-one/config/nginx-443.conf
@@ -73,6 +73,9 @@ http {
add_header Cross-Origin-Resource-Policy "same-origin" always;
add_header Content-Security-Policy "frame-ancestors 'self'" always;
+ # Deployment type marker (install / build / aio) for observability
+ add_header X-AliasVault-Deployment "__DEPLOYMENT_MODE__" always;
+
# Root for static files
root /usr/share/nginx/html;
diff --git a/dockerfiles/all-in-one/config/nginx-80-443.conf b/dockerfiles/all-in-one/config/nginx-80-443.conf
index 576d43109..82f1108ee 100644
--- a/dockerfiles/all-in-one/config/nginx-80-443.conf
+++ b/dockerfiles/all-in-one/config/nginx-80-443.conf
@@ -60,6 +60,9 @@ http {
add_header Cross-Origin-Resource-Policy "same-origin" always;
add_header Content-Security-Policy "frame-ancestors 'self'" always;
+ # Deployment type marker (install / build / aio) for observability
+ add_header X-AliasVault-Deployment "__DEPLOYMENT_MODE__" always;
+
# Root for static files
root /usr/share/nginx/html;
@@ -168,6 +171,9 @@ http {
add_header Cross-Origin-Resource-Policy "same-origin" always;
add_header Content-Security-Policy "frame-ancestors 'self'" always;
+ # Deployment type marker (install / build / aio) for observability
+ add_header X-AliasVault-Deployment "__DEPLOYMENT_MODE__" always;
+
# Root for static files
root /usr/share/nginx/html;
diff --git a/dockerfiles/all-in-one/s6-scripts/client/run b/dockerfiles/all-in-one/s6-scripts/client/run
index a6f5b5e18..54597fdfa 100644
--- a/dockerfiles/all-in-one/s6-scripts/client/run
+++ b/dockerfiles/all-in-one/s6-scripts/client/run
@@ -74,7 +74,8 @@ cat > /app/client/wwwroot/appsettings.json << EOF
"PrivateEmailDomains": $json_array,
"HiddenPrivateEmailDomains": $hidden_json_array,
"SupportEmail": "$SUPPORT_EMAIL",
- "PublicRegistrationEnabled": "$PUBLIC_REGISTRATION_ENABLED"
+ "PublicRegistrationEnabled": "$PUBLIC_REGISTRATION_ENABLED",
+ "DeploymentMode": "${DEPLOYMENT_MODE:-aio-build}"
}
EOF
diff --git a/dockerfiles/all-in-one/s6-scripts/nginx/run b/dockerfiles/all-in-one/s6-scripts/nginx/run
index 9cf396171..bde6b2f48 100644
--- a/dockerfiles/all-in-one/s6-scripts/nginx/run
+++ b/dockerfiles/all-in-one/s6-scripts/nginx/run
@@ -83,6 +83,9 @@ build_admin_ip_geo_rules() {
MAX_UPLOAD_SIZE_MB_VALUE="${MAX_UPLOAD_SIZE_MB:-100}"
sed -i "s|__MAX_UPLOAD_SIZE__|${MAX_UPLOAD_SIZE_MB_VALUE}|g" /etc/nginx/nginx.conf
+DEPLOYMENT_MODE_VALUE="${DEPLOYMENT_MODE:-unknown}"
+sed -i "s|__DEPLOYMENT_MODE__|${DEPLOYMENT_MODE_VALUE}|g" /etc/nginx/nginx.conf
+
ADMIN_IP_GEO_RULES_VALUE=$(build_admin_ip_geo_rules)
sed -i "s|__ADMIN_IP_GEO_RULES__|${ADMIN_IP_GEO_RULES_VALUE}|g" /etc/nginx/nginx.conf
diff --git a/install.sh b/install.sh
index 85a0f156f..c9874a96d 100755
--- a/install.sh
+++ b/install.sh
@@ -1271,7 +1271,7 @@ generate_admin_password() {
PASSWORD=$(openssl rand -base64 12)
# Build locally if in build mode or if pre-built image is not available
- if grep -q "^DEPLOYMENT_MODE=build" "$ENV_FILE" 2>/dev/null || ! docker pull ${GITHUB_CONTAINER_REGISTRY}/installcli:latest > /dev/null 2>&1; then
+ if grep -qE "^DEPLOYMENT_MODE=(install-build|build)" "$ENV_FILE" 2>/dev/null || ! docker pull ${GITHUB_CONTAINER_REGISTRY}/installcli:latest > /dev/null 2>&1; then
log_info "Building InstallCli locally..."
if [ "$VERBOSE" = true ]; then
if ! docker build -t installcli -f apps/server/Utilities/AliasVault.InstallCli/Dockerfile .; then
@@ -1859,7 +1859,7 @@ get_docker_compose_command() {
local base_command="docker compose -f docker-compose.yml"
# Check if using build configuration
- if grep -q "^DEPLOYMENT_MODE=build" "$ENV_FILE" 2>/dev/null; then
+ if grep -qE "^DEPLOYMENT_MODE=(install-build|build)" "$ENV_FILE" 2>/dev/null; then
base_command="$base_command -f dockerfiles/docker-compose.build.yml"
fi
@@ -2000,8 +2000,8 @@ handle_install() {
handle_build() {
printf "\n${YELLOW}+++ Building AliasVault from source +++${NC}\n"
- # Set deployment mode to build to ensure container lifecycle uses build configuration
- set_deployment_mode "build"
+ # Set deployment mode to install-build to ensure container lifecycle uses build configuration
+ set_deployment_mode "install-build"
# Initialize workspace which makes sure all required directories and files exist
initialize_workspace
@@ -2867,7 +2867,7 @@ handle_install_version() {
# Function to set deployment mode in .env
set_deployment_mode() {
local mode=$1
- if [ "$mode" != "build" ] && [ "$mode" != "install" ]; then
+ if [ "$mode" != "install-build" ] && [ "$mode" != "install" ]; then
printf "${RED}Invalid deployment mode: $mode${NC}\n"
exit 1
fi