From 37aebdb1494556ab09495ce3c7fe52bbac0e3d22 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 09:19:35 +0000 Subject: [PATCH 1/2] Initial plan From 6e45f4cbe2e625ab9926e2d04db634548fa6cc21 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 09:22:23 +0000 Subject: [PATCH 2/2] Add installer scripts for Odoo, Shopify CLI, Contentful CLI, Strapi, and React Bricks CMS Co-authored-by: nexusct <19503275+nexusct@users.noreply.github.com> Agent-Logs-Url: https://github.com/nexusct/1Panel/sessions/1b017fed-a2d6-4ac9-b287-80226f2549de --- ci/install_contentful.sh | 45 +++++++++++ ci/install_odoo.sh | 148 +++++++++++++++++++++++++++++++++++++ ci/install_react_bricks.sh | 61 +++++++++++++++ ci/install_shopify.sh | 50 +++++++++++++ ci/install_strapi.sh | 62 ++++++++++++++++ ci/script.sh | 14 ++++ 6 files changed, 380 insertions(+) create mode 100644 ci/install_contentful.sh create mode 100644 ci/install_odoo.sh create mode 100644 ci/install_react_bricks.sh create mode 100644 ci/install_shopify.sh create mode 100644 ci/install_strapi.sh diff --git a/ci/install_contentful.sh b/ci/install_contentful.sh new file mode 100644 index 000000000000..070bb57912e0 --- /dev/null +++ b/ci/install_contentful.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Contentful CLI Installer +# npm package: contentful-cli + +set -e + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE='\033[0;34m' +NC='\033[0m' + +log_info() { echo -e "${BLUE}[Contentful CLI] $1${NC}"; } +log_ok() { echo -e "${GREEN}[Contentful CLI] $1${NC}"; } +log_warn() { echo -e "${YELLOW}[Contentful CLI] $1${NC}"; } +log_err() { echo -e "${RED}[Contentful CLI] $1${NC}"; } + +check_node() { + if ! command -v node >/dev/null 2>&1; then + log_err "Node.js is required but not found. Please install Node.js LTS first." + return 1 + fi + log_ok "Node.js $(node --version) detected." +} + +install_contentful_cli() { + log_info "Installing Contentful CLI..." + + if command -v contentful >/dev/null 2>&1; then + log_warn "Contentful CLI already installed ($(contentful --version 2>/dev/null || echo 'unknown')). Skipping." + return 0 + fi + + if npm install -g contentful-cli; then + log_ok "Contentful CLI installed successfully." + log_info " Run 'contentful login' to authenticate." + log_info " Docs: https://www.contentful.com/developers/docs/tutorials/cli/" + log_info " npm: https://www.npmjs.com/package/contentful-cli" + else + log_err "Failed to install Contentful CLI." + return 1 + fi +} + +check_node && install_contentful_cli diff --git a/ci/install_odoo.sh b/ci/install_odoo.sh new file mode 100644 index 000000000000..08731b24e06e --- /dev/null +++ b/ci/install_odoo.sh @@ -0,0 +1,148 @@ +#!/bin/bash +# Odoo Installer +# Supports: Docker (default) or native deb/rpm package install + +set -e + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE='\033[0;34m' +NC='\033[0m' + +ODOO_VERSION="${ODOO_VERSION:-17}" +ODOO_PORT="${ODOO_PORT:-8069}" +DB_PASSWORD="${ODOO_DB_PASSWORD:-$(tr -dc A-Za-z0-9 /dev/null 2>&1; then + log_err "Docker is not installed. Please install Docker first (the 1Panel installer handles this)." + return 1 + fi + log_ok "Docker detected: $(docker --version)" +} + +install_odoo_docker() { + log_info "Installing Odoo ${ODOO_VERSION} via Docker..." + + if docker ps -a --format '{{.Names}}' | grep -q '^odoo$'; then + log_warn "Odoo container already exists. Skipping." + return 0 + fi + + # Create data directories + mkdir -p "${INSTALL_DIR}/data" "${INSTALL_DIR}/config" "${INSTALL_DIR}/addons" + + # Persist credentials to a restricted file + CREDENTIALS_FILE="${INSTALL_DIR}/credentials.txt" + if [ ! -f "${CREDENTIALS_FILE}" ]; then + install -m 600 /dev/null "${CREDENTIALS_FILE}" + { + echo "Odoo DB User: odoo" + echo "Odoo DB Password: ${DB_PASSWORD}" + } > "${CREDENTIALS_FILE}" + log_info " Credentials saved to: ${CREDENTIALS_FILE}" + fi + + # Create a dedicated Docker network for Odoo + if ! docker network ls --format '{{.Name}}' | grep -q '^odoo-net$'; then + log_info "Creating Docker network 'odoo-net'..." + docker network create odoo-net + fi + + # Start PostgreSQL container for Odoo + if ! docker ps -a --format '{{.Names}}' | grep -q '^odoo-db$'; then + log_info "Starting PostgreSQL container for Odoo..." + docker run -d \ + --name odoo-db \ + --restart unless-stopped \ + --network odoo-net \ + -e POSTGRES_DB=postgres \ + -e POSTGRES_PASSWORD="${DB_PASSWORD}" \ + -e POSTGRES_USER=odoo \ + -v "${INSTALL_DIR}/db:/var/lib/postgresql/data" \ + postgres:15 + sleep 5 + else + log_warn "odoo-db container already exists, reusing." + # Ensure it is on the odoo-net network + docker network connect odoo-net odoo-db 2>/dev/null || true + fi + + # Start Odoo container + log_info "Starting Odoo ${ODOO_VERSION} container on port ${ODOO_PORT}..." + docker run -d \ + --name odoo \ + --restart unless-stopped \ + --network odoo-net \ + -p "${ODOO_PORT}:8069" \ + -e HOST=odoo-db \ + -e USER=odoo \ + -e PASSWORD="${DB_PASSWORD}" \ + -v "${INSTALL_DIR}/data:/var/lib/odoo" \ + -v "${INSTALL_DIR}/config:/etc/odoo" \ + -v "${INSTALL_DIR}/addons:/mnt/extra-addons" \ + "odoo:${ODOO_VERSION}" + + log_ok "Odoo ${ODOO_VERSION} installed and running." + log_info " Access Odoo at: http://localhost:${ODOO_PORT}" + log_info " DB User: odoo | DB Password: ${DB_PASSWORD}" + log_info " Data directory: ${INSTALL_DIR}" + log_info " Docs: https://hub.docker.com/_/odoo" +} + +install_odoo_package() { + log_info "Installing Odoo ${ODOO_VERSION} via system package..." + + if command -v odoo >/dev/null 2>&1; then + log_warn "Odoo is already installed. Skipping." + return 0 + fi + + if command -v apt-get >/dev/null 2>&1; then + # Debian/Ubuntu + apt-get install -y wget gnupg + wget -q -O - https://nightly.odoo.com/odoo.key | gpg --dearmor -o /usr/share/keyrings/odoo-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/odoo-archive-keyring.gpg] https://nightly.odoo.com/${ODOO_VERSION}.0/nightly/deb/ ./" \ + > /etc/apt/sources.list.d/odoo.list + apt-get update && apt-get install -y odoo + systemctl enable odoo + systemctl start odoo + elif command -v dnf >/dev/null 2>&1; then + # Fedora/RHEL/CentOS + dnf config-manager --add-repo="https://nightly.odoo.com/${ODOO_VERSION}.0/nightly/rpm/odoo.repo" + dnf install -y odoo + systemctl enable odoo + systemctl start odoo + elif command -v yum >/dev/null 2>&1; then + yum-config-manager --add-repo="https://nightly.odoo.com/${ODOO_VERSION}.0/nightly/rpm/odoo.repo" + yum install -y odoo + systemctl enable odoo + systemctl start odoo + else + log_err "Unsupported package manager. Use INSTALL_MODE=docker." + return 1 + fi + + log_ok "Odoo ${ODOO_VERSION} installed via system package." + log_info " Access Odoo at: http://localhost:8069" +} + +main() { + log_info "Starting Odoo installation (version ${ODOO_VERSION})..." + INSTALL_MODE="${INSTALL_MODE:-docker}" + + if [ "$INSTALL_MODE" = "docker" ]; then + check_docker && install_odoo_docker + else + install_odoo_package + fi +} + +main diff --git a/ci/install_react_bricks.sh b/ci/install_react_bricks.sh new file mode 100644 index 000000000000..ceb0636543df --- /dev/null +++ b/ci/install_react_bricks.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# React Bricks CMS Installer +# Scaffolds a new React Bricks project using: npx create-reactbricks-app@latest + +set -e + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE='\033[0;34m' +NC='\033[0m' + +REACTBRICKS_PROJECT_NAME="${REACTBRICKS_PROJECT_NAME:-my-reactbricks-app}" +REACTBRICKS_INSTALL_DIR="${REACTBRICKS_INSTALL_DIR:-/opt/reactbricks}" + +log_info() { echo -e "${BLUE}[React Bricks] $1${NC}"; } +log_ok() { echo -e "${GREEN}[React Bricks] $1${NC}"; } +log_warn() { echo -e "${YELLOW}[React Bricks] $1${NC}"; } +log_err() { echo -e "${RED}[React Bricks] $1${NC}"; } + +check_node() { + if ! command -v node >/dev/null 2>&1; then + log_err "Node.js is required but not found. Please install Node.js 18+ first." + return 1 + fi + node_major=$(node --version | sed 's/v//' | cut -d. -f1) + if [ "$node_major" -lt 18 ]; then + log_err "Node.js 18+ required (found $(node --version))." + return 1 + fi + log_ok "Node.js $(node --version) detected." +} + +install_react_bricks() { + log_info "Setting up React Bricks CMS project '${REACTBRICKS_PROJECT_NAME}'..." + + TARGET_DIR="${REACTBRICKS_INSTALL_DIR}/${REACTBRICKS_PROJECT_NAME}" + + if [ -d "${TARGET_DIR}" ]; then + log_warn "React Bricks project already exists at ${TARGET_DIR}. Skipping." + return 0 + fi + + mkdir -p "${REACTBRICKS_INSTALL_DIR}" + + log_info "Scaffolding React Bricks project at ${TARGET_DIR} (this may take a few minutes)..." + cd "${REACTBRICKS_INSTALL_DIR}" + + if npx create-reactbricks-app@latest "${REACTBRICKS_PROJECT_NAME}"; then + log_ok "React Bricks project '${REACTBRICKS_PROJECT_NAME}' created at ${TARGET_DIR}." + log_info " To start: cd ${TARGET_DIR} && npm run dev" + log_info " Docs: https://www.reactbricks.com/docs" + log_info " npm: https://www.npmjs.com/package/react-bricks" + log_info " Note: You will need a React Bricks account and App ID to use the CMS." + else + log_err "Failed to scaffold React Bricks project." + return 1 + fi +} + +check_node && install_react_bricks diff --git a/ci/install_shopify.sh b/ci/install_shopify.sh new file mode 100644 index 000000000000..0da8586f5d43 --- /dev/null +++ b/ci/install_shopify.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Shopify CLI Installer +# npm package: @shopify/cli + +set -e + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE='\033[0;34m' +NC='\033[0m' + +log_info() { echo -e "${BLUE}[Shopify CLI] $1${NC}"; } +log_ok() { echo -e "${GREEN}[Shopify CLI] $1${NC}"; } +log_warn() { echo -e "${YELLOW}[Shopify CLI] $1${NC}"; } +log_err() { echo -e "${RED}[Shopify CLI] $1${NC}"; } + +check_node() { + if ! command -v node >/dev/null 2>&1; then + log_err "Node.js is required but not found. Please install Node.js 18+ first." + return 1 + fi + node_major=$(node --version | sed 's/v//' | cut -d. -f1) + if [ "$node_major" -lt 18 ]; then + log_err "Node.js 18+ required (found $(node --version))." + return 1 + fi + log_ok "Node.js $(node --version) detected." +} + +install_shopify_cli() { + log_info "Installing Shopify CLI..." + + if command -v shopify >/dev/null 2>&1; then + log_warn "Shopify CLI already installed ($(shopify version 2>/dev/null || echo 'unknown')). Skipping." + return 0 + fi + + if npm install -g @shopify/cli@latest; then + log_ok "Shopify CLI installed successfully." + log_info " Run 'shopify' to get started." + log_info " Docs: https://shopify.dev/docs/api/shopify-cli" + log_info " GitHub: https://github.com/Shopify/cli" + else + log_err "Failed to install Shopify CLI." + return 1 + fi +} + +check_node && install_shopify_cli diff --git a/ci/install_strapi.sh b/ci/install_strapi.sh new file mode 100644 index 000000000000..33a077324ad3 --- /dev/null +++ b/ci/install_strapi.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# Strapi CMS Installer +# Scaffolds a new Strapi project using: npx create-strapi@latest + +set -e + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE='\033[0;34m' +NC='\033[0m' + +STRAPI_PROJECT_NAME="${STRAPI_PROJECT_NAME:-my-strapi-app}" +STRAPI_INSTALL_DIR="${STRAPI_INSTALL_DIR:-/opt/strapi}" + +log_info() { echo -e "${BLUE}[Strapi] $1${NC}"; } +log_ok() { echo -e "${GREEN}[Strapi] $1${NC}"; } +log_warn() { echo -e "${YELLOW}[Strapi] $1${NC}"; } +log_err() { echo -e "${RED}[Strapi] $1${NC}"; } + +check_node() { + if ! command -v node >/dev/null 2>&1; then + log_err "Node.js is required but not found. Please install Node.js 18+ first." + return 1 + fi + node_major=$(node --version | sed 's/v//' | cut -d. -f1) + if [ "$node_major" -lt 18 ]; then + log_err "Node.js 18+ required (found $(node --version))." + return 1 + fi + log_ok "Node.js $(node --version) detected." +} + +install_strapi() { + log_info "Setting up Strapi CMS project '${STRAPI_PROJECT_NAME}'..." + + TARGET_DIR="${STRAPI_INSTALL_DIR}/${STRAPI_PROJECT_NAME}" + + if [ -d "${TARGET_DIR}" ]; then + log_warn "Strapi project already exists at ${TARGET_DIR}. Skipping." + return 0 + fi + + mkdir -p "${STRAPI_INSTALL_DIR}" + + log_info "Scaffolding Strapi project at ${TARGET_DIR} (this may take a few minutes)..." + cd "${STRAPI_INSTALL_DIR}" + + # Use --quickstart for SQLite (no extra DB setup needed) + if npx create-strapi@latest "${STRAPI_PROJECT_NAME}" --quickstart --no-run; then + log_ok "Strapi project '${STRAPI_PROJECT_NAME}' created at ${TARGET_DIR}." + log_info " To start Strapi: cd ${TARGET_DIR} && npm run develop" + log_info " Default port: 1337" + log_info " Admin panel: http://localhost:1337/admin" + log_info " Docs: https://docs.strapi.io/cms/installation/cli" + else + log_err "Failed to scaffold Strapi project." + return 1 + fi +} + +check_node && install_strapi diff --git a/ci/script.sh b/ci/script.sh index 556002a653e5..80688a41a9dd 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -38,3 +38,17 @@ if [ ! -f "GeoIP.mmdb" ]; then fi chmod 755 1pctl install.sh + +# Make application installer scripts executable +SCRIPT_DIR="$(dirname "$0")" +for installer in \ + install_ai_tools.sh \ + install_odoo.sh \ + install_shopify.sh \ + install_contentful.sh \ + install_strapi.sh \ + install_react_bricks.sh; do + if [ -f "${SCRIPT_DIR}/${installer}" ]; then + chmod +x "${SCRIPT_DIR}/${installer}" + fi +done