diff --git a/src/lib/components/furniture/Header.svelte b/src/lib/components/furniture/Header.svelte
index 9927da8..5421038 100644
--- a/src/lib/components/furniture/Header.svelte
+++ b/src/lib/components/furniture/Header.svelte
@@ -1,6 +1,6 @@
{#snippet validationMessages(errors: string[], warnings: string[])}
@@ -515,6 +560,55 @@
{/if}
+
+ {#if standalone}
+
+
Syncing Settings and Backup/Restore
+
+ Your settings are saved in your browser's local storage, and so they will be retained even after you quit the
+ app.
+
+
+ Since we don't require login/signup to use the app, there is currently no way to automatically sync your
+ settings across devices. But if you're self-hosting Networking Toolbox, you can apply settings in your config,
+ by including the following environment variables. This way, you're settings will be applied to all users across
+ all devices.
+
+
(showExportSettings = !showExportSettings)}
+ aria-expanded={showExportSettings}
+ >
+
+ Export Settings
+
+ {#if showExportSettings}
+
+
+
+ Current environment variable values. Copy and paste into your config file for self-hosted instances.
+
+
+
{envVarsString}
+
+
+
+ {envVarsCopied ? 'Copied!' : 'Copy to Clipboard'}
+
+
+ {/if}
+
+ {/if}
+
{#if !standalone}
@@ -595,6 +689,14 @@
&.info-more-section {
grid-column: span 2;
}
+ &.saving-section {
+ grid-column: 1/-1;
+ .line-1 {
+ color: var(--text-tertiary);
+ font-size: var(--font-size-md);
+ font-style: italic;
+ }
+ }
.theme-option {
flex-direction: column;
@@ -611,6 +713,17 @@
grid-column: span 1;
}
}
+ @media (max-width: 990px) {
+ &.site-branding-section {
+ grid-column: span 1;
+ }
+ &.delete-section {
+ grid-column: 1 / -1;
+ }
+ &.info-more-section {
+ grid-column: 1 / -1;
+ }
+ }
}
.theme-options {
@@ -990,8 +1103,8 @@
}
.show-more-btn {
- width: 100%;
- margin-top: var(--spacing-sm);
+ max-width: 16rem;
+ margin: var(--spacing-sm) auto;
justify-content: center;
&[aria-expanded='true'] {
@@ -1187,6 +1300,8 @@
background: var(--color-primary);
color: var(--bg-primary);
border-color: var(--color-primary);
+ float: right;
+ width: fit-content !important;
&:hover {
background: color-mix(in srgb, var(--color-primary), black 10%);
@@ -1358,6 +1473,62 @@
}
}
+ .saving-section {
+ .show-more-btn {
+ margin-top: var(--spacing-md);
+ }
+
+ .env-vars-section {
+ margin-top: var(--spacing-md);
+ padding-top: var(--spacing-md);
+ border-top: 1px solid var(--border-primary);
+
+ .env-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: var(--spacing-sm);
+
+ h4 {
+ margin: 0;
+ font-size: var(--font-size-md);
+ font-weight: 600;
+ color: var(--text-primary);
+ }
+ }
+
+ .section-description {
+ font-size: var(--font-size-sm);
+ color: var(--text-secondary);
+ margin: 0 0 var(--spacing-md) 0;
+ }
+
+ .env-block {
+ width: 100%;
+ padding: var(--spacing-md);
+ background: var(--bg-tertiary);
+ border: 1px solid var(--border-primary);
+ border-radius: var(--radius-sm);
+ margin-bottom: var(--spacing-md);
+ overflow-x: auto;
+
+ code {
+ font-family: 'Courier New', monospace;
+ font-size: var(--font-size-sm);
+ color: var(--text-primary);
+ line-height: 1.6;
+ white-space: pre;
+ padding: 0;
+ }
+ }
+
+ .action-btn {
+ width: 100%;
+ justify-content: center;
+ }
+ }
+ }
+
@keyframes slideIn {
from {
opacity: 0;
diff --git a/src/lib/config/customizable-settings.ts b/src/lib/config/customizable-settings.ts
index 71ba72d..f27a7f1 100644
--- a/src/lib/config/customizable-settings.ts
+++ b/src/lib/config/customizable-settings.ts
@@ -102,3 +102,48 @@ export const BLOCK_PRIVATE_DNS_IPS = env.NTB_BLOCK_PRIVATE_DNS_IPS !== 'false';
export const ALLOWED_DNS_SERVERS = env.NTB_ALLOWED_DNS_SERVERS
? env.NTB_ALLOWED_DNS_SERVERS.split(',').map((ip) => ip.trim())
: DEFAULT_TRUSTED_DNS_SERVERS;
+
+/**
+ * Get user settings list with values prioritized as:
+ * 1. User-set value from localStorage
+ * 2. Environment variable value
+ * 3. Empty string
+ */
+export function getUserSettingsList(): Array<{ name: string; value: string }> {
+ if (!browser) return [];
+
+ const getLocalStorageValue = (key: string): string | null => {
+ try {
+ return localStorage.getItem(key);
+ } catch {
+ return null;
+ }
+ };
+
+ const getUserCustomValue = (key: keyof typeof userCustom): string => {
+ return userCustom?.[key] || '';
+ };
+
+ // Read actual user preferences from localStorage
+ const userTheme = getLocalStorageValue('theme');
+ const userFontScale = getLocalStorageValue('font-scale');
+ const userHomepageLayout = getLocalStorageValue('homepage-layout');
+ const userNavbarDisplay = getLocalStorageValue('navbar-display');
+ const userPrimaryColor = getLocalStorageValue('user-primary-color');
+
+ return [
+ { name: 'NTB_SITE_TITLE', value: getUserCustomValue('title') || env.NTB_SITE_TITLE || '' },
+ { name: 'NTB_SITE_DESCRIPTION', value: getUserCustomValue('description') || env.NTB_SITE_DESCRIPTION || '' },
+ { name: 'NTB_SITE_ICON', value: getUserCustomValue('iconUrl') || env.NTB_SITE_ICON || '' },
+ { name: 'NTB_HOMEPAGE_LAYOUT', value: userHomepageLayout || env.NTB_HOMEPAGE_LAYOUT || '' },
+ { name: 'NTB_NAVBAR_DISPLAY', value: userNavbarDisplay || env.NTB_NAVBAR_DISPLAY || '' },
+ { name: 'NTB_DEFAULT_THEME', value: userTheme || env.NTB_DEFAULT_THEME || '' },
+ { name: 'NTB_DEFAULT_LANGUAGE', value: env.NTB_DEFAULT_LANGUAGE || '' },
+ { name: 'NTB_PRIMARY_COLOR', value: userPrimaryColor || env.NTB_PRIMARY_COLOR || '' },
+ { name: 'NTB_FONT_SCALE', value: userFontScale || env.NTB_FONT_SCALE || '' },
+ { name: 'NTB_SHOW_TIPS_ON_HOMEPAGE', value: env.NTB_SHOW_TIPS_ON_HOMEPAGE || '' },
+ { name: 'NTB_ALLOW_CUSTOM_DNS', value: env.NTB_ALLOW_CUSTOM_DNS || '' },
+ { name: 'NTB_BLOCK_PRIVATE_DNS_IPS', value: env.NTB_BLOCK_PRIVATE_DNS_IPS || '' },
+ { name: 'NTB_ALLOWED_DNS_SERVERS', value: env.NTB_ALLOWED_DNS_SERVERS || '' },
+ ];
+}
diff --git a/src/lib/constants/site.ts b/src/lib/constants/site.ts
index 2ba1d2d..abae4da 100644
--- a/src/lib/constants/site.ts
+++ b/src/lib/constants/site.ts
@@ -3,7 +3,7 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '$lib/config/customizable-settings'
export const site = {
name: SITE_TITLE || 'Networking Toolbox',
title: SITE_TITLE || 'Networking Toolbox',
- description: 'A free set of online tools to help with IP addressing and subnetting.',
+ description: SITE_DESCRIPTION || 'A free set of online tools to help with IP addressing and subnetting.',
longDescription:
'Comprehensive IP address calculator with subnet calculations, CIDR conversion, IP format conversion, and network reference tools.',
heroDescription: SITE_DESCRIPTION || 'Your companion for all-things networking',
diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte
index e70f6aa..e16db86 100644
--- a/src/routes/about/+page.svelte
+++ b/src/routes/about/+page.svelte
@@ -24,14 +24,15 @@
diff --git a/src/styles/pages.scss b/src/styles/pages.scss
index a11cf2f..07a1aa5 100644
--- a/src/styles/pages.scss
+++ b/src/styles/pages.scss
@@ -106,7 +106,7 @@
display: flex;
align-items: center;
gap: var(--spacing-sm);
- margin-bottom: var(--spacing-lg);
+ margin: var(--spacing-lg) 0 var(--spacing-md) 0;
svg {
color: var(--color-primary);
}