Skip to content

Modern Docker Management, Designed for Everyone

fix: compose updater not correctly falling back to standalone container update (#2923)

Kyle Mendellb5217d903d55
diff --git a/backend/go.mod b/backend/go.mod
index 38beb967a..b6bf6d483 100644
--- a/backend/go.mod
+++ b/backend/go.mod
@@ -55,7 +55,7 @@ require (
github.com/spf13/cobra v1.10.2
github.com/stretchr/testify v1.11.1
github.com/wneessen/go-mail v0.7.3
- go.getarcane.app/updater v0.3.9
+ go.getarcane.app/updater v0.3.10
golang.org/x/crypto v0.53.0
golang.org/x/mod v0.37.0
golang.org/x/net v0.55.0
diff --git a/backend/go.sum b/backend/go.sum
index 693c8cfb3..f7a3eeba2 100644
--- a/backend/go.sum
+++ b/backend/go.sum
@@ -540,8 +540,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
-go.getarcane.app/updater v0.3.9 h1:+qVmC1ruV7tDVONXDQcb56seSlhshMEIvH877XxZA40=
-go.getarcane.app/updater v0.3.9/go.mod h1:4+jvmGU+HdDLHTuqFZ/NJ7lzZzF0F2AVvqnap5uJQaQ=
+go.getarcane.app/updater v0.3.10 h1:ZCYcjIQRgWMbO0rwBjmSS2X8h0F9kN/9GqYUK9Mfw7E=
+go.getarcane.app/updater v0.3.10/go.mod h1:4+jvmGU+HdDLHTuqFZ/NJ7lzZzF0F2AVvqnap5uJQaQ=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
diff --git a/backend/internal/configschema/schema_test.go b/backend/internal/configschema/schema_test.go
index dfd0e4dd1..c1ec77333 100644
--- a/backend/internal/configschema/schema_test.go
+++ b/backend/internal/configschema/schema_test.go
@@ -276,7 +276,6 @@ var expectedSettingOverrideKeys = []string{
"autoHealRestartWindow",
"autoInjectEnv",
"autoUpdate",
- "autoUpdateComposeStandaloneFallback",
"autoUpdateExcludedContainers",
"autoUpdateInterval",
"baseServerUrl",
diff --git a/backend/internal/models/settings.go b/backend/internal/models/settings.go
index e0be72d1f..1c9b4b69b 100644
--- a/backend/internal/models/settings.go
+++ b/backend/internal/models/settings.go
@@ -82,46 +82,45 @@ type Settings struct {
OledMode SettingVariable `key:"oledMode,public,local" meta:"label=OLED Mode;type=boolean;keywords=oled,dark,theme,black,amoled,appearance,display;category=general;description=Use true-black backgrounds for OLED displays (only active in dark mode)"`
// Docker category
- AutoUpdate SettingVariable `key:"autoUpdate" meta:"label=Auto Update;type=boolean;keywords=auto,update,automatic,upgrade,refresh,restart,deploy;category=internal;description=Automatically update containers when new images are available"`
- AutoUpdateInterval SettingVariable `key:"autoUpdateInterval" meta:"label=Auto Update Interval;type=cron;keywords=auto,update,interval,frequency,schedule,automatic,timing;category=internal;description=How often to check for automatic updates (cron expression)"`
- AutoUpdateExcludedContainers SettingVariable `key:"autoUpdateExcludedContainers" meta:"label=Excluded Containers;type=text;keywords=exclude,containers,ignore,skip;category=internal;description=Comma-separated list of containers to exclude from auto-update"`
- AutoUpdateComposeStandaloneFallback SettingVariable `key:"autoUpdateComposeStandaloneFallback" meta:"label=Compose Standalone Fallback;type=boolean;keywords=auto,update,compose,standalone,fallback,containers;category=internal;description=Allow auto-update to recreate Compose-managed containers directly when Arcane cannot resolve the owning project. Restart Arcane after changing this setting."`
- PollingEnabled SettingVariable `key:"pollingEnabled" meta:"label=Enable Polling;type=boolean;keywords=polling,check,monitor,watch,scan,detection,automatic;category=internal;description=Enable automatic checking for image updates"`
- PollingInterval SettingVariable `key:"pollingInterval" meta:"label=Polling Interval;type=cron;keywords=interval,frequency,schedule,time,minutes,period,delay;category=internal;description=How often to check for image updates (cron expression)"`
- DockerClientRefreshInterval SettingVariable `key:"dockerClientRefreshInterval" meta:"label=Docker Client Refresh Interval;type=cron;keywords=docker,client,refresh,daemon,api,version,reconnect,renegotiate,schedule;category=internal;description=How often to refresh the cached Docker client API version (cron expression)"`
- EventCleanupInterval SettingVariable `key:"eventCleanupInterval" meta:"label=Event Cleanup Interval;type=cron;keywords=events,cleanup,retention,interval,frequency,schedule,history,logs,jobs;description=How often to delete old events (cron expression)"`
- ExpiredSessionsCleanupInterval SettingVariable `key:"expiredSessionsCleanupInterval" meta:"label=Expired Sessions Cleanup Interval;type=cron;keywords=sessions,cleanup,retention,expired,revoked,interval,frequency,schedule,auth,jobs;description=How often to delete expired and old revoked sessions (cron expression)"`
- ActivityHistoryRetentionDays SettingVariable `key:"activityHistoryRetentionDays" meta:"label=Activity History Retention;type=number;keywords=activity,history,retention,days,cleanup,background,tasks;category=activity;description=Delete completed Activity Center entries older than this many days. Set 0 to disable age-based cleanup." catmeta:"id=activity;title=Activity;icon=activity;url=/settings/activity;description=Configure Activity Center history and cleanup"`
- ActivityHistoryMaxEntries SettingVariable `key:"activityHistoryMaxEntries" meta:"label=Activity History Limit;type=number;keywords=activity,history,limit,entries,count,cleanup,background,tasks;category=activity;description=Maximum completed Activity Center entries to keep per environment. Set 0 to disable count-based cleanup."`
- AutoInjectEnv SettingVariable `key:"autoInjectEnv" meta:"label=Auto Inject Env Variables;type=boolean;keywords=auto,inject,env,environment,variables,interpolation;category=internal;description=Automatically inject project .env variables into all containers (default: false)"`
- DefaultDeployPullPolicy SettingVariable `key:"defaultDeployPullPolicy" meta:"label=Default Deploy Pull Policy;type=select;keywords=deploy,pull,policy,compose,up,missing,always;category=internal;description=Default image pull policy when deploying projects"`
- ScheduledPruneEnabled SettingVariable `key:"scheduledPruneEnabled" meta:"label=Scheduled Prune Enabled;type=boolean;keywords=prune,cleanup,maintenance,schedule,automatic;category=internal;description=Enable scheduled pruning of unused Docker resources"`
- ScheduledPruneInterval SettingVariable `key:"scheduledPruneInterval" meta:"label=Scheduled Prune Interval;type=cron;keywords=prune,cleanup,interval,minutes,schedule;category=internal;description=How often to run scheduled prunes (cron expression)"`
- PruneContainerMode SettingVariable `key:"pruneContainerMode" meta:"label=Prune Containers;type=select;keywords=prune,containers,cleanup,maintenance,mode,older,stopped;category=internal;description=Select how containers should be pruned when the scheduled prune job runs"`
- PruneContainerUntil SettingVariable `key:"pruneContainerUntil" meta:"label=Container Age Filter;type=text;keywords=prune,containers,cleanup,maintenance,until,older,duration;category=internal;description=Duration threshold for scheduled container prune when mode is olderThan"`
- PruneImageMode SettingVariable `key:"pruneImageMode" meta:"label=Prune Images;type=select;keywords=prune,images,cleanup,maintenance,mode,dangling,all,older;category=internal;description=Select how images should be pruned when the scheduled prune job runs"`
- PruneImageUntil SettingVariable `key:"pruneImageUntil" meta:"label=Image Age Filter;type=text;keywords=prune,images,cleanup,maintenance,until,older,duration;category=internal;description=Duration threshold for scheduled image prune when mode is olderThan"`
- PruneVolumeMode SettingVariable `key:"pruneVolumeMode" meta:"label=Prune Volumes;type=select;keywords=prune,volumes,cleanup,maintenance,mode,anonymous,named;category=internal;description=Select how volumes should be pruned when the scheduled prune job runs"`
- PruneNetworkMode SettingVariable `key:"pruneNetworkMode" meta:"label=Prune Networks;type=select;keywords=prune,networks,cleanup,maintenance,mode,unused,older;category=internal;description=Select how networks should be pruned when the scheduled prune job runs"`
- PruneNetworkUntil SettingVariable `key:"pruneNetworkUntil" meta:"label=Network Age Filter;type=text;keywords=prune,networks,cleanup,maintenance,until,older,duration;category=internal;description=Duration threshold for scheduled network prune when mode is olderThan"`
- PruneBuildCacheMode SettingVariable `key:"pruneBuildCacheMode" meta:"label=Prune Build Cache;type=select;keywords=prune,build cache,cleanup,maintenance,mode,unused,all,older;category=internal;description=Select how build cache should be pruned when the scheduled prune job runs"`
- PruneBuildCacheUntil SettingVariable `key:"pruneBuildCacheUntil" meta:"label=Build Cache Age Filter;type=text;keywords=prune,build cache,cleanup,maintenance,until,older,duration;category=internal;description=Duration threshold for scheduled build cache prune when mode is olderThan"`
- AutoHealEnabled SettingVariable `key:"autoHealEnabled" meta:"label=Auto Heal;type=boolean;keywords=auto,heal,health,restart,unhealthy,recovery,container,healthcheck;category=internal;description=Automatically restart containers that become unhealthy"`
- AutoHealInterval SettingVariable `key:"autoHealInterval" meta:"label=Auto Heal Interval;type=cron;keywords=auto,heal,interval,frequency,schedule,health,jobs;description=How often to check container health (cron expression)" catmeta:"id=jobschedule"`
- AutoHealExcludedContainers SettingVariable `key:"autoHealExcludedContainers" meta:"label=Auto Heal Excluded Containers;type=text;keywords=auto,heal,exclude,containers,ignore,skip,health;category=internal;description=Comma-separated list of containers to exclude from auto-heal"`
- AutoHealMaxRestarts SettingVariable `key:"autoHealMaxRestarts" meta:"label=Auto Heal Max Restarts;type=number;keywords=auto,heal,max,restarts,limit,loop,protection;category=internal;description=Maximum auto-heal restarts per container within the restart window (default: 5)"`
- AutoHealRestartWindow SettingVariable `key:"autoHealRestartWindow" meta:"label=Auto Heal Restart Window;type=number;keywords=auto,heal,restart,window,minutes,cooldown,protection;category=internal;description=Time window in minutes for counting auto-heal restarts (default: 30)"`
- VolumeBrowserHelperIdleTimeout SettingVariable `key:"volumeBrowserHelperIdleTimeout" meta:"label=Volume Browser Idle Timeout;type=number;keywords=volume,browser,helper,idle,timeout,cleanup,reaper,minutes;category=internal;description=Minutes a volume-browser helper container may sit idle before automatic removal (default: 10; 0 disables)"`
- MaxImageUploadSize SettingVariable `key:"maxImageUploadSize" meta:"label=Max Image Upload Size;type=number;keywords=upload,size,limit,maximum,image,tar,file,megabytes,mb,storage;category=internal;description=Maximum size in MB for image archive uploads (default: 500)"`
- GitSyncMaxFiles SettingVariable `key:"gitSyncMaxFiles,envOverride" meta:"label=Git Sync Max Files;type=number;keywords=git,sync,files,limit,repository,compose,gitops;category=general;description=Maximum number of repository files copied during a Git sync. Set 0 to disable the environment cap (default: 500)"`
- GitSyncMaxTotalSizeMb SettingVariable `key:"gitSyncMaxTotalSizeMb,envOverride" meta:"label=Git Sync Max Total Size (MB);type=number;keywords=git,sync,size,limit,repository,compose,gitops,mb;category=general;description=Maximum combined size in MB for files copied during a Git sync. Set 0 to disable the environment cap (default: 50)"`
- GitSyncMaxBinarySizeMb SettingVariable `key:"gitSyncMaxBinarySizeMb,envOverride" meta:"label=Git Sync Max Binary Size (MB);type=number;keywords=git,sync,binary,size,limit,repository,compose,gitops,mb;category=general;description=Maximum size in MB for a single binary file copied during a Git sync. Set 0 to disable the environment cap (default: 10)"`
- DockerHost SettingVariable `key:"dockerHost,authrequired,envOverride" meta:"label=Docker Host;type=text;keywords=docker,host,daemon,socket,unix,remote;category=internal;description=URI for Docker daemon"`
- BuildProvider SettingVariable `key:"buildProvider,envOverride" meta:"label=Build Provider;type=select;keywords=build,buildkit,depot,provider,remote,local;category=build;description=Default build provider (local or depot)" catmeta:"id=build;title=Build;icon=code;url=/settings/builds;description=Configure BuildKit and Depot build settings"`
- BuildsDirectory SettingVariable `key:"buildsDirectory,envOverride" meta:"label=Builds Directory;type=text;keywords=builds,directory,path,workspace,context;category=build;description=Root directory for manual build workspaces"`
- BuildTimeout SettingVariable `key:"buildTimeout,envOverride" meta:"label=Build Timeout;type=number;keywords=build,timeout,seconds,buildkit;category=build;description=Timeout for BuildKit builds in seconds (default: 1800 = 30 minutes)"`
- DepotProjectId SettingVariable `key:"depotProjectId,envOverride" meta:"label=Depot Project ID;type=text;keywords=depot,project,id,build,provider;category=build;description=Depot project identifier"`
- DepotToken SettingVariable `key:"depotToken,envOverride,sensitive" meta:"label=Depot Token;type=password;keywords=depot,token,api,secret,build,provider;category=build;description=Depot API token"`
+ AutoUpdate SettingVariable `key:"autoUpdate" meta:"label=Auto Update;type=boolean;keywords=auto,update,automatic,upgrade,refresh,restart,deploy;category=internal;description=Automatically update containers when new images are available"`
+ AutoUpdateInterval SettingVariable `key:"autoUpdateInterval" meta:"label=Auto Update Interval;type=cron;keywords=auto,update,interval,frequency,schedule,automatic,timing;category=internal;description=How often to check for automatic updates (cron expression)"`
+ AutoUpdateExcludedContainers SettingVariable `key:"autoUpdateExcludedContainers" meta:"label=Excluded Containers;type=text;keywords=exclude,containers,ignore,skip;category=internal;description=Comma-separated list of containers to exclude from auto-update"`
+ PollingEnabled SettingVariable `key:"pollingEnabled" meta:"label=Enable Polling;type=boolean;keywords=polling,check,monitor,watch,scan,detection,automatic;category=internal;description=Enable automatic checking for image updates"`
+ PollingInterval SettingVariable `key:"pollingInterval" meta:"label=Polling Interval;type=cron;keywords=interval,frequency,schedule,time,minutes,period,delay;category=internal;description=How often to check for image updates (cron expression)"`
+ DockerClientRefreshInterval SettingVariable `key:"dockerClientRefreshInterval" meta:"label=Docker Client Refresh Interval;type=cron;keywords=docker,client,refresh,daemon,api,version,reconnect,renegotiate,schedule;category=internal;description=How often to refresh the cached Docker client API version (cron expression)"`
+ EventCleanupInterval SettingVariable `key:"eventCleanupInterval" meta:"label=Event Cleanup Interval;type=cron;keywords=events,cleanup,retention,interval,frequency,schedule,history,logs,jobs;description=How often to delete old events (cron expression)"`
+ ExpiredSessionsCleanupInterval SettingVariable `key:"expiredSessionsCleanupInterval" meta:"label=Expired Sessions Cleanup Interval;type=cron;keywords=sessions,cleanup,retention,expired,revoked,interval,frequency,schedule,auth,jobs;description=How often to delete expired and old revoked sessions (cron expression)"`
+ ActivityHistoryRetentionDays SettingVariable `key:"activityHistoryRetentionDays" meta:"label=Activity History Retention;type=number;keywords=activity,history,retention,days,cleanup,background,tasks;category=activity;description=Delete completed Activity Center entries older than this many days. Set 0 to disable age-based cleanup." catmeta:"id=activity;title=Activity;icon=activity;url=/settings/activity;description=Configure Activity Center history and cleanup"`
+ ActivityHistoryMaxEntries SettingVariable `key:"activityHistoryMaxEntries" meta:"label=Activity History Limit;type=number;keywords=activity,history,limit,entries,count,cleanup,background,tasks;category=activity;description=Maximum completed Activity Center entries to keep per environment. Set 0 to disable count-based cleanup."`
+ AutoInjectEnv SettingVariable `key:"autoInjectEnv" meta:"label=Auto Inject Env Variables;type=boolean;keywords=auto,inject,env,environment,variables,interpolation;category=internal;description=Automatically inject project .env variables into all containers (default: false)"`
+ DefaultDeployPullPolicy SettingVariable `key:"defaultDeployPullPolicy" meta:"label=Default Deploy Pull Policy;type=select;keywords=deploy,pull,policy,compose,up,missing,always;category=internal;description=Default image pull policy when deploying projects"`
+ ScheduledPruneEnabled SettingVariable `key:"scheduledPruneEnabled" meta:"label=Scheduled Prune Enabled;type=boolean;keywords=prune,cleanup,maintenance,schedule,automatic;category=internal;description=Enable scheduled pruning of unused Docker resources"`
+ ScheduledPruneInterval SettingVariable `key:"scheduledPruneInterval" meta:"label=Scheduled Prune Interval;type=cron;keywords=prune,cleanup,interval,minutes,schedule;category=internal;description=How often to run scheduled prunes (cron expression)"`
+ PruneContainerMode SettingVariable `key:"pruneContainerMode" meta:"label=Prune Containers;type=select;keywords=prune,containers,cleanup,maintenance,mode,older,stopped;category=internal;description=Select how containers should be pruned when the scheduled prune job runs"`
+ PruneContainerUntil SettingVariable `key:"pruneContainerUntil" meta:"label=Container Age Filter;type=text;keywords=prune,containers,cleanup,maintenance,until,older,duration;category=internal;description=Duration threshold for scheduled container prune when mode is olderThan"`
+ PruneImageMode SettingVariable `key:"pruneImageMode" meta:"label=Prune Images;type=select;keywords=prune,images,cleanup,maintenance,mode,dangling,all,older;category=internal;description=Select how images should be pruned when the scheduled prune job runs"`
+ PruneImageUntil SettingVariable `key:"pruneImageUntil" meta:"label=Image Age Filter;type=text;keywords=prune,images,cleanup,maintenance,until,older,duration;category=internal;description=Duration threshold for scheduled image prune when mode is olderThan"`
+ PruneVolumeMode SettingVariable `key:"pruneVolumeMode" meta:"label=Prune Volumes;type=select;keywords=prune,volumes,cleanup,maintenance,mode,anonymous,named;category=internal;description=Select how volumes should be pruned when the scheduled prune job runs"`
+ PruneNetworkMode SettingVariable `key:"pruneNetworkMode" meta:"label=Prune Networks;type=select;keywords=prune,networks,cleanup,maintenance,mode,unused,older;category=internal;description=Select how networks should be pruned when the scheduled prune job runs"`
+ PruneNetworkUntil SettingVariable `key:"pruneNetworkUntil" meta:"label=Network Age Filter;type=text;keywords=prune,networks,cleanup,maintenance,until,older,duration;category=internal;description=Duration threshold for scheduled network prune when mode is olderThan"`
+ PruneBuildCacheMode SettingVariable `key:"pruneBuildCacheMode" meta:"label=Prune Build Cache;type=select;keywords=prune,build cache,cleanup,maintenance,mode,unused,all,older;category=internal;description=Select how build cache should be pruned when the scheduled prune job runs"`
+ PruneBuildCacheUntil SettingVariable `key:"pruneBuildCacheUntil" meta:"label=Build Cache Age Filter;type=text;keywords=prune,build cache,cleanup,maintenance,until,older,duration;category=internal;description=Duration threshold for scheduled build cache prune when mode is olderThan"`
+ AutoHealEnabled SettingVariable `key:"autoHealEnabled" meta:"label=Auto Heal;type=boolean;keywords=auto,heal,health,restart,unhealthy,recovery,container,healthcheck;category=internal;description=Automatically restart containers that become unhealthy"`
+ AutoHealInterval SettingVariable `key:"autoHealInterval" meta:"label=Auto Heal Interval;type=cron;keywords=auto,heal,interval,frequency,schedule,health,jobs;description=How often to check container health (cron expression)" catmeta:"id=jobschedule"`
+ AutoHealExcludedContainers SettingVariable `key:"autoHealExcludedContainers" meta:"label=Auto Heal Excluded Containers;type=text;keywords=auto,heal,exclude,containers,ignore,skip,health;category=internal;description=Comma-separated list of containers to exclude from auto-heal"`
+ AutoHealMaxRestarts SettingVariable `key:"autoHealMaxRestarts" meta:"label=Auto Heal Max Restarts;type=number;keywords=auto,heal,max,restarts,limit,loop,protection;category=internal;description=Maximum auto-heal restarts per container within the restart window (default: 5)"`
+ AutoHealRestartWindow SettingVariable `key:"autoHealRestartWindow" meta:"label=Auto Heal Restart Window;type=number;keywords=auto,heal,restart,window,minutes,cooldown,protection;category=internal;description=Time window in minutes for counting auto-heal restarts (default: 30)"`
+ VolumeBrowserHelperIdleTimeout SettingVariable `key:"volumeBrowserHelperIdleTimeout" meta:"label=Volume Browser Idle Timeout;type=number;keywords=volume,browser,helper,idle,timeout,cleanup,reaper,minutes;category=internal;description=Minutes a volume-browser helper container may sit idle before automatic removal (default: 10; 0 disables)"`
+ MaxImageUploadSize SettingVariable `key:"maxImageUploadSize" meta:"label=Max Image Upload Size;type=number;keywords=upload,size,limit,maximum,image,tar,file,megabytes,mb,storage;category=internal;description=Maximum size in MB for image archive uploads (default: 500)"`
+ GitSyncMaxFiles SettingVariable `key:"gitSyncMaxFiles,envOverride" meta:"label=Git Sync Max Files;type=number;keywords=git,sync,files,limit,repository,compose,gitops;category=general;description=Maximum number of repository files copied during a Git sync. Set 0 to disable the environment cap (default: 500)"`
+ GitSyncMaxTotalSizeMb SettingVariable `key:"gitSyncMaxTotalSizeMb,envOverride" meta:"label=Git Sync Max Total Size (MB);type=number;keywords=git,sync,size,limit,repository,compose,gitops,mb;category=general;description=Maximum combined size in MB for files copied during a Git sync. Set 0 to disable the environment cap (default: 50)"`
+ GitSyncMaxBinarySizeMb SettingVariable `key:"gitSyncMaxBinarySizeMb,envOverride" meta:"label=Git Sync Max Binary Size (MB);type=number;keywords=git,sync,binary,size,limit,repository,compose,gitops,mb;category=general;description=Maximum size in MB for a single binary file copied during a Git sync. Set 0 to disable the environment cap (default: 10)"`
+ DockerHost SettingVariable `key:"dockerHost,authrequired,envOverride" meta:"label=Docker Host;type=text;keywords=docker,host,daemon,socket,unix,remote;category=internal;description=URI for Docker daemon"`
+ BuildProvider SettingVariable `key:"buildProvider,envOverride" meta:"label=Build Provider;type=select;keywords=build,buildkit,depot,provider,remote,local;category=build;description=Default build provider (local or depot)" catmeta:"id=build;title=Build;icon=code;url=/settings/builds;description=Configure BuildKit and Depot build settings"`
+ BuildsDirectory SettingVariable `key:"buildsDirectory,envOverride" meta:"label=Builds Directory;type=text;keywords=builds,directory,path,workspace,context;category=build;description=Root directory for manual build workspaces"`
+ BuildTimeout SettingVariable `key:"buildTimeout,envOverride" meta:"label=Build Timeout;type=number;keywords=build,timeout,seconds,buildkit;category=build;description=Timeout for BuildKit builds in seconds (default: 1800 = 30 minutes)"`
+ DepotProjectId SettingVariable `key:"depotProjectId,envOverride" meta:"label=Depot Project ID;type=text;keywords=depot,project,id,build,provider;category=build;description=Depot project identifier"`
+ DepotToken SettingVariable `key:"depotToken,envOverride,sensitive" meta:"label=Depot Token;type=password;keywords=depot,token,api,secret,build,provider;category=build;description=Depot API token"`
// Authentication and security categories
AuthLocalEnabled SettingVariable `key:"authLocalEnabled,public" meta:"label=Local Authentication;type=boolean;keywords=local,auth,authentication,username,password,login,credentials;category=authentication;description=Enable local username/password authentication" catmeta:"id=authentication;title=Authentication;icon=lock;url=/settings/authentication;description=Manage authentication providers, password policy, and session behavior"`
diff --git a/backend/internal/services/project_service.go b/backend/internal/services/project_service.go
index 0251f3dbe..eaa937845 100644
--- a/backend/internal/services/project_service.go
+++ b/backend/internal/services/project_service.go
@@ -2042,6 +2042,11 @@ func (s *ProjectService) DownProject(ctx context.Context, projectID string, user
}
func (s *ProjectService) CreateProject(ctx context.Context, name, composeContent string, envContent *string, user models.User) (*models.Project, error) {
+ // A top-level `name:` in the compose file is authoritative over the
+ // submitted project name.
+ if yamlName := projects.ComposeContentProjectName(composeContent); yamlName != "" {
+ name = yamlName
+ }
sanitized := projects.SanitizeProjectName(name)
projectsDirectory, err := projects.GetProjectsDirectory(ctx, s.settingsService.GetStringSetting(ctx, "projectsDirectory", "/app/data/projects"))
@@ -2900,6 +2905,21 @@ func (s *ProjectService) UpdateProject(ctx context.Context, projectID string, na
return nil, err
}
+ // A top-level `name:` in the compose file is authoritative over the
+ // submitted project name. For name-only renames, enforce against the
+ // compose file on disk so the lock can't be bypassed via the API.
+ if composeContent != nil {
+ if yamlName := projects.ComposeContentProjectName(*composeContent); yamlName != "" {
+ name = &yamlName
+ }
+ } else if name != nil {
+ if onDiskCompose, _, readErr := projects.ReadProjectFiles(proj.Path, ""); readErr == nil {
+ if yamlName := projects.ComposeContentProjectName(onDiskCompose); yamlName != "" {
+ name = &yamlName
+ }
+ }
+ }
+
if err := s.withProjectRenameRollback(ctx, &proj, func() error {
if err := s.applyProjectRenameIfNeeded(&proj, name, projectsDirectory); err != nil {
return err
diff --git a/backend/internal/services/settings_service.go b/backend/internal/services/settings_service.go
index 524096d04..0c93fbf23 100644
--- a/backend/internal/services/settings_service.go
+++ b/backend/internal/services/settings_service.go
@@ -107,89 +107,88 @@ func (s *SettingsService) getDefaultSettings() *models.Settings {
// DefaultSettingsConfig returns the canonical default settings model used by Arcane.
func DefaultSettingsConfig() *models.Settings {
return &models.Settings{
- ProjectsDirectory: models.SettingVariable{Value: "/app/data/projects"},
- TemplatesDirectory: models.SettingVariable{Value: "/app/data/templates"},
- FollowProjectSymlinks: models.SettingVariable{Value: "false"},
- SwarmStackSourcesDirectory: models.SettingVariable{Value: "/app/data/swarm/sources"},
- DiskUsagePath: models.SettingVariable{Value: "/app/data/projects"},
- AutoUpdate: models.SettingVariable{Value: "false"},
- AutoUpdateInterval: models.SettingVariable{Value: "0 0 0 * * *"},
- AutoUpdateExcludedContainers: models.SettingVariable{Value: ""},
- AutoUpdateComposeStandaloneFallback: models.SettingVariable{Value: "false"},
- PollingEnabled: models.SettingVariable{Value: "true"},
- PollingInterval: models.SettingVariable{Value: "0 0 * * * *"},
- DockerClientRefreshInterval: models.SettingVariable{Value: "*/30 * * * * *"},
- EventCleanupInterval: models.SettingVariable{Value: "0 0 */6 * * *"},
- ExpiredSessionsCleanupInterval: models.SettingVariable{Value: "0 0 0 * * *"},
- ActivityHistoryRetentionDays: models.SettingVariable{Value: "30"},
- ActivityHistoryMaxEntries: models.SettingVariable{Value: "1000"},
- AutoInjectEnv: models.SettingVariable{Value: "false"},
- DefaultDeployPullPolicy: models.SettingVariable{Value: "missing"},
- ScheduledPruneEnabled: models.SettingVariable{Value: "false"},
- ScheduledPruneInterval: models.SettingVariable{Value: "0 0 0 * * *"},
- PruneContainerMode: models.SettingVariable{Value: "stopped"},
- PruneContainerUntil: models.SettingVariable{Value: ""},
- PruneImageMode: models.SettingVariable{Value: "dangling"},
- PruneImageUntil: models.SettingVariable{Value: ""},
- PruneVolumeMode: models.SettingVariable{Value: "none"},
- PruneNetworkMode: models.SettingVariable{Value: "unused"},
- PruneNetworkUntil: models.SettingVariable{Value: ""},
- PruneBuildCacheMode: models.SettingVariable{Value: "none"},
- PruneBuildCacheUntil: models.SettingVariable{Value: ""},
- AutoHealEnabled: models.SettingVariable{Value: "false"},
- AutoHealInterval: models.SettingVariable{Value: "*/30 * * * * *"},
- AutoHealExcludedContainers: models.SettingVariable{Value: ""},
- AutoHealMaxRestarts: models.SettingVariable{Value: "5"},
- AutoHealRestartWindow: models.SettingVariable{Value: "30"},
- VolumeBrowserHelperIdleTimeout: models.SettingVariable{Value: "10"},
- BaseServerURL: models.SettingVariable{Value: "http://localhost"},
- EnableGravatar: models.SettingVariable{Value: "true"},
- DefaultShell: models.SettingVariable{Value: "/bin/sh"},
- DockerHost: models.SettingVariable{Value: "unix:///var/run/docker.sock"},
- BuildsDirectory: models.SettingVariable{Value: "/builds"},
- AuthLocalEnabled: models.SettingVariable{Value: "true"},
- AuthSessionTimeout: models.SettingVariable{Value: "1440"},
- AuthPasswordPolicy: models.SettingVariable{Value: "strong"},
- VulnerabilityScanEnabled: models.SettingVariable{Value: "false"},
- VulnerabilityScanInterval: models.SettingVariable{Value: "0 0 0 * * *"},
- TrivyImage: models.SettingVariable{Value: DefaultTrivyImage},
- TrivyNetwork: models.SettingVariable{Value: ""},
- TrivySecurityOpts: models.SettingVariable{Value: ""},
- TrivyPrivileged: models.SettingVariable{Value: "false"},
- TrivyPreserveCacheOnVolumePrune: models.SettingVariable{Value: "true"},
- TrivyResourceLimitsEnabled: models.SettingVariable{Value: "true"},
- TrivyCpuLimit: models.SettingVariable{Value: "1"},
- TrivyMemoryLimitMb: models.SettingVariable{Value: "0"},
- TrivyConcurrentScanContainers: models.SettingVariable{Value: "1"},
- OidcEnabled: models.SettingVariable{Value: "false"},
- OidcClientId: models.SettingVariable{Value: ""},
- OidcClientSecret: models.SettingVariable{Value: ""},
- OidcIssuerUrl: models.SettingVariable{Value: ""},
- OidcAuthorizationEndpoint: models.SettingVariable{Value: ""},
- OidcTokenEndpoint: models.SettingVariable{Value: ""},
- OidcUserinfoEndpoint: models.SettingVariable{Value: ""},
- OidcJwksEndpoint: models.SettingVariable{Value: ""},
- OidcScopes: models.SettingVariable{Value: "openid email profile"},
- OidcGroupsClaim: models.SettingVariable{Value: "groups"},
- OidcSkipTlsVerify: models.SettingVariable{Value: "false"},
- OidcAutoRedirectToProvider: models.SettingVariable{Value: "false"},
- OidcMergeAccounts: models.SettingVariable{Value: "false"},
- OidcProviderName: models.SettingVariable{Value: ""},
- OidcProviderLogoUrl: models.SettingVariable{Value: ""},
- OidcMobileRedirectUris: models.SettingVariable{Value: "arcane-mobile://oidc-callback"},
- MobileNavigationMode: models.SettingVariable{Value: "floating"},
- MobileNavigationShowLabels: models.SettingVariable{Value: "true"},
- SidebarHoverExpansion: models.SettingVariable{Value: "true"},
- KeyboardShortcutsEnabled: models.SettingVariable{Value: "true"},
- ApplicationTheme: models.SettingVariable{Value: "default"},
- IconCatalog: models.SettingVariable{Value: "selfhst"},
- AccentColor: models.SettingVariable{Value: "oklch(0.606 0.25 292.717)"},
- OledMode: models.SettingVariable{Value: "false"},
- MaxImageUploadSize: models.SettingVariable{Value: "500"},
- GitSyncMaxFiles: models.SettingVariable{Value: "500"},
- GitSyncMaxTotalSizeMb: models.SettingVariable{Value: "50"},
- GitSyncMaxBinarySizeMb: models.SettingVariable{Value: "10"},
- EnvironmentHealthInterval: models.SettingVariable{Value: "0 */2 * * * *"},
+ ProjectsDirectory: models.SettingVariable{Value: "/app/data/projects"},
+ TemplatesDirectory: models.SettingVariable{Value: "/app/data/templates"},
+ FollowProjectSymlinks: models.SettingVariable{Value: "false"},
+ SwarmStackSourcesDirectory: models.SettingVariable{Value: "/app/data/swarm/sources"},
+ DiskUsagePath: models.SettingVariable{Value: "/app/data/projects"},
+ AutoUpdate: models.SettingVariable{Value: "false"},
+ AutoUpdateInterval: models.SettingVariable{Value: "0 0 0 * * *"},
+ AutoUpdateExcludedContainers: models.SettingVariable{Value: ""},
+ PollingEnabled: models.SettingVariable{Value: "true"},
+ PollingInterval: models.SettingVariable{Value: "0 0 * * * *"},
+ DockerClientRefreshInterval: models.SettingVariable{Value: "*/30 * * * * *"},
+ EventCleanupInterval: models.SettingVariable{Value: "0 0 */6 * * *"},
+ ExpiredSessionsCleanupInterval: models.SettingVariable{Value: "0 0 0 * * *"},
+ ActivityHistoryRetentionDays: models.SettingVariable{Value: "30"},
+ ActivityHistoryMaxEntries: models.SettingVariable{Value: "1000"},
+ AutoInjectEnv: models.SettingVariable{Value: "false"},
+ DefaultDeployPullPolicy: models.SettingVariable{Value: "missing"},
+ ScheduledPruneEnabled: models.SettingVariable{Value: "false"},
+ ScheduledPruneInterval: models.SettingVariable{Value: "0 0 0 * * *"},
+ PruneContainerMode: models.SettingVariable{Value: "stopped"},
+ PruneContainerUntil: models.SettingVariable{Value: ""},
+ PruneImageMode: models.SettingVariable{Value: "dangling"},
+ PruneImageUntil: models.SettingVariable{Value: ""},
+ PruneVolumeMode: models.SettingVariable{Value: "none"},
+ PruneNetworkMode: models.SettingVariable{Value: "unused"},
+ PruneNetworkUntil: models.SettingVariable{Value: ""},
+ PruneBuildCacheMode: models.SettingVariable{Value: "none"},
+ PruneBuildCacheUntil: models.SettingVariable{Value: ""},
+ AutoHealEnabled: models.SettingVariable{Value: "false"},
+ AutoHealInterval: models.SettingVariable{Value: "*/30 * * * * *"},
+ AutoHealExcludedContainers: models.SettingVariable{Value: ""},
+ AutoHealMaxRestarts: models.SettingVariable{Value: "5"},
+ AutoHealRestartWindow: models.SettingVariable{Value: "30"},
+ VolumeBrowserHelperIdleTimeout: models.SettingVariable{Value: "10"},
+ BaseServerURL: models.SettingVariable{Value: "http://localhost"},
+ EnableGravatar: models.SettingVariable{Value: "true"},
+ DefaultShell: models.SettingVariable{Value: "/bin/sh"},
+ DockerHost: models.SettingVariable{Value: "unix:///var/run/docker.sock"},
+ BuildsDirectory: models.SettingVariable{Value: "/builds"},
+ AuthLocalEnabled: models.SettingVariable{Value: "true"},
+ AuthSessionTimeout: models.SettingVariable{Value: "1440"},
+ AuthPasswordPolicy: models.SettingVariable{Value: "strong"},
+ VulnerabilityScanEnabled: models.SettingVariable{Value: "false"},
+ VulnerabilityScanInterval: models.SettingVariable{Value: "0 0 0 * * *"},
+ TrivyImage: models.SettingVariable{Value: DefaultTrivyImage},
+ TrivyNetwork: models.SettingVariable{Value: ""},
+ TrivySecurityOpts: models.SettingVariable{Value: ""},
+ TrivyPrivileged: models.SettingVariable{Value: "false"},
+ TrivyPreserveCacheOnVolumePrune: models.SettingVariable{Value: "true"},
+ TrivyResourceLimitsEnabled: models.SettingVariable{Value: "true"},
+ TrivyCpuLimit: models.SettingVariable{Value: "1"},
+ TrivyMemoryLimitMb: models.SettingVariable{Value: "0"},
+ TrivyConcurrentScanContainers: models.SettingVariable{Value: "1"},
+ OidcEnabled: models.SettingVariable{Value: "false"},
+ OidcClientId: models.SettingVariable{Value: ""},
+ OidcClientSecret: models.SettingVariable{Value: ""},
+ OidcIssuerUrl: models.SettingVariable{Value: ""},
+ OidcAuthorizationEndpoint: models.SettingVariable{Value: ""},
+ OidcTokenEndpoint: models.SettingVariable{Value: ""},
+ OidcUserinfoEndpoint: models.SettingVariable{Value: ""},
+ OidcJwksEndpoint: models.SettingVariable{Value: ""},
+ OidcScopes: models.SettingVariable{Value: "openid email profile"},
+ OidcGroupsClaim: models.SettingVariable{Value: "groups"},
+ OidcSkipTlsVerify: models.SettingVariable{Value: "false"},
+ OidcAutoRedirectToProvider: models.SettingVariable{Value: "false"},
+ OidcMergeAccounts: models.SettingVariable{Value: "false"},
+ OidcProviderName: models.SettingVariable{Value: ""},
+ OidcProviderLogoUrl: models.SettingVariable{Value: ""},
+ OidcMobileRedirectUris: models.SettingVariable{Value: "arcane-mobile://oidc-callback"},
+ MobileNavigationMode: models.SettingVariable{Value: "floating"},
+ MobileNavigationShowLabels: models.SettingVariable{Value: "true"},
+ SidebarHoverExpansion: models.SettingVariable{Value: "true"},
+ KeyboardShortcutsEnabled: models.SettingVariable{Value: "true"},
+ ApplicationTheme: models.SettingVariable{Value: "default"},
+ IconCatalog: models.SettingVariable{Value: "selfhst"},
+ AccentColor: models.SettingVariable{Value: "oklch(0.606 0.25 292.717)"},
+ OledMode: models.SettingVariable{Value: "false"},
+ MaxImageUploadSize: models.SettingVariable{Value: "500"},
+ GitSyncMaxFiles: models.SettingVariable{Value: "500"},
+ GitSyncMaxTotalSizeMb: models.SettingVariable{Value: "50"},
+ GitSyncMaxBinarySizeMb: models.SettingVariable{Value: "10"},
+ EnvironmentHealthInterval: models.SettingVariable{Value: "0 */2 * * * *"},
DockerAPITimeout: models.SettingVariable{Value: "30"},
DockerImagePullTimeout: models.SettingVariable{Value: "600"},
diff --git a/backend/internal/services/settings_service_test.go b/backend/internal/services/settings_service_test.go
index f5e6d9cab..bb9368991 100644
--- a/backend/internal/services/settings_service_test.go
+++ b/backend/internal/services/settings_service_test.go
@@ -43,7 +43,7 @@ func TestSettingsService_EnsureDefaultSettings_Idempotent(t *testing.T) {
require.Equal(t, count1, count2)
// Spot-check core and automation defaults exist with correct values
- for _, key := range []string{"authLocalEnabled", "projectsDirectory", "followProjectSymlinks", "autoUpdateExcludedContainers", "autoUpdateComposeStandaloneFallback", "vulnerabilityScanEnabled", "vulnerabilityScanInterval", "trivyImage", "trivyNetwork", "trivySecurityOpts", "trivyPrivileged", "trivyPreserveCacheOnVolumePrune", "trivyResourceLimitsEnabled", "trivyCpuLimit", "trivyMemoryLimitMb", "trivyConcurrentScanContainers", "gitSyncMaxFiles", "gitSyncMaxTotalSizeMb", "gitSyncMaxBinarySizeMb"} {
+ for _, key := range []string{"authLocalEnabled", "projectsDirectory", "followProjectSymlinks", "autoUpdateExcludedContainers", "vulnerabilityScanEnabled", "vulnerabilityScanInterval", "trivyImage", "trivyNetwork", "trivySecurityOpts", "trivyPrivileged", "trivyPreserveCacheOnVolumePrune", "trivyResourceLimitsEnabled", "trivyCpuLimit", "trivyMemoryLimitMb", "trivyConcurrentScanContainers", "gitSyncMaxFiles", "gitSyncMaxTotalSizeMb", "gitSyncMaxBinarySizeMb"} {
var sv models.SettingVariable
err := svc.db.WithContext(ctx).Where("key = ?", key).First(&sv).Error
require.NoErrorf(t, err, "missing default key %s", key)
@@ -53,8 +53,6 @@ func TestSettingsService_EnsureDefaultSettings_Idempotent(t *testing.T) {
require.Equal(t, "false", sv.Value)
case "autoUpdateExcludedContainers":
require.Equal(t, "", sv.Value)
- case "autoUpdateComposeStandaloneFallback":
- require.Equal(t, "false", sv.Value)
case "vulnerabilityScanEnabled":
require.Equal(t, "false", sv.Value)
case "vulnerabilityScanInterval":
diff --git a/backend/internal/services/updater_service.go b/backend/internal/services/updater_service.go
index 54318736b..76081d469 100644
--- a/backend/internal/services/updater_service.go
+++ b/backend/internal/services/updater_service.go
@@ -30,8 +30,6 @@ import (
moduletypes "go.getarcane.app/updater/types"
)
-const autoUpdateComposeStandaloneFallbackSettingKeyInternal = "autoUpdateComposeStandaloneFallback"
-
// UpdaterService is Arcane's handler-facing service for the standalone updater engine.
type UpdaterService struct {
deps updaterDependenciesInternal
@@ -88,27 +86,26 @@ func NewUpdaterService(
SystemUser: systemUser,
},
}
- service.engine = moduleapi.NewService(service.configInternal(context.Background()))
+ service.engine = moduleapi.NewService(service.configInternal())
return service
}
-func (s *UpdaterService) configInternal(ctx context.Context) moduleapi.Config {
+func (s *UpdaterService) configInternal() moduleapi.Config {
return moduleapi.Config{
- DockerClientProvider: s,
- ImagePuller: s,
- PendingStore: s,
- RunRecorder: s,
- Settings: s,
- RegistryDigestResolver: s.registryDigestResolverInternal(),
- ProjectUpdater: s,
- SelfUpdater: s,
- Notifier: s,
- EventRecorder: s,
- UsedImageCollector: moduleapi.UsedImageCollectorFunc(s.CollectUsedImages),
- LabelPolicy: labels.DefaultLabelPolicy(),
- AllowComposeStandaloneFallback: s.allowComposeStandaloneFallbackInternal(ctx),
- SelfContainerID: selfContainerIDInternal(),
- Logger: s.loggerInternal(),
+ DockerClientProvider: s,
+ ImagePuller: s,
+ PendingStore: s,
+ RunRecorder: s,
+ Settings: s,
+ RegistryDigestResolver: s.registryDigestResolverInternal(),
+ ProjectUpdater: s,
+ SelfUpdater: s,
+ Notifier: s,
+ EventRecorder: s,
+ UsedImageCollector: moduleapi.UsedImageCollectorFunc(s.CollectUsedImages),
+ LabelPolicy: labels.DefaultLabelPolicy(),
+ SelfContainerID: selfContainerIDInternal(),
+ Logger: s.loggerInternal(),
}
}
@@ -134,13 +131,6 @@ func (s *UpdaterService) loggerInternal() *slog.Logger {
return slog.Default()
}
-func (s *UpdaterService) allowComposeStandaloneFallbackInternal(ctx context.Context) bool {
- if s == nil || s.deps.Settings == nil {
- return false
- }
- return s.deps.Settings.GetBoolSetting(ctx, autoUpdateComposeStandaloneFallbackSettingKeyInternal, false)
-}
-
func (s *UpdaterService) registryDigestResolverInternal() updaterdigest.RemoteResolver {
if s == nil || s.deps.RegistryDigestResolver == nil {
return nil
diff --git a/backend/internal/services/updater_service_test.go b/backend/internal/services/updater_service_test.go
index faf50fa2f..e3cefa0a8 100644
--- a/backend/internal/services/updater_service_test.go
+++ b/backend/internal/services/updater_service_test.go
@@ -203,30 +203,6 @@ func TestUpdaterService_ApplyPendingNoRecordsInternal(t *testing.T) {
assert.Empty(t, result.Items)
}
-func TestUpdaterService_ConfigUsesComposeStandaloneFallbackSettingInternal(t *testing.T) {
- ctx := context.Background()
-
- t.Run("defaults disabled without settings service", func(t *testing.T) {
- svc := NewUpdaterService(nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
-
- cfg := svc.configInternal(ctx)
-
- assert.False(t, cfg.AllowComposeStandaloneFallback)
- })
-
- t.Run("reads settings service", func(t *testing.T) {
- db := setupProjectTestDB(t)
- settingsSvc, err := NewSettingsService(ctx, db)
- require.NoError(t, err)
- require.NoError(t, settingsSvc.SetBoolSetting(ctx, autoUpdateComposeStandaloneFallbackSettingKeyInternal, true))
- svc := NewUpdaterService(db, settingsSvc, nil, nil, nil, nil, nil, nil, nil, nil, nil)
-
- cfg := svc.configInternal(ctx)
-
- assert.True(t, cfg.AllowComposeStandaloneFallback)
- })
-}
-
func TestUpdaterService_ModuleOptionsFromUpdaterOptionsInternal(t *testing.T) {
got := moduleOptionsFromUpdaterOptionsInternal(arcaneupdater.Options{
Type: moduletypes.ResourceTypeImage,
diff --git a/backend/pkg/projects/name.go b/backend/pkg/projects/name.go
new file mode 100644
index 000000000..18d9b0888
--- /dev/null
+++ b/backend/pkg/projects/name.go
@@ -0,0 +1,27 @@
+package projects
+
+import (
+ "strings"
+
+ "github.com/compose-spec/compose-go/v2/loader"
+ "github.com/goccy/go-yaml"
+)
+
+// ComposeContentProjectName returns the normalized top-level `name:` from
+// compose YAML content, or "" when the key is absent or unusable. Interpolated
+// names (containing `${`) are treated as absent so the backend and the
+// frontend name lock behave identically; parse errors are ignored here because
+// the full compose validation reports them with proper context.
+func ComposeContentProjectName(composeContent string) string {
+ var doc struct {
+ Name string `yaml:"name"`
+ }
+ if err := yaml.Unmarshal([]byte(composeContent), &doc); err != nil {
+ return ""
+ }
+ raw := strings.TrimSpace(doc.Name)
+ if raw == "" || strings.Contains(raw, "${") {
+ return ""
+ }
+ return loader.NormalizeProjectName(raw)
+}
diff --git a/backend/pkg/projects/name_test.go b/backend/pkg/projects/name_test.go
new file mode 100644
index 000000000..3158d6da9
--- /dev/null
+++ b/backend/pkg/projects/name_test.go
@@ -0,0 +1,24 @@
+package projects
+
+import "testing"
+
+func TestComposeContentProjectName(t *testing.T) {
+ tests := []struct {
+ name string
+ content string
+ want string
+ }{
+ {"literal name", "name: sabnzbd\nservices:\n sabnzbd:\n image: nginx\n", "sabnzbd"},
+ {"normalized", "name: My_App 2\nservices: {}\n", "my_app2"},
+ {"absent", "services: {}\n", ""},
+ {"interpolated", "name: ${PROJECT}\nservices: {}\n", ""},
+ {"invalid yaml", "name: [unclosed\n", ""},
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ if got := ComposeContentProjectName(tt.content); got != tt.want {
+ t.Errorf("ComposeContentProjectName() = %q, want %q", got, tt.want)
+ }
+ })
+ }
+}
diff --git a/frontend/messages/en.json b/frontend/messages/en.json
index 5478b23f2..67b036c9b 100644
--- a/frontend/messages/en.json
+++ b/frontend/messages/en.json
@@ -1242,6 +1242,7 @@
"compose_no_services_found": "No services found for this project",
"compose_service_not_created": "Not created",
"compose_name_change_not_allowed": "Project name cannot be changed while running. Please stop the project first.",
+ "compose_project_name_defined_in_yaml": "The project name is set by the 'name:' key in the compose file. Remove that key to rename the project.",
"compose_logs_title": "Project Logs",
"project": "Project",
"_comment_environments": "=== ENVIRONMENTS ===",
diff --git a/frontend/src/lib/layouts/tabbed-page-layout.svelte b/frontend/src/lib/layouts/tabbed-page-layout.svelte
index 3558e188a..4bf4ff798 100644
--- a/frontend/src/lib/layouts/tabbed-page-layout.svelte
+++ b/frontend/src/lib/layouts/tabbed-page-layout.svelte
@@ -57,7 +57,7 @@
>
<div class="max-w-full px-4 py-3">
<div class="flex items-start justify-between gap-3">
- <div class="flex min-w-0 items-start gap-3">
+ <div class="flex min-w-0 items-start gap-2">
{#if backUrl}
<ArcaneButton action="base" tone="ghost" size="sm" href={backUrl}>
<ArrowLeftIcon class="size-4" />
diff --git a/frontend/src/lib/utils/compose-flow.ts b/frontend/src/lib/utils/compose-flow.ts
index 4fce0c1cc..a51bcdda7 100644
--- a/frontend/src/lib/utils/compose-flow.ts
+++ b/frontend/src/lib/utils/compose-flow.ts
@@ -4,6 +4,7 @@ import { templateService } from '$lib/services/template-service.js';
import type { Template } from '$lib/types/swarm';
import { handleApiResultWithCallbacks, tryCatch } from '$lib/utils/api';
import { toast } from 'svelte-sonner';
+import { parseDocument } from 'yaml';
import { z } from 'zod/v4';
export type ConvertedDockerRun = {
@@ -48,6 +49,28 @@ export function templateNameSlug(name: string): string {
return name.toLowerCase().replace(/[^a-z0-9-_]/g, '-');
}
+// Returns the normalized top-level `name:` from compose YAML content, or null
+// when the key is absent or unusable. Interpolated names (containing `${`)
+// and unparseable content are treated as absent, mirroring the backend's
+// ComposeContentProjectName so the name lock engages identically on both sides.
+export function extractComposeYamlName(content: string): string | null {
+ if (!content?.trim()) return null;
+ try {
+ const doc = parseDocument(content);
+ if (doc.errors.length > 0) return null;
+ const raw = doc.get('name', false);
+ if (typeof raw !== 'string' || raw.includes('${')) return null;
+ const normalized = raw
+ .trim()
+ .toLowerCase()
+ .replace(/[^a-z0-9_-]/g, '')
+ .replace(/^[_-]+/, '');
+ return normalized || null;
+ } catch {
+ return null;
+ }
+}
+
export function createComposeEditorSchema(nameRequiredMessage: string) {
return z.object({
name: z
diff --git a/frontend/src/routes/(app)/projects/[projectId]/+page.svelte b/frontend/src/routes/(app)/projects/[projectId]/+page.svelte
index 405d9fa6d..0b98b1c5f 100644
--- a/frontend/src/routes/(app)/projects/[projectId]/+page.svelte
+++ b/frontend/src/routes/(app)/projects/[projectId]/+page.svelte
@@ -43,6 +43,7 @@
import IfPermitted from '$lib/components/if-permitted.svelte';
import { activityToastOptions, extractActivityId } from '$lib/utils/activity-toast';
import { globalVariablesToMap } from '$lib/utils/template-load';
+ import { extractComposeYamlName } from '$lib/utils/compose-flow';
let { data } = $props();
let projectId = $derived(data.projectId);
@@ -135,8 +136,13 @@
)
);
+ const composeYamlName = $derived(extractComposeYamlName($inputs.composeContent.value));
+ // The compose file's top-level `name:` is authoritative; surface it as the
+ // effective name without writing to form state reactively.
+ const effectiveName = $derived(composeYamlName ?? $inputs.name.value);
+
let hasChanges = $derived(
- $inputs.name.value !== serverName ||
+ effectiveName !== serverName ||
$inputs.composeContent.value !== serverComposeContent ||
$inputs.envContent.value !== serverEnvContent ||
Object.entries(includeFilesState).some(([relativePath, content]) => content !== serverIncludeFiles[relativePath])
@@ -144,11 +150,13 @@
let isGitOpsManaged = $derived(!!project?.gitOpsManagedBy);
let hasBuildDirective = $derived(!!project?.hasBuildDirective);
+
let canEditName = $derived(
canUpdateProject &&
!project?.isArchived &&
!isGitOpsManaged &&
!isLoading.saving &&
+ !composeYamlName &&
project?.status !== 'running' &&
project?.status !== 'partially running'
);
@@ -442,8 +450,8 @@
const validated = isGitOpsManaged ? formValues : form.validate();
if (!validated) return;
- const { name, composeContent, envContent } = validated;
- const namePayload = isGitOpsManaged ? undefined : name;
+ const { composeContent, envContent } = validated;
+ const namePayload = isGitOpsManaged ? undefined : effectiveName;
const composePayload = isGitOpsManaged ? undefined : composeContent;
handleApiResultWithCallbacks({
@@ -488,7 +496,7 @@
function saveNameIfChanged() {
if (project?.isArchived) return;
- if ($inputs.name.value === serverName) return;
+ if (effectiveName === serverName) return;
const validated = form.validate();
if (!validated) return;
handleSaveChanges();
@@ -719,7 +727,7 @@
}}
>
{#snippet headerInfo()}
- <div class="flex min-w-0 items-start gap-3">
+ <div class="flex min-w-0 items-start gap-2.5">
<IconImage
src={getThemedIconUrl(project, mode.current)}
alt={project.name}
@@ -728,14 +736,16 @@
containerClass="size-9 bg-transparent ring-0"
/>
<div class="min-w-0 flex-1">
- <div class="flex min-w-0 flex-wrap items-center gap-2">
+ <div class="flex min-h-9 min-w-0 flex-wrap items-center gap-x-2 gap-y-1">
<EditableName
bind:value={$inputs.name.value}
+ displayValue={effectiveName}
bind:ref={nameInputRef}
variant="inline"
error={$inputs.name.error ?? undefined}
originalValue={serverName}
canEdit={canEditName}
+ disabledMessage={composeYamlName ? m.compose_project_name_defined_in_yaml() : undefined}
onCommit={saveNameIfChanged}
class="max-w-[10rem] min-w-0 sm:max-w-[14rem] md:max-w-[18rem] lg:max-w-[22rem]"
/>
@@ -756,24 +766,25 @@
checking={checkProjectUpdatesMutation.isPending}
disabled={!!project.isArchived}
/>
- {#if project.urls && project.urls.length > 0}
- <div class="flex min-w-0 flex-wrap items-center gap-2">
- {#each project.urls as url, i (i)}
- <a
- class="ring-offset-background focus-visible:ring-ring bg-background/70 inline-flex min-h-6 max-w-[10rem] min-w-0 items-center gap-1 rounded-lg border border-sky-700/20 px-2 py-0.5 text-[12px] font-semibold shadow-sm transition-colors hover:border-sky-700/40 hover:bg-sky-500/10 hover:shadow-md focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none sm:max-w-[14rem] md:max-w-[18rem] dark:border-sky-400/40 dark:bg-sky-500/20 dark:text-sky-100 dark:hover:border-sky-300/60 dark:hover:bg-sky-500/30"
- href={toSafeHref(url)}
- target="_blank"
- rel="noopener noreferrer"
- title={url}
- >
- <GlobeIcon class="size-3 text-sky-500" />
- <span class="truncate leading-normal">{formatUrlLabel(url)}</span>
- </a>
- {/each}
- </div>
- {/if}
</div>
+ {#if project.urls && project.urls.length > 0}
+ <div class="mt-1 flex min-w-0 flex-wrap items-center gap-1.5">
+ {#each project.urls as url, i (i)}
+ <a
+ class="ring-offset-background focus-visible:ring-ring bg-background/70 inline-flex h-6 max-w-[10rem] min-w-0 items-center gap-1.5 rounded-[var(--radius)] border border-sky-700/20 px-2.5 text-[12px] font-semibold transition-colors hover:border-sky-700/40 hover:bg-sky-500/10 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none sm:max-w-[14rem] md:max-w-[18rem] dark:border-sky-400/40 dark:bg-sky-500/20 dark:text-sky-100 dark:hover:border-sky-300/60 dark:hover:bg-sky-500/30"
+ href={toSafeHref(url)}
+ target="_blank"
+ rel="noopener noreferrer"
+ title={url}
+ >
+ <GlobeIcon class="size-3 text-sky-500" />
+ <span class="truncate">{formatUrlLabel(url)}</span>
+ </a>
+ {/each}
+ </div>
+ {/if}
+
{#if project.lastSyncCommit}
{@const commitUrl = project.gitRepositoryURL
? toGitCommitUrl(project.gitRepositoryURL, project.lastSyncCommit)
diff --git a/frontend/src/routes/(app)/projects/components/EditableName.svelte b/frontend/src/routes/(app)/projects/components/EditableName.svelte
index 9172cc8a2..aa9078b69 100644
--- a/frontend/src/routes/(app)/projects/components/EditableName.svelte
+++ b/frontend/src/routes/(app)/projects/components/EditableName.svelte
@@ -9,6 +9,7 @@
let {
value = $bindable(),
+ displayValue,
ref = $bindable(),
variant = 'block',
error,
@@ -16,9 +17,11 @@
canEdit = true,
onCommit,
placeholder = '',
+ disabledMessage = m.compose_name_change_not_allowed(),
class: className = ''
}: {
value: string;
+ displayValue?: string;
ref: HTMLInputElement | null;
variant?: 'block' | 'inline';
error?: string;
@@ -26,9 +29,12 @@
canEdit?: boolean;
onCommit?: () => void;
placeholder?: string;
+ disabledMessage?: string;
class?: string;
} = $props();
+ let shownValue = $derived(displayValue ?? value);
+
let isEditing = $state(false);
let wrapperClass = $derived(cn('group', variant === 'block' ? 'w-full' : 'min-w-0', className));
@@ -100,11 +106,12 @@
class="hover:bg-muted/50 focus:ring-ring min-h-[32px] w-full rounded bg-transparent px-1 py-1 text-center text-base font-semibold transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 {error
? 'border border-destructive'
: ''}"
- title={canEdit ? `${value || placeholder} (tap to edit)` : value || placeholder}
+ title={canEdit ? `${shownValue || placeholder} (tap to edit)` : shownValue || placeholder}
onclick={beginEdit}
disabled={!canEdit}
>
- <span class="block truncate {!value && placeholder ? 'text-muted-foreground' : ''}">{value || placeholder}</span>
+ <span class="block truncate {!shownValue && placeholder ? 'text-muted-foreground' : ''}">{shownValue || placeholder}</span
+ >
</button>
</h1>
@@ -124,20 +131,20 @@
</div>
{/if}
{:else}
- <div class="flex items-center gap-1">
- <h1 class="m-0 max-w-[360px]">
+ <div class="flex h-8 min-w-0 items-center gap-1.5">
+ <h1 class="m-0 max-w-[360px] min-w-0">
<button
type="button"
class={cn(
- 'w-full truncate bg-transparent px-0 py-0 text-left text-lg leading-none font-semibold',
- !value && placeholder && 'text-muted-foreground',
+ 'w-full truncate bg-transparent px-0 py-0 text-left text-lg font-semibold',
+ !shownValue && placeholder && 'text-muted-foreground',
error && 'rounded border border-destructive px-1'
)}
- title={value || placeholder}
+ title={shownValue || placeholder}
onclick={beginEdit}
disabled={!canEdit}
>
- {value || placeholder}
+ {shownValue || placeholder}
</button>
</h1>
{#if canEdit}
@@ -154,12 +161,12 @@
{:else}
<ArcaneTooltip.Root>
<ArcaneTooltip.Trigger>
- <span class="text-muted-foreground inline-flex cursor-help items-center leading-none">
- <InfoIcon class="relative top-0.5 size-4 shrink-0" />
+ <span class="text-muted-foreground inline-flex cursor-help items-center">
+ <InfoIcon class="size-4 shrink-0" />
</span>
</ArcaneTooltip.Trigger>
<ArcaneTooltip.Content>
- {m.compose_name_change_not_allowed()}
+ {disabledMessage}
</ArcaneTooltip.Content>
</ArcaneTooltip.Root>
{/if}
diff --git a/frontend/src/routes/(app)/projects/new/+page.svelte b/frontend/src/routes/(app)/projects/new/+page.svelte
index 382d66975..f7bee0086 100644
--- a/frontend/src/routes/(app)/projects/new/+page.svelte
+++ b/frontend/src/routes/(app)/projects/new/+page.svelte
@@ -26,6 +26,7 @@
createComposeTemplateDialogFlow,
dropdownContentClass,
dropdownItemClass,
+ extractComposeYamlName,
submitComposeResourceForm,
templateBtnClass,
templateNameSlug
@@ -84,11 +85,19 @@
let nameInputRef = $state<HTMLInputElement | null>(null);
+ const composeYamlName = $derived(extractComposeYamlName($inputs.composeContent.value));
+ // The compose file's top-level `name:` is authoritative; surface it as the
+ // effective name without writing to form state reactively.
+ const effectiveName = $derived(composeYamlName ?? $inputs.name.value);
+
async function handleSubmit() {
await handleCreateProject();
}
async function handleCreateProject() {
+ // Sync the authoritative compose name into form state at submit time so
+ // validation and the create payload use it (event-time write, not an effect).
+ if (composeYamlName) form.setValue('name', composeYamlName);
await submitComposeResourceForm({
validate: () => validateTemplateEditorForm(validationState, form.validate),
setLoading: (value) => (ui.saving = value),
@@ -131,12 +140,14 @@
<div class="hidden items-center gap-3 sm:flex">
<EditableName
bind:value={$inputs.name.value}
+ displayValue={effectiveName}
bind:ref={nameInputRef}
variant="inline"
error={$inputs.name.error ?? undefined}
originalValue=""
placeholder={m.compose_project_name_placeholder?.() || 'Enter project name...'}
- canEdit={!ui.saving && !ui.isLoadingTemplateContent}
+ canEdit={!ui.saving && !ui.isLoadingTemplateContent && !composeYamlName}
+ disabledMessage={composeYamlName ? m.compose_project_name_defined_in_yaml() : undefined}
class="hidden sm:block"
/>
</div>
@@ -145,7 +156,7 @@
<div class="flex items-center gap-2">
<ButtonGroup.Root>
<ArcaneTooltip.Root
- open={!$inputs.name.value && !ui.saving && !ui.converting && !ui.isLoadingTemplateContent ? undefined : false}
+ open={!effectiveName && !ui.saving && !ui.converting && !ui.isLoadingTemplateContent ? undefined : false}
>
<ArcaneTooltip.Trigger>
<span>
@@ -153,7 +164,7 @@
<ArcaneButton
action="create"
tone="ghost"
- disabled={!$inputs.name.value ||
+ disabled={!effectiveName ||
!$inputs.composeContent.value ||
hasEditorErrors ||
ui.saving ||
@@ -169,7 +180,7 @@
</span>
</ArcaneTooltip.Trigger>
<ArcaneTooltip.Content class="arcane-tooltip-content max-w-[280px]">
- {#if $inputs.name.value === ''}
+ {#if effectiveName === ''}
<p class="mb-1 text-sm font-medium">{m.compose_project_name_tooltip_title()}</p>
<p class="text-muted-foreground text-xs">
{m.compose_project_name_tooltip_description()}
@@ -250,12 +261,14 @@
<div class="block flex-shrink-0 py-4 sm:hidden">
<EditableName
bind:value={$inputs.name.value}
+ displayValue={effectiveName}
bind:ref={nameInputRef}
variant="block"
error={$inputs.name.error ?? undefined}
originalValue=""
placeholder={m.compose_project_name_placeholder()}
- canEdit={!ui.saving && !ui.isLoadingTemplateContent}
+ canEdit={!ui.saving && !ui.isLoadingTemplateContent && !composeYamlName}
+ disabledMessage={composeYamlName ? m.compose_project_name_defined_in_yaml() : undefined}
/>
</div>
diff --git a/go.work.sum b/go.work.sum
index 525292e5a..c15cc9add 100644
--- a/go.work.sum
+++ b/go.work.sum
@@ -1163,6 +1163,7 @@ go.getarcane.app/updater v0.3.6 h1:+BqoycaRsHj+cLVSzcYQuqbHxUKbtmaozMNblz5bVSw=
go.getarcane.app/updater v0.3.6/go.mod h1:2ENitZR/lA5MuBn60OZYR5wvU3ZCE+pAgfrebfOlRDA=
go.getarcane.app/updater v0.3.7 h1:WqHsxudvt8gvCR7iSHdxdzwH0+hM0FAh64bSypBX9Mo=
go.getarcane.app/updater v0.3.7/go.mod h1:9RZOKaBbpUJfVA4Q9/jvqtjvWBwCnVw0OkPeQCnqAAo=
+go.getarcane.app/updater v0.3.10/go.mod h1:4+jvmGU+HdDLHTuqFZ/NJ7lzZzF0F2AVvqnap5uJQaQ=
go.mongodb.org/mongo-driver v1.7.5 h1:ny3p0reEpgsR2cfA5cjgwFZg3Cv/ofFh/8jbhGtz9VI=
go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng=
go.mongodb.org/mongo-driver v1.17.6 h1:87JUG1wZfWsr6rIz3ZmpH90rL5tea7O3IHuSwHUpsss=