aidevops 2.52.1 → 2.53.2
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/README.md +1 -1
- package/VERSION +1 -1
- package/aidevops.sh +15 -9
- package/package.json +4 -4
- package/scripts/npm-postinstall.js +6 -7
- package/setup.sh +1 -1
- package/templates/deploy-templates.sh +144 -0
- package/templates/home/.agent/README.md +33 -0
- package/templates/home/AGENTS.md +96 -0
- package/templates/home/git/.agent/README.md +48 -0
- package/templates/home/git/AGENTS.md +97 -0
- package/templates/standard-functions.sh +179 -0
- package/templates/wordpress-performance-workflow.md +217 -0
- package/.agent/AGENTS.md +0 -614
- package/.agent/accounts.md +0 -65
- package/.agent/aidevops/add-new-mcp-to-aidevops.md +0 -456
- package/.agent/aidevops/api-integrations.md +0 -335
- package/.agent/aidevops/architecture.md +0 -510
- package/.agent/aidevops/configs.md +0 -274
- package/.agent/aidevops/docs.md +0 -244
- package/.agent/aidevops/extension.md +0 -311
- package/.agent/aidevops/mcp-integrations.md +0 -340
- package/.agent/aidevops/mcp-troubleshooting.md +0 -162
- package/.agent/aidevops/memory-patterns.md +0 -172
- package/.agent/aidevops/providers.md +0 -217
- package/.agent/aidevops/recommendations.md +0 -321
- package/.agent/aidevops/requirements.md +0 -301
- package/.agent/aidevops/resources.md +0 -214
- package/.agent/aidevops/security-requirements.md +0 -174
- package/.agent/aidevops/security.md +0 -350
- package/.agent/aidevops/service-links.md +0 -400
- package/.agent/aidevops/services.md +0 -357
- package/.agent/aidevops/setup.md +0 -153
- package/.agent/aidevops/troubleshooting.md +0 -389
- package/.agent/aidevops.md +0 -124
- package/.agent/build-plus.md +0 -244
- package/.agent/content/guidelines.md +0 -109
- package/.agent/content.md +0 -87
- package/.agent/health.md +0 -59
- package/.agent/legal.md +0 -59
- package/.agent/loop-state/full-loop.local.md +0 -16
- package/.agent/loop-state/ralph-loop.local.md +0 -10
- package/.agent/marketing.md +0 -440
- package/.agent/memory/README.md +0 -260
- package/.agent/onboarding.md +0 -796
- package/.agent/plan-plus.md +0 -245
- package/.agent/research.md +0 -100
- package/.agent/sales.md +0 -333
- package/.agent/scripts/101domains-helper.sh +0 -701
- package/.agent/scripts/add-missing-returns.sh +0 -140
- package/.agent/scripts/agent-browser-helper.sh +0 -311
- package/.agent/scripts/agno-setup.sh +0 -712
- package/.agent/scripts/ahrefs-mcp-wrapper.js +0 -168
- package/.agent/scripts/aidevops-update-check.sh +0 -71
- package/.agent/scripts/ampcode-cli.sh +0 -522
- package/.agent/scripts/auto-version-bump.sh +0 -156
- package/.agent/scripts/autogen-helper.sh +0 -512
- package/.agent/scripts/beads-sync-helper.sh +0 -596
- package/.agent/scripts/closte-helper.sh +0 -5
- package/.agent/scripts/cloudron-helper.sh +0 -321
- package/.agent/scripts/codacy-cli-chunked.sh +0 -581
- package/.agent/scripts/codacy-cli.sh +0 -442
- package/.agent/scripts/code-audit-helper.sh +0 -5
- package/.agent/scripts/coderabbit-cli.sh +0 -417
- package/.agent/scripts/coderabbit-pro-analysis.sh +0 -238
- package/.agent/scripts/commands/code-simplifier.md +0 -86
- package/.agent/scripts/commands/full-loop.md +0 -246
- package/.agent/scripts/commands/postflight-loop.md +0 -103
- package/.agent/scripts/commands/recall.md +0 -182
- package/.agent/scripts/commands/remember.md +0 -132
- package/.agent/scripts/commands/save-todo.md +0 -175
- package/.agent/scripts/commands/session-review.md +0 -154
- package/.agent/scripts/comprehensive-quality-fix.sh +0 -106
- package/.agent/scripts/context-builder-helper.sh +0 -522
- package/.agent/scripts/coolify-cli-helper.sh +0 -674
- package/.agent/scripts/coolify-helper.sh +0 -380
- package/.agent/scripts/crawl4ai-examples.sh +0 -401
- package/.agent/scripts/crawl4ai-helper.sh +0 -1078
- package/.agent/scripts/crewai-helper.sh +0 -681
- package/.agent/scripts/dev-browser-helper.sh +0 -513
- package/.agent/scripts/dns-helper.sh +0 -396
- package/.agent/scripts/domain-research-helper.sh +0 -917
- package/.agent/scripts/dspy-helper.sh +0 -285
- package/.agent/scripts/dspyground-helper.sh +0 -291
- package/.agent/scripts/eeat-score-helper.sh +0 -1242
- package/.agent/scripts/efficient-return-fix.sh +0 -92
- package/.agent/scripts/extract-opencode-prompts.sh +0 -128
- package/.agent/scripts/find-missing-returns.sh +0 -113
- package/.agent/scripts/fix-auth-headers.sh +0 -104
- package/.agent/scripts/fix-common-strings.sh +0 -254
- package/.agent/scripts/fix-content-type.sh +0 -100
- package/.agent/scripts/fix-error-messages.sh +0 -130
- package/.agent/scripts/fix-misplaced-returns.sh +0 -74
- package/.agent/scripts/fix-remaining-literals.sh +0 -152
- package/.agent/scripts/fix-return-statements.sh +0 -41
- package/.agent/scripts/fix-s131-default-cases.sh +0 -249
- package/.agent/scripts/fix-sc2155-simple.sh +0 -102
- package/.agent/scripts/fix-shellcheck-critical.sh +0 -187
- package/.agent/scripts/fix-string-literals.sh +0 -273
- package/.agent/scripts/full-loop-helper.sh +0 -773
- package/.agent/scripts/generate-opencode-agents.sh +0 -497
- package/.agent/scripts/generate-opencode-commands.sh +0 -1629
- package/.agent/scripts/generate-skills.sh +0 -366
- package/.agent/scripts/git-platforms-helper.sh +0 -640
- package/.agent/scripts/gitea-cli-helper.sh +0 -743
- package/.agent/scripts/github-cli-helper.sh +0 -702
- package/.agent/scripts/gitlab-cli-helper.sh +0 -682
- package/.agent/scripts/gsc-add-user-helper.sh +0 -325
- package/.agent/scripts/gsc-sitemap-helper.sh +0 -678
- package/.agent/scripts/hetzner-helper.sh +0 -485
- package/.agent/scripts/hostinger-helper.sh +0 -229
- package/.agent/scripts/keyword-research-helper.sh +0 -1815
- package/.agent/scripts/langflow-helper.sh +0 -544
- package/.agent/scripts/linkedin-automation.py +0 -241
- package/.agent/scripts/linter-manager.sh +0 -599
- package/.agent/scripts/linters-local.sh +0 -434
- package/.agent/scripts/list-keys-helper.sh +0 -488
- package/.agent/scripts/local-browser-automation.py +0 -339
- package/.agent/scripts/localhost-helper.sh +0 -744
- package/.agent/scripts/loop-common.sh +0 -806
- package/.agent/scripts/mainwp-helper.sh +0 -728
- package/.agent/scripts/markdown-formatter.sh +0 -338
- package/.agent/scripts/markdown-lint-fix.sh +0 -311
- package/.agent/scripts/mass-fix-returns.sh +0 -58
- package/.agent/scripts/mcp-diagnose.sh +0 -167
- package/.agent/scripts/mcp-inspector-helper.sh +0 -449
- package/.agent/scripts/memory-helper.sh +0 -650
- package/.agent/scripts/monitor-code-review.sh +0 -255
- package/.agent/scripts/onboarding-helper.sh +0 -706
- package/.agent/scripts/opencode-github-setup-helper.sh +0 -797
- package/.agent/scripts/opencode-test-helper.sh +0 -213
- package/.agent/scripts/pagespeed-helper.sh +0 -464
- package/.agent/scripts/pandoc-helper.sh +0 -362
- package/.agent/scripts/postflight-check.sh +0 -555
- package/.agent/scripts/pre-commit-hook.sh +0 -259
- package/.agent/scripts/pre-edit-check.sh +0 -169
- package/.agent/scripts/qlty-cli.sh +0 -356
- package/.agent/scripts/quality-cli-manager.sh +0 -525
- package/.agent/scripts/quality-feedback-helper.sh +0 -462
- package/.agent/scripts/quality-fix.sh +0 -263
- package/.agent/scripts/quality-loop-helper.sh +0 -1108
- package/.agent/scripts/ralph-loop-helper.sh +0 -836
- package/.agent/scripts/ralph-upstream-check.sh +0 -341
- package/.agent/scripts/secretlint-helper.sh +0 -847
- package/.agent/scripts/servers-helper.sh +0 -241
- package/.agent/scripts/ses-helper.sh +0 -619
- package/.agent/scripts/session-review-helper.sh +0 -404
- package/.agent/scripts/setup-linters-wizard.sh +0 -379
- package/.agent/scripts/setup-local-api-keys.sh +0 -330
- package/.agent/scripts/setup-mcp-integrations.sh +0 -472
- package/.agent/scripts/shared-constants.sh +0 -246
- package/.agent/scripts/site-crawler-helper.sh +0 -1487
- package/.agent/scripts/snyk-helper.sh +0 -940
- package/.agent/scripts/sonarcloud-autofix.sh +0 -193
- package/.agent/scripts/sonarcloud-cli.sh +0 -191
- package/.agent/scripts/sonarscanner-cli.sh +0 -455
- package/.agent/scripts/spaceship-helper.sh +0 -747
- package/.agent/scripts/stagehand-helper.sh +0 -321
- package/.agent/scripts/stagehand-python-helper.sh +0 -321
- package/.agent/scripts/stagehand-python-setup.sh +0 -441
- package/.agent/scripts/stagehand-setup.sh +0 -439
- package/.agent/scripts/system-cleanup.sh +0 -340
- package/.agent/scripts/terminal-title-helper.sh +0 -388
- package/.agent/scripts/terminal-title-setup.sh +0 -549
- package/.agent/scripts/test-stagehand-both-integration.sh +0 -317
- package/.agent/scripts/test-stagehand-integration.sh +0 -309
- package/.agent/scripts/test-stagehand-python-integration.sh +0 -341
- package/.agent/scripts/todo-ready.sh +0 -263
- package/.agent/scripts/tool-version-check.sh +0 -362
- package/.agent/scripts/toon-helper.sh +0 -469
- package/.agent/scripts/twilio-helper.sh +0 -917
- package/.agent/scripts/updown-helper.sh +0 -279
- package/.agent/scripts/validate-mcp-integrations.sh +0 -250
- package/.agent/scripts/validate-version-consistency.sh +0 -131
- package/.agent/scripts/vaultwarden-helper.sh +0 -597
- package/.agent/scripts/vercel-cli-helper.sh +0 -816
- package/.agent/scripts/verify-mirrors.sh +0 -169
- package/.agent/scripts/version-manager.sh +0 -831
- package/.agent/scripts/webhosting-helper.sh +0 -471
- package/.agent/scripts/webhosting-verify.sh +0 -238
- package/.agent/scripts/wordpress-mcp-helper.sh +0 -508
- package/.agent/scripts/worktree-helper.sh +0 -595
- package/.agent/scripts/worktree-sessions.sh +0 -577
- package/.agent/seo/dataforseo.md +0 -215
- package/.agent/seo/domain-research.md +0 -532
- package/.agent/seo/eeat-score.md +0 -659
- package/.agent/seo/google-search-console.md +0 -366
- package/.agent/seo/gsc-sitemaps.md +0 -282
- package/.agent/seo/keyword-research.md +0 -521
- package/.agent/seo/serper.md +0 -278
- package/.agent/seo/site-crawler.md +0 -387
- package/.agent/seo.md +0 -236
- package/.agent/services/accounting/quickfile.md +0 -159
- package/.agent/services/communications/telfon.md +0 -470
- package/.agent/services/communications/twilio.md +0 -569
- package/.agent/services/crm/fluentcrm.md +0 -449
- package/.agent/services/email/ses.md +0 -399
- package/.agent/services/hosting/101domains.md +0 -378
- package/.agent/services/hosting/closte.md +0 -177
- package/.agent/services/hosting/cloudflare.md +0 -251
- package/.agent/services/hosting/cloudron.md +0 -478
- package/.agent/services/hosting/dns-providers.md +0 -335
- package/.agent/services/hosting/domain-purchasing.md +0 -344
- package/.agent/services/hosting/hetzner.md +0 -327
- package/.agent/services/hosting/hostinger.md +0 -287
- package/.agent/services/hosting/localhost.md +0 -419
- package/.agent/services/hosting/spaceship.md +0 -353
- package/.agent/services/hosting/webhosting.md +0 -330
- package/.agent/social-media.md +0 -69
- package/.agent/templates/plans-template.md +0 -114
- package/.agent/templates/prd-template.md +0 -129
- package/.agent/templates/tasks-template.md +0 -108
- package/.agent/templates/todo-template.md +0 -89
- package/.agent/tools/ai-assistants/agno.md +0 -471
- package/.agent/tools/ai-assistants/capsolver.md +0 -326
- package/.agent/tools/ai-assistants/configuration.md +0 -221
- package/.agent/tools/ai-assistants/overview.md +0 -209
- package/.agent/tools/ai-assistants/status.md +0 -171
- package/.agent/tools/ai-assistants/windsurf.md +0 -193
- package/.agent/tools/ai-orchestration/autogen.md +0 -406
- package/.agent/tools/ai-orchestration/crewai.md +0 -445
- package/.agent/tools/ai-orchestration/langflow.md +0 -405
- package/.agent/tools/ai-orchestration/openprose.md +0 -487
- package/.agent/tools/ai-orchestration/overview.md +0 -362
- package/.agent/tools/ai-orchestration/packaging.md +0 -647
- package/.agent/tools/browser/agent-browser.md +0 -464
- package/.agent/tools/browser/browser-automation.md +0 -400
- package/.agent/tools/browser/chrome-devtools.md +0 -282
- package/.agent/tools/browser/crawl4ai-integration.md +0 -422
- package/.agent/tools/browser/crawl4ai-resources.md +0 -277
- package/.agent/tools/browser/crawl4ai-usage.md +0 -416
- package/.agent/tools/browser/crawl4ai.md +0 -585
- package/.agent/tools/browser/dev-browser.md +0 -341
- package/.agent/tools/browser/pagespeed.md +0 -260
- package/.agent/tools/browser/playwright.md +0 -266
- package/.agent/tools/browser/playwriter.md +0 -310
- package/.agent/tools/browser/stagehand-examples.md +0 -456
- package/.agent/tools/browser/stagehand-python.md +0 -483
- package/.agent/tools/browser/stagehand.md +0 -421
- package/.agent/tools/build-agent/agent-review.md +0 -224
- package/.agent/tools/build-agent/build-agent.md +0 -784
- package/.agent/tools/build-mcp/aidevops-plugin.md +0 -476
- package/.agent/tools/build-mcp/api-wrapper.md +0 -445
- package/.agent/tools/build-mcp/build-mcp.md +0 -240
- package/.agent/tools/build-mcp/deployment.md +0 -401
- package/.agent/tools/build-mcp/server-patterns.md +0 -632
- package/.agent/tools/build-mcp/transports.md +0 -366
- package/.agent/tools/code-review/auditing.md +0 -383
- package/.agent/tools/code-review/automation.md +0 -219
- package/.agent/tools/code-review/best-practices.md +0 -203
- package/.agent/tools/code-review/codacy.md +0 -151
- package/.agent/tools/code-review/code-simplifier.md +0 -174
- package/.agent/tools/code-review/code-standards.md +0 -309
- package/.agent/tools/code-review/coderabbit.md +0 -101
- package/.agent/tools/code-review/management.md +0 -155
- package/.agent/tools/code-review/qlty.md +0 -248
- package/.agent/tools/code-review/secretlint.md +0 -565
- package/.agent/tools/code-review/setup.md +0 -250
- package/.agent/tools/code-review/snyk.md +0 -563
- package/.agent/tools/code-review/tools.md +0 -230
- package/.agent/tools/content/summarize.md +0 -353
- package/.agent/tools/context/augment-context-engine.md +0 -468
- package/.agent/tools/context/context-builder-agent.md +0 -76
- package/.agent/tools/context/context-builder.md +0 -375
- package/.agent/tools/context/context7.md +0 -371
- package/.agent/tools/context/dspy.md +0 -302
- package/.agent/tools/context/dspyground.md +0 -374
- package/.agent/tools/context/llm-tldr.md +0 -219
- package/.agent/tools/context/osgrep.md +0 -488
- package/.agent/tools/context/prompt-optimization.md +0 -338
- package/.agent/tools/context/toon.md +0 -292
- package/.agent/tools/conversion/pandoc.md +0 -304
- package/.agent/tools/credentials/api-key-management.md +0 -154
- package/.agent/tools/credentials/api-key-setup.md +0 -224
- package/.agent/tools/credentials/environment-variables.md +0 -180
- package/.agent/tools/credentials/vaultwarden.md +0 -382
- package/.agent/tools/data-extraction/outscraper.md +0 -974
- package/.agent/tools/deployment/coolify-cli.md +0 -388
- package/.agent/tools/deployment/coolify-setup.md +0 -353
- package/.agent/tools/deployment/coolify.md +0 -345
- package/.agent/tools/deployment/vercel.md +0 -390
- package/.agent/tools/git/authentication.md +0 -132
- package/.agent/tools/git/gitea-cli.md +0 -193
- package/.agent/tools/git/github-actions.md +0 -207
- package/.agent/tools/git/github-cli.md +0 -223
- package/.agent/tools/git/gitlab-cli.md +0 -190
- package/.agent/tools/git/opencode-github-security.md +0 -350
- package/.agent/tools/git/opencode-github.md +0 -328
- package/.agent/tools/git/opencode-gitlab.md +0 -252
- package/.agent/tools/git/security.md +0 -196
- package/.agent/tools/git.md +0 -207
- package/.agent/tools/opencode/oh-my-opencode.md +0 -375
- package/.agent/tools/opencode/opencode-anthropic-auth.md +0 -446
- package/.agent/tools/opencode/opencode.md +0 -651
- package/.agent/tools/social-media/bird.md +0 -437
- package/.agent/tools/task-management/beads.md +0 -336
- package/.agent/tools/terminal/terminal-title.md +0 -251
- package/.agent/tools/ui/shadcn.md +0 -196
- package/.agent/tools/ui/ui-skills.md +0 -115
- package/.agent/tools/wordpress/localwp.md +0 -311
- package/.agent/tools/wordpress/mainwp.md +0 -391
- package/.agent/tools/wordpress/scf.md +0 -527
- package/.agent/tools/wordpress/wp-admin.md +0 -729
- package/.agent/tools/wordpress/wp-dev.md +0 -940
- package/.agent/tools/wordpress/wp-preferred.md +0 -398
- package/.agent/tools/wordpress.md +0 -95
- package/.agent/workflows/branch/bugfix.md +0 -63
- package/.agent/workflows/branch/chore.md +0 -95
- package/.agent/workflows/branch/experiment.md +0 -115
- package/.agent/workflows/branch/feature.md +0 -59
- package/.agent/workflows/branch/hotfix.md +0 -98
- package/.agent/workflows/branch/refactor.md +0 -92
- package/.agent/workflows/branch/release.md +0 -96
- package/.agent/workflows/branch.md +0 -347
- package/.agent/workflows/bug-fixing.md +0 -267
- package/.agent/workflows/changelog.md +0 -129
- package/.agent/workflows/code-audit-remote.md +0 -279
- package/.agent/workflows/conversation-starter.md +0 -69
- package/.agent/workflows/error-feedback.md +0 -578
- package/.agent/workflows/feature-development.md +0 -355
- package/.agent/workflows/git-workflow.md +0 -702
- package/.agent/workflows/multi-repo-workspace.md +0 -268
- package/.agent/workflows/plans.md +0 -709
- package/.agent/workflows/postflight.md +0 -604
- package/.agent/workflows/pr.md +0 -571
- package/.agent/workflows/preflight.md +0 -278
- package/.agent/workflows/ralph-loop.md +0 -773
- package/.agent/workflows/release.md +0 -498
- package/.agent/workflows/session-manager.md +0 -254
- package/.agent/workflows/session-review.md +0 -311
- package/.agent/workflows/sql-migrations.md +0 -631
- package/.agent/workflows/version-bump.md +0 -283
- package/.agent/workflows/wiki-update.md +0 -333
- package/.agent/workflows/worktree.md +0 -477
|
@@ -1,747 +0,0 @@
|
|
|
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
|
-
# Spaceship Domain Registrar Helper Script
|
|
5
|
-
# Comprehensive domain and DNS management for AI assistants
|
|
6
|
-
|
|
7
|
-
# Colors for output
|
|
8
|
-
# String literal constants
|
|
9
|
-
readonly ERROR_DOMAIN_NAME_REQUIRED="Domain name is required"
|
|
10
|
-
readonly DOMAINS_ENDPOINT="domains"
|
|
11
|
-
|
|
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
|
-
# HTTP Constants
|
|
19
|
-
readonly AUTH_HEADER_PREFIX="Authorization: Bearer"
|
|
20
|
-
# Common message constants
|
|
21
|
-
readonly HELP_SHOW_MESSAGE="Show this help"
|
|
22
|
-
readonly USAGE_COMMAND_OPTIONS="Usage: $0 <command> [options]"
|
|
23
|
-
|
|
24
|
-
# Common constants
|
|
25
|
-
readonly CONTENT_TYPE_JSON="$CONTENT_TYPE_JSON"
|
|
26
|
-
|
|
27
|
-
print_info() {
|
|
28
|
-
local msg="$1"
|
|
29
|
-
echo -e "${BLUE}[INFO]${NC} $msg"
|
|
30
|
-
return 0
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
print_success() {
|
|
34
|
-
local msg="$1"
|
|
35
|
-
echo -e "${GREEN}[SUCCESS]${NC} $msg"
|
|
36
|
-
return 0
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
print_warning() {
|
|
40
|
-
local msg="$1"
|
|
41
|
-
echo -e "${YELLOW}[WARNING]${NC} $msg"
|
|
42
|
-
return 0
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
print_error() {
|
|
46
|
-
local msg="$1"
|
|
47
|
-
echo -e "${RED}[ERROR]${NC} $msg" >&2
|
|
48
|
-
return 0
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
CONFIG_FILE="../configs/spaceship-config.json"
|
|
52
|
-
API_BASE_URL="https://api.spaceship.com/v1"
|
|
53
|
-
|
|
54
|
-
# Check dependencies
|
|
55
|
-
check_dependencies() {
|
|
56
|
-
if ! command -v curl &> /dev/null; then
|
|
57
|
-
print_error "$ERROR_CURL_REQUIRED"
|
|
58
|
-
exit 1
|
|
59
|
-
fi
|
|
60
|
-
|
|
61
|
-
if ! command -v jq &> /dev/null; then
|
|
62
|
-
print_error "$ERROR_JQ_REQUIRED"
|
|
63
|
-
echo "$INFO_JQ_INSTALL_MACOS" >&2
|
|
64
|
-
echo "$INFO_JQ_INSTALL_UBUNTU" >&2
|
|
65
|
-
exit 1
|
|
66
|
-
fi
|
|
67
|
-
|
|
68
|
-
return 0
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
# Load configuration
|
|
72
|
-
load_config() {
|
|
73
|
-
if [[ ! -f "$CONFIG_FILE" ]]; then
|
|
74
|
-
print_error "$ERROR_CONFIG_NOT_FOUND"
|
|
75
|
-
print_info "Copy and customize: cp ../configs/spaceship-config.json.txt $CONFIG_FILE"
|
|
76
|
-
exit 1
|
|
77
|
-
fi
|
|
78
|
-
|
|
79
|
-
if ! jq empty "$CONFIG_FILE" 2>/dev/null; then
|
|
80
|
-
print_error "$ERROR_INVALID_JSON"
|
|
81
|
-
exit 1
|
|
82
|
-
fi
|
|
83
|
-
|
|
84
|
-
return 0
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
# Get account configuration
|
|
88
|
-
get_account_config() {
|
|
89
|
-
local account_name="$command"
|
|
90
|
-
|
|
91
|
-
if [[ -z "$account_name" ]]; then
|
|
92
|
-
print_error "$ERROR_ACCOUNT_REQUIRED"
|
|
93
|
-
list_accounts
|
|
94
|
-
exit 1
|
|
95
|
-
fi
|
|
96
|
-
|
|
97
|
-
local account_config
|
|
98
|
-
account_config=$(jq -r ".accounts.\"$account_name\"" "$CONFIG_FILE")
|
|
99
|
-
if [[ "$account_config" == "null" ]]; then
|
|
100
|
-
print_error "Account '$account_name' not found in configuration"
|
|
101
|
-
list_accounts
|
|
102
|
-
exit 1
|
|
103
|
-
fi
|
|
104
|
-
|
|
105
|
-
echo "$account_config"
|
|
106
|
-
return 0
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
# Make API request
|
|
110
|
-
api_request() {
|
|
111
|
-
local account_name="$command"
|
|
112
|
-
local method="$account_name"
|
|
113
|
-
local endpoint="$target"
|
|
114
|
-
local data="$options"
|
|
115
|
-
|
|
116
|
-
local config
|
|
117
|
-
config=$(get_account_config "$account_name")
|
|
118
|
-
local api_key
|
|
119
|
-
api_key=$(echo "$config" | jq -r '.api_key')
|
|
120
|
-
local api_secret
|
|
121
|
-
api_secret=$(echo "$config" | jq -r '.api_secret')
|
|
122
|
-
|
|
123
|
-
if [[ "$api_key" == "null" || "$api_secret" == "null" ]]; then
|
|
124
|
-
print_error "Invalid API credentials for account '$account_name'"
|
|
125
|
-
exit 1
|
|
126
|
-
fi
|
|
127
|
-
|
|
128
|
-
local auth_header="$AUTH_HEADER_PREFIX $api_key"
|
|
129
|
-
local url="$API_BASE_URL/$endpoint"
|
|
130
|
-
|
|
131
|
-
if [[ "$method" == "GET" ]]; then
|
|
132
|
-
curl -s -H "$auth_header" -H "$CONTENT_TYPE_JSON" "$url"
|
|
133
|
-
elif [[ "$method" == "POST" ]]; then
|
|
134
|
-
curl -s -X POST -H "$auth_header" -H "$CONTENT_TYPE_JSON" -d "$data" "$url"
|
|
135
|
-
elif [[ "$method" == "PUT" ]]; then
|
|
136
|
-
curl -s -X PUT -H "$auth_header" -H "$CONTENT_TYPE_JSON" -d "$data" "$url"
|
|
137
|
-
elif [[ "$method" == "DELETE" ]]; then
|
|
138
|
-
curl -s -X DELETE -H "$auth_header" -H "$CONTENT_TYPE_JSON" "$url"
|
|
139
|
-
fi
|
|
140
|
-
return 0
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
# List all configured accounts
|
|
144
|
-
list_accounts() {
|
|
145
|
-
load_config
|
|
146
|
-
print_info "Available Spaceship accounts:"
|
|
147
|
-
jq -r '.accounts | keys[]' "$CONFIG_FILE" | while read -r account; do
|
|
148
|
-
local description
|
|
149
|
-
description=$(jq -r ".accounts.\"$account\".description" "$CONFIG_FILE")
|
|
150
|
-
local email
|
|
151
|
-
email=$(jq -r ".accounts.\"$account\".email" "$CONFIG_FILE")
|
|
152
|
-
echo " - $account ($email) - $description"
|
|
153
|
-
done
|
|
154
|
-
return 0
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
# List domains
|
|
158
|
-
list_domains() {
|
|
159
|
-
local account_name="$command"
|
|
160
|
-
|
|
161
|
-
print_info "Listing domains for account: $account_name"
|
|
162
|
-
local response
|
|
163
|
-
if response=$(api_request "$account_name" "GET" "$DOMAINS_ENDPOINT"); then
|
|
164
|
-
echo "$response" | jq -r '.data[] | "\(.domain) - Status: \(.status) - Expires: \(.expires_at)"'
|
|
165
|
-
else
|
|
166
|
-
print_error "Failed to retrieve domains"
|
|
167
|
-
echo "$response"
|
|
168
|
-
fi
|
|
169
|
-
return 0
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
# Check domain availability
|
|
173
|
-
check_domain_availability() {
|
|
174
|
-
local account_name="$command"
|
|
175
|
-
local domain="$account_name"
|
|
176
|
-
|
|
177
|
-
if [[ -z "$domain" ]]; then
|
|
178
|
-
print_error "$ERROR_DOMAIN_NAME_REQUIRED"
|
|
179
|
-
exit 1
|
|
180
|
-
fi
|
|
181
|
-
|
|
182
|
-
print_info "Checking availability for domain: $domain"
|
|
183
|
-
local response
|
|
184
|
-
if response=$(api_request "$account_name" "GET" "domains/check?domain=$domain"); then
|
|
185
|
-
local available
|
|
186
|
-
available=$(echo "$response" | jq -r '.available')
|
|
187
|
-
local price
|
|
188
|
-
price=$(echo "$response" | jq -r '.price // "N/A"')
|
|
189
|
-
|
|
190
|
-
if [[ "$available" == "true" ]]; then
|
|
191
|
-
print_success "Domain $domain is available for registration"
|
|
192
|
-
echo "Price: $price"
|
|
193
|
-
else
|
|
194
|
-
print_warning "Domain $domain is not available"
|
|
195
|
-
fi
|
|
196
|
-
|
|
197
|
-
echo "$response" | jq '.'
|
|
198
|
-
else
|
|
199
|
-
print_error "Failed to check domain availability"
|
|
200
|
-
echo "$response"
|
|
201
|
-
fi
|
|
202
|
-
return 0
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
# Purchase domain
|
|
206
|
-
purchase_domain() {
|
|
207
|
-
local account_name="$command"
|
|
208
|
-
local domain="$account_name"
|
|
209
|
-
local years="${3:-1}"
|
|
210
|
-
local auto_renew="${4:-false}"
|
|
211
|
-
|
|
212
|
-
if [[ -z "$domain" ]]; then
|
|
213
|
-
print_error "$ERROR_DOMAIN_NAME_REQUIRED"
|
|
214
|
-
exit 1
|
|
215
|
-
fi
|
|
216
|
-
|
|
217
|
-
# First check availability
|
|
218
|
-
print_info "Checking availability before purchase..."
|
|
219
|
-
local availability
|
|
220
|
-
availability=$(api_request "$account_name" "GET" "domains/check?domain=$domain")
|
|
221
|
-
local available
|
|
222
|
-
available=$(echo "$availability" | jq -r '.available')
|
|
223
|
-
|
|
224
|
-
if [[ "$available" != "true" ]]; then
|
|
225
|
-
print_error "Domain $domain is not available for registration"
|
|
226
|
-
return 1
|
|
227
|
-
fi
|
|
228
|
-
|
|
229
|
-
local price
|
|
230
|
-
price=$(echo "$availability" | jq -r '.price')
|
|
231
|
-
print_warning "Domain $domain will be purchased for $price for $years year(s)"
|
|
232
|
-
print_warning "This action will charge your account. Continue? (y/N)"
|
|
233
|
-
|
|
234
|
-
read -r confirmation
|
|
235
|
-
if [[ "$confirmation" != "y" && "$confirmation" != "Y" ]]; then
|
|
236
|
-
print_info "Domain purchase cancelled"
|
|
237
|
-
return 0
|
|
238
|
-
fi
|
|
239
|
-
|
|
240
|
-
local data=$(jq -n \
|
|
241
|
-
--arg domain "$domain" \
|
|
242
|
-
--argjson years "$years" \
|
|
243
|
-
--argjson auto_renew "$auto_renew" \
|
|
244
|
-
'{domain: $domain, years: $years, auto_renew: $auto_renew}')
|
|
245
|
-
|
|
246
|
-
print_info "Purchasing domain: $domain"
|
|
247
|
-
local response
|
|
248
|
-
if response=$(api_request "$account_name" "POST" "$DOMAINS_ENDPOINT" "$data"); then
|
|
249
|
-
print_success "Domain purchased successfully"
|
|
250
|
-
echo "$response" | jq '.'
|
|
251
|
-
else
|
|
252
|
-
print_error "Failed to purchase domain"
|
|
253
|
-
echo "$response"
|
|
254
|
-
fi
|
|
255
|
-
return 0
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
# Bulk domain availability check
|
|
259
|
-
bulk_check_domains() {
|
|
260
|
-
local account_name="$command"
|
|
261
|
-
shift
|
|
262
|
-
local domains=("$@")
|
|
263
|
-
|
|
264
|
-
if [[ ${#domains[@]} -eq 0 ]]; then
|
|
265
|
-
print_error "At least one domain is required"
|
|
266
|
-
exit 1
|
|
267
|
-
fi
|
|
268
|
-
|
|
269
|
-
print_info "Checking availability for ${#domains[@]} domains"
|
|
270
|
-
echo ""
|
|
271
|
-
|
|
272
|
-
for domain in "${domains[@]}"; do
|
|
273
|
-
echo "Checking: $domain"
|
|
274
|
-
check_domain_availability "$account_name" "$domain"
|
|
275
|
-
echo ""
|
|
276
|
-
sleep 1 # Rate limiting
|
|
277
|
-
done
|
|
278
|
-
return 0
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
# Get domain details
|
|
282
|
-
get_domain_details() {
|
|
283
|
-
local account_name="$command"
|
|
284
|
-
local domain="$account_name"
|
|
285
|
-
|
|
286
|
-
if [[ -z "$domain" ]]; then
|
|
287
|
-
print_error "$ERROR_DOMAIN_NAME_REQUIRED"
|
|
288
|
-
exit 1
|
|
289
|
-
fi
|
|
290
|
-
|
|
291
|
-
print_info "Getting details for domain: $domain"
|
|
292
|
-
local response
|
|
293
|
-
if response=$(api_request "$account_name" "GET" "domains/$domain"); then
|
|
294
|
-
echo "$response" | jq '.'
|
|
295
|
-
else
|
|
296
|
-
print_error "Failed to get domain details"
|
|
297
|
-
echo "$response"
|
|
298
|
-
fi
|
|
299
|
-
return 0
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
# List DNS records
|
|
303
|
-
list_dns_records() {
|
|
304
|
-
local account_name="$command"
|
|
305
|
-
local domain="$account_name"
|
|
306
|
-
|
|
307
|
-
if [[ -z "$domain" ]]; then
|
|
308
|
-
print_error "$ERROR_DOMAIN_NAME_REQUIRED"
|
|
309
|
-
exit 1
|
|
310
|
-
fi
|
|
311
|
-
|
|
312
|
-
print_info "Listing DNS records for domain: $domain"
|
|
313
|
-
local response
|
|
314
|
-
if response=$(api_request "$account_name" "GET" "domains/$domain/dns"); then
|
|
315
|
-
echo "$response" | jq -r '.data[] | "\(.name) \(.type) \(.content) (TTL: \(.ttl))"'
|
|
316
|
-
else
|
|
317
|
-
print_error "Failed to retrieve DNS records"
|
|
318
|
-
echo "$response"
|
|
319
|
-
fi
|
|
320
|
-
return 0
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
# Add DNS record
|
|
324
|
-
add_dns_record() {
|
|
325
|
-
local account_name="$command"
|
|
326
|
-
local domain="$account_name"
|
|
327
|
-
local name="$target"
|
|
328
|
-
local type="$options"
|
|
329
|
-
local content="$param5"
|
|
330
|
-
local ttl="${6:-3600}"
|
|
331
|
-
|
|
332
|
-
if [[ -z "$domain" || -z "$name" || -z "$type" || -z "$content" ]]; then
|
|
333
|
-
print_error "Domain, name, type, and content are required"
|
|
334
|
-
exit 1
|
|
335
|
-
fi
|
|
336
|
-
|
|
337
|
-
local data=$(jq -n \
|
|
338
|
-
--arg name "$name" \
|
|
339
|
-
--arg type "$type" \
|
|
340
|
-
--arg content "$content" \
|
|
341
|
-
--arg ttl "$ttl" \
|
|
342
|
-
'{name: $name, type: $type, content: $content, ttl: ($ttl | tonumber)}')
|
|
343
|
-
|
|
344
|
-
print_info "Adding DNS record: $name $type $content"
|
|
345
|
-
local response
|
|
346
|
-
if response=$(api_request "$account_name" "POST" "domains/$domain/dns" "$data"); then
|
|
347
|
-
print_success "DNS record added successfully"
|
|
348
|
-
echo "$response" | jq '.'
|
|
349
|
-
else
|
|
350
|
-
print_error "Failed to add DNS record"
|
|
351
|
-
echo "$response"
|
|
352
|
-
fi
|
|
353
|
-
return 0
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
# Update DNS record
|
|
357
|
-
update_dns_record() {
|
|
358
|
-
local account_name="$command"
|
|
359
|
-
local domain="$account_name"
|
|
360
|
-
local record_id="$target"
|
|
361
|
-
local name="$options"
|
|
362
|
-
local type="$param5"
|
|
363
|
-
local content="$param6"
|
|
364
|
-
local ttl="${7:-3600}"
|
|
365
|
-
|
|
366
|
-
if [[ -z "$domain" || -z "$record_id" || -z "$name" || -z "$type" || -z "$content" ]]; then
|
|
367
|
-
print_error "Domain, record ID, name, type, and content are required"
|
|
368
|
-
exit 1
|
|
369
|
-
fi
|
|
370
|
-
|
|
371
|
-
local data=$(jq -n \
|
|
372
|
-
--arg name "$name" \
|
|
373
|
-
--arg type "$type" \
|
|
374
|
-
--arg content "$content" \
|
|
375
|
-
--arg ttl "$ttl" \
|
|
376
|
-
'{name: $name, type: $type, content: $content, ttl: ($ttl | tonumber)}')
|
|
377
|
-
|
|
378
|
-
print_info "Updating DNS record: $record_id"
|
|
379
|
-
local response
|
|
380
|
-
if response=$(api_request "$account_name" "PUT" "domains/$domain/dns/$record_id" "$data"); then
|
|
381
|
-
print_success "DNS record updated successfully"
|
|
382
|
-
echo "$response" | jq '.'
|
|
383
|
-
else
|
|
384
|
-
print_error "Failed to update DNS record"
|
|
385
|
-
echo "$response"
|
|
386
|
-
fi
|
|
387
|
-
return 0
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
# Delete DNS record
|
|
391
|
-
delete_dns_record() {
|
|
392
|
-
local account_name="$command"
|
|
393
|
-
local domain="$account_name"
|
|
394
|
-
local record_id="$target"
|
|
395
|
-
|
|
396
|
-
if [[ -z "$domain" || -z "$record_id" ]]; then
|
|
397
|
-
print_error "Domain and record ID are required"
|
|
398
|
-
exit 1
|
|
399
|
-
fi
|
|
400
|
-
|
|
401
|
-
print_warning "Deleting DNS record: $record_id"
|
|
402
|
-
local response
|
|
403
|
-
if response=$(api_request "$account_name" "DELETE" "domains/$domain/dns/$record_id"); then
|
|
404
|
-
print_success "DNS record deleted successfully"
|
|
405
|
-
else
|
|
406
|
-
print_error "Failed to delete DNS record"
|
|
407
|
-
echo "$response"
|
|
408
|
-
fi
|
|
409
|
-
return 0
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
# Get domain nameservers
|
|
413
|
-
get_nameservers() {
|
|
414
|
-
local account_name="$command"
|
|
415
|
-
local domain="$account_name"
|
|
416
|
-
|
|
417
|
-
if [[ -z "$domain" ]]; then
|
|
418
|
-
print_error "$ERROR_DOMAIN_NAME_REQUIRED"
|
|
419
|
-
exit 1
|
|
420
|
-
fi
|
|
421
|
-
|
|
422
|
-
print_info "Getting nameservers for domain: $domain"
|
|
423
|
-
local response
|
|
424
|
-
if response=$(api_request "$account_name" "GET" "domains/$domain/nameservers"); then
|
|
425
|
-
echo "$response" | jq -r '.data[]'
|
|
426
|
-
else
|
|
427
|
-
print_error "Failed to get nameservers"
|
|
428
|
-
echo "$response"
|
|
429
|
-
fi
|
|
430
|
-
return 0
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
# Update nameservers
|
|
434
|
-
update_nameservers() {
|
|
435
|
-
local account_name="$command"
|
|
436
|
-
local domain="$account_name"
|
|
437
|
-
shift 2
|
|
438
|
-
local nameservers=("$@")
|
|
439
|
-
|
|
440
|
-
if [[ -z "$domain" || ${#nameservers[@]} -eq 0 ]]; then
|
|
441
|
-
print_error "Domain and at least one nameserver are required"
|
|
442
|
-
exit 1
|
|
443
|
-
fi
|
|
444
|
-
|
|
445
|
-
local ns_json
|
|
446
|
-
ns_json=$(printf '%s\n' "${nameservers[@]}" | jq -R . | jq -s .)
|
|
447
|
-
local data
|
|
448
|
-
data=$(jq -n --argjson nameservers "$ns_json" '{nameservers: $nameservers}')
|
|
449
|
-
|
|
450
|
-
print_info "Updating nameservers for domain: $domain"
|
|
451
|
-
local response
|
|
452
|
-
if response=$(api_request "$account_name" "PUT" "domains/$domain/nameservers" "$data"); then
|
|
453
|
-
print_success "Nameservers updated successfully"
|
|
454
|
-
echo "$response" | jq '.'
|
|
455
|
-
else
|
|
456
|
-
print_error "Failed to update nameservers"
|
|
457
|
-
echo "$response"
|
|
458
|
-
fi
|
|
459
|
-
return 0
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
# Check domain availability
|
|
463
|
-
check_availability() {
|
|
464
|
-
local account_name="$command"
|
|
465
|
-
local domain="$account_name"
|
|
466
|
-
|
|
467
|
-
if [[ -z "$domain" ]]; then
|
|
468
|
-
print_error "$ERROR_DOMAIN_NAME_REQUIRED"
|
|
469
|
-
exit 1
|
|
470
|
-
fi
|
|
471
|
-
|
|
472
|
-
print_info "Checking availability for domain: $domain"
|
|
473
|
-
local response
|
|
474
|
-
if response=$(api_request "$account_name" "GET" "domains/check?domain=$domain"); then
|
|
475
|
-
local available
|
|
476
|
-
available=$(echo "$response" | jq -r '.available')
|
|
477
|
-
local price
|
|
478
|
-
price=$(echo "$response" | jq -r '.price')
|
|
479
|
-
|
|
480
|
-
if [[ "$available" == "true" ]]; then
|
|
481
|
-
print_success "Domain $domain is available for $price"
|
|
482
|
-
else
|
|
483
|
-
print_warning "Domain $domain is not available"
|
|
484
|
-
fi
|
|
485
|
-
echo "$response" | jq '.'
|
|
486
|
-
else
|
|
487
|
-
print_error "Failed to check domain availability"
|
|
488
|
-
echo "$response"
|
|
489
|
-
fi
|
|
490
|
-
return 0
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
# Get domain contacts
|
|
494
|
-
get_domain_contacts() {
|
|
495
|
-
local account_name="$command"
|
|
496
|
-
local domain="$account_name"
|
|
497
|
-
|
|
498
|
-
if [[ -z "$domain" ]]; then
|
|
499
|
-
print_error "$ERROR_DOMAIN_NAME_REQUIRED"
|
|
500
|
-
exit 1
|
|
501
|
-
fi
|
|
502
|
-
|
|
503
|
-
print_info "Getting contacts for domain: $domain"
|
|
504
|
-
local response
|
|
505
|
-
if response=$(api_request "$account_name" "GET" "domains/$domain/contacts"); then
|
|
506
|
-
echo "$response" | jq '.'
|
|
507
|
-
else
|
|
508
|
-
print_error "Failed to get domain contacts"
|
|
509
|
-
echo "$response"
|
|
510
|
-
fi
|
|
511
|
-
return 0
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
# Enable/disable domain lock
|
|
515
|
-
toggle_domain_lock() {
|
|
516
|
-
local account_name="$command"
|
|
517
|
-
local domain="$account_name"
|
|
518
|
-
local action="$target" # "lock" or "unlock"
|
|
519
|
-
|
|
520
|
-
if [[ -z "$domain" || -z "$action" ]]; then
|
|
521
|
-
print_error "Domain and action (lock/unlock) are required"
|
|
522
|
-
exit 1
|
|
523
|
-
fi
|
|
524
|
-
|
|
525
|
-
local locked="true"
|
|
526
|
-
if [[ "$action" == "unlock" ]]; then
|
|
527
|
-
locked="false"
|
|
528
|
-
fi
|
|
529
|
-
|
|
530
|
-
local data
|
|
531
|
-
data=$(jq -n --arg locked "$locked" '{locked: ($locked | test("true"))}')
|
|
532
|
-
|
|
533
|
-
print_info "${action^}ing domain: $domain"
|
|
534
|
-
local response
|
|
535
|
-
if response=$(api_request "$account_name" "PUT" "domains/$domain/lock" "$data"); then
|
|
536
|
-
print_success "Domain ${action}ed successfully"
|
|
537
|
-
echo "$response" | jq '.'
|
|
538
|
-
else
|
|
539
|
-
print_error "Failed to $action domain"
|
|
540
|
-
echo "$response"
|
|
541
|
-
fi
|
|
542
|
-
return 0
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
# Get domain transfer status
|
|
546
|
-
get_transfer_status() {
|
|
547
|
-
local account_name="$command"
|
|
548
|
-
local domain="$account_name"
|
|
549
|
-
|
|
550
|
-
if [[ -z "$domain" ]]; then
|
|
551
|
-
print_error "$ERROR_DOMAIN_NAME_REQUIRED"
|
|
552
|
-
exit 1
|
|
553
|
-
fi
|
|
554
|
-
|
|
555
|
-
print_info "Getting transfer status for domain: $domain"
|
|
556
|
-
local response
|
|
557
|
-
if response=$(api_request "$account_name" "GET" "domains/$domain/transfer"); then
|
|
558
|
-
echo "$response" | jq '.'
|
|
559
|
-
else
|
|
560
|
-
print_error "Failed to get transfer status"
|
|
561
|
-
echo "$response"
|
|
562
|
-
fi
|
|
563
|
-
return 0
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
# Audit domain configuration
|
|
567
|
-
audit_domain() {
|
|
568
|
-
local account_name="$command"
|
|
569
|
-
local domain="$account_name"
|
|
570
|
-
|
|
571
|
-
if [[ -z "$domain" ]]; then
|
|
572
|
-
print_error "$ERROR_DOMAIN_NAME_REQUIRED"
|
|
573
|
-
exit 1
|
|
574
|
-
fi
|
|
575
|
-
|
|
576
|
-
print_info "Auditing domain configuration: $domain"
|
|
577
|
-
echo ""
|
|
578
|
-
|
|
579
|
-
print_info "=== DOMAIN DETAILS ==="
|
|
580
|
-
get_domain_details "$account_name" "$domain"
|
|
581
|
-
echo ""
|
|
582
|
-
|
|
583
|
-
print_info "=== NAMESERVERS ==="
|
|
584
|
-
get_nameservers "$account_name" "$domain"
|
|
585
|
-
echo ""
|
|
586
|
-
|
|
587
|
-
print_info "=== DNS RECORDS ==="
|
|
588
|
-
list_dns_records "$account_name" "$domain"
|
|
589
|
-
echo ""
|
|
590
|
-
|
|
591
|
-
print_info "=== DOMAIN CONTACTS ==="
|
|
592
|
-
get_domain_contacts "$account_name" "$domain"
|
|
593
|
-
return 0
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
# Monitor domain expiration
|
|
597
|
-
monitor_expiration() {
|
|
598
|
-
local account_name="$command"
|
|
599
|
-
local days_threshold="${2:-30}"
|
|
600
|
-
|
|
601
|
-
print_info "Monitoring domain expiration (threshold: $days_threshold days)"
|
|
602
|
-
local response
|
|
603
|
-
if response=$(api_request "$account_name" "GET" "$DOMAINS_ENDPOINT"); then
|
|
604
|
-
echo "$response" | jq -r --arg threshold "$days_threshold" '
|
|
605
|
-
.data[] |
|
|
606
|
-
select(.expires_at != null) |
|
|
607
|
-
select(((.expires_at | strptime("%Y-%m-%d") | mktime) - now) / 86400 < ($threshold | tonumber)) |
|
|
608
|
-
"\(.domain) expires on \(.expires_at) (\((((.expires_at | strptime("%Y-%m-%d") | mktime) - now) / 86400 | floor)) days)"
|
|
609
|
-
'
|
|
610
|
-
else
|
|
611
|
-
print_error "Failed to retrieve domain expiration data"
|
|
612
|
-
echo "$response"
|
|
613
|
-
fi
|
|
614
|
-
return 0
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
# Show help
|
|
618
|
-
show_help() {
|
|
619
|
-
echo "Spaceship Domain Registrar Helper Script"
|
|
620
|
-
echo "Usage: $0 [command] [account] [options]"
|
|
621
|
-
echo ""
|
|
622
|
-
echo "Commands:"
|
|
623
|
-
echo " accounts - List all configured accounts"
|
|
624
|
-
echo " domains [account] - List all domains"
|
|
625
|
-
echo " domain-details [account] [domain] - Get domain details"
|
|
626
|
-
echo " dns-records [account] [domain] - List DNS records"
|
|
627
|
-
echo " add-dns [account] [domain] [name] [type] [content] [ttl] - Add DNS record"
|
|
628
|
-
echo " update-dns [account] [domain] [id] [name] [type] [content] [ttl] - Update DNS record"
|
|
629
|
-
echo " delete-dns [account] [domain] [id] - Delete DNS record"
|
|
630
|
-
echo " nameservers [account] [domain] - Get nameservers"
|
|
631
|
-
echo " update-ns [account] [domain] [ns1] [ns2...] - Update nameservers"
|
|
632
|
-
echo " check-availability [account] [domain] - Check domain availability"
|
|
633
|
-
echo " purchase [account] [domain] [years] [auto_renew] - Purchase domain"
|
|
634
|
-
echo " bulk-check [account] [domain1] [domain2...] - Bulk check domain availability"
|
|
635
|
-
echo " contacts [account] [domain] - Get domain contacts"
|
|
636
|
-
echo " lock [account] [domain] - Lock domain"
|
|
637
|
-
echo " unlock [account] [domain] - Unlock domain"
|
|
638
|
-
echo " transfer-status [account] [domain] - Get transfer status"
|
|
639
|
-
echo " audit [account] [domain] - Audit domain configuration"
|
|
640
|
-
echo " monitor-expiration [account] [days] - Monitor domain expiration"
|
|
641
|
-
echo " help - $HELP_SHOW_MESSAGE"
|
|
642
|
-
echo ""
|
|
643
|
-
echo "Examples:"
|
|
644
|
-
echo " $0 accounts"
|
|
645
|
-
echo " $0 domains personal"
|
|
646
|
-
echo " $0 dns-records personal example.com"
|
|
647
|
-
echo " $0 add-dns personal example.com www A 192.168.1.100"
|
|
648
|
-
echo " $0 audit personal example.com"
|
|
649
|
-
echo " $0 monitor-expiration personal 30"
|
|
650
|
-
return 0
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
# Main script logic
|
|
654
|
-
main() {
|
|
655
|
-
# Assign positional parameters to local variables
|
|
656
|
-
local command="${1:-help}"
|
|
657
|
-
local account_name="$account_name"
|
|
658
|
-
local target="$target"
|
|
659
|
-
local options="$options"
|
|
660
|
-
# Assign positional parameters to local variables
|
|
661
|
-
local command="${1:-help}"
|
|
662
|
-
local account_name="$account_name"
|
|
663
|
-
local target="$target"
|
|
664
|
-
local options="$options"
|
|
665
|
-
# Assign positional parameters to local variables
|
|
666
|
-
local command="${1:-help}"
|
|
667
|
-
local account_name="$account_name"
|
|
668
|
-
local target="$target"
|
|
669
|
-
local options="$options"
|
|
670
|
-
# Assign positional parameters to local variables
|
|
671
|
-
# Assign positional parameters to local variables
|
|
672
|
-
local domain="$target"
|
|
673
|
-
local param4="$options"
|
|
674
|
-
local param5="$param5"
|
|
675
|
-
local param6="$param6"
|
|
676
|
-
local param7="$param7"
|
|
677
|
-
local param8="$param8"
|
|
678
|
-
|
|
679
|
-
check_dependencies
|
|
680
|
-
|
|
681
|
-
case "$command" in
|
|
682
|
-
"accounts")
|
|
683
|
-
list_accounts
|
|
684
|
-
;;
|
|
685
|
-
"domains")
|
|
686
|
-
list_domains "$account_name"
|
|
687
|
-
;;
|
|
688
|
-
"domain-details")
|
|
689
|
-
get_domain_details "$account_name" "$domain"
|
|
690
|
-
;;
|
|
691
|
-
"dns-records")
|
|
692
|
-
list_dns_records "$account_name" "$domain"
|
|
693
|
-
;;
|
|
694
|
-
"add-dns")
|
|
695
|
-
add_dns_record "$account_name" "$domain" "$param4" "$param5" "$param6" "$param7"
|
|
696
|
-
;;
|
|
697
|
-
"update-dns")
|
|
698
|
-
update_dns_record "$account_name" "$domain" "$param4" "$param5" "$param6" "$param7" "$param8"
|
|
699
|
-
;;
|
|
700
|
-
"delete-dns")
|
|
701
|
-
delete_dns_record "$account_name" "$domain" "$param4"
|
|
702
|
-
;;
|
|
703
|
-
"nameservers")
|
|
704
|
-
get_nameservers "$account_name" "$domain"
|
|
705
|
-
;;
|
|
706
|
-
"update-ns")
|
|
707
|
-
shift 3
|
|
708
|
-
update_nameservers "$param2" "$param3" "$@"
|
|
709
|
-
;;
|
|
710
|
-
"check-availability")
|
|
711
|
-
check_domain_availability "$param2" "$param3"
|
|
712
|
-
;;
|
|
713
|
-
"purchase")
|
|
714
|
-
purchase_domain "$param2" "$param3" "$param4" "$param5"
|
|
715
|
-
;;
|
|
716
|
-
"bulk-check")
|
|
717
|
-
shift 2
|
|
718
|
-
bulk_check_domains "$param2" "$@"
|
|
719
|
-
;;
|
|
720
|
-
"contacts")
|
|
721
|
-
get_domain_contacts "$param2" "$param3"
|
|
722
|
-
;;
|
|
723
|
-
"lock")
|
|
724
|
-
toggle_domain_lock "$param2" "$param3" "lock"
|
|
725
|
-
;;
|
|
726
|
-
"unlock")
|
|
727
|
-
toggle_domain_lock "$param2" "$param3" "unlock"
|
|
728
|
-
;;
|
|
729
|
-
"transfer-status")
|
|
730
|
-
get_transfer_status "$param2" "$param3"
|
|
731
|
-
;;
|
|
732
|
-
"audit")
|
|
733
|
-
audit_domain "$param2" "$param3"
|
|
734
|
-
;;
|
|
735
|
-
"monitor-expiration")
|
|
736
|
-
monitor_expiration "$param2" "$param3"
|
|
737
|
-
;;
|
|
738
|
-
"help"|*)
|
|
739
|
-
show_help
|
|
740
|
-
;;
|
|
741
|
-
esac
|
|
742
|
-
return 0
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
main "$@"
|
|
746
|
-
|
|
747
|
-
return 0
|