feat: base volume path setting

Add global base_volume_path to settings. Relative volume source
paths are automatically prepended with the base path at deploy
time. Absolute paths are used as-is. Configurable in Settings >
General.
This commit is contained in:
2026-03-28 15:21:37 +03:00
parent 62a9249abf
commit 1cfd23c431
6 changed files with 23 additions and 5 deletions
+1
View File
@@ -103,6 +103,7 @@ export interface Settings {
npm_password: string;
webhook_secret: string;
polling_interval: string;
base_volume_path: string;
updated_at: string;
}
+4 -1
View File
@@ -17,6 +17,7 @@
let network = $state('');
let subdomainPattern = $state('');
let pollingInterval = $state('');
let baseVolumePath = $state('');
let notificationUrl = $state('');
let errors = $state<Record<string, string>>({});
@@ -68,6 +69,7 @@
network = settings.network ?? '';
subdomainPattern = settings.subdomain_pattern ?? '';
pollingInterval = settings.polling_interval ?? '';
baseVolumePath = settings.base_volume_path ?? '';
notificationUrl = settings.notification_url ?? '';
} catch (err) {
toasts.error(err instanceof Error ? err.message : $t('settingsGeneral.loadFailed'));
@@ -90,7 +92,7 @@
await updateSettings({
domain: domain.trim(), server_ip: serverIp.trim(), network: network.trim(),
subdomain_pattern: subdomainPattern.trim(), polling_interval: pollingInterval.trim(),
notification_url: notificationUrl.trim()
base_volume_path: baseVolumePath.trim(), notification_url: notificationUrl.trim()
});
toasts.success($t('settingsGeneral.saved'));
} catch (err) {
@@ -139,6 +141,7 @@
<FormField label={$t('settingsGeneral.dockerNetwork')} name="network" bind:value={network} placeholder="staging-net" helpText={$t('settingsGeneral.dockerNetworkHelp')} />
<FormField label={$t('settingsGeneral.subdomainPattern')} name="subdomainPattern" bind:value={subdomainPattern} placeholder="stage-{'{stage}'}-{'{project}'}" helpText={$t('settingsGeneral.subdomainPatternHelp')} />
<FormField label={$t('settingsGeneral.pollingInterval')} name="pollingInterval" type="number" bind:value={pollingInterval} placeholder="60" error={errors.pollingInterval ?? ''} helpText={$t('settingsGeneral.pollingIntervalHelp')} />
<FormField label="Base Volume Path" name="baseVolumePath" bind:value={baseVolumePath} placeholder="/data" helpText="Prepended to relative volume sources (e.g., /data + my-app/uploads = /data/my-app/uploads)" />
<FormField label={$t('settingsGeneral.notificationUrl')} name="notificationUrl" bind:value={notificationUrl} placeholder="https://notify.example.com/webhook" error={errors.notificationUrl ?? ''} helpText={$t('settingsGeneral.notificationUrlHelp')} />
</div>
<div class="mt-6">