From 3fb5bd1094028bdfb5cd038b415790bbf30ab7ee Mon Sep 17 00:00:00 2001 From: "cto-new[bot]" <140088366+cto-new[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 16:09:03 +0000 Subject: [PATCH 1/2] Replace python dependency in entrypoint and quiet repo credential logs --- scripts/entrypoint.sh | 83 +++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 46 deletions(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index b4cbb72..9897e3b 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -93,13 +93,13 @@ get_auth_url() { log "Initializing Shopify AI App Builder..." -# Log repository configuration details -log "Repository Configuration:" -log " URL: ${REPO_URL:-'NOT SET'}" -log " Branch: ${REPO_BRANCH:-'NOT SET'}" -log " Directory: ${REPO_DIR}" -log " GitHub Username: ${GITHUB_USERNAME:-'NOT SET'}" -log " GitHub PAT: ${GITHUB_PAT:+SET (hidden)}${GITHUB_PAT:-NOT SET}" +# Log repository configuration details only when cloning is enabled +if [ -n "$REPO_URL" ]; then + log "Repository Configuration:" + log " URL: ${REPO_URL}" + log " Branch: ${REPO_BRANCH}" + log " Directory: ${REPO_DIR}" +fi # Only clone/pull if REPO_URL is set if [ -n "$REPO_URL" ]; then @@ -107,13 +107,6 @@ if [ -n "$REPO_URL" ]; then log "Repository directory: $REPO_DIR" log "Default branch: $REPO_BRANCH" - # Check if authentication credentials are available - if [ -n "$GITHUB_USERNAME" ] && [ -n "$GITHUB_PAT" ]; then - log "GitHub authentication credentials found for user: $GITHUB_USERNAME" - else - log "WARNING: No GitHub authentication credentials found. Private repository access may fail." - fi - # Check if git is available if ! command -v git &> /dev/null; then log "ERROR: git is not available in the container" @@ -229,43 +222,41 @@ ensure_root_opencode_config() { log "Writing OpenCode config: ${config_path} (baseURL=${OPENCODE_OLLAMA_BASE_URL}, model=${OPENCODE_OLLAMA_MODEL})" - python3 - <<'PY' > "$config_path" -import json, os + node - <<'NODE' > "$config_path" +const baseUrl = (process.env.OPENCODE_OLLAMA_BASE_URL || "https://ollama.plugincompass.com").replace(/\/+$/, ""); +const modelId = process.env.OPENCODE_OLLAMA_MODEL || "qwen3:0.6b"; +const apiKey = (process.env.OPENCODE_OLLAMA_API_KEY || "").trim(); +const providerName = process.env.OPENCODE_OLLAMA_PROVIDER || "ollama"; -base_url = (os.environ.get("OPENCODE_OLLAMA_BASE_URL") or "https://ollama.plugincompass.com").rstrip("/") - -model_id = os.environ.get("OPENCODE_OLLAMA_MODEL") or "qwen3:0.6b" -api_key = (os.environ.get("OPENCODE_OLLAMA_API_KEY") or "").strip() -provider_name = os.environ.get("OPENCODE_OLLAMA_PROVIDER") or "ollama" - -provider_cfg = { - "options": { - "baseURL": base_url, - }, - "models": { - model_id: { - "id": model_id, - "name": model_id, - "tool_call": True, - "temperature": True, - } +const providerConfig = { + options: { + baseURL: baseUrl, + }, + models: { + [modelId]: { + id: modelId, + name: modelId, + tool_call: true, + temperature: true, }, + }, +}; + +if (apiKey) { + providerConfig.options.apiKey = apiKey; } -if api_key: - provider_cfg["options"]["apiKey"] = api_key +const config = { + $schema: "https://opencode.ai/config.json", + model: `${providerName}/${modelId}`, + small_model: `${providerName}/${modelId}`, + provider: { + [providerName]: providerConfig, + }, +}; -cfg = { - "$schema": "https://opencode.ai/config.json", - "model": f"{provider_name}/{model_id}", - "small_model": f"{provider_name}/{model_id}", - "provider": { - provider_name: provider_cfg, - }, -} - -print(json.dumps(cfg, indent=2)) -PY +process.stdout.write(`${JSON.stringify(config, null, 2)}\n`); +NODE chmod 600 "$config_path" 2>/dev/null || true } From 8d4cae97074bd94004b0c1d1e5b92d67df5ddd7e Mon Sep 17 00:00:00 2001 From: "cto-new[bot]" <140088366+cto-new[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 16:13:58 +0000 Subject: [PATCH 2/2] Clean up entrypoint startup logs and remove GitHub auth handling --- scripts/diagnostic-logger.sh | 2 -- scripts/entrypoint.sh | 28 +++------------------------- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/scripts/diagnostic-logger.sh b/scripts/diagnostic-logger.sh index dd58fa0..a3f849d 100644 --- a/scripts/diagnostic-logger.sh +++ b/scripts/diagnostic-logger.sh @@ -166,8 +166,6 @@ validate_environment() { "DODO_PAYMENTS_API_KEY" "ADMIN_USER" "ADMIN_PASSWORD" - "REPO_URL" - "REPO_BRANCH" ) # Check critical variables diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 9897e3b..2308d8a 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -76,20 +76,6 @@ log "=== ENVIRONMENT SANITIZATION COMPLETE ===" REPO_URL="${REPO_URL:-}" REPO_DIR="/home/web/data" REPO_BRANCH="${REPO_BRANCH:-main}" -GITHUB_USERNAME="${GITHUB_USERNAME:-}" -GITHUB_PAT="${GITHUB_PAT:-}" - -# Helper function to get authenticated repository URL -get_auth_url() { - local url="$1" - if [ -n "$GITHUB_USERNAME" ] && [ -n "$GITHUB_PAT" ]; then - # Extract the repository path from the URL - local repo_path=$(echo "$url" | sed 's|https://github.com/||') - echo "https://${GITHUB_USERNAME}:${GITHUB_PAT}@github.com/${repo_path}" - else - echo "$url" - fi -} log "Initializing Shopify AI App Builder..." @@ -123,22 +109,14 @@ if [ -n "$REPO_URL" ]; then fi log "Repository not found. Cloning $REPO_URL into $REPO_DIR..." - auth_url=$(get_auth_url "$REPO_URL") - git clone "$auth_url" "$REPO_DIR" + git clone "$REPO_URL" "$REPO_DIR" cd "$REPO_DIR" log "Successfully cloned repository" else # Repository exists, pull latest changes cd "$REPO_DIR" log "Repository found at $REPO_DIR. Pulling latest changes from $REPO_BRANCH..." - - # Update remote URL to use authentication if credentials are available - if [ -n "$GITHUB_USERNAME" ] && [ -n "$GITHUB_PAT" ]; then - auth_url=$(get_auth_url "$REPO_URL") - log "Updating remote URL with authentication credentials" - git remote set-url origin "$auth_url" - fi - + # Check if we're on a detached HEAD or have uncommitted changes if git diff --quiet && git diff --cached --quiet; then git fetch origin @@ -155,8 +133,8 @@ if [ -n "$REPO_URL" ]; then fi log "Repository is ready at $REPO_DIR" else - log "No REPO_URL set - starting with empty workspace" mkdir -p "$REPO_DIR" + log "Workspace directory ready at $REPO_DIR" fi log "Starting Shopify AI App Builder service..."