Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
refactor: remove deprecated onboarding types and logic (#1176)
Kyle Mendell29063fbed6d8
diff --git a/backend/internal/api/playwright_handler.go b/backend/internal/api/playwright_handler.goindex eb941cd97..f99095848 100644--- a/backend/internal/api/playwright_handler.go+++ b/backend/internal/api/playwright_handler.go@@ -5,7 +5,6 @@ package apiimport ("net/http"- "github.com/getarcaneapp/arcane/backend/internal/common""github.com/getarcaneapp/arcane/backend/internal/services""github.com/gin-gonic/gin")@@ -23,30 +22,10 @@ func SetupPlaywrightRoutes(api *gin.RouterGroup, playwrightService *services.PlaplaywrightHandler := NewPlaywrightHandler(playwrightService)- playwright.POST("/skip-onboarding", playwrightHandler.SkipOnboardingHandler)- playwright.POST("/reset-onboarding", playwrightHandler.ResetOnboardingHandler)playwright.POST("/create-test-api-keys", playwrightHandler.CreateTestApiKeysHandler)playwright.POST("/delete-test-api-keys", playwrightHandler.DeleteTestApiKeysHandler)}-func (ph *PlaywrightHandler) SkipOnboardingHandler(c *gin.Context) {- if err := ph.PlaywrightService.SkipOnboarding(c.Request.Context()); err != nil {- c.JSON(http.StatusInternalServerError, gin.H{"error": (&common.SkipOnboardingError{Err: err}).Error()})- return- }-- c.Status(http.StatusNoContent)-}--func (ph *PlaywrightHandler) ResetOnboardingHandler(c *gin.Context) {- if err := ph.PlaywrightService.ResetOnboarding(c.Request.Context()); err != nil {- c.JSON(http.StatusInternalServerError, gin.H{"error": (&common.ResetOnboardingError{Err: err}).Error()})- return- }-- c.Status(http.StatusNoContent)-}-type CreateTestApiKeysRequest struct {Count int `json:"count"`}diff --git a/backend/internal/bootstrap/playwright_router_bootstrap.go b/backend/internal/bootstrap/playwright_router_bootstrap.goindex 8964bd0c2..e90abe94d 100644--- a/backend/internal/bootstrap/playwright_router_bootstrap.go+++ b/backend/internal/bootstrap/playwright_router_bootstrap.go@@ -13,7 +13,7 @@ import (func init() {registerPlaywrightRoutes = []func(apiGroup *gin.RouterGroup, services *Services){func(apiGroup *gin.RouterGroup, svc *Services) {- playwrightService := services.NewPlaywrightService(svc.Settings, svc.ApiKey, svc.User)+ playwrightService := services.NewPlaywrightService(svc.ApiKey, svc.User)if playwrightService == nil {slog.Warn("Playwright service not available, skipping playwright routes")returndiff --git a/backend/internal/models/settings.go b/backend/internal/models/settings.goindex 715d561c0..c393c54a9 100644--- a/backend/internal/models/settings.go+++ b/backend/internal/models/settings.go@@ -52,16 +52,6 @@ type Settings struct {EnvironmentHealthInterval SettingVariable `key:"environmentHealthInterval" meta:"label=Environment Health Check Interval;type=number;keywords=environment,health,check,interval,frequency,heartbeat,status,monitoring,uptime;category=general;description=How often to check environment connectivity in minutes (default: 2)"`AccentColor SettingVariable `key:"accentColor,public,local" meta:"label=Accent Color;type=text;keywords=color,accent,theme,css,appearance,ui;category=general;description=Primary accent color for UI"`- // Deprecated: OnboardingCompleted is no longer used as of the onboarding removal.- // This field is kept for backward compatibility and is automatically set to true on startup.- // This will be removed in a future release.- OnboardingCompleted SettingVariable `key:"onboardingCompleted,public" meta:"label=Onboarding Completed;type=boolean;keywords=onboarding,completed,setup,first-run;category=general;description=Whether onboarding has been completed"`-- // Deprecated: OnboardingSteps is no longer used as of the onboarding removal.- // This field is kept for backward compatibility only.- // This will be removed in a future release.- OnboardingSteps SettingVariable `key:"onboardingSteps" meta:"label=Onboarding Steps;type=text;keywords=onboarding,steps,progress,guide;category=general;description=Serialized onboarding steps"`-// Docker categoryAutoUpdate SettingVariable `key:"autoUpdate" meta:"label=Auto Update;type=boolean;keywords=auto,update,automatic,upgrade,refresh,restart,deploy;category=docker;description=Automatically update containers when new images are available" catmeta:"id=docker;title=Docker;icon=database;url=/settings/docker;description=Configure Docker settings, polling, and auto-updates"`AutoUpdateInterval SettingVariable `key:"autoUpdateInterval" meta:"label=Auto Update Interval;type=number;keywords=auto,update,interval,frequency,schedule,automatic,timing;category=docker;description=Interval between automatic updates"`diff --git a/backend/internal/services/playwright_service.go b/backend/internal/services/playwright_service.goindex 2bed0c38e..88079c261 100644--- a/backend/internal/services/playwright_service.go+++ b/backend/internal/services/playwright_service.go@@ -12,43 +12,17 @@ import ()type PlaywrightService struct {- settingsService *SettingsServiceapiKeyService *ApiKeyServiceuserService *UserService}-func NewPlaywrightService(settingsService *SettingsService, apiKeyService *ApiKeyService, userService *UserService) *PlaywrightService {+func NewPlaywrightService(apiKeyService *ApiKeyService, userService *UserService) *PlaywrightService {return &PlaywrightService{- settingsService: settingsService,apiKeyService: apiKeyService,userService: userService,}}-func (ps *PlaywrightService) SkipOnboarding(ctx context.Context) error {- slog.Info("Playwright: Skipping onboarding for test environment")-- err := ps.settingsService.SetBoolSetting(ctx, "onboardingCompleted", true)- if err != nil {- return fmt.Errorf("failed to skip onboarding: %w", err)- }-- slog.Info("Playwright: Onboarding skipped successfully")- return nil-}--func (ps *PlaywrightService) ResetOnboarding(ctx context.Context) error {- slog.Info("Playwright: Resetting onboarding for test environment")-- err := ps.settingsService.SetBoolSetting(ctx, "onboardingCompleted", false)- if err != nil {- return fmt.Errorf("failed to skip onboarding: %w", err)- }-- slog.Info("Playwright: Onboarding reset successfully")- return nil-}-func (ps *PlaywrightService) CreateTestApiKeys(ctx context.Context, count int) ([]*apikey.ApiKeyCreatedDto, error) {slog.Info("Playwright: Creating test API keys", "count", count)diff --git a/backend/internal/services/settings_service.go b/backend/internal/services/settings_service.goindex 6e0cd4506..db6bd4be8 100644--- a/backend/internal/services/settings_service.go+++ b/backend/internal/services/settings_service.go@@ -101,8 +101,6 @@ func (s *SettingsService) getDefaultSettings() *models.Settings {OidcAdminClaim: models.SettingVariable{Value: ""},OidcAdminValue: models.SettingVariable{Value: ""},OidcMergeAccounts: models.SettingVariable{Value: "false"},- OnboardingCompleted: models.SettingVariable{Value: "false"},- OnboardingSteps: models.SettingVariable{Value: "[]"},MobileNavigationMode: models.SettingVariable{Value: "floating"},MobileNavigationShowLabels: models.SettingVariable{Value: "true"},SidebarHoverExpansion: models.SettingVariable{Value: "true"},diff --git a/backend/internal/utils/bootstrap_util.go b/backend/internal/utils/bootstrap_util.goindex e057daab9..489d6af6f 100644--- a/backend/internal/utils/bootstrap_util.go+++ b/backend/internal/utils/bootstrap_util.go@@ -42,13 +42,6 @@ func InitializeDefaultSettings(ctx context.Context, cfg *config.Config, settingsslog.InfoContext(ctx, "Default settings initialized successfully")}- // Mark onboarding as completed for all installs (onboarding is replaced with first-login password change)- if err := settingsMgr.SetBoolSetting(ctx, "onboardingCompleted", true); err != nil {- slog.WarnContext(ctx, "Failed to mark onboarding as completed", "error", err.Error())- } else {- slog.InfoContext(ctx, "Onboarding marked as completed")- }-if cfg.AgentMode || cfg.UIConfigurationDisabled {if err := settingsMgr.PersistEnvSettingsIfMissing(ctx); err != nil {slog.WarnContext(ctx, "Failed to persist env-driven settings", "error", err.Error())diff --git a/frontend/src/lib/services/settings-service.ts b/frontend/src/lib/services/settings-service.tsindex 254d247a7..e423a853e 100644--- a/frontend/src/lib/services/settings-service.ts+++ b/frontend/src/lib/services/settings-service.ts@@ -109,11 +109,10 @@ export default class SettingsService extends BaseAPIService {}private parseValue(key: string, value: string) {- if (key === 'onboardingSteps' || key === 'registryCredentials' || key === 'templateRegistries') {+ if (key === 'registryCredentials' || key === 'templateRegistries') {try {return JSON.parse(value);} catch {- if (key === 'onboardingSteps') return {};return [];}}diff --git a/frontend/src/lib/types/settings.type.ts b/frontend/src/lib/types/settings.type.tsindex 0bbc29aaf..e1751bc00 100644--- a/frontend/src/lib/types/settings.type.ts+++ b/frontend/src/lib/types/settings.type.ts@@ -29,15 +29,6 @@ export type Settings = {oidcAdminValue: string;oidcMergeAccounts: boolean;- onboardingCompleted: boolean;- onboardingSteps: {- welcome?: boolean;- password?: boolean;- docker?: boolean;- security?: boolean;- settings?: boolean;- };-mobileNavigationMode: 'floating' | 'docked';mobileNavigationShowLabels: boolean;sidebarHoverExpansion: boolean;diff --git a/tests/setup/auth.setup.ts b/tests/setup/auth.setup.tsindex 01a03175b..cc0ee71e0 100644--- a/tests/setup/auth.setup.ts+++ b/tests/setup/auth.setup.ts@@ -1,12 +1,9 @@import { test as setup } from '@playwright/test';-import { skipOnboarding } from '../utils/onboarding.util';import authUtil from '../utils/auth.util';const authFile = '.auth/login.json';setup('authenticate', async ({ page }) => {- await skipOnboarding(); // Deprecated-await authUtil.login(page);await page.waitForURL('/dashboard');diff --git a/tests/spec/api-keys.spec.ts b/tests/spec/api-keys.spec.tsindex c5b8bac1c..b9e89edc7 100644--- a/tests/spec/api-keys.spec.ts+++ b/tests/spec/api-keys.spec.ts@@ -1,5 +1,5 @@import { test, expect, type Page } from '@playwright/test';-import { createTestApiKeys, deleteTestApiKeys } from '../utils/onboarding.util';+import { createTestApiKeys, deleteTestApiKeys } from '../utils/playwright.util';const API_KEYS_ROUTE = '/settings/api-keys';diff --git a/tests/utils/onboarding.util.ts b/tests/utils/onboarding.util.tsindex 3721ff346..0d9ee2035 100644--- a/tests/utils/onboarding.util.ts+++ b/tests/utils/onboarding.util.ts@@ -1,43 +1 @@-import playwrightConfig from '../playwright.config';--export async function skipOnboarding() {- const url = new URL('/api/playwright/skip-onboarding', playwrightConfig.use!.baseURL);-- const response = await fetch(url, {- method: 'POST',- });-- if (!response.ok) {- throw new Error(`Failed to skip onboarding: ${response.status} ${response.statusText}`);- }-}--export async function createTestApiKeys(count: number = 2) {- const url = new URL('/api/playwright/create-test-api-keys', playwrightConfig.use!.baseURL);-- const response = await fetch(url, {- method: 'POST',- headers: {- 'Content-Type': 'application/json',- },- body: JSON.stringify({ count }),- });-- if (!response.ok) {- throw new Error(`Failed to create test API keys: ${response.status} ${response.statusText}`);- }-- return response.json();-}--export async function deleteTestApiKeys() {- const url = new URL('/api/playwright/delete-test-api-keys', playwrightConfig.use!.baseURL);-- const response = await fetch(url, {- method: 'POST',- });-- if (!response.ok) {- throw new Error(`Failed to delete test API keys: ${response.status} ${response.statusText}`);- }-}+export { createTestApiKeys, deleteTestApiKeys } from './playwright.util';diff --git a/tests/utils/playwright.util.ts b/tests/utils/playwright.util.tsnew file mode 100644index 000000000..245768f17--- /dev/null+++ b/tests/utils/playwright.util.ts@@ -0,0 +1,31 @@+import playwrightConfig from '../playwright.config';++export async function createTestApiKeys(count: number = 2) {+ const url = new URL('/api/playwright/create-test-api-keys', playwrightConfig.use!.baseURL);++ const response = await fetch(url, {+ method: 'POST',+ headers: {+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({ count }),+ });++ if (!response.ok) {+ throw new Error(`Failed to create test API keys: ${response.status} ${response.statusText}`);+ }++ return response.json();+}++export async function deleteTestApiKeys() {+ const url = new URL('/api/playwright/delete-test-api-keys', playwrightConfig.use!.baseURL);++ const response = await fetch(url, {+ method: 'POST',+ });++ if (!response.ok) {+ throw new Error(`Failed to delete test API keys: ${response.status} ${response.statusText}`);+ }+}diff --git a/types/settings/settings.go b/types/settings/settings.goindex b16f168b7..874d7db68 100644--- a/types/settings/settings.go+++ b/types/settings/settings.go@@ -161,16 +161,6 @@ type Update struct {// Required: falseOidcAdminValue *string `json:"oidcAdminValue,omitempty"`- // OnboardingCompleted indicates if the onboarding process is complete.- //- // Required: false- OnboardingCompleted *string `json:"onboardingCompleted,omitempty"`-- // OnboardingSteps tracks the completed onboarding steps.- //- // Required: false- OnboardingSteps *string `json:"onboardingSteps,omitempty"`-// MobileNavigationMode is the navigation mode for mobile devices.//// Required: false