cli/internal/cmd/unifi/cmd_config.go

156 lines
4.1 KiB
Go
Raw Normal View History

feat(release): add Homebrew tap support and fix artifact naming (#325) * feat(release): add Homebrew tap support and fix artifact naming - Fix platform naming: binaries now named core-{os}-{arch} instead of just 'core', preventing collision when artifacts merge - Add tar.gz archives for non-Windows builds (Homebrew requirement) - Add update-tap job to alpha-release workflow that auto-updates host-uk/homebrew-tap with checksums on each alpha release - Add homebrew publisher to .core/release.yaml for formal releases - Update install instructions to include brew install Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(unifi): add UniFi Go SDK integration and CLI commands - Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution, and typed accessors for sites, clients, devices, networks, and routes - Add CLI commands: unifi sites, clients, devices, networks, routes, config - Register unifi commands in full variant build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(release): set AppVersion ldflags, git config, and tap token - Set -X pkg/cli.AppVersion in ldflags so core --version reports the correct version instead of "dev" - Add git config user.name/email in update-tap job so commit succeeds - Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo push to host-uk/homebrew-tap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(unifi): address CodeRabbit review feedback - Reject conflicting --wired and --wireless flags in clients command - Complete --type flag help text with bgp and ospf route types - URL-escape site name in routes API path - Wrap all command errors with log.E for contextual diagnostics - Set TLS MinVersion to 1.2 on UniFi client - Simplify redundant fmt.Sprintf in Print calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:37:02 +00:00
package unifi
import (
"fmt"
"github.com/host-uk/core/pkg/cli"
uf "github.com/host-uk/core/pkg/unifi"
)
// Config command flags.
var (
Add User Documentation (User Guide, FAQ, Troubleshooting) (#307) * docs: add user guide, faq, and enhance troubleshooting - Created docs/user-guide.md with key concepts and workflows. - Created docs/faq.md with common questions and answers. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Getting Help sections. - Refactored mkdocs.yml to reflect actual file structure and include new docs. * docs: add user documentation and fix mkdocs navigation - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Help links. - Restored original mkdocs.yml navigation and added new user documentation sections. - Fixed formatting in pkg/io/local/client.go to ensure CI passes. * docs: add user documentation and fix auto-merge workflow - Created docs/user-guide.md and docs/faq.md with user-focused content. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and organized help links. - Refactored mkdocs.yml to include new documentation while preserving technical sections. - Fixed .github/workflows/auto-merge.yml by inlining the logic and adding git repository context (checkout and -R flag) to resolve CI failures. - Verified that docs/workflows.md is present in the repository. * docs: add user documentation and resolve merge conflict - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and Help sections. - Merged latest base branch changes and resolved conflict in .github/workflows/auto-merge.yml. - Verified and organized mkdocs.yml navigation. * docs: add user documentation and fix UniFi security issue - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability (CodeQL alert) by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Verified all documentation links and navigation. * docs: add user documentation and fix formatting/security - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Fixed formatting in internal/cmd/unifi/cmd_config.go. - Verified all documentation links and navigation. --------- Co-authored-by: Claude <developers@lethean.io>
2026-02-05 06:55:52 +00:00
configURL string
configUser string
configPass string
configAPIKey string
configInsecure bool
configTest bool
feat(release): add Homebrew tap support and fix artifact naming (#325) * feat(release): add Homebrew tap support and fix artifact naming - Fix platform naming: binaries now named core-{os}-{arch} instead of just 'core', preventing collision when artifacts merge - Add tar.gz archives for non-Windows builds (Homebrew requirement) - Add update-tap job to alpha-release workflow that auto-updates host-uk/homebrew-tap with checksums on each alpha release - Add homebrew publisher to .core/release.yaml for formal releases - Update install instructions to include brew install Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(unifi): add UniFi Go SDK integration and CLI commands - Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution, and typed accessors for sites, clients, devices, networks, and routes - Add CLI commands: unifi sites, clients, devices, networks, routes, config - Register unifi commands in full variant build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(release): set AppVersion ldflags, git config, and tap token - Set -X pkg/cli.AppVersion in ldflags so core --version reports the correct version instead of "dev" - Add git config user.name/email in update-tap job so commit succeeds - Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo push to host-uk/homebrew-tap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(unifi): address CodeRabbit review feedback - Reject conflicting --wired and --wireless flags in clients command - Complete --type flag help text with bgp and ospf route types - URL-escape site name in routes API path - Wrap all command errors with log.E for contextual diagnostics - Set TLS MinVersion to 1.2 on UniFi client - Simplify redundant fmt.Sprintf in Print calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:37:02 +00:00
)
// addConfigCommand adds the 'config' subcommand for UniFi connection setup.
func addConfigCommand(parent *cli.Command) {
cmd := &cli.Command{
Use: "config",
Short: "Configure UniFi connection",
Long: "Set the UniFi controller URL and credentials, or test the current connection.",
RunE: func(cmd *cli.Command, args []string) error {
Add User Documentation (User Guide, FAQ, Troubleshooting) (#307) * docs: add user guide, faq, and enhance troubleshooting - Created docs/user-guide.md with key concepts and workflows. - Created docs/faq.md with common questions and answers. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Getting Help sections. - Refactored mkdocs.yml to reflect actual file structure and include new docs. * docs: add user documentation and fix mkdocs navigation - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Help links. - Restored original mkdocs.yml navigation and added new user documentation sections. - Fixed formatting in pkg/io/local/client.go to ensure CI passes. * docs: add user documentation and fix auto-merge workflow - Created docs/user-guide.md and docs/faq.md with user-focused content. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and organized help links. - Refactored mkdocs.yml to include new documentation while preserving technical sections. - Fixed .github/workflows/auto-merge.yml by inlining the logic and adding git repository context (checkout and -R flag) to resolve CI failures. - Verified that docs/workflows.md is present in the repository. * docs: add user documentation and resolve merge conflict - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and Help sections. - Merged latest base branch changes and resolved conflict in .github/workflows/auto-merge.yml. - Verified and organized mkdocs.yml navigation. * docs: add user documentation and fix UniFi security issue - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability (CodeQL alert) by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Verified all documentation links and navigation. * docs: add user documentation and fix formatting/security - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Fixed formatting in internal/cmd/unifi/cmd_config.go. - Verified all documentation links and navigation. --------- Co-authored-by: Claude <developers@lethean.io>
2026-02-05 06:55:52 +00:00
return runConfig(cmd)
feat(release): add Homebrew tap support and fix artifact naming (#325) * feat(release): add Homebrew tap support and fix artifact naming - Fix platform naming: binaries now named core-{os}-{arch} instead of just 'core', preventing collision when artifacts merge - Add tar.gz archives for non-Windows builds (Homebrew requirement) - Add update-tap job to alpha-release workflow that auto-updates host-uk/homebrew-tap with checksums on each alpha release - Add homebrew publisher to .core/release.yaml for formal releases - Update install instructions to include brew install Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(unifi): add UniFi Go SDK integration and CLI commands - Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution, and typed accessors for sites, clients, devices, networks, and routes - Add CLI commands: unifi sites, clients, devices, networks, routes, config - Register unifi commands in full variant build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(release): set AppVersion ldflags, git config, and tap token - Set -X pkg/cli.AppVersion in ldflags so core --version reports the correct version instead of "dev" - Add git config user.name/email in update-tap job so commit succeeds - Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo push to host-uk/homebrew-tap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(unifi): address CodeRabbit review feedback - Reject conflicting --wired and --wireless flags in clients command - Complete --type flag help text with bgp and ospf route types - URL-escape site name in routes API path - Wrap all command errors with log.E for contextual diagnostics - Set TLS MinVersion to 1.2 on UniFi client - Simplify redundant fmt.Sprintf in Print calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:37:02 +00:00
},
}
cmd.Flags().StringVar(&configURL, "url", "", "UniFi controller URL")
cmd.Flags().StringVar(&configUser, "user", "", "UniFi username")
cmd.Flags().StringVar(&configPass, "pass", "", "UniFi password")
cmd.Flags().StringVar(&configAPIKey, "apikey", "", "UniFi API key")
Add User Documentation (User Guide, FAQ, Troubleshooting) (#307) * docs: add user guide, faq, and enhance troubleshooting - Created docs/user-guide.md with key concepts and workflows. - Created docs/faq.md with common questions and answers. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Getting Help sections. - Refactored mkdocs.yml to reflect actual file structure and include new docs. * docs: add user documentation and fix mkdocs navigation - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Help links. - Restored original mkdocs.yml navigation and added new user documentation sections. - Fixed formatting in pkg/io/local/client.go to ensure CI passes. * docs: add user documentation and fix auto-merge workflow - Created docs/user-guide.md and docs/faq.md with user-focused content. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and organized help links. - Refactored mkdocs.yml to include new documentation while preserving technical sections. - Fixed .github/workflows/auto-merge.yml by inlining the logic and adding git repository context (checkout and -R flag) to resolve CI failures. - Verified that docs/workflows.md is present in the repository. * docs: add user documentation and resolve merge conflict - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and Help sections. - Merged latest base branch changes and resolved conflict in .github/workflows/auto-merge.yml. - Verified and organized mkdocs.yml navigation. * docs: add user documentation and fix UniFi security issue - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability (CodeQL alert) by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Verified all documentation links and navigation. * docs: add user documentation and fix formatting/security - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Fixed formatting in internal/cmd/unifi/cmd_config.go. - Verified all documentation links and navigation. --------- Co-authored-by: Claude <developers@lethean.io>
2026-02-05 06:55:52 +00:00
cmd.Flags().BoolVar(&configInsecure, "insecure", false, "Allow insecure TLS connections (e.g. self-signed certs)")
feat(release): add Homebrew tap support and fix artifact naming (#325) * feat(release): add Homebrew tap support and fix artifact naming - Fix platform naming: binaries now named core-{os}-{arch} instead of just 'core', preventing collision when artifacts merge - Add tar.gz archives for non-Windows builds (Homebrew requirement) - Add update-tap job to alpha-release workflow that auto-updates host-uk/homebrew-tap with checksums on each alpha release - Add homebrew publisher to .core/release.yaml for formal releases - Update install instructions to include brew install Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(unifi): add UniFi Go SDK integration and CLI commands - Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution, and typed accessors for sites, clients, devices, networks, and routes - Add CLI commands: unifi sites, clients, devices, networks, routes, config - Register unifi commands in full variant build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(release): set AppVersion ldflags, git config, and tap token - Set -X pkg/cli.AppVersion in ldflags so core --version reports the correct version instead of "dev" - Add git config user.name/email in update-tap job so commit succeeds - Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo push to host-uk/homebrew-tap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(unifi): address CodeRabbit review feedback - Reject conflicting --wired and --wireless flags in clients command - Complete --type flag help text with bgp and ospf route types - URL-escape site name in routes API path - Wrap all command errors with log.E for contextual diagnostics - Set TLS MinVersion to 1.2 on UniFi client - Simplify redundant fmt.Sprintf in Print calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:37:02 +00:00
cmd.Flags().BoolVar(&configTest, "test", false, "Test the current connection")
parent.AddCommand(cmd)
}
Add User Documentation (User Guide, FAQ, Troubleshooting) (#307) * docs: add user guide, faq, and enhance troubleshooting - Created docs/user-guide.md with key concepts and workflows. - Created docs/faq.md with common questions and answers. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Getting Help sections. - Refactored mkdocs.yml to reflect actual file structure and include new docs. * docs: add user documentation and fix mkdocs navigation - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Help links. - Restored original mkdocs.yml navigation and added new user documentation sections. - Fixed formatting in pkg/io/local/client.go to ensure CI passes. * docs: add user documentation and fix auto-merge workflow - Created docs/user-guide.md and docs/faq.md with user-focused content. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and organized help links. - Refactored mkdocs.yml to include new documentation while preserving technical sections. - Fixed .github/workflows/auto-merge.yml by inlining the logic and adding git repository context (checkout and -R flag) to resolve CI failures. - Verified that docs/workflows.md is present in the repository. * docs: add user documentation and resolve merge conflict - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and Help sections. - Merged latest base branch changes and resolved conflict in .github/workflows/auto-merge.yml. - Verified and organized mkdocs.yml navigation. * docs: add user documentation and fix UniFi security issue - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability (CodeQL alert) by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Verified all documentation links and navigation. * docs: add user documentation and fix formatting/security - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Fixed formatting in internal/cmd/unifi/cmd_config.go. - Verified all documentation links and navigation. --------- Co-authored-by: Claude <developers@lethean.io>
2026-02-05 06:55:52 +00:00
func runConfig(cmd *cli.Command) error {
var insecure *bool
if cmd.Flags().Changed("insecure") {
insecure = &configInsecure
}
feat(release): add Homebrew tap support and fix artifact naming (#325) * feat(release): add Homebrew tap support and fix artifact naming - Fix platform naming: binaries now named core-{os}-{arch} instead of just 'core', preventing collision when artifacts merge - Add tar.gz archives for non-Windows builds (Homebrew requirement) - Add update-tap job to alpha-release workflow that auto-updates host-uk/homebrew-tap with checksums on each alpha release - Add homebrew publisher to .core/release.yaml for formal releases - Update install instructions to include brew install Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(unifi): add UniFi Go SDK integration and CLI commands - Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution, and typed accessors for sites, clients, devices, networks, and routes - Add CLI commands: unifi sites, clients, devices, networks, routes, config - Register unifi commands in full variant build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(release): set AppVersion ldflags, git config, and tap token - Set -X pkg/cli.AppVersion in ldflags so core --version reports the correct version instead of "dev" - Add git config user.name/email in update-tap job so commit succeeds - Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo push to host-uk/homebrew-tap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(unifi): address CodeRabbit review feedback - Reject conflicting --wired and --wireless flags in clients command - Complete --type flag help text with bgp and ospf route types - URL-escape site name in routes API path - Wrap all command errors with log.E for contextual diagnostics - Set TLS MinVersion to 1.2 on UniFi client - Simplify redundant fmt.Sprintf in Print calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:37:02 +00:00
// If setting values, save them first
Add User Documentation (User Guide, FAQ, Troubleshooting) (#307) * docs: add user guide, faq, and enhance troubleshooting - Created docs/user-guide.md with key concepts and workflows. - Created docs/faq.md with common questions and answers. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Getting Help sections. - Refactored mkdocs.yml to reflect actual file structure and include new docs. * docs: add user documentation and fix mkdocs navigation - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Help links. - Restored original mkdocs.yml navigation and added new user documentation sections. - Fixed formatting in pkg/io/local/client.go to ensure CI passes. * docs: add user documentation and fix auto-merge workflow - Created docs/user-guide.md and docs/faq.md with user-focused content. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and organized help links. - Refactored mkdocs.yml to include new documentation while preserving technical sections. - Fixed .github/workflows/auto-merge.yml by inlining the logic and adding git repository context (checkout and -R flag) to resolve CI failures. - Verified that docs/workflows.md is present in the repository. * docs: add user documentation and resolve merge conflict - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and Help sections. - Merged latest base branch changes and resolved conflict in .github/workflows/auto-merge.yml. - Verified and organized mkdocs.yml navigation. * docs: add user documentation and fix UniFi security issue - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability (CodeQL alert) by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Verified all documentation links and navigation. * docs: add user documentation and fix formatting/security - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Fixed formatting in internal/cmd/unifi/cmd_config.go. - Verified all documentation links and navigation. --------- Co-authored-by: Claude <developers@lethean.io>
2026-02-05 06:55:52 +00:00
if configURL != "" || configUser != "" || configPass != "" || configAPIKey != "" || insecure != nil {
if err := uf.SaveConfig(configURL, configUser, configPass, configAPIKey, insecure); err != nil {
feat(release): add Homebrew tap support and fix artifact naming (#325) * feat(release): add Homebrew tap support and fix artifact naming - Fix platform naming: binaries now named core-{os}-{arch} instead of just 'core', preventing collision when artifacts merge - Add tar.gz archives for non-Windows builds (Homebrew requirement) - Add update-tap job to alpha-release workflow that auto-updates host-uk/homebrew-tap with checksums on each alpha release - Add homebrew publisher to .core/release.yaml for formal releases - Update install instructions to include brew install Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(unifi): add UniFi Go SDK integration and CLI commands - Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution, and typed accessors for sites, clients, devices, networks, and routes - Add CLI commands: unifi sites, clients, devices, networks, routes, config - Register unifi commands in full variant build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(release): set AppVersion ldflags, git config, and tap token - Set -X pkg/cli.AppVersion in ldflags so core --version reports the correct version instead of "dev" - Add git config user.name/email in update-tap job so commit succeeds - Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo push to host-uk/homebrew-tap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(unifi): address CodeRabbit review feedback - Reject conflicting --wired and --wireless flags in clients command - Complete --type flag help text with bgp and ospf route types - URL-escape site name in routes API path - Wrap all command errors with log.E for contextual diagnostics - Set TLS MinVersion to 1.2 on UniFi client - Simplify redundant fmt.Sprintf in Print calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:37:02 +00:00
return err
}
if configURL != "" {
cli.Success(fmt.Sprintf("UniFi URL set to %s", configURL))
}
if configUser != "" {
cli.Success("UniFi username saved")
}
if configPass != "" {
cli.Success("UniFi password saved")
}
if configAPIKey != "" {
cli.Success("UniFi API key saved")
}
Add User Documentation (User Guide, FAQ, Troubleshooting) (#307) * docs: add user guide, faq, and enhance troubleshooting - Created docs/user-guide.md with key concepts and workflows. - Created docs/faq.md with common questions and answers. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Getting Help sections. - Refactored mkdocs.yml to reflect actual file structure and include new docs. * docs: add user documentation and fix mkdocs navigation - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Help links. - Restored original mkdocs.yml navigation and added new user documentation sections. - Fixed formatting in pkg/io/local/client.go to ensure CI passes. * docs: add user documentation and fix auto-merge workflow - Created docs/user-guide.md and docs/faq.md with user-focused content. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and organized help links. - Refactored mkdocs.yml to include new documentation while preserving technical sections. - Fixed .github/workflows/auto-merge.yml by inlining the logic and adding git repository context (checkout and -R flag) to resolve CI failures. - Verified that docs/workflows.md is present in the repository. * docs: add user documentation and resolve merge conflict - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and Help sections. - Merged latest base branch changes and resolved conflict in .github/workflows/auto-merge.yml. - Verified and organized mkdocs.yml navigation. * docs: add user documentation and fix UniFi security issue - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability (CodeQL alert) by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Verified all documentation links and navigation. * docs: add user documentation and fix formatting/security - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Fixed formatting in internal/cmd/unifi/cmd_config.go. - Verified all documentation links and navigation. --------- Co-authored-by: Claude <developers@lethean.io>
2026-02-05 06:55:52 +00:00
if insecure != nil {
if *insecure {
cli.Warn("UniFi insecure mode enabled")
} else {
cli.Success("UniFi insecure mode disabled")
}
Add User Documentation (User Guide, FAQ, Troubleshooting) (#307) * docs: add user guide, faq, and enhance troubleshooting - Created docs/user-guide.md with key concepts and workflows. - Created docs/faq.md with common questions and answers. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Getting Help sections. - Refactored mkdocs.yml to reflect actual file structure and include new docs. * docs: add user documentation and fix mkdocs navigation - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Help links. - Restored original mkdocs.yml navigation and added new user documentation sections. - Fixed formatting in pkg/io/local/client.go to ensure CI passes. * docs: add user documentation and fix auto-merge workflow - Created docs/user-guide.md and docs/faq.md with user-focused content. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and organized help links. - Refactored mkdocs.yml to include new documentation while preserving technical sections. - Fixed .github/workflows/auto-merge.yml by inlining the logic and adding git repository context (checkout and -R flag) to resolve CI failures. - Verified that docs/workflows.md is present in the repository. * docs: add user documentation and resolve merge conflict - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and Help sections. - Merged latest base branch changes and resolved conflict in .github/workflows/auto-merge.yml. - Verified and organized mkdocs.yml navigation. * docs: add user documentation and fix UniFi security issue - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability (CodeQL alert) by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Verified all documentation links and navigation. * docs: add user documentation and fix formatting/security - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Fixed formatting in internal/cmd/unifi/cmd_config.go. - Verified all documentation links and navigation. --------- Co-authored-by: Claude <developers@lethean.io>
2026-02-05 06:55:52 +00:00
}
feat(release): add Homebrew tap support and fix artifact naming (#325) * feat(release): add Homebrew tap support and fix artifact naming - Fix platform naming: binaries now named core-{os}-{arch} instead of just 'core', preventing collision when artifacts merge - Add tar.gz archives for non-Windows builds (Homebrew requirement) - Add update-tap job to alpha-release workflow that auto-updates host-uk/homebrew-tap with checksums on each alpha release - Add homebrew publisher to .core/release.yaml for formal releases - Update install instructions to include brew install Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(unifi): add UniFi Go SDK integration and CLI commands - Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution, and typed accessors for sites, clients, devices, networks, and routes - Add CLI commands: unifi sites, clients, devices, networks, routes, config - Register unifi commands in full variant build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(release): set AppVersion ldflags, git config, and tap token - Set -X pkg/cli.AppVersion in ldflags so core --version reports the correct version instead of "dev" - Add git config user.name/email in update-tap job so commit succeeds - Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo push to host-uk/homebrew-tap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(unifi): address CodeRabbit review feedback - Reject conflicting --wired and --wireless flags in clients command - Complete --type flag help text with bgp and ospf route types - URL-escape site name in routes API path - Wrap all command errors with log.E for contextual diagnostics - Set TLS MinVersion to 1.2 on UniFi client - Simplify redundant fmt.Sprintf in Print calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:37:02 +00:00
}
// If testing, verify the connection
if configTest {
Add User Documentation (User Guide, FAQ, Troubleshooting) (#307) * docs: add user guide, faq, and enhance troubleshooting - Created docs/user-guide.md with key concepts and workflows. - Created docs/faq.md with common questions and answers. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Getting Help sections. - Refactored mkdocs.yml to reflect actual file structure and include new docs. * docs: add user documentation and fix mkdocs navigation - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Help links. - Restored original mkdocs.yml navigation and added new user documentation sections. - Fixed formatting in pkg/io/local/client.go to ensure CI passes. * docs: add user documentation and fix auto-merge workflow - Created docs/user-guide.md and docs/faq.md with user-focused content. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and organized help links. - Refactored mkdocs.yml to include new documentation while preserving technical sections. - Fixed .github/workflows/auto-merge.yml by inlining the logic and adding git repository context (checkout and -R flag) to resolve CI failures. - Verified that docs/workflows.md is present in the repository. * docs: add user documentation and resolve merge conflict - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and Help sections. - Merged latest base branch changes and resolved conflict in .github/workflows/auto-merge.yml. - Verified and organized mkdocs.yml navigation. * docs: add user documentation and fix UniFi security issue - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability (CodeQL alert) by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Verified all documentation links and navigation. * docs: add user documentation and fix formatting/security - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Fixed formatting in internal/cmd/unifi/cmd_config.go. - Verified all documentation links and navigation. --------- Co-authored-by: Claude <developers@lethean.io>
2026-02-05 06:55:52 +00:00
return runConfigTest(cmd)
feat(release): add Homebrew tap support and fix artifact naming (#325) * feat(release): add Homebrew tap support and fix artifact naming - Fix platform naming: binaries now named core-{os}-{arch} instead of just 'core', preventing collision when artifacts merge - Add tar.gz archives for non-Windows builds (Homebrew requirement) - Add update-tap job to alpha-release workflow that auto-updates host-uk/homebrew-tap with checksums on each alpha release - Add homebrew publisher to .core/release.yaml for formal releases - Update install instructions to include brew install Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(unifi): add UniFi Go SDK integration and CLI commands - Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution, and typed accessors for sites, clients, devices, networks, and routes - Add CLI commands: unifi sites, clients, devices, networks, routes, config - Register unifi commands in full variant build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(release): set AppVersion ldflags, git config, and tap token - Set -X pkg/cli.AppVersion in ldflags so core --version reports the correct version instead of "dev" - Add git config user.name/email in update-tap job so commit succeeds - Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo push to host-uk/homebrew-tap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(unifi): address CodeRabbit review feedback - Reject conflicting --wired and --wireless flags in clients command - Complete --type flag help text with bgp and ospf route types - URL-escape site name in routes API path - Wrap all command errors with log.E for contextual diagnostics - Set TLS MinVersion to 1.2 on UniFi client - Simplify redundant fmt.Sprintf in Print calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:37:02 +00:00
}
// If no flags, show current config
if configURL == "" && configUser == "" && configPass == "" && configAPIKey == "" && !cmd.Flags().Changed("insecure") && !configTest {
feat(release): add Homebrew tap support and fix artifact naming (#325) * feat(release): add Homebrew tap support and fix artifact naming - Fix platform naming: binaries now named core-{os}-{arch} instead of just 'core', preventing collision when artifacts merge - Add tar.gz archives for non-Windows builds (Homebrew requirement) - Add update-tap job to alpha-release workflow that auto-updates host-uk/homebrew-tap with checksums on each alpha release - Add homebrew publisher to .core/release.yaml for formal releases - Update install instructions to include brew install Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(unifi): add UniFi Go SDK integration and CLI commands - Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution, and typed accessors for sites, clients, devices, networks, and routes - Add CLI commands: unifi sites, clients, devices, networks, routes, config - Register unifi commands in full variant build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(release): set AppVersion ldflags, git config, and tap token - Set -X pkg/cli.AppVersion in ldflags so core --version reports the correct version instead of "dev" - Add git config user.name/email in update-tap job so commit succeeds - Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo push to host-uk/homebrew-tap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(unifi): address CodeRabbit review feedback - Reject conflicting --wired and --wireless flags in clients command - Complete --type flag help text with bgp and ospf route types - URL-escape site name in routes API path - Wrap all command errors with log.E for contextual diagnostics - Set TLS MinVersion to 1.2 on UniFi client - Simplify redundant fmt.Sprintf in Print calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:37:02 +00:00
return showConfig()
}
return nil
}
func showConfig() error {
Add User Documentation (User Guide, FAQ, Troubleshooting) (#307) * docs: add user guide, faq, and enhance troubleshooting - Created docs/user-guide.md with key concepts and workflows. - Created docs/faq.md with common questions and answers. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Getting Help sections. - Refactored mkdocs.yml to reflect actual file structure and include new docs. * docs: add user documentation and fix mkdocs navigation - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Help links. - Restored original mkdocs.yml navigation and added new user documentation sections. - Fixed formatting in pkg/io/local/client.go to ensure CI passes. * docs: add user documentation and fix auto-merge workflow - Created docs/user-guide.md and docs/faq.md with user-focused content. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and organized help links. - Refactored mkdocs.yml to include new documentation while preserving technical sections. - Fixed .github/workflows/auto-merge.yml by inlining the logic and adding git repository context (checkout and -R flag) to resolve CI failures. - Verified that docs/workflows.md is present in the repository. * docs: add user documentation and resolve merge conflict - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and Help sections. - Merged latest base branch changes and resolved conflict in .github/workflows/auto-merge.yml. - Verified and organized mkdocs.yml navigation. * docs: add user documentation and fix UniFi security issue - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability (CodeQL alert) by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Verified all documentation links and navigation. * docs: add user documentation and fix formatting/security - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Fixed formatting in internal/cmd/unifi/cmd_config.go. - Verified all documentation links and navigation. --------- Co-authored-by: Claude <developers@lethean.io>
2026-02-05 06:55:52 +00:00
url, user, pass, apikey, insecure, err := uf.ResolveConfig("", "", "", "", nil)
feat(release): add Homebrew tap support and fix artifact naming (#325) * feat(release): add Homebrew tap support and fix artifact naming - Fix platform naming: binaries now named core-{os}-{arch} instead of just 'core', preventing collision when artifacts merge - Add tar.gz archives for non-Windows builds (Homebrew requirement) - Add update-tap job to alpha-release workflow that auto-updates host-uk/homebrew-tap with checksums on each alpha release - Add homebrew publisher to .core/release.yaml for formal releases - Update install instructions to include brew install Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(unifi): add UniFi Go SDK integration and CLI commands - Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution, and typed accessors for sites, clients, devices, networks, and routes - Add CLI commands: unifi sites, clients, devices, networks, routes, config - Register unifi commands in full variant build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(release): set AppVersion ldflags, git config, and tap token - Set -X pkg/cli.AppVersion in ldflags so core --version reports the correct version instead of "dev" - Add git config user.name/email in update-tap job so commit succeeds - Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo push to host-uk/homebrew-tap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(unifi): address CodeRabbit review feedback - Reject conflicting --wired and --wireless flags in clients command - Complete --type flag help text with bgp and ospf route types - URL-escape site name in routes API path - Wrap all command errors with log.E for contextual diagnostics - Set TLS MinVersion to 1.2 on UniFi client - Simplify redundant fmt.Sprintf in Print calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:37:02 +00:00
if err != nil {
return err
}
cli.Blank()
cli.Print(" %s %s\n", dimStyle.Render("URL:"), valueStyle.Render(url))
if user != "" {
cli.Print(" %s %s\n", dimStyle.Render("User:"), valueStyle.Render(user))
} else {
cli.Print(" %s %s\n", dimStyle.Render("User:"), warningStyle.Render("not set"))
}
if pass != "" {
cli.Print(" %s %s\n", dimStyle.Render("Pass:"), valueStyle.Render("****"))
} else {
cli.Print(" %s %s\n", dimStyle.Render("Pass:"), warningStyle.Render("not set"))
}
if apikey != "" {
masked := apikey
if len(apikey) >= 8 {
masked = apikey[:4] + "..." + apikey[len(apikey)-4:]
}
cli.Print(" %s %s\n", dimStyle.Render("API Key:"), valueStyle.Render(masked))
} else {
cli.Print(" %s %s\n", dimStyle.Render("API Key:"), warningStyle.Render("not set"))
}
Remove StrictHostKeyChecking=no from SSH commands (#315) * Remove StrictHostKeyChecking=no and implement proper host key verification This commit addresses security concerns from the OWASP audit by enforcing strict host key verification for all SSH and SCP commands. Key changes: - Replaced StrictHostKeyChecking=accept-new with yes in pkg/container and pkg/devops. - Removed insecure host key verification from pkg/ansible SSH client. - Implemented a synchronous host key discovery mechanism during VM boot using ssh-keyscan to populate ~/.core/known_hosts. - Updated the devops Boot lifecycle to wait until the host key is verified. - Ensured pkg/ansible correctly handles missing known_hosts files. - Refactored hardcoded SSH port 2222 to a package constant DefaultSSHPort. - Added CORE_SKIP_SSH_SCAN environment variable for test environments. * Remove StrictHostKeyChecking=no and implement proper host key verification Addresses security concerns from OWASP audit by enforcing strict host key verification. Changes: - Replaced StrictHostKeyChecking=accept-new with yes in pkg/container and devops. - Removed insecure host key verification from pkg/ansible. - Added 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. - Fixed formatting issues identified by QA check. * Secure SSH commands and fix auto-merge CI failure Addresses OWASP security audit by enforcing strict host key verification and fixes a CI failure in the auto-merge workflow. Key changes: - Replaced StrictHostKeyChecking=accept-new with yes in pkg/container and pkg/devops. - Removed insecure host key verification from pkg/ansible. - Implemented synchronous host key discovery using ssh-keyscan during VM boot. - Handled missing known_hosts file in pkg/ansible. - Refactored hardcoded SSH port to DefaultSSHPort constant. - Added pkg/ansible/ssh_test.go to verify SSH client initialization. - Fixed formatting in pkg/io/local/client.go. - Fixed auto-merge.yml by inlining the script and providing repository context to 'gh' command, resolving the "not a git repository" error in CI. * 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. * Secure SSH and TLS connections, and fix CI issues Addresses security concerns from OWASP audit and CodeQL by enforcing strict host key verification and TLS certificate verification. Security Changes: - Enforced strict SSH host key checking in pkg/container and devops. - Removed insecure SSH host key verification from pkg/ansible. - Added synchronous host key discovery during VM boot using ssh-keyscan. - Updated UniFi client to enforce TLS certificate verification by default. - Added --insecure flag and config option for UniFi to allow opt-in to skipping TLS verification for self-signed certificates. CI and Maintenance: - Fixed auto-merge workflow by providing repository context to 'gh' command. - Resolved merge conflicts in .github/workflows/auto-merge.yml. - Added unit tests for secured Ansible SSH client. - Fixed formatting issues identified by QA checks. * fix: gofmt alignment in cmd_config.go Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Secure connections, fix CI auto-merge, and resolve formatting Addresses OWASP security audit and CodeQL security alerts by enforcing secure defaults for SSH and TLS connections. Key changes: - Enforced strict SSH host key checking (StrictHostKeyChecking=yes). - Implemented synchronous host key verification during VM boot using ssh-keyscan. - Updated UniFi client to enforce TLS certificate verification by default. - Added --insecure flag and config option for UniFi to allow opt-in to skipping TLS verification. - Fixed auto-merge workflow by providing repository context to 'gh' command. - Resolved merge conflicts in .github/workflows/auto-merge.yml. - Fixed formatting in internal/cmd/unifi/cmd_config.go and pkg/io/local/client.go. - Added unit tests for secured Ansible SSH client. --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Claude <developers@lethean.io>
2026-02-05 07:09:34 +00:00
if insecure {
cli.Print(" %s %s\n", dimStyle.Render("Insecure:"), warningStyle.Render("enabled"))
} else {
cli.Print(" %s %s\n", dimStyle.Render("Insecure:"), successStyle.Render("disabled"))
}
Add User Documentation (User Guide, FAQ, Troubleshooting) (#307) * docs: add user guide, faq, and enhance troubleshooting - Created docs/user-guide.md with key concepts and workflows. - Created docs/faq.md with common questions and answers. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Getting Help sections. - Refactored mkdocs.yml to reflect actual file structure and include new docs. * docs: add user documentation and fix mkdocs navigation - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Help links. - Restored original mkdocs.yml navigation and added new user documentation sections. - Fixed formatting in pkg/io/local/client.go to ensure CI passes. * docs: add user documentation and fix auto-merge workflow - Created docs/user-guide.md and docs/faq.md with user-focused content. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and organized help links. - Refactored mkdocs.yml to include new documentation while preserving technical sections. - Fixed .github/workflows/auto-merge.yml by inlining the logic and adding git repository context (checkout and -R flag) to resolve CI failures. - Verified that docs/workflows.md is present in the repository. * docs: add user documentation and resolve merge conflict - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and Help sections. - Merged latest base branch changes and resolved conflict in .github/workflows/auto-merge.yml. - Verified and organized mkdocs.yml navigation. * docs: add user documentation and fix UniFi security issue - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability (CodeQL alert) by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Verified all documentation links and navigation. * docs: add user documentation and fix formatting/security - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Fixed formatting in internal/cmd/unifi/cmd_config.go. - Verified all documentation links and navigation. --------- Co-authored-by: Claude <developers@lethean.io>
2026-02-05 06:55:52 +00:00
feat(release): add Homebrew tap support and fix artifact naming (#325) * feat(release): add Homebrew tap support and fix artifact naming - Fix platform naming: binaries now named core-{os}-{arch} instead of just 'core', preventing collision when artifacts merge - Add tar.gz archives for non-Windows builds (Homebrew requirement) - Add update-tap job to alpha-release workflow that auto-updates host-uk/homebrew-tap with checksums on each alpha release - Add homebrew publisher to .core/release.yaml for formal releases - Update install instructions to include brew install Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(unifi): add UniFi Go SDK integration and CLI commands - Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution, and typed accessors for sites, clients, devices, networks, and routes - Add CLI commands: unifi sites, clients, devices, networks, routes, config - Register unifi commands in full variant build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(release): set AppVersion ldflags, git config, and tap token - Set -X pkg/cli.AppVersion in ldflags so core --version reports the correct version instead of "dev" - Add git config user.name/email in update-tap job so commit succeeds - Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo push to host-uk/homebrew-tap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(unifi): address CodeRabbit review feedback - Reject conflicting --wired and --wireless flags in clients command - Complete --type flag help text with bgp and ospf route types - URL-escape site name in routes API path - Wrap all command errors with log.E for contextual diagnostics - Set TLS MinVersion to 1.2 on UniFi client - Simplify redundant fmt.Sprintf in Print calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:37:02 +00:00
cli.Blank()
return nil
}
Add User Documentation (User Guide, FAQ, Troubleshooting) (#307) * docs: add user guide, faq, and enhance troubleshooting - Created docs/user-guide.md with key concepts and workflows. - Created docs/faq.md with common questions and answers. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Getting Help sections. - Refactored mkdocs.yml to reflect actual file structure and include new docs. * docs: add user documentation and fix mkdocs navigation - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issues. - Updated README.md with CLI Quick Start and Help links. - Restored original mkdocs.yml navigation and added new user documentation sections. - Fixed formatting in pkg/io/local/client.go to ensure CI passes. * docs: add user documentation and fix auto-merge workflow - Created docs/user-guide.md and docs/faq.md with user-focused content. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and organized help links. - Refactored mkdocs.yml to include new documentation while preserving technical sections. - Fixed .github/workflows/auto-merge.yml by inlining the logic and adding git repository context (checkout and -R flag) to resolve CI failures. - Verified that docs/workflows.md is present in the repository. * docs: add user documentation and resolve merge conflict - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md with AI/Agentic issue solutions. - Updated README.md with CLI Quick Start and Help sections. - Merged latest base branch changes and resolved conflict in .github/workflows/auto-merge.yml. - Verified and organized mkdocs.yml navigation. * docs: add user documentation and fix UniFi security issue - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability (CodeQL alert) by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Verified all documentation links and navigation. * docs: add user documentation and fix formatting/security - Created docs/user-guide.md and docs/faq.md. - Enhanced docs/troubleshooting.md. - Updated README.md with CLI Quick Start. - Fixed UniFi security vulnerability by making TLS verification configurable. - Added --insecure flag to UniFi CLI commands. - Fixed formatting in internal/cmd/unifi/cmd_config.go. - Verified all documentation links and navigation. --------- Co-authored-by: Claude <developers@lethean.io>
2026-02-05 06:55:52 +00:00
func runConfigTest(cmd *cli.Command) error {
var insecure *bool
if cmd.Flags().Changed("insecure") {
insecure = &configInsecure
}
client, err := uf.NewFromConfig(configURL, configUser, configPass, configAPIKey, insecure)
feat(release): add Homebrew tap support and fix artifact naming (#325) * feat(release): add Homebrew tap support and fix artifact naming - Fix platform naming: binaries now named core-{os}-{arch} instead of just 'core', preventing collision when artifacts merge - Add tar.gz archives for non-Windows builds (Homebrew requirement) - Add update-tap job to alpha-release workflow that auto-updates host-uk/homebrew-tap with checksums on each alpha release - Add homebrew publisher to .core/release.yaml for formal releases - Update install instructions to include brew install Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(unifi): add UniFi Go SDK integration and CLI commands - Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution, and typed accessors for sites, clients, devices, networks, and routes - Add CLI commands: unifi sites, clients, devices, networks, routes, config - Register unifi commands in full variant build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(release): set AppVersion ldflags, git config, and tap token - Set -X pkg/cli.AppVersion in ldflags so core --version reports the correct version instead of "dev" - Add git config user.name/email in update-tap job so commit succeeds - Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo push to host-uk/homebrew-tap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(unifi): address CodeRabbit review feedback - Reject conflicting --wired and --wireless flags in clients command - Complete --type flag help text with bgp and ospf route types - URL-escape site name in routes API path - Wrap all command errors with log.E for contextual diagnostics - Set TLS MinVersion to 1.2 on UniFi client - Simplify redundant fmt.Sprintf in Print calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:37:02 +00:00
if err != nil {
return err
}
sites, err := client.GetSites()
if err != nil {
cli.Error("Connection failed")
return cli.WrapVerb(err, "connect to", "UniFi controller")
}
cli.Blank()
cli.Success(fmt.Sprintf("Connected to %s", client.URL()))
cli.Print(" %s %s\n", dimStyle.Render("Sites:"), numberStyle.Render(fmt.Sprintf("%d", len(sites))))
for _, s := range sites {
cli.Print(" %s %s\n", valueStyle.Render(s.Name), dimStyle.Render(s.Desc))
}
cli.Blank()
return nil
}