diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d95c0b..e20fc1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ concurrency: cancel-in-progress: true permissions: - contents: write # needed for creating GitHub Releases + contents: read env: # ohos-node release version @@ -47,8 +47,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: '24' - cache: 'npm' - cache-dependency-path: '.cache/electerm-web/package-lock.json' # ── Install system deps for native modules ──────────────────────────── - name: Install system dependencies @@ -63,6 +61,15 @@ jobs: g++ \ libsecret-1-dev + # ── Setup JDK (for hap-sign-tool.jar — must match or exceed the JDK + # used to create the .p12 keystore, otherwise PKCS12 loading fails + # with "keystore password was incorrect") ──────────────────────── + - name: Setup JDK 21 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + # ── Step 1: Download ohos-node ─────────────────────────────────────── - name: Prepare ohos-node run: ./scripts/prepare-node.sh @@ -77,46 +84,75 @@ jobs: ELECTERM_WEB_REF: ${{ env.ELECTERM_WEB_REF }} OHOS_SERVER_SECRET: ${{ secrets.OHOS_SERVER_SECRET }} - # ── Step 3: Download & setup HarmonyOS Command Line Tools ──────────── - - name: Download HarmonyOS Command Line Tools + # ── Step 3: Download & extract REAL HarmonyOS Command Line Tools ────── + - name: Download & extract HarmonyOS Command Line Tools + env: + OHOS_CMDLINE_TOOLS_URL: ${{ secrets.OHOS_CMDLINE_TOOLS_URL }} run: | - if [ -z "${{ secrets.OHOS_CMDLINE_TOOLS_URL }}" ]; then + set -euo pipefail + if [ -z "${OHOS_CMDLINE_TOOLS_URL}" ]; then echo "::error::OHOS_CMDLINE_TOOLS_URL secret is not set." - echo "See build/ENV_SETUP.md for instructions." exit 1 fi mkdir -p .cache - curl -L --fail \ - -o .cache/commandline-tools.zip \ - "${{ secrets.OHOS_CMDLINE_TOOLS_URL }}" - echo "Downloaded command line tools." - - - name: Extract HarmonyOS Command Line Tools - run: | + ZIP=".cache/commandline-tools.zip" + echo "Downloading HarmonyOS Command Line Tools (~2 GB) from secret URL ..." + # NOTE: Huawei CDN blocks curl's default User-Agent (returns 403), + # so a browser User-Agent must be sent. + curl -L --retry 10 --retry-all-errors --retry-delay 5 -C - \ + -A "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0 Safari/537.36" \ + -o "$ZIP" "${OHOS_CMDLINE_TOOLS_URL}" + echo "Verifying archive integrity ..." + if ! unzip -t "$ZIP" >/dev/null 2>&1; then + echo "::error::Downloaded archive is corrupt; retrying once without resume." + curl -L --retry 10 --retry-all-errors --retry-delay 5 \ + -A "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0 Safari/537.36" \ + -o "$ZIP" "${OHOS_CMDLINE_TOOLS_URL}" + unzip -t "$ZIP" >/dev/null 2>&1 || { echo "::error::Still corrupt after retry"; exit 1; } + fi + rm -rf .cache/commandline-tools mkdir -p .cache/commandline-tools - unzip -q .cache/commandline-tools.zip -d .cache/commandline-tools - # Find the actual tools directory (may be nested) - CMD_TOOLS_DIR=$(find .cache/commandline-tools -name "ohpm" -type f -exec dirname {} \; | head -1 | xargs dirname) - echo "COMMANDLINE_TOOLS=${CMD_TOOLS_DIR}" >> $GITHUB_ENV - echo "OHOS_SDK_HOME=${CMD_TOOLS_DIR}/sdk" >> $GITHUB_ENV - echo "PATH=${CMD_TOOLS_DIR}/bin:${CMD_TOOLS_DIR}/hvigor/bin:${PATH}" >> $GITHUB_ENV - echo "Found Command Line Tools at: ${CMD_TOOLS_DIR}" + # -o: overwrite without prompting (the official zip contains duplicate path entries) + unzip -o -q "$ZIP" -d .cache/commandline-tools + COMMANDLINE_TOOLS="$(pwd)/.cache/commandline-tools/command-line-tools" + if [ ! -d "$COMMANDLINE_TOOLS" ]; then + COMMANDLINE_TOOLS="$(cd "$(dirname "$(find .cache/commandline-tools -name ohpm -type f | head -1)")/.." && pwd)" + fi + echo "COMMANDLINE_TOOLS=$COMMANDLINE_TOOLS" >> "$GITHUB_ENV" + echo "OHOS_SDK_HOME=$COMMANDLINE_TOOLS/sdk" >> "$GITHUB_ENV" + echo "DEVECO_NODE_HOME=$COMMANDLINE_TOOLS/tool/node" >> "$GITHUB_ENV" + echo "DEVECO_SDK_HOME=$COMMANDLINE_TOOLS/sdk" >> "$GITHUB_ENV" + # Use GITHUB_PATH to PREPEND dirs to PATH (preserves system paths like /usr/bin) + echo "$COMMANDLINE_TOOLS/bin" >> "$GITHUB_PATH" + echo "$COMMANDLINE_TOOLS/hvigor/bin" >> "$GITHUB_PATH" + echo "Extracted HarmonyOS Command Line Tools at $COMMANDLINE_TOOLS" - name: Configure ohpm registry run: | - # Use default registry; switch to mirror if in China - # ohpm config set registry https://ohpm.openharmony.cn/ohpm/ + ohpm config set registry https://ohpm.openharmony.cn/ohpm/ || true ohpm --version || true # ── Step 4: Decode signing materials ──────────────────────────────── - name: Decode signing materials + env: + OHOS_KEYSTORE_B64: ${{ secrets.OHOS_KEYSTORE_B64 }} + OHOS_CERT_B64: ${{ secrets.OHOS_CERT_B64 }} + OHOS_PROFILE_B64: ${{ secrets.OHOS_PROFILE_B64 }} run: | + # Decode signing files to signing/ directory. + # We sign with hap-sign-tool.jar directly (not hvigor's built-in signer), + # so no material/ subdirectory is needed. mkdir -p signing - echo "${{ secrets.OHOS_KEYSTORE_B64 }}" | base64 -d > signing/electerm.p12 - echo "${{ secrets.OHOS_CERT_B64 }}" | base64 -d > signing/electerm_publish.cer - echo "${{ secrets.OHOS_PROFILE_B64 }}" | base64 -d > signing/electermRelease.p7b + if [ -z "${OHOS_KEYSTORE_B64}" ] || [ -z "${OHOS_CERT_B64}" ] || [ -z "${OHOS_PROFILE_B64}" ]; then + echo "One or more signing material secrets are not set" + exit 1 + fi + echo "${OHOS_KEYSTORE_B64}" | base64 -d > signing/electerm.p12 + echo "${OHOS_CERT_B64}" | base64 -d > signing/electerm_publish.cer + echo "${OHOS_PROFILE_B64}" | base64 -d > signing/electermRelease.p7b - # Verify files + # Verify files exist and have correct sizes + ls -la signing/ for f in signing/electerm.p12 signing/electerm_publish.cer signing/electermRelease.p7b; do if [ ! -s "${f}" ]; then echo "::error::Failed to decode ${f} — check GitHub Secrets." @@ -148,7 +184,6 @@ jobs: KEYSTORE_PASSWORD: ${{ secrets.OHOS_KEYSTORE_PASSWORD }} KEY_PASSWORD: ${{ secrets.OHOS_KEY_PASSWORD }} KEY_ALIAS: ${{ secrets.OHOS_KEY_ALIAS }} - # ── Step 7: Upload artifact ────────────────────────────────────────── - name: Find HAP file id: find_hap @@ -169,16 +204,6 @@ jobs: path: ${{ steps.find_hap.outputs.hap_path }} retention-days: 30 - # ── Step 8: Create GitHub Release (on tag push) ────────────────────── - - name: Create GitHub Release - if: startsWith(github.ref, 'refs/tags/v') - uses: softprops/action-gh-release@v2 - with: - files: ${{ steps.find_hap.outputs.hap_path }} - generate_release_notes: true - draft: false - prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-beta') }} - # ── Summary ────────────────────────────────────────────────────────── - name: Build summary if: always() diff --git a/entry/build-profile.json5 b/entry/build-profile.json5 index 492e05a..a3a2f60 100644 --- a/entry/build-profile.json5 +++ b/entry/build-profile.json5 @@ -1,12 +1,12 @@ { "apiType": "stageMode", "buildOption": {}, - "buildModeSet": [ + "buildModeBinder": [ { - "name": "debug" + "buildModeName": "debug" }, { - "name": "release" + "buildModeName": "release" } ], "targets": [ diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 2c55b17..d15f641 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -1,8 +1,9 @@ import { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; import { fileIo as fs } from '@kit.CoreFileKit'; -import { process } from '@kit.ArkTS'; import { hilog } from '@kit.PerformanceAnalysisKit'; +import { http } from '@kit.NetworkKit'; const DOMAIN = 0x0001; const TAG = 'electerm-web'; @@ -25,7 +26,7 @@ struct Index { /** * Extract bundled node binary and electerm-web files from rawfile - * to the app sandbox, then spawn the Node.js process. + * to the app sandbox, then wait for the server to be ready. */ async startBackend(): Promise { try { @@ -33,14 +34,12 @@ struct Index { const sandboxDir = context.filesDir; const nodeDir = `${sandboxDir}/node`; const webDir = `${sandboxDir}/electerm-web`; - const nodeBin = `${nodeDir}/bin/node`; // Check if already extracted + const nodeBin = `${nodeDir}/bin/node`; if (!fs.accessSync(nodeBin)) { hilog.info(DOMAIN, TAG, 'Extracting node binary from rawfile...'); await this.extractRawfile(context, 'node', nodeDir); - // Make the binary executable - fs.chmodSync(nodeBin, 0o755); hilog.info(DOMAIN, TAG, 'Node binary extracted.'); } @@ -51,24 +50,6 @@ struct Index { hilog.info(DOMAIN, TAG, 'electerm-web extracted.'); } - // Start the Node.js server as a child process - hilog.info(DOMAIN, TAG, `Starting node: ${nodeBin} src/app/app.js`); - const child = process.spawn(nodeBin, ['src/app/app.js'], { - cwd: webDir, - env: { - NODE_ENV: 'production', - HOST: SERVER_HOST, - PORT: String(SERVER_PORT), - PATH: '/data/local/usr/bin:/system/bin', - }, - }); - - // Listen for process exit - child.on('exit', (code: number) => { - hilog.error(DOMAIN, TAG, `Node process exited with code ${code}`); - this.statusMessage = `Backend exited (code ${code})`; - }); - // Poll server until ready await this.waitForServer(); this.serverReady = true; @@ -107,8 +88,8 @@ struct Index { const intervalMs = 1000; for (let i = 0; i < maxAttempts; i++) { try { - const response = await fetch(SERVER_URL); - if (response.ok) { + const response: boolean = await this.httpGet(SERVER_URL); + if (response) { hilog.info(DOMAIN, TAG, `Server ready after ${i + 1} attempts.`); return; } @@ -120,6 +101,25 @@ struct Index { throw new Error('Backend did not start within timeout.'); } + /** + * Simple HTTP GET check using NetworkKit + */ + async httpGet(url: string): Promise { + const httpRequest = http.createHttp(); + try { + const response: http.HttpResponse = await httpRequest.request(url, { + method: http.RequestMethod.GET, + connectTimeout: 2000, + readTimeout: 2000, + }); + httpRequest.destroy(); + return response.responseCode === 200; + } catch { + httpRequest.destroy(); + return false; + } + } + build() { Column() { if (this.serverReady) { diff --git a/hvigor/hvigor-config.json5 b/hvigor/hvigor-config.json5 index 7fe1043..e49f3b0 100644 --- a/hvigor/hvigor-config.json5 +++ b/hvigor/hvigor-config.json5 @@ -1,7 +1,7 @@ { - "hvigorVersion": "5.0.2", + "modelVersion": "5.0.0", "dependencies": { - "@ohos/hvigor-ohos-plugin": "5.0.2" + "@ohos/hvigor-ohos-plugin": "5.10.3" }, "execution": {}, "logging": { diff --git a/oh-package.json5 b/oh-package.json5 index 4bb1805..708e23b 100644 --- a/oh-package.json5 +++ b/oh-package.json5 @@ -17,9 +17,11 @@ "bugs": { "url": "https://github.com/electerm/electerm-harmony/issues" }, - "dependencies": {}, + "modelVersion": "5.0.0", + "dependencies": { + "entry": "file:./entry" + }, "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hvigor-ohos-plugin": "5.0.2" + "@ohos/hypium": "1.0.21" } } diff --git a/scripts/build-app.sh b/scripts/build-app.sh index 044873b..256e91b 100755 --- a/scripts/build-app.sh +++ b/scripts/build-app.sh @@ -1,9 +1,14 @@ #!/usr/bin/env bash # build-app.sh — Build and sign the HarmonyOS HAP package. # +# This script builds an UNSIGNED HAP using hvigorw, then signs it +# directly using hap-sign-tool.jar with plaintext passwords. +# This bypasses the hvigor plugin's password encryption requirement +# (which needs DevEco Studio's encrypted passwords + material/ key dirs). +# # Prerequisites: # - HarmonyOS Command Line Tools installed (ohpm, hvigorw in PATH) -# - Signing materials in signing/ directory OR provided via env vars +# - Signing materials in signing/ directory # - prepare-node.sh and prepare-web.sh already run # # Usage: @@ -16,8 +21,8 @@ # KEYSTORE_FILE — keystore filename (default: electerm.p12) # CERT_FILE — certificate filename (default: electerm_publish.cer) # PROFILE_FILE — profile filename (default: electermRelease.p7b) -# KEYSTORE_PASSWORD — keystore password -# KEY_PASSWORD — key password +# KEYSTORE_PASSWORD — keystore password (plaintext) +# KEY_PASSWORD — key password (plaintext) # KEY_ALIAS — key alias (default: electerm_key) set -euo pipefail @@ -99,39 +104,39 @@ fi export OHOS_SDK_HOME export PATH="${PATH}:${COMMANDLINE_TOOLS}/bin:${COMMANDLINE_TOOLS}/hvigor/bin" +# Locate hap-sign-tool.jar +SIGN_TOOL_JAR="${OHOS_SDK_HOME}/default/openharmony/toolchains/lib/hap-sign-tool.jar" +if [ ! -f "${SIGN_TOOL_JAR}" ]; then + # Try alternative path + SIGN_TOOL_JAR=$(find "${OHOS_SDK_HOME}" -name "hap-sign-tool.jar" -type f 2>/dev/null | head -1) +fi +if [ -z "${SIGN_TOOL_JAR:-}" ] || [ ! -f "${SIGN_TOOL_JAR}" ]; then + echo " ✗ hap-sign-tool.jar not found in SDK" + exit 1 +fi + echo " OHOS_SDK_HOME: ${OHOS_SDK_HOME}" echo " ohpm: ${OHPM}" echo " hvigorw: ${HVIGORW}" +echo " sign tool: ${SIGN_TOOL_JAR}" -# --- Generate build-profile.json5 with signing config ----------------------- +# --- Generate build-profile.json5 (without signing config) ------------------ +# We build an UNSIGNED HAP and sign it separately with hap-sign-tool.jar. +# This avoids the hvigor plugin's password encryption requirement. -echo "==> Configuring signing in build-profile.json5 ..." +echo "==> Configuring build-profile.json5 ..." BUILD_PROFILE="${PROJECT_ROOT}/build-profile.json5" cat > "${BUILD_PROFILE}" < "${BUILD_PROFILE}" < Configuring hvigor-config.json5 ..." + +HVIGOR_CONFIG="${PROJECT_ROOT}/hvigor/hvigor-config.json5" + +# Read the bundled hvigor version from the command line tools +BUNDLED_HVIGOR_DIR="${COMMANDLINE_TOOLS}/hvigor/hvigor" +BUNDLED_PLUGIN_DIR="${COMMANDLINE_TOOLS}/hvigor/hvigor-ohos-plugin" + +if [ -f "${BUNDLED_HVIGOR_DIR}/package.json" ]; then + BUNDLED_HVIGOR_VERSION=$(python3 -c "import json; print(json.load(open('${BUNDLED_HVIGOR_DIR}/package.json'))['version'])" 2>/dev/null || echo "5.10.3") +else + BUNDLED_HVIGOR_VERSION="5.10.3" +fi +echo " Bundled @ohos/hvigor version: ${BUNDLED_HVIGOR_VERSION}" + +# Use file: protocol to reference the bundled plugin directly. +# This avoids version mismatch between the plugin and the hvigor engine, +# and avoids relying on the npm registry for the plugin. +if [ -d "${BUNDLED_PLUGIN_DIR}" ]; then + cat > "${HVIGOR_CONFIG}" < Configuring npm registry for hvigor ..." + +NPMRC_FILE="${HOME}/.npmrc" +cat > "${NPMRC_FILE}" <<'NPMRC' +@ohos:registry=https://repo.harmonyos.com/npm/ +registry=https://registry.npmjs.org/ +NPMRC +echo " ✓ Created ${NPMRC_FILE} with scoped HarmonyOS + npmjs registry" # --- Install ohpm dependencies ---------------------------------------------- @@ -159,28 +216,71 @@ echo "==> Installing ohpm dependencies ..." cd "${PROJECT_ROOT}" "${OHPM}" install -# --- Build the HAP ---------------------------------------------------------- +# --- Build the unsigned HAP ------------------------------------------------- -echo "==> Building HAP (${BUILD_MODE}) ..." +echo "==> Building unsigned HAP (${BUILD_MODE}) ..." +# Build with enableSignTask=false to skip the hvigor signing step. +# We sign separately using hap-sign-tool.jar with plaintext passwords. if [ "${BUILD_MODE}" = "debug" ]; then "${HVIGORW}" assembleHap --mode module -p product=default \ - -p buildMode=debug --no-daemon + -p buildMode=debug -p enableSignTask=false --no-daemon else "${HVIGORW}" assembleHap --mode module -p product=default \ - -p buildMode=release --no-daemon + -p buildMode=release -p enableSignTask=false --no-daemon fi -# --- Locate output ---------------------------------------------------------- +# --- Locate the unsigned HAP ------------------------------------------------ HAP_DIR="${PROJECT_ROOT}/entry/build/default/outputs/default" -HAP_FILE=$(find "${HAP_DIR}" -name "*.hap" -type f | head -1) +UNSIGNED_HAP=$(find "${HAP_DIR}" -name "*.hap" -type f | head -1) -if [ -z "${HAP_FILE}" ]; then +if [ -z "${UNSIGNED_HAP}" ]; then echo " ✗ No .hap file found in ${HAP_DIR}" exit 1 fi +echo " ✓ Unsigned HAP: ${UNSIGNED_HAP} ($(du -h "${UNSIGNED_HAP}" | cut -f1))" + +# --- Sign the HAP with hap-sign-tool.jar ------------------------------------ + +echo "==> Signing HAP with hap-sign-tool.jar ..." + +# Show Java version for debugging (PKCS12 keystore compatibility) +JAVA_VERSION=$(java -version 2>&1 | head -1) +echo " Java: ${JAVA_VERSION}" + +SIGNED_HAP="${UNSIGNED_HAP%.hap}-signed.hap" + +# Sign the HAP. +# NOTE: -mode localSign is required (COMMAND_ERROR code 101 if missing). +# NOTE: -compatibleVersion, -signCode, -pwdInputMode are NOT supported by +# this SDK version (COMMAND_PARAM_ERROR code 110). They were added later. +java -jar "${SIGN_TOOL_JAR}" sign-app \ + -mode localSign \ + -keyAlias "${KEY_ALIAS}" \ + -keyPwd "${KEY_PASSWORD}" \ + -appCertFile "${CERT_PATH}" \ + -profileFile "${PROFILE_PATH}" \ + -inFile "${UNSIGNED_HAP}" \ + -signAlg SHA256withECDSA \ + -keystoreFile "${KEYSTORE_PATH}" \ + -keystorePwd "${KEYSTORE_PASSWORD}" \ + -outFile "${SIGNED_HAP}" + +if [ ! -f "${SIGNED_HAP}" ]; then + echo " ✗ Signing failed — no signed HAP produced" + exit 1 +fi + +# Replace the unsigned HAP with the signed one +mv -f "${SIGNED_HAP}" "${UNSIGNED_HAP}" +HAP_FILE="${UNSIGNED_HAP}" + +echo " ✓ Signed HAP: ${HAP_FILE} ($(du -h "${HAP_FILE}" | cut -f1))" + +# --- Done ------------------------------------------------------------------- + echo "" echo "==> Build complete!" echo " Mode: ${BUILD_MODE}" diff --git a/scripts/gen-secrets.sh b/scripts/gen-secrets.sh index 3c102da..aec5eba 100755 --- a/scripts/gen-secrets.sh +++ b/scripts/gen-secrets.sh @@ -23,6 +23,8 @@ if [ ! -f "${ENV_FILE}" ]; then echo ' echo "name: electerm" >> temp/.env' echo ' echo "应用包名:org.electerm.electerm" >> temp/.env' echo ' echo "password: " >> temp/.env' + echo ' # Optional (defaults are used if omitted):' + echo ' # echo "cmdline_tools_url: " >> temp/.env' exit 1 fi @@ -32,6 +34,21 @@ BUNDLE=$(grep -i '应用包名' "${ENV_FILE}" | sed 's/.*://') APPID=$(grep -i '^appid:' "${ENV_FILE}" | sed 's/^appid:[[:space:]]*//') ALIAS="electerm_key" +# Optional: cmdline tools URL (read from .env or use default) +CMDLINE_TOOLS_URL=$(grep -i '^cmdline_tools_url:' "${ENV_FILE}" | sed 's/^cmdline_tools_url:[[:space:]]*//' 2>/dev/null || true) +if [ -z "${CMDLINE_TOOLS_URL}" ]; then + CMDLINE_TOOLS_URL="https://hf-mirror.com/csukuangfj/harmonyos-commandline-tools/resolve/main/commandline-tools-linux-x64-5.0.5.200.zip" +fi + +# Optional: server secret (reuse existing from github-secrets.txt, or generate new) +OUT="temp/github-secrets.txt" +if [ -f "${OUT}" ]; then + SERVER_SECRET=$(grep -E '^OHOS_SERVER_SECRET=' "${OUT}" | sed 's/^OHOS_SERVER_SECRET=//' || true) +fi +if [ -z "${SERVER_SECRET}" ]; then + SERVER_SECRET=$(openssl rand -base64 32 | tr -d '\n') +fi + if [ -z "${PASS}" ]; then echo "✗ password not found in ${ENV_FILE}" exit 1 @@ -51,13 +68,8 @@ KEYSTORE_B64=$(base64 -i signing/electerm.p12 | tr -d '\n') CERT_B64=$(base64 -i signing/electerm_publish.cer | tr -d '\n') PROFILE_B64=$(base64 -i signing/electermRelease.p7b | tr -d '\n') -# Generate a random server secret for electerm-web -SERVER_SECRET=$(openssl rand -base64 32 | tr -d '\n') - # --- Write output (to gitignored temp/) -------------------------------------- -OUT="temp/github-secrets.txt" - { echo "# ============================================" echo "# GitHub Secrets — electerm-harmony" @@ -89,8 +101,7 @@ OUT="temp/github-secrets.txt" echo "OHOS_APP_ID=${APPID}" echo "" echo "# 9. OHOS_CMDLINE_TOOLS_URL" - echo "# → 从 https://developer.huawei.com/consumer/cn/download/ 获取 Linux 版下载链接" - echo "# OHOS_CMDLINE_TOOLS_URL=https://contentcenter-vali-drcn.dbankcdn.cn/..." + echo "OHOS_CMDLINE_TOOLS_URL=${CMDLINE_TOOLS_URL}" echo "" echo "# 10. OHOS_SERVER_SECRET (electerm-web server secret)" echo "OHOS_SERVER_SECRET=${SERVER_SECRET}" diff --git a/scripts/prepare-web.sh b/scripts/prepare-web.sh index d1cdd48..fef8e40 100755 --- a/scripts/prepare-web.sh +++ b/scripts/prepare-web.sh @@ -65,7 +65,7 @@ cd "${CLONE_DIR}" # Install dependencies echo " Installing dependencies ..." -npm ci +npm install --legacy-peer-deps # Create .env from .sample.env echo " Creating .env ..." @@ -86,7 +86,7 @@ NODE_ENV=production npm run build # Prune dev dependencies to reduce size echo " Pruning devDependencies ..." -npm prune --production +npm prune --production --legacy-peer-deps # --- Bundle into rawfile ----------------------------------------------------