From b488fcab62a3863179192ccbd6beae4203b12ea5 Mon Sep 17 00:00:00 2001 From: Nicolas Agustin Guevara Pihen Date: Thu, 14 Nov 2024 13:04:53 -0300 Subject: [PATCH] Remove plugin from package --- .../build_wazuh_dashboard_with_plugins.yml | 35 +++++++------------ dev-tools/build-packages/deb/debian/postinst | 1 + .../build-packages/rpm/wazuh-dashboard.spec | 2 +- src/core/public/chrome/chrome_service.tsx | 2 +- .../public/chrome/ui/header/header_logo.tsx | 2 +- .../public/chrome/ui/header/home_loader.tsx | 2 +- 6 files changed, 17 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index fe70603170f3..3129f1b0e8bb 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -48,7 +48,7 @@ on: required: true default: false upload: - description: "Upload ?" + description: 'Upload ?' type: boolean default: true checksum: @@ -126,21 +126,21 @@ jobs: - name: Get SHA of wazuh-dashboard-plugins id: get-plugins-sha run: | - git clone -b ${{ inputs.reference_wazuh_plugins }} --single-branch https://github.com/wazuh/wazuh-dashboard-plugins.git wzdp - cd wzdp - echo "WAZUH_PLUGINS_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + git clone -b ${{ inputs.reference_wazuh_plugins }} --single-branch https://github.com/wazuh/wazuh-dashboard-plugins.git wzdp + cd wzdp + echo "WAZUH_PLUGINS_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Get SHA of wazuh-security-dashboards-plugin id: get-security-sha run: | - git clone -b ${{ inputs.reference_security_plugins }} --single-branch https://github.com/wazuh/wazuh-security-dashboards-plugin.git wzsp - cd wzsp - echo "WAZUH_SECURITY_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + git clone -b ${{ inputs.reference_security_plugins }} --single-branch https://github.com/wazuh/wazuh-security-dashboards-plugin.git wzsp + cd wzsp + echo "WAZUH_SECURITY_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Get SHA of wazuh-dashboards-reporting id: get-reporting-sha run: | - git clone -b ${{ inputs.reference_report_plugins }} --single-branch https://github.com/wazuh/wazuh-dashboards-reporting.git wzrp - cd wzrp - echo "WAZUH_REPORTING_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + git clone -b ${{ inputs.reference_report_plugins }} --single-branch https://github.com/wazuh/wazuh-dashboards-reporting.git wzrp + cd wzrp + echo "WAZUH_REPORTING_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Setup variables id: setup-variables @@ -219,18 +219,6 @@ jobs: aws-secret-access-key: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_SECRET_KEY }} aws-region: ${{ secrets.CI_AWS_REGION }} - - name: Verify if package is already built - run: | - set +e - echo "Verifying package" - PACKAGE_NAME=${{ needs.setup-variables.outputs.FINAL_NAME }} - exists=$(aws s3 ls s3://packages-dev.internal.wazuh.com/development/wazuh/5.x/main/packages/$PACKAGE_NAME) - if [ -n "$exists" ]; then - echo "Package already exists" - exit 1 - fi - set -e - build-base: needs: [validate-job] name: Build dashboard @@ -260,7 +248,8 @@ jobs: with: reference: ${{ inputs.reference_report_plugins }} build-and-test-package: - needs: [setup-variables, build-main-plugins, build-base, build-security-plugin, build-report-plugin] + needs: + [setup-variables, build-main-plugins, build-base, build-security-plugin, build-report-plugin] runs-on: ${{ (inputs.architecture == 'arm64' || inputs.architecture == 'aarch64') && 'wz-linux-arm64' || 'ubuntu-22.04' }} name: Generate packages steps: diff --git a/dev-tools/build-packages/deb/debian/postinst b/dev-tools/build-packages/deb/debian/postinst index 3c5f0e031b39..8951ca33792a 100644 --- a/dev-tools/build-packages/deb/debian/postinst +++ b/dev-tools/build-packages/deb/debian/postinst @@ -40,6 +40,7 @@ configure) runuser "${NAME}" --shell="/bin/bash" --command="echo kibanaserver | ${INSTALLATION_DIR}/bin/opensearch-dashboards-keystore add opensearch.username --stdin" >/dev/null 2>&1 runuser "${NAME}" --shell="/bin/bash" --command="echo kibanaserver | ${INSTALLATION_DIR}/bin/opensearch-dashboards-keystore add opensearch.password --stdin" >/dev/null 2>&1 fi + /usr/share/wazuh-dashboard/bin/opensearch-dashboards-plugin remove wazuh --allow-root >/dev/null 2>&1 ;; abort-upgrade | abort-remove | abort-deconfigure) ;; diff --git a/dev-tools/build-packages/rpm/wazuh-dashboard.spec b/dev-tools/build-packages/rpm/wazuh-dashboard.spec index 3addff105bde..705c5f488117 100644 --- a/dev-tools/build-packages/rpm/wazuh-dashboard.spec +++ b/dev-tools/build-packages/rpm/wazuh-dashboard.spec @@ -191,7 +191,7 @@ if [ -f %{INSTALL_DIR}/wazuh-dashboard.restart ]; then fi fi - +/usr/share/wazuh-dashboard/bin/opensearch-dashboards-plugin remove wazuh --allow-root # ----------------------------------------------------------------------------- diff --git a/src/core/public/chrome/chrome_service.tsx b/src/core/public/chrome/chrome_service.tsx index 3ceb31ca2aea..f2cef928d63a 100644 --- a/src/core/public/chrome/chrome_service.tsx +++ b/src/core/public/chrome/chrome_service.tsx @@ -363,7 +363,7 @@ export class ChromeService { forceAppSwitcherNavigation$={navLinks.getForceAppSwitcherNavigation$()} helpExtension$={helpExtension$.pipe(takeUntil(this.stop$))} helpSupportUrl$={helpSupportUrl$.pipe(takeUntil(this.stop$))} - homeHref={application.getUrlForApp('wz-home')} + homeHref={application.getUrlForApp('home')} isVisible$={this.isVisible$} headerVariant$={this.headerVariant$} opensearchDashboardsVersion={injectedMetadata.getWazuhVersion()} diff --git a/src/core/public/chrome/ui/header/header_logo.tsx b/src/core/public/chrome/ui/header/header_logo.tsx index 6c9e44817688..68776cbf9d3c 100644 --- a/src/core/public/chrome/ui/header/header_logo.tsx +++ b/src/core/public/chrome/ui/header/header_logo.tsx @@ -78,7 +78,7 @@ function onClick( event.stopPropagation(); } } else { - navigateToApp('wz-home'); + navigateToApp('home'); event.preventDefault(); } } diff --git a/src/core/public/chrome/ui/header/home_loader.tsx b/src/core/public/chrome/ui/header/home_loader.tsx index cf29ace6073c..fbdd32da4b9b 100644 --- a/src/core/public/chrome/ui/header/home_loader.tsx +++ b/src/core/public/chrome/ui/header/home_loader.tsx @@ -97,7 +97,7 @@ function onClick( event.stopPropagation(); } } else { - navigateToApp('wz-home'); + navigateToApp('home'); event.preventDefault(); } }