cli/internal/cmd/gitea/cmd_gitea.go
Snider cf63e0d2f7 Secure SSH, fix CI auto-merge, and resolve merge conflicts
This commit addresses the OWASP security audit by enforcing strict host key
verification and resolves persistent CI issues.

Security Changes:
- Replaced StrictHostKeyChecking=accept-new with yes in pkg/container and devops.
- Removed insecure host key verification from pkg/ansible.
- Implemented synchronous host key discovery using ssh-keyscan during VM boot.
- Updated Boot lifecycle to wait for host key verification.
- Handled missing known_hosts file in pkg/ansible.
- Refactored hardcoded SSH port to DefaultSSHPort constant.

CI and Maintenance:
- Fixed auto-merge.yml by inlining the script and adding repository context
  to 'gh' command, resolving the "not a git repository" error in CI.
- Resolved merge conflicts in .github/workflows/auto-merge.yml with dev branch.
- Added pkg/ansible/ssh_test.go for SSH client verification.
- Fixed formatting in pkg/io/local/client.go to pass QA checks.
2026-02-05 03:40:28 +00:00

47 lines
1.2 KiB
Go

// Package gitea provides CLI commands for managing a Gitea instance.
//
// Commands:
// - config: Configure Gitea connection (URL, token)
// - repos: List repositories
// - issues: List and create issues
// - prs: List pull requests
// - mirror: Create GitHub-to-Gitea mirrors
// - sync: Sync GitHub repos to Gitea upstream branches
package gitea
import (
"github.com/host-uk/core/pkg/cli"
)
func init() {
cli.RegisterCommands(AddGiteaCommands)
}
// Style aliases from shared package.
var (
successStyle = cli.SuccessStyle
errorStyle = cli.ErrorStyle
warningStyle = cli.WarningStyle
dimStyle = cli.DimStyle
valueStyle = cli.ValueStyle
repoStyle = cli.RepoStyle
numberStyle = cli.NumberStyle
infoStyle = cli.InfoStyle
)
// AddGiteaCommands registers the 'gitea' command and all subcommands.
func AddGiteaCommands(root *cli.Command) {
giteaCmd := &cli.Command{
Use: "gitea",
Short: "Gitea instance management",
Long: "Manage repositories, issues, and pull requests on your Gitea instance.",
}
root.AddCommand(giteaCmd)
addConfigCommand(giteaCmd)
addReposCommand(giteaCmd)
addIssuesCommand(giteaCmd)
addPRsCommand(giteaCmd)
addMirrorCommand(giteaCmd)
addSyncCommand(giteaCmd)
}