Skip to content

v1.2.6 - Security Hardening, Monorepo Workspaces & Enhanced Rollbacks

Latest

Choose a tag to compare

@iulian-mnk iulian-mnk released this 18 Sep 13:23
· 1 commit to main since this release

Security

  • Project Root Deployment Protection:
    • validateDistDirectory in src/core/config.ts and src/core/deployer.ts strictly rejects deploying the repository or project root (dist_path: "."), requiring a genuine build output directory to prevent inadvertent deployment of source code, .git, .env files, and node_modules.
    • Guarded root index.html fallback in src/core/detector.ts so detected bundler frameworks (Vite, Nuxt, Next.js, Astro, SvelteKit, Remix, Angular) never fall back to dist_path: ".".
  • Sensitive File Exclusion in Archiver:
    • Added isSensitiveArchiveEntry in src/core/archiver.ts to strictly filter out .env*, .git, .github, .gitlab, .vscode, node_modules, and credentials even if accidentally placed inside the distribution directory.
  • OAuth PKCE Loopback Hardening:
    • Non-OAuth loopback requests (e.g. /favicon.ico, root /, network scanners) in src/client/pkce-auth.ts now return HTTP 404 rather than stalling or triggering invalid token exchanges.
    • Exchange authorization code for tokens before rendering the browser success page, ensuring OAuth failures display immediate errors in the browser.
    • Active and idle HTTP sockets are cleanly closed with closeIdleConnections to prevent dangling process listeners.
  • Credential Sanitization in Error Reporting:
    • KodallNodeClient strips HTTP Basic Auth credentials from target URLs in error messages and logs.
  • Secret Stripping on Environment Duplication:
    • cloneEnvironment in src/core/env-manager.ts strips api_key, token, and secrets when duplicating environments unless explicitly overridden.

Added

  • HTTP DELETE Method:
    • Added client.delete() to KodallNodeClient supporting automatic handling of HTTP 204 No Content responses.
  • Cookie Store Eviction:
    • Added deleteCookie() method to CookieStore in src/client/cookie-store.ts.

Fixed

  • Monorepo Ancestor Workspace Resolution:
    • src/core/pm-detector.ts traverses ancestor directories up to the filesystem root to identify monorepo workspace roots (pnpm-workspace.yaml, turbo.json, lerna.json, root lockfiles), resolving package managers when executing from nested package folders.
  • Cookie Header Parsing & Expiration:
    • Fixed cookie corruption when Set-Cookie headers contain RFC 1123 HTTP dates with commas without splitting single cookies into invalid fragments.
    • Automatically prune expired cookies (Max-Age=0 or past Expires).
  • Nuxt / Nitro DevProxy Path Duplication:
    • Configured prependPath: false in src/core/proxy-helpers.ts (getNitroProxy) to prevent Nitro from duplicating route prefixes.
  • Proxy Header & Compression Forwarding:
    • Stripped content-encoding and content-length headers in createNextProxyHandler when upstream bodies are already decompressed by fetch.
    • Filtered hop-by-hop headers (connection, keep-alive, transfer-encoding, upgrade) in createNitroProxyHandler Node proxying.
    • Added dynamic rule.rewrite in getDevProxy when instanceUrl contains subpaths (e.g. https://host.com/subpath).
  • Rollback Engine & History Integrity:
    • Rollback updates both id_storage_file_version and id_storage_file to keep server entity state consistent.
    • Fixed rollback history to record metadata safely without overwriting commit hashes.
    • Added support for negative step syntax (e.g. -R -1 or --steps 2).
    • Added support for comma-separated environment strings (-e dev,staging) in rollback and status commands.
  • CLI Argument Parsing & Command Routing:
    • Handled options preceding subcommands (e.g. kodall-deploy -c custom.json use dev or --config foo.json build).
    • Fixed --build flag routing during deployment commands (-e dev --build) so it does not intercept as standalone build subcommand.
    • Handled short options with equals syntax (e.g. -e=dev, -t=prod, -R=137).
    • Handled bare --add-env, --update-env, and --edit-env opening interactive prompts without throwing argument parsing errors.
  • Headless & Non-Interactive CI Safety:
    • Added headless guards across interactive commands (envs, use, set-default, add-env, remove-env, clone-env, manage-envs, rollback, init) to fail fast with code 1 instead of hanging on piped input or CI runners.
    • Added 5-second timeout in src/commands/auth-probe.ts to prevent hanging on unreachable instances.
  • UI Prompts & Stream Robustness:
    • Handled stream close / end events in askText and askPassword.
    • Ignored ANSI escape sequences in askPassword.
    • Restored terminal cursor on SIGINT / exit in askSelect.
    • Unrefed background spinner timer intervals to prevent blocking process termination.
  • CI Template Generator:
    • Configured pnpm/action-setup@v4 before Node setup in generated GitHub Actions workflows.
    • Added KODALL_INSTANCE secret variables in Jenkinsfile and AWS CodeBuild templates.
  • Status Dashboard Query Syntax:
    • Converted SQL queries in src/commands/status.ts to Kodall query syntax (FILTER AND (...)) and forwarded CLI API keys.