aidevops 2.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/AGENTS.md +614 -0
- package/.agent/accounts.md +65 -0
- package/.agent/aidevops/add-new-mcp-to-aidevops.md +456 -0
- package/.agent/aidevops/api-integrations.md +335 -0
- package/.agent/aidevops/architecture.md +510 -0
- package/.agent/aidevops/configs.md +274 -0
- package/.agent/aidevops/docs.md +244 -0
- package/.agent/aidevops/extension.md +311 -0
- package/.agent/aidevops/mcp-integrations.md +340 -0
- package/.agent/aidevops/mcp-troubleshooting.md +162 -0
- package/.agent/aidevops/memory-patterns.md +172 -0
- package/.agent/aidevops/providers.md +217 -0
- package/.agent/aidevops/recommendations.md +321 -0
- package/.agent/aidevops/requirements.md +301 -0
- package/.agent/aidevops/resources.md +214 -0
- package/.agent/aidevops/security-requirements.md +174 -0
- package/.agent/aidevops/security.md +350 -0
- package/.agent/aidevops/service-links.md +400 -0
- package/.agent/aidevops/services.md +357 -0
- package/.agent/aidevops/setup.md +153 -0
- package/.agent/aidevops/troubleshooting.md +389 -0
- package/.agent/aidevops.md +124 -0
- package/.agent/build-plus.md +244 -0
- package/.agent/content/guidelines.md +109 -0
- package/.agent/content.md +87 -0
- package/.agent/health.md +59 -0
- package/.agent/legal.md +59 -0
- package/.agent/loop-state/full-loop.local.md +16 -0
- package/.agent/loop-state/ralph-loop.local.md +10 -0
- package/.agent/marketing.md +440 -0
- package/.agent/memory/README.md +260 -0
- package/.agent/onboarding.md +796 -0
- package/.agent/plan-plus.md +245 -0
- package/.agent/research.md +100 -0
- package/.agent/sales.md +333 -0
- package/.agent/scripts/101domains-helper.sh +701 -0
- package/.agent/scripts/add-missing-returns.sh +140 -0
- package/.agent/scripts/agent-browser-helper.sh +311 -0
- package/.agent/scripts/agno-setup.sh +712 -0
- package/.agent/scripts/ahrefs-mcp-wrapper.js +168 -0
- package/.agent/scripts/aidevops-update-check.sh +71 -0
- package/.agent/scripts/ampcode-cli.sh +522 -0
- package/.agent/scripts/auto-version-bump.sh +156 -0
- package/.agent/scripts/autogen-helper.sh +512 -0
- package/.agent/scripts/beads-sync-helper.sh +596 -0
- package/.agent/scripts/closte-helper.sh +5 -0
- package/.agent/scripts/cloudron-helper.sh +321 -0
- package/.agent/scripts/codacy-cli-chunked.sh +581 -0
- package/.agent/scripts/codacy-cli.sh +442 -0
- package/.agent/scripts/code-audit-helper.sh +5 -0
- package/.agent/scripts/coderabbit-cli.sh +417 -0
- package/.agent/scripts/coderabbit-pro-analysis.sh +238 -0
- package/.agent/scripts/commands/code-simplifier.md +86 -0
- package/.agent/scripts/commands/full-loop.md +246 -0
- package/.agent/scripts/commands/postflight-loop.md +103 -0
- package/.agent/scripts/commands/recall.md +182 -0
- package/.agent/scripts/commands/remember.md +132 -0
- package/.agent/scripts/commands/save-todo.md +175 -0
- package/.agent/scripts/commands/session-review.md +154 -0
- package/.agent/scripts/comprehensive-quality-fix.sh +106 -0
- package/.agent/scripts/context-builder-helper.sh +522 -0
- package/.agent/scripts/coolify-cli-helper.sh +674 -0
- package/.agent/scripts/coolify-helper.sh +380 -0
- package/.agent/scripts/crawl4ai-examples.sh +401 -0
- package/.agent/scripts/crawl4ai-helper.sh +1078 -0
- package/.agent/scripts/crewai-helper.sh +681 -0
- package/.agent/scripts/dev-browser-helper.sh +513 -0
- package/.agent/scripts/dns-helper.sh +396 -0
- package/.agent/scripts/domain-research-helper.sh +917 -0
- package/.agent/scripts/dspy-helper.sh +285 -0
- package/.agent/scripts/dspyground-helper.sh +291 -0
- package/.agent/scripts/eeat-score-helper.sh +1242 -0
- package/.agent/scripts/efficient-return-fix.sh +92 -0
- package/.agent/scripts/extract-opencode-prompts.sh +128 -0
- package/.agent/scripts/find-missing-returns.sh +113 -0
- package/.agent/scripts/fix-auth-headers.sh +104 -0
- package/.agent/scripts/fix-common-strings.sh +254 -0
- package/.agent/scripts/fix-content-type.sh +100 -0
- package/.agent/scripts/fix-error-messages.sh +130 -0
- package/.agent/scripts/fix-misplaced-returns.sh +74 -0
- package/.agent/scripts/fix-remaining-literals.sh +152 -0
- package/.agent/scripts/fix-return-statements.sh +41 -0
- package/.agent/scripts/fix-s131-default-cases.sh +249 -0
- package/.agent/scripts/fix-sc2155-simple.sh +102 -0
- package/.agent/scripts/fix-shellcheck-critical.sh +187 -0
- package/.agent/scripts/fix-string-literals.sh +273 -0
- package/.agent/scripts/full-loop-helper.sh +773 -0
- package/.agent/scripts/generate-opencode-agents.sh +497 -0
- package/.agent/scripts/generate-opencode-commands.sh +1629 -0
- package/.agent/scripts/generate-skills.sh +366 -0
- package/.agent/scripts/git-platforms-helper.sh +640 -0
- package/.agent/scripts/gitea-cli-helper.sh +743 -0
- package/.agent/scripts/github-cli-helper.sh +702 -0
- package/.agent/scripts/gitlab-cli-helper.sh +682 -0
- package/.agent/scripts/gsc-add-user-helper.sh +325 -0
- package/.agent/scripts/gsc-sitemap-helper.sh +678 -0
- package/.agent/scripts/hetzner-helper.sh +485 -0
- package/.agent/scripts/hostinger-helper.sh +229 -0
- package/.agent/scripts/keyword-research-helper.sh +1815 -0
- package/.agent/scripts/langflow-helper.sh +544 -0
- package/.agent/scripts/linkedin-automation.py +241 -0
- package/.agent/scripts/linter-manager.sh +599 -0
- package/.agent/scripts/linters-local.sh +434 -0
- package/.agent/scripts/list-keys-helper.sh +488 -0
- package/.agent/scripts/local-browser-automation.py +339 -0
- package/.agent/scripts/localhost-helper.sh +744 -0
- package/.agent/scripts/loop-common.sh +806 -0
- package/.agent/scripts/mainwp-helper.sh +728 -0
- package/.agent/scripts/markdown-formatter.sh +338 -0
- package/.agent/scripts/markdown-lint-fix.sh +311 -0
- package/.agent/scripts/mass-fix-returns.sh +58 -0
- package/.agent/scripts/mcp-diagnose.sh +167 -0
- package/.agent/scripts/mcp-inspector-helper.sh +449 -0
- package/.agent/scripts/memory-helper.sh +650 -0
- package/.agent/scripts/monitor-code-review.sh +255 -0
- package/.agent/scripts/onboarding-helper.sh +706 -0
- package/.agent/scripts/opencode-github-setup-helper.sh +797 -0
- package/.agent/scripts/opencode-test-helper.sh +213 -0
- package/.agent/scripts/pagespeed-helper.sh +464 -0
- package/.agent/scripts/pandoc-helper.sh +362 -0
- package/.agent/scripts/postflight-check.sh +555 -0
- package/.agent/scripts/pre-commit-hook.sh +259 -0
- package/.agent/scripts/pre-edit-check.sh +169 -0
- package/.agent/scripts/qlty-cli.sh +356 -0
- package/.agent/scripts/quality-cli-manager.sh +525 -0
- package/.agent/scripts/quality-feedback-helper.sh +462 -0
- package/.agent/scripts/quality-fix.sh +263 -0
- package/.agent/scripts/quality-loop-helper.sh +1108 -0
- package/.agent/scripts/ralph-loop-helper.sh +836 -0
- package/.agent/scripts/ralph-upstream-check.sh +341 -0
- package/.agent/scripts/secretlint-helper.sh +847 -0
- package/.agent/scripts/servers-helper.sh +241 -0
- package/.agent/scripts/ses-helper.sh +619 -0
- package/.agent/scripts/session-review-helper.sh +404 -0
- package/.agent/scripts/setup-linters-wizard.sh +379 -0
- package/.agent/scripts/setup-local-api-keys.sh +330 -0
- package/.agent/scripts/setup-mcp-integrations.sh +472 -0
- package/.agent/scripts/shared-constants.sh +246 -0
- package/.agent/scripts/site-crawler-helper.sh +1487 -0
- package/.agent/scripts/snyk-helper.sh +940 -0
- package/.agent/scripts/sonarcloud-autofix.sh +193 -0
- package/.agent/scripts/sonarcloud-cli.sh +191 -0
- package/.agent/scripts/sonarscanner-cli.sh +455 -0
- package/.agent/scripts/spaceship-helper.sh +747 -0
- package/.agent/scripts/stagehand-helper.sh +321 -0
- package/.agent/scripts/stagehand-python-helper.sh +321 -0
- package/.agent/scripts/stagehand-python-setup.sh +441 -0
- package/.agent/scripts/stagehand-setup.sh +439 -0
- package/.agent/scripts/system-cleanup.sh +340 -0
- package/.agent/scripts/terminal-title-helper.sh +388 -0
- package/.agent/scripts/terminal-title-setup.sh +549 -0
- package/.agent/scripts/test-stagehand-both-integration.sh +317 -0
- package/.agent/scripts/test-stagehand-integration.sh +309 -0
- package/.agent/scripts/test-stagehand-python-integration.sh +341 -0
- package/.agent/scripts/todo-ready.sh +263 -0
- package/.agent/scripts/tool-version-check.sh +362 -0
- package/.agent/scripts/toon-helper.sh +469 -0
- package/.agent/scripts/twilio-helper.sh +917 -0
- package/.agent/scripts/updown-helper.sh +279 -0
- package/.agent/scripts/validate-mcp-integrations.sh +250 -0
- package/.agent/scripts/validate-version-consistency.sh +131 -0
- package/.agent/scripts/vaultwarden-helper.sh +597 -0
- package/.agent/scripts/vercel-cli-helper.sh +816 -0
- package/.agent/scripts/verify-mirrors.sh +169 -0
- package/.agent/scripts/version-manager.sh +831 -0
- package/.agent/scripts/webhosting-helper.sh +471 -0
- package/.agent/scripts/webhosting-verify.sh +238 -0
- package/.agent/scripts/wordpress-mcp-helper.sh +508 -0
- package/.agent/scripts/worktree-helper.sh +595 -0
- package/.agent/scripts/worktree-sessions.sh +577 -0
- package/.agent/seo/dataforseo.md +215 -0
- package/.agent/seo/domain-research.md +532 -0
- package/.agent/seo/eeat-score.md +659 -0
- package/.agent/seo/google-search-console.md +366 -0
- package/.agent/seo/gsc-sitemaps.md +282 -0
- package/.agent/seo/keyword-research.md +521 -0
- package/.agent/seo/serper.md +278 -0
- package/.agent/seo/site-crawler.md +387 -0
- package/.agent/seo.md +236 -0
- package/.agent/services/accounting/quickfile.md +159 -0
- package/.agent/services/communications/telfon.md +470 -0
- package/.agent/services/communications/twilio.md +569 -0
- package/.agent/services/crm/fluentcrm.md +449 -0
- package/.agent/services/email/ses.md +399 -0
- package/.agent/services/hosting/101domains.md +378 -0
- package/.agent/services/hosting/closte.md +177 -0
- package/.agent/services/hosting/cloudflare.md +251 -0
- package/.agent/services/hosting/cloudron.md +478 -0
- package/.agent/services/hosting/dns-providers.md +335 -0
- package/.agent/services/hosting/domain-purchasing.md +344 -0
- package/.agent/services/hosting/hetzner.md +327 -0
- package/.agent/services/hosting/hostinger.md +287 -0
- package/.agent/services/hosting/localhost.md +419 -0
- package/.agent/services/hosting/spaceship.md +353 -0
- package/.agent/services/hosting/webhosting.md +330 -0
- package/.agent/social-media.md +69 -0
- package/.agent/templates/plans-template.md +114 -0
- package/.agent/templates/prd-template.md +129 -0
- package/.agent/templates/tasks-template.md +108 -0
- package/.agent/templates/todo-template.md +89 -0
- package/.agent/tools/ai-assistants/agno.md +471 -0
- package/.agent/tools/ai-assistants/capsolver.md +326 -0
- package/.agent/tools/ai-assistants/configuration.md +221 -0
- package/.agent/tools/ai-assistants/overview.md +209 -0
- package/.agent/tools/ai-assistants/status.md +171 -0
- package/.agent/tools/ai-assistants/windsurf.md +193 -0
- package/.agent/tools/ai-orchestration/autogen.md +406 -0
- package/.agent/tools/ai-orchestration/crewai.md +445 -0
- package/.agent/tools/ai-orchestration/langflow.md +405 -0
- package/.agent/tools/ai-orchestration/openprose.md +487 -0
- package/.agent/tools/ai-orchestration/overview.md +362 -0
- package/.agent/tools/ai-orchestration/packaging.md +647 -0
- package/.agent/tools/browser/agent-browser.md +464 -0
- package/.agent/tools/browser/browser-automation.md +400 -0
- package/.agent/tools/browser/chrome-devtools.md +282 -0
- package/.agent/tools/browser/crawl4ai-integration.md +422 -0
- package/.agent/tools/browser/crawl4ai-resources.md +277 -0
- package/.agent/tools/browser/crawl4ai-usage.md +416 -0
- package/.agent/tools/browser/crawl4ai.md +585 -0
- package/.agent/tools/browser/dev-browser.md +341 -0
- package/.agent/tools/browser/pagespeed.md +260 -0
- package/.agent/tools/browser/playwright.md +266 -0
- package/.agent/tools/browser/playwriter.md +310 -0
- package/.agent/tools/browser/stagehand-examples.md +456 -0
- package/.agent/tools/browser/stagehand-python.md +483 -0
- package/.agent/tools/browser/stagehand.md +421 -0
- package/.agent/tools/build-agent/agent-review.md +224 -0
- package/.agent/tools/build-agent/build-agent.md +784 -0
- package/.agent/tools/build-mcp/aidevops-plugin.md +476 -0
- package/.agent/tools/build-mcp/api-wrapper.md +445 -0
- package/.agent/tools/build-mcp/build-mcp.md +240 -0
- package/.agent/tools/build-mcp/deployment.md +401 -0
- package/.agent/tools/build-mcp/server-patterns.md +632 -0
- package/.agent/tools/build-mcp/transports.md +366 -0
- package/.agent/tools/code-review/auditing.md +383 -0
- package/.agent/tools/code-review/automation.md +219 -0
- package/.agent/tools/code-review/best-practices.md +203 -0
- package/.agent/tools/code-review/codacy.md +151 -0
- package/.agent/tools/code-review/code-simplifier.md +174 -0
- package/.agent/tools/code-review/code-standards.md +309 -0
- package/.agent/tools/code-review/coderabbit.md +101 -0
- package/.agent/tools/code-review/management.md +155 -0
- package/.agent/tools/code-review/qlty.md +248 -0
- package/.agent/tools/code-review/secretlint.md +565 -0
- package/.agent/tools/code-review/setup.md +250 -0
- package/.agent/tools/code-review/snyk.md +563 -0
- package/.agent/tools/code-review/tools.md +230 -0
- package/.agent/tools/content/summarize.md +353 -0
- package/.agent/tools/context/augment-context-engine.md +468 -0
- package/.agent/tools/context/context-builder-agent.md +76 -0
- package/.agent/tools/context/context-builder.md +375 -0
- package/.agent/tools/context/context7.md +371 -0
- package/.agent/tools/context/dspy.md +302 -0
- package/.agent/tools/context/dspyground.md +374 -0
- package/.agent/tools/context/llm-tldr.md +219 -0
- package/.agent/tools/context/osgrep.md +488 -0
- package/.agent/tools/context/prompt-optimization.md +338 -0
- package/.agent/tools/context/toon.md +292 -0
- package/.agent/tools/conversion/pandoc.md +304 -0
- package/.agent/tools/credentials/api-key-management.md +154 -0
- package/.agent/tools/credentials/api-key-setup.md +224 -0
- package/.agent/tools/credentials/environment-variables.md +180 -0
- package/.agent/tools/credentials/vaultwarden.md +382 -0
- package/.agent/tools/data-extraction/outscraper.md +974 -0
- package/.agent/tools/deployment/coolify-cli.md +388 -0
- package/.agent/tools/deployment/coolify-setup.md +353 -0
- package/.agent/tools/deployment/coolify.md +345 -0
- package/.agent/tools/deployment/vercel.md +390 -0
- package/.agent/tools/git/authentication.md +132 -0
- package/.agent/tools/git/gitea-cli.md +193 -0
- package/.agent/tools/git/github-actions.md +207 -0
- package/.agent/tools/git/github-cli.md +223 -0
- package/.agent/tools/git/gitlab-cli.md +190 -0
- package/.agent/tools/git/opencode-github-security.md +350 -0
- package/.agent/tools/git/opencode-github.md +328 -0
- package/.agent/tools/git/opencode-gitlab.md +252 -0
- package/.agent/tools/git/security.md +196 -0
- package/.agent/tools/git.md +207 -0
- package/.agent/tools/opencode/oh-my-opencode.md +375 -0
- package/.agent/tools/opencode/opencode-anthropic-auth.md +446 -0
- package/.agent/tools/opencode/opencode.md +651 -0
- package/.agent/tools/social-media/bird.md +437 -0
- package/.agent/tools/task-management/beads.md +336 -0
- package/.agent/tools/terminal/terminal-title.md +251 -0
- package/.agent/tools/ui/shadcn.md +196 -0
- package/.agent/tools/ui/ui-skills.md +115 -0
- package/.agent/tools/wordpress/localwp.md +311 -0
- package/.agent/tools/wordpress/mainwp.md +391 -0
- package/.agent/tools/wordpress/scf.md +527 -0
- package/.agent/tools/wordpress/wp-admin.md +729 -0
- package/.agent/tools/wordpress/wp-dev.md +940 -0
- package/.agent/tools/wordpress/wp-preferred.md +398 -0
- package/.agent/tools/wordpress.md +95 -0
- package/.agent/workflows/branch/bugfix.md +63 -0
- package/.agent/workflows/branch/chore.md +95 -0
- package/.agent/workflows/branch/experiment.md +115 -0
- package/.agent/workflows/branch/feature.md +59 -0
- package/.agent/workflows/branch/hotfix.md +98 -0
- package/.agent/workflows/branch/refactor.md +92 -0
- package/.agent/workflows/branch/release.md +96 -0
- package/.agent/workflows/branch.md +347 -0
- package/.agent/workflows/bug-fixing.md +267 -0
- package/.agent/workflows/changelog.md +129 -0
- package/.agent/workflows/code-audit-remote.md +279 -0
- package/.agent/workflows/conversation-starter.md +69 -0
- package/.agent/workflows/error-feedback.md +578 -0
- package/.agent/workflows/feature-development.md +355 -0
- package/.agent/workflows/git-workflow.md +702 -0
- package/.agent/workflows/multi-repo-workspace.md +268 -0
- package/.agent/workflows/plans.md +709 -0
- package/.agent/workflows/postflight.md +604 -0
- package/.agent/workflows/pr.md +571 -0
- package/.agent/workflows/preflight.md +278 -0
- package/.agent/workflows/ralph-loop.md +773 -0
- package/.agent/workflows/release.md +498 -0
- package/.agent/workflows/session-manager.md +254 -0
- package/.agent/workflows/session-review.md +311 -0
- package/.agent/workflows/sql-migrations.md +631 -0
- package/.agent/workflows/version-bump.md +283 -0
- package/.agent/workflows/wiki-update.md +333 -0
- package/.agent/workflows/worktree.md +477 -0
- package/LICENSE +21 -0
- package/README.md +1446 -0
- package/VERSION +1 -0
- package/aidevops.sh +1746 -0
- package/bin/aidevops +21 -0
- package/package.json +75 -0
- package/scripts/npm-postinstall.js +60 -0
- package/setup.sh +2366 -0
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# shellcheck disable=SC2034,SC2155,SC2317,SC2329,SC2016,SC2181,SC1091,SC2154,SC2015,SC2086,SC2129,SC2030,SC2031,SC2119,SC2120,SC2001,SC2162,SC2088,SC2089,SC2090,SC2029,SC2006,SC2153
|
|
3
|
+
|
|
4
|
+
# DNS Management Helper Script
|
|
5
|
+
# Manages DNS records across multiple providers
|
|
6
|
+
|
|
7
|
+
# Source shared constants if available
|
|
8
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || exit
|
|
9
|
+
source "$SCRIPT_DIR/shared-constants.sh" 2>/dev/null || true
|
|
10
|
+
|
|
11
|
+
# Colors for output
|
|
12
|
+
GREEN='\033[0;32m'
|
|
13
|
+
BLUE='\033[0;34m'
|
|
14
|
+
YELLOW='\033[1;33m'
|
|
15
|
+
RED='\033[0;31m'
|
|
16
|
+
NC='\033[0m' # No Color
|
|
17
|
+
|
|
18
|
+
# Common message constants
|
|
19
|
+
readonly HELP_SHOW_MESSAGE="Show this help"
|
|
20
|
+
readonly USAGE_COMMAND_OPTIONS="Usage: $0 [command] [options]"
|
|
21
|
+
readonly HELP_USAGE_INFO="Use '$0 help' for usage information"
|
|
22
|
+
|
|
23
|
+
# Common constants
|
|
24
|
+
readonly AUTH_BEARER_PREFIX="Authorization: Bearer"
|
|
25
|
+
|
|
26
|
+
print_info() {
|
|
27
|
+
local msg="$1"
|
|
28
|
+
echo -e "${BLUE}[INFO]${NC} $msg"
|
|
29
|
+
return 0
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
print_success() {
|
|
33
|
+
local msg="$1"
|
|
34
|
+
echo -e "${GREEN}[SUCCESS]${NC} $msg"
|
|
35
|
+
return 0
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
print_warning() {
|
|
39
|
+
local msg="$1"
|
|
40
|
+
echo -e "${YELLOW}[WARNING]${NC} $msg"
|
|
41
|
+
return 0
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
print_error() {
|
|
45
|
+
local msg="$1"
|
|
46
|
+
echo -e "${RED}[ERROR]${NC} $msg" >&2
|
|
47
|
+
return 0
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
# Configuration directory
|
|
51
|
+
CONFIG_DIR="../configs"
|
|
52
|
+
|
|
53
|
+
# Constants for repeated strings
|
|
54
|
+
readonly PROVIDER_CLOUDFLARE="cloudflare"
|
|
55
|
+
readonly PROVIDER_NAMECHEAP="namecheap"
|
|
56
|
+
readonly PROVIDER_ROUTE53="route53"
|
|
57
|
+
|
|
58
|
+
# Get provider config file
|
|
59
|
+
get_provider_config() {
|
|
60
|
+
local provider="$1"
|
|
61
|
+
|
|
62
|
+
case "$provider" in
|
|
63
|
+
"$PROVIDER_CLOUDFLARE")
|
|
64
|
+
echo "$CONFIG_DIR/cloudflare-dns-config.json"
|
|
65
|
+
;;
|
|
66
|
+
"$PROVIDER_NAMECHEAP")
|
|
67
|
+
echo "$CONFIG_DIR/namecheap-dns-config.json"
|
|
68
|
+
;;
|
|
69
|
+
"$PROVIDER_ROUTE53")
|
|
70
|
+
echo "$CONFIG_DIR/route53-dns-config.json"
|
|
71
|
+
;;
|
|
72
|
+
*)
|
|
73
|
+
echo "" # No fallback - provider must be specified
|
|
74
|
+
;;
|
|
75
|
+
esac
|
|
76
|
+
|
|
77
|
+
return 0
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
# Check if provider config file exists
|
|
81
|
+
check_provider_config() {
|
|
82
|
+
local provider="$1"
|
|
83
|
+
local config_file
|
|
84
|
+
config_file=$(get_provider_config "$provider")
|
|
85
|
+
|
|
86
|
+
if [[ ! -f "$config_file" ]]; then
|
|
87
|
+
print_error "Configuration file not found: $config_file"
|
|
88
|
+
case "$provider" in
|
|
89
|
+
"$PROVIDER_CLOUDFLARE")
|
|
90
|
+
print_info "Copy and customize: cp $CONFIG_DIR/cloudflare-dns-config.json.txt $config_file"
|
|
91
|
+
;;
|
|
92
|
+
"$PROVIDER_NAMECHEAP")
|
|
93
|
+
print_info "Copy and customize: cp $CONFIG_DIR/namecheap-dns-config.json.txt $config_file"
|
|
94
|
+
;;
|
|
95
|
+
"$PROVIDER_ROUTE53")
|
|
96
|
+
print_info "Copy and customize: cp $CONFIG_DIR/route53-dns-config.json.txt $config_file"
|
|
97
|
+
;;
|
|
98
|
+
*)
|
|
99
|
+
print_error "Unknown DNS provider: $provider"
|
|
100
|
+
print_info "Supported providers: cloudflare, namecheap, route53"
|
|
101
|
+
;;
|
|
102
|
+
esac
|
|
103
|
+
return 1
|
|
104
|
+
fi
|
|
105
|
+
return 0
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
# List all DNS providers and domains
|
|
109
|
+
list_providers() {
|
|
110
|
+
print_info "Available DNS providers:"
|
|
111
|
+
|
|
112
|
+
# Check for provider-specific config files
|
|
113
|
+
for config_file in "$CONFIG_DIR"/*-dns-config.json; do
|
|
114
|
+
if [[ -f "$config_file" ]]; then
|
|
115
|
+
local provider
|
|
116
|
+
provider=$(basename "$config_file" | sed 's/-dns-config.json//')
|
|
117
|
+
local description
|
|
118
|
+
description=$(jq -r '.description' "$config_file" 2>/dev/null || echo "DNS provider")
|
|
119
|
+
|
|
120
|
+
echo " ✅ $provider: $description"
|
|
121
|
+
|
|
122
|
+
# Show accounts for Cloudflare
|
|
123
|
+
if [[ "$provider" == "cloudflare" ]]; then
|
|
124
|
+
local accounts
|
|
125
|
+
accounts=$(jq -r '.accounts | keys[]?' "$config_file" 2>/dev/null | tr '\n' ' ')
|
|
126
|
+
if [[ -n "$accounts" ]]; then
|
|
127
|
+
echo " Accounts: $accounts"
|
|
128
|
+
fi
|
|
129
|
+
fi
|
|
130
|
+
|
|
131
|
+
# Show domains
|
|
132
|
+
local domains
|
|
133
|
+
domains=$(jq -r '.domains[]?' "$config_file" 2>/dev/null | tr '\n' ' ')
|
|
134
|
+
if [[ -n "$domains" ]]; then
|
|
135
|
+
echo " Domains: $domains"
|
|
136
|
+
fi
|
|
137
|
+
echo ""
|
|
138
|
+
fi
|
|
139
|
+
done
|
|
140
|
+
|
|
141
|
+
# Check for template files that haven't been configured yet
|
|
142
|
+
print_info "Available templates (not yet configured):"
|
|
143
|
+
for template_file in "$CONFIG_DIR"/*-dns-config.json.txt; do
|
|
144
|
+
if [[ -f "$template_file" ]]; then
|
|
145
|
+
local provider
|
|
146
|
+
provider=$(basename "$template_file" | sed 's/-dns-config.json.txt//')
|
|
147
|
+
local config_file="$CONFIG_DIR/${provider}-dns-config.json"
|
|
148
|
+
|
|
149
|
+
if [[ ! -f "$config_file" ]]; then
|
|
150
|
+
local description
|
|
151
|
+
description=$(jq -r '.description' "$template_file" 2>/dev/null || echo "DNS provider")
|
|
152
|
+
echo " 📝 $provider: $description (template available)"
|
|
153
|
+
fi
|
|
154
|
+
fi
|
|
155
|
+
done
|
|
156
|
+
return 0
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
# Cloudflare DNS operations
|
|
160
|
+
cloudflare_dns() {
|
|
161
|
+
local action="$1"
|
|
162
|
+
local account="${2:-personal}"
|
|
163
|
+
local domain="$3"
|
|
164
|
+
local record_name="$4"
|
|
165
|
+
local record_type="$param5"
|
|
166
|
+
local record_value="$param6"
|
|
167
|
+
|
|
168
|
+
local config_file
|
|
169
|
+
config_file=$(get_provider_config "$PROVIDER_CLOUDFLARE")
|
|
170
|
+
|
|
171
|
+
if ! check_provider_config "$PROVIDER_CLOUDFLARE"; then
|
|
172
|
+
return 1
|
|
173
|
+
fi
|
|
174
|
+
|
|
175
|
+
# Get API token and zone ID from Cloudflare-specific config
|
|
176
|
+
local api_token
|
|
177
|
+
api_token=$(jq -r ".accounts[\"$account\"].api_token" "$config_file" 2>/dev/null)
|
|
178
|
+
local zone_id
|
|
179
|
+
zone_id=$(jq -r ".accounts[\"$account\"].zones[\"$domain\"]" "$config_file" 2>/dev/null)
|
|
180
|
+
|
|
181
|
+
# Check for legacy single-account structure (backward compatibility)
|
|
182
|
+
if [[ "$api_token" == "null" ]]; then
|
|
183
|
+
api_token=$(jq -r '.api_token' "$config_file" 2>/dev/null)
|
|
184
|
+
zone_id=$(jq -r ".zones[\"$domain\"]" "$config_file" 2>/dev/null)
|
|
185
|
+
|
|
186
|
+
# Shift parameters for legacy compatibility
|
|
187
|
+
domain="$param2"
|
|
188
|
+
record_name="$param3"
|
|
189
|
+
record_type="$param4"
|
|
190
|
+
record_value="$param5"
|
|
191
|
+
account="default"
|
|
192
|
+
fi
|
|
193
|
+
|
|
194
|
+
if [[ "$api_token" == "null" || "$api_token" == *"YOUR_"*"_HERE" ]]; then
|
|
195
|
+
print_error "Cloudflare API token not configured for account '$account'"
|
|
196
|
+
local available_accounts
|
|
197
|
+
available_accounts=$(jq -r '.accounts | keys[]?' "$config_file" 2>/dev/null | tr '\n' ' ')
|
|
198
|
+
if [[ -n "$available_accounts" ]]; then
|
|
199
|
+
print_info "Available accounts: $available_accounts"
|
|
200
|
+
fi
|
|
201
|
+
return 1
|
|
202
|
+
fi
|
|
203
|
+
|
|
204
|
+
if [[ "$zone_id" == "null" ]]; then
|
|
205
|
+
print_error "Zone ID for $domain not found in account '$account'"
|
|
206
|
+
local available_zones
|
|
207
|
+
available_zones=$(jq -r ".accounts[\"$account\"].zones | keys[]?" "$config_file" 2>/dev/null | tr '\n' ' ')
|
|
208
|
+
if [[ -n "$available_zones" ]]; then
|
|
209
|
+
print_info "Available zones in '$account': $available_zones"
|
|
210
|
+
fi
|
|
211
|
+
return 1
|
|
212
|
+
fi
|
|
213
|
+
|
|
214
|
+
case "$action" in
|
|
215
|
+
"list")
|
|
216
|
+
print_info "Listing DNS records for $domain..."
|
|
217
|
+
curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$zone_id/dns_records" \
|
|
218
|
+
-H "$AUTH_BEARER_PREFIX $api_token" \
|
|
219
|
+
-H "$CONTENT_TYPE_JSON" | \
|
|
220
|
+
jq -r '.result[] | "\(.name) \(.type) \(.content) (TTL: \(.ttl))"'
|
|
221
|
+
;;
|
|
222
|
+
"add")
|
|
223
|
+
print_info "Adding DNS record: $record_name.$domain $record_type $record_value"
|
|
224
|
+
curl -s -X POST "https://api.cloudflare.com/client/v4/zones/$zone_id/dns_records" \
|
|
225
|
+
-H "$AUTH_BEARER_PREFIX $api_token" \
|
|
226
|
+
-H "$CONTENT_TYPE_JSON" \
|
|
227
|
+
--data "{\"type\":\"$record_type\",\"name\":\"$record_name\",\"content\":\"$record_value\",\"ttl\":300}"
|
|
228
|
+
;;
|
|
229
|
+
"delete")
|
|
230
|
+
print_info "Deleting DNS record: $record_name.$domain"
|
|
231
|
+
# First get record ID
|
|
232
|
+
local record_id=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$zone_id/dns_records?name=$record_name.$domain" \
|
|
233
|
+
-H "$AUTH_BEARER_PREFIX $api_token" | jq -r '.result[0].id')
|
|
234
|
+
|
|
235
|
+
if [[ "$record_id" != "null" ]]; then
|
|
236
|
+
curl -s -X DELETE "https://api.cloudflare.com/client/v4/zones/$zone_id/dns_records/$record_id" \
|
|
237
|
+
-H "$AUTH_BEARER_PREFIX $api_token"
|
|
238
|
+
print_success "Record deleted"
|
|
239
|
+
else
|
|
240
|
+
print_error "Record not found"
|
|
241
|
+
fi
|
|
242
|
+
;;
|
|
243
|
+
*)
|
|
244
|
+
print_error "Unknown action: $action. Supported actions: list, add, delete"
|
|
245
|
+
return 1
|
|
246
|
+
;;
|
|
247
|
+
esac
|
|
248
|
+
return 0
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
# Namecheap DNS operations
|
|
252
|
+
namecheap_dns() {
|
|
253
|
+
local action="$1"
|
|
254
|
+
local domain="$2"
|
|
255
|
+
local record_name="$3"
|
|
256
|
+
local record_type="$4"
|
|
257
|
+
local record_value="$param5"
|
|
258
|
+
|
|
259
|
+
local api_user
|
|
260
|
+
api_user=$(jq -r '.providers.namecheap.api_user' "$CONFIG_FILE")
|
|
261
|
+
local api_key
|
|
262
|
+
api_key=$(jq -r '.providers.namecheap.api_key' "$CONFIG_FILE")
|
|
263
|
+
local client_ip
|
|
264
|
+
client_ip=$(jq -r '.providers.namecheap.client_ip' "$CONFIG_FILE")
|
|
265
|
+
|
|
266
|
+
if [[ "$api_key" == "null" || "$api_key" == "YOUR_NAMECHEAP_API_KEY_HERE" ]]; then
|
|
267
|
+
print_error "Namecheap API credentials not configured"
|
|
268
|
+
return 1
|
|
269
|
+
fi
|
|
270
|
+
|
|
271
|
+
case "$action" in
|
|
272
|
+
"list")
|
|
273
|
+
print_info "Listing DNS records for $domain..."
|
|
274
|
+
curl -s "https://api.namecheap.com/xml.response?ApiUser=$api_user&ApiKey=$api_key&UserName=$api_user&Command=namecheap.domains.dns.getHosts&ClientIp=$client_ip&SLD=${domain%.*}&TLD=${domain##*.}"
|
|
275
|
+
;;
|
|
276
|
+
"add")
|
|
277
|
+
print_info "Adding DNS record: $record_name.$domain $record_type $record_value"
|
|
278
|
+
print_warning "Namecheap requires getting all records, modifying, and setting all at once"
|
|
279
|
+
print_info "Use Namecheap web interface or implement full record management"
|
|
280
|
+
;;
|
|
281
|
+
*)
|
|
282
|
+
print_error "Unknown action: $action. Supported actions: list, add"
|
|
283
|
+
return 1
|
|
284
|
+
;;
|
|
285
|
+
esac
|
|
286
|
+
return 0
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
# Generic DNS operations dispatcher
|
|
290
|
+
dns_operation() {
|
|
291
|
+
local provider="$1"
|
|
292
|
+
local action="$2"
|
|
293
|
+
local domain="$3"
|
|
294
|
+
local record_name="$4"
|
|
295
|
+
local record_type="$param5"
|
|
296
|
+
local record_value="$param6"
|
|
297
|
+
|
|
298
|
+
case "$provider" in
|
|
299
|
+
"$PROVIDER_CLOUDFLARE")
|
|
300
|
+
cloudflare_dns "$action" "$domain" "$record_name" "$record_type" "$record_value"
|
|
301
|
+
;;
|
|
302
|
+
"namecheap")
|
|
303
|
+
namecheap_dns "$action" "$domain" "$record_name" "$record_type" "$record_value"
|
|
304
|
+
;;
|
|
305
|
+
"spaceship")
|
|
306
|
+
print_warning "Spaceship DNS API integration not yet implemented"
|
|
307
|
+
print_info "Use Spaceship web interface for DNS management"
|
|
308
|
+
;;
|
|
309
|
+
"1and1"|"ionos")
|
|
310
|
+
print_warning "1&1/IONOS DNS API integration not yet implemented"
|
|
311
|
+
print_info "Use 1&1/IONOS web interface for DNS management"
|
|
312
|
+
;;
|
|
313
|
+
"dnsmadeeasy")
|
|
314
|
+
print_warning "DNS Made Easy API integration not yet implemented"
|
|
315
|
+
print_info "Use DNS Made Easy web interface for DNS management"
|
|
316
|
+
;;
|
|
317
|
+
*)
|
|
318
|
+
print_error "Unknown DNS provider: $provider"
|
|
319
|
+
list_providers
|
|
320
|
+
;;
|
|
321
|
+
esac
|
|
322
|
+
return 0
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
# Main function
|
|
326
|
+
main() {
|
|
327
|
+
# Assign positional parameters to local variables
|
|
328
|
+
local command="${1:-help}"
|
|
329
|
+
local param2="$2"
|
|
330
|
+
local param3="$3"
|
|
331
|
+
local param4="$4"
|
|
332
|
+
local param5="$5"
|
|
333
|
+
local param6="$6"
|
|
334
|
+
|
|
335
|
+
local provider="$param2"
|
|
336
|
+
local domain="$param3"
|
|
337
|
+
local record_type="$param4"
|
|
338
|
+
local record_name="$param5"
|
|
339
|
+
local record_value="$param6"
|
|
340
|
+
|
|
341
|
+
# Main command handler
|
|
342
|
+
case "$command" in
|
|
343
|
+
"list")
|
|
344
|
+
list_providers
|
|
345
|
+
;;
|
|
346
|
+
"records")
|
|
347
|
+
dns_operation "$provider" "list" "$domain"
|
|
348
|
+
;;
|
|
349
|
+
"add")
|
|
350
|
+
dns_operation "$provider" "add" "$domain" "$record_type" "$record_name" "$record_value"
|
|
351
|
+
;;
|
|
352
|
+
"delete")
|
|
353
|
+
dns_operation "$param2" "delete" "$param3" "$param4"
|
|
354
|
+
;;
|
|
355
|
+
"help"|"-h"|"--help"|"")
|
|
356
|
+
echo "DNS Management Helper Script"
|
|
357
|
+
echo "$USAGE_COMMAND_OPTIONS"
|
|
358
|
+
echo ""
|
|
359
|
+
echo "Commands:"
|
|
360
|
+
echo " list - List all DNS providers and domains"
|
|
361
|
+
echo " records [provider] [domain] - List DNS records for domain"
|
|
362
|
+
echo " add [provider] [domain] [name] [type] [value] - Add DNS record"
|
|
363
|
+
echo " delete [provider] [domain] [name] - Delete DNS record"
|
|
364
|
+
echo " help - $HELP_SHOW_MESSAGE"
|
|
365
|
+
echo ""
|
|
366
|
+
echo "Cloudflare Multi-Account Support:"
|
|
367
|
+
echo " records cloudflare [account] [domain] - List records for specific account"
|
|
368
|
+
echo " add cloudflare [account] [domain] [name] [type] [value] - Add record to account"
|
|
369
|
+
echo " delete cloudflare [account] [domain] [name] - Delete record from account"
|
|
370
|
+
echo ""
|
|
371
|
+
echo "Supported Providers:"
|
|
372
|
+
echo " - cloudflare (Full API support with multi-account)"
|
|
373
|
+
echo " - namecheap (Limited API support)"
|
|
374
|
+
echo " - spaceship (Web interface only)"
|
|
375
|
+
echo " - 1and1/ionos (Web interface only)"
|
|
376
|
+
echo " - dnsmadeeasy (Web interface only)"
|
|
377
|
+
echo ""
|
|
378
|
+
echo "Examples:"
|
|
379
|
+
echo " $0 list"
|
|
380
|
+
echo " $0 records cloudflare example.com # Legacy single account"
|
|
381
|
+
echo " $0 records cloudflare personal example.com # Multi-account"
|
|
382
|
+
echo " $0 add cloudflare personal example.com www A 192.168.1.100"
|
|
383
|
+
echo " $0 add cloudflare business company.com api A 10.0.1.50"
|
|
384
|
+
echo " $0 delete cloudflare personal example.com www"
|
|
385
|
+
;;
|
|
386
|
+
*)
|
|
387
|
+
print_error "$ERROR_UNKNOWN_COMMAND $command"
|
|
388
|
+
print_info "$HELP_USAGE_INFO"
|
|
389
|
+
exit 1
|
|
390
|
+
;;
|
|
391
|
+
esac
|
|
392
|
+
return 0
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
# Run main function
|
|
396
|
+
main "$@"
|