Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AIPentest CyberStrikeAI update Rollback

From Leeroopedia
Knowledge Sources
Domains Deployment, Updates
Last Updated 2026-10-19 04:10 GMT

Overview

Concrete tool for rolling back an in-place update to the previous commit and binary provided by the internal/update package.

Description

Rollback restores the previous commit and binary saved before the last Apply. It uses the .upgrade-backup/ directory, .update-state.json, and the cyberstrike-ai.prev binary as restore points. For tarball installs, upgrade.sh provides a fallback using rsync --delete from a Release tarball. Returns a Result with from/to commits. A service restart is required after rollback.

Usage

  • Self-update step 4 (rollback): called via -update-rollback flag when the update is bad.

Code Reference

Source Location

  • Repository: CyberStrikeAI
  • File: internal/update/apply.go
  • Lines: Rollback L907+

Signature

func Rollback(ctx context.Context, opts Options) (*Result, error)

// tarball fallback: upgrade.sh (rsync --delete from Release tarball)

Import

import "cyberstrike-ai/internal/update"

I/O Contract

Inputs

Name Type Required Description
ctx context.Context Yes Cancellation
opts Options Yes Root + Repo

Outputs

Name Type Description
returns *Result, error Restored commit + binary, or error

Usage Examples

Rollback a Bad Update

res, err := update.Rollback(ctx, opts)
if err != nil { log.Fatal(err) }
fmt.Printf("Rolled back %s -> %s; restart required\n", res.FromCommit, res.ToCommit)

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment