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,321 @@
|
|
|
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
|
+
# Cloudron Helper Script
|
|
5
|
+
# Manages Cloudron servers and applications
|
|
6
|
+
|
|
7
|
+
# Colors for output
|
|
8
|
+
# String literal constants
|
|
9
|
+
readonly ERROR_CONFIG_NOT_FOUND="Configuration file not found"
|
|
10
|
+
readonly ERROR_SERVER_NAME_REQUIRED="Server name is required"
|
|
11
|
+
readonly ERROR_SERVER_NOT_FOUND="Server not found in configuration"
|
|
12
|
+
|
|
13
|
+
GREEN='\033[0;32m'
|
|
14
|
+
BLUE='\033[0;34m'
|
|
15
|
+
YELLOW='\033[1;33m'
|
|
16
|
+
RED='\033[0;31m'
|
|
17
|
+
NC='\033[0m' # No Color
|
|
18
|
+
|
|
19
|
+
# Error message constants
|
|
20
|
+
# readonly USAGE_PREFIX="Usage:" # Currently unused
|
|
21
|
+
readonly ERROR_UNKNOWN_COMMAND="Unknown command:"
|
|
22
|
+
|
|
23
|
+
print_info() {
|
|
24
|
+
local message="$1"
|
|
25
|
+
echo -e "${BLUE}[INFO]${NC} $message"
|
|
26
|
+
return 0
|
|
27
|
+
}
|
|
28
|
+
print_success() {
|
|
29
|
+
local message="$1"
|
|
30
|
+
echo -e "${GREEN}[SUCCESS]${NC} $message"
|
|
31
|
+
return 0
|
|
32
|
+
}
|
|
33
|
+
print_warning() {
|
|
34
|
+
local message="$1"
|
|
35
|
+
echo -e "${YELLOW}[WARNING]${NC} $message"
|
|
36
|
+
return 0
|
|
37
|
+
}
|
|
38
|
+
print_error() {
|
|
39
|
+
local message="$1"
|
|
40
|
+
echo -e "${RED}[ERROR]${NC} $message" >&2
|
|
41
|
+
return 0
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
# Configuration file
|
|
45
|
+
CONFIG_FILE="../configs/cloudron-config.json"
|
|
46
|
+
|
|
47
|
+
# Check if config file exists
|
|
48
|
+
check_config() {
|
|
49
|
+
if [[ ! -f "$CONFIG_FILE" ]]; then
|
|
50
|
+
print_error "$ERROR_CONFIG_NOT_FOUND"
|
|
51
|
+
print_info "Copy and customize: cp ../configs/cloudron-config.json.txt $CONFIG_FILE"
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
return 0
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
# Check if Cloudron CLI is installed
|
|
58
|
+
check_cloudron_cli() {
|
|
59
|
+
if ! command -v cloudron >/dev/null 2>&1; then
|
|
60
|
+
print_warning "Cloudron CLI not found"
|
|
61
|
+
print_info "Install with: npm install -g cloudron"
|
|
62
|
+
print_info "Or download from: https://cloudron.io/documentation/cli/"
|
|
63
|
+
return 1
|
|
64
|
+
fi
|
|
65
|
+
return 0
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
# List all Cloudron servers
|
|
69
|
+
list_servers() {
|
|
70
|
+
check_config
|
|
71
|
+
print_info "Available Cloudron servers:"
|
|
72
|
+
|
|
73
|
+
servers=$(jq -r '.servers | keys[]' "$CONFIG_FILE")
|
|
74
|
+
for server in $servers; do
|
|
75
|
+
description=$(jq -r ".servers.$server.description" "$CONFIG_FILE")
|
|
76
|
+
domain=$(jq -r ".servers.$server.domain" "$CONFIG_FILE")
|
|
77
|
+
ip=$(jq -r ".servers.$server.ip" "$CONFIG_FILE")
|
|
78
|
+
echo " - $server: $description ($domain - $ip)"
|
|
79
|
+
done
|
|
80
|
+
return 0
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
# Connect to Cloudron server (SSH as root initially)
|
|
84
|
+
connect_server() {
|
|
85
|
+
local server="$1"
|
|
86
|
+
check_config
|
|
87
|
+
|
|
88
|
+
if [[ -z "$server" ]]; then
|
|
89
|
+
print_error "$ERROR_SERVER_NAME_REQUIRED"
|
|
90
|
+
list_servers
|
|
91
|
+
exit 1
|
|
92
|
+
fi
|
|
93
|
+
|
|
94
|
+
# Get server configuration
|
|
95
|
+
local ip
|
|
96
|
+
ip=$(jq -r ".servers.$server.ip" "$CONFIG_FILE")
|
|
97
|
+
local domain
|
|
98
|
+
domain=$(jq -r ".servers.$server.domain" "$CONFIG_FILE")
|
|
99
|
+
local ssh_port
|
|
100
|
+
ssh_port=$(jq -r ".servers.$server.ssh_port" "$CONFIG_FILE")
|
|
101
|
+
|
|
102
|
+
if [[ "$ip" == "null" ]]; then
|
|
103
|
+
print_error "$ERROR_SERVER_NOT_FOUND"
|
|
104
|
+
list_servers
|
|
105
|
+
exit 1
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
ssh_port="${ssh_port:-22}"
|
|
109
|
+
|
|
110
|
+
print_info "Connecting to Cloudron server $server ($domain)..."
|
|
111
|
+
print_warning "Note: Use 'root' user for initial SSH access to Cloudron servers"
|
|
112
|
+
|
|
113
|
+
ssh -p "$ssh_port" "root@$ip"
|
|
114
|
+
return 0
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
# Execute command on Cloudron server
|
|
118
|
+
exec_on_server() {
|
|
119
|
+
local server="$1"
|
|
120
|
+
local command="$2"
|
|
121
|
+
check_config
|
|
122
|
+
|
|
123
|
+
if [[ -z "$server" || -z "$command" ]]; then
|
|
124
|
+
print_error "Usage: exec [server] [command]"
|
|
125
|
+
exit 1
|
|
126
|
+
fi
|
|
127
|
+
|
|
128
|
+
# Get server configuration
|
|
129
|
+
local ip
|
|
130
|
+
ip=$(jq -r ".servers.$server.ip" "$CONFIG_FILE")
|
|
131
|
+
local ssh_port
|
|
132
|
+
ssh_port=$(jq -r ".servers.$server.ssh_port" "$CONFIG_FILE")
|
|
133
|
+
|
|
134
|
+
if [[ "$ip" == "null" ]]; then
|
|
135
|
+
print_error "$ERROR_SERVER_NOT_FOUND"
|
|
136
|
+
exit 1
|
|
137
|
+
fi
|
|
138
|
+
|
|
139
|
+
ssh_port="${ssh_port:-22}"
|
|
140
|
+
|
|
141
|
+
print_info "Executing '$command' on $server..."
|
|
142
|
+
ssh -p "$ssh_port" "root@$ip" "$command"
|
|
143
|
+
return 0
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
# List apps on Cloudron server
|
|
147
|
+
list_apps() {
|
|
148
|
+
local server="$1"
|
|
149
|
+
check_config
|
|
150
|
+
|
|
151
|
+
if [[ -z "$server" ]]; then
|
|
152
|
+
print_error "$ERROR_SERVER_NAME_REQUIRED"
|
|
153
|
+
exit 1
|
|
154
|
+
fi
|
|
155
|
+
|
|
156
|
+
local domain
|
|
157
|
+
domain=$(jq -r ".servers.$server.domain" "$CONFIG_FILE")
|
|
158
|
+
local token
|
|
159
|
+
token=$(jq -r ".servers.$server.api_token" "$CONFIG_FILE")
|
|
160
|
+
|
|
161
|
+
if [[ "$domain" == "null" ]]; then
|
|
162
|
+
print_error "$ERROR_SERVER_NOT_FOUND"
|
|
163
|
+
exit 1
|
|
164
|
+
fi
|
|
165
|
+
|
|
166
|
+
if check_cloudron_cli; then
|
|
167
|
+
print_info "Listing apps on $server ($domain)..."
|
|
168
|
+
if [[ "$token" != "null" ]]; then
|
|
169
|
+
cloudron list --server "$domain" --token "$token"
|
|
170
|
+
else
|
|
171
|
+
print_warning "No API token configured. Using SSH method..."
|
|
172
|
+
exec_on_server "$server" "docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}' | grep -v redis"
|
|
173
|
+
fi
|
|
174
|
+
else
|
|
175
|
+
print_info "Using SSH method to list apps..."
|
|
176
|
+
return 0
|
|
177
|
+
exec_on_server "$server" "docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}' | grep -v redis"
|
|
178
|
+
fi
|
|
179
|
+
return 0
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
# Execute command in Cloudron app container
|
|
183
|
+
exec_in_app() {
|
|
184
|
+
local server="$1"
|
|
185
|
+
local app_id="$2"
|
|
186
|
+
local command="$3"
|
|
187
|
+
check_config
|
|
188
|
+
|
|
189
|
+
if [[ -z "$server" || -z "$app_id" || -z "$command" ]]; then
|
|
190
|
+
print_error "Usage: exec-app [server] [app-id] [command]"
|
|
191
|
+
exit 1
|
|
192
|
+
fi
|
|
193
|
+
|
|
194
|
+
print_info "Executing '$command' in app $app_id on $server..."
|
|
195
|
+
exec_on_server "$server" "docker exec $app_id $command"
|
|
196
|
+
return 0
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
# Check Cloudron server status
|
|
200
|
+
check_status() {
|
|
201
|
+
local server="$1"
|
|
202
|
+
check_config
|
|
203
|
+
|
|
204
|
+
if [[ -z "$server" ]]; then
|
|
205
|
+
return 0
|
|
206
|
+
print_error "$ERROR_SERVER_NAME_REQUIRED"
|
|
207
|
+
exit 1
|
|
208
|
+
fi
|
|
209
|
+
|
|
210
|
+
return 0
|
|
211
|
+
print_info "Checking Cloudron server status for $server..."
|
|
212
|
+
exec_on_server "$server" "echo 'Cloudron Status:' && systemctl status cloudron --no-pager -l && echo '' && echo 'Docker Status:' && docker ps --format 'table {{.Names}}\t{{.Status}}' | head -10"
|
|
213
|
+
return 0
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
# Generate SSH configurations for Cloudron servers
|
|
217
|
+
generate_ssh_configs() {
|
|
218
|
+
check_config
|
|
219
|
+
print_info "Generating SSH configurations for Cloudron servers..."
|
|
220
|
+
|
|
221
|
+
servers=$(jq -r '.servers | keys[]' "$CONFIG_FILE")
|
|
222
|
+
|
|
223
|
+
echo "# Cloudron servers SSH configuration" > ~/.ssh/cloudron_config
|
|
224
|
+
echo "# Generated on $(date)" >> ~/.ssh/cloudron_config
|
|
225
|
+
echo "# Note: Cloudron servers typically require 'root' user for SSH access" >> ~/.ssh/cloudron_config
|
|
226
|
+
|
|
227
|
+
for server in $servers; do
|
|
228
|
+
ip=$(jq -r ".servers.$server.ip" "$CONFIG_FILE")
|
|
229
|
+
domain=$(jq -r ".servers.$server.domain" "$CONFIG_FILE")
|
|
230
|
+
ssh_port=$(jq -r ".servers.$server.ssh_port" "$CONFIG_FILE")
|
|
231
|
+
description=$(jq -r ".servers.$server.description" "$CONFIG_FILE")
|
|
232
|
+
|
|
233
|
+
ssh_port="${ssh_port:-22}"
|
|
234
|
+
|
|
235
|
+
echo "" >> ~/.ssh/cloudron_config
|
|
236
|
+
echo "# $description ($domain)" >> ~/.ssh/cloudron_config
|
|
237
|
+
echo "Host $server" >> ~/.ssh/cloudron_config
|
|
238
|
+
echo " HostName $ip" >> ~/.ssh/cloudron_config
|
|
239
|
+
echo " Port $ssh_port" >> ~/.ssh/cloudron_config
|
|
240
|
+
echo " User root" >> ~/.ssh/cloudron_config
|
|
241
|
+
echo " IdentityFile ~/.ssh/id_ed25519" >> ~/.ssh/cloudron_config
|
|
242
|
+
echo " AddKeysToAgent yes" >> ~/.ssh/cloudron_config
|
|
243
|
+
echo " UseKeychain yes" >> ~/.ssh/cloudron_config
|
|
244
|
+
|
|
245
|
+
print_success "Added SSH config for $server ($domain)"
|
|
246
|
+
done
|
|
247
|
+
|
|
248
|
+
print_success "SSH configurations generated in ~/.ssh/cloudron_config"
|
|
249
|
+
print_info "Add 'Include ~/.ssh/cloudron_config' to your ~/.ssh/config"
|
|
250
|
+
return 0
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
# Assign positional parameters to local variables
|
|
254
|
+
# Main function
|
|
255
|
+
main() {
|
|
256
|
+
local command="${1:-help}"
|
|
257
|
+
local param2="$2"
|
|
258
|
+
local param3="$3"
|
|
259
|
+
local param4="$4"
|
|
260
|
+
|
|
261
|
+
local server_name="$param2"
|
|
262
|
+
local command_to_run="$param3"
|
|
263
|
+
|
|
264
|
+
# Main command handler
|
|
265
|
+
case "$command" in
|
|
266
|
+
"list")
|
|
267
|
+
list_servers
|
|
268
|
+
;;
|
|
269
|
+
"connect")
|
|
270
|
+
connect_server "$server_name"
|
|
271
|
+
;;
|
|
272
|
+
"exec")
|
|
273
|
+
exec_on_server "$server_name" "$command_to_run"
|
|
274
|
+
;;
|
|
275
|
+
"apps")
|
|
276
|
+
list_apps "$server_name"
|
|
277
|
+
;;
|
|
278
|
+
"exec-app")
|
|
279
|
+
exec_in_app "$param2" "$param3" "$param4"
|
|
280
|
+
;;
|
|
281
|
+
"status")
|
|
282
|
+
check_status "$param2"
|
|
283
|
+
;;
|
|
284
|
+
"generate-ssh-configs")
|
|
285
|
+
generate_ssh_configs
|
|
286
|
+
;;
|
|
287
|
+
"help"|"-h"|"--help"|"")
|
|
288
|
+
echo "Cloudron Helper Script"
|
|
289
|
+
echo "$USAGE_COMMAND_OPTIONS"
|
|
290
|
+
echo ""
|
|
291
|
+
echo "Commands:"
|
|
292
|
+
echo " list - List all Cloudron servers"
|
|
293
|
+
echo " connect [server] - Connect to server via SSH (as root)"
|
|
294
|
+
echo " exec [server] [command] - Execute command on server"
|
|
295
|
+
echo " apps [server] - List apps on Cloudron server"
|
|
296
|
+
echo " exec-app [server] [app] [cmd] - Execute command in app container"
|
|
297
|
+
echo " status [server] - Check Cloudron server status"
|
|
298
|
+
echo " generate-ssh-configs - Generate SSH configurations"
|
|
299
|
+
echo " help - $HELP_SHOW_MESSAGE"
|
|
300
|
+
echo ""
|
|
301
|
+
echo "Examples:"
|
|
302
|
+
echo " $0 list"
|
|
303
|
+
echo " $0 connect cloudron01"
|
|
304
|
+
echo " $0 apps cloudron01"
|
|
305
|
+
echo " $0 exec-app cloudron01 app-id 'ls -la /app/data'"
|
|
306
|
+
echo " $0 status cloudron01"
|
|
307
|
+
echo ""
|
|
308
|
+
echo "Note: Cloudron servers typically require 'root' user for SSH access"
|
|
309
|
+
echo "Install Cloudron CLI: npm install -g cloudron"
|
|
310
|
+
;;
|
|
311
|
+
*)
|
|
312
|
+
print_error "$ERROR_UNKNOWN_COMMAND $command"
|
|
313
|
+
print_info "$HELP_USAGE_INFO"
|
|
314
|
+
exit 1
|
|
315
|
+
;;
|
|
316
|
+
esac
|
|
317
|
+
return 0
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
# Run main function
|
|
321
|
+
main "$@"
|