Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace documentation links with Wazuh's #18

Closed
Tracked by #1
AlexRuiz7 opened this issue Feb 9, 2023 · 2 comments · Fixed by #27 or #55
Closed
Tracked by #1

Replace documentation links with Wazuh's #18

AlexRuiz7 opened this issue Feb 9, 2023 · 2 comments · Fixed by #27 or #55
Assignees
Labels
level/task Task issue type/enhancement New feature or request

Comments

@AlexRuiz7
Copy link
Member

AlexRuiz7 commented Feb 9, 2023

Description

We would like to show the Wazuh's version in the Help menu instead of the version of OpenSearch Dashboards.

Help menu in OpenSearch Dashboards:
image

Help menu in Wazuh Dashboard:
image

The number shown there is the value of the variable opensearchDashboardsVersion, which is equal to version in the package.json file. This won't be a major problem unless it must match the version of the indexer nodes. At least the minor version must match, for example, 2.4.0 in dashboards and 2.4.1 in indexer works, so we cannot simply change this value in the package.json. We'll need to add a new field to this field, for example wazuhVersion, in which we can set the Wazuh version this platform is built for, and read this value in the React component instead of the original opensearchDashboardsVersion variable.

All the related tests must be updated too, and probably we'll need to create new code to read this new value from the package.json and transport it to the required component.

After that, we can define and dynamically generate our documentation links using this value, and use them in the Help menu.

The documentation links are centralized in DocLinksService:

export class DocLinksService {
public setup() {}
public start({ injectedMetadata }: StartDeps): DocLinksStart {
const DOC_LINK_VERSION =
injectedMetadata.getOpenSearchDashboardsBranch() === 'main'
? 'latest'
: injectedMetadata.getOpenSearchDashboardsBranch();
const OPENSEARCH_WEBSITE_URL = 'https://opensearch.org/';
const OPENSEARCH_WEBSITE_DOCS = `${OPENSEARCH_WEBSITE_URL}docs/${DOC_LINK_VERSION}`;
const OPENSEARCH_VERSIONED_DOCS = `${OPENSEARCH_WEBSITE_DOCS}/opensearch/`;
const OPENSEARCH_DASHBOARDS_VERSIONED_DOCS = `${OPENSEARCH_WEBSITE_DOCS}/dashboards/`;
return deepFreeze({
DOC_LINK_VERSION,
OPENSEARCH_WEBSITE_URL,
links: {
opensearch: {
// https://opensearch.org/docs/latest/opensearch/index/
introduction: `${OPENSEARCH_VERSIONED_DOCS}index/`,
installation: {
// https://opensearch.org/docs/latest/opensearch/install/index/
base: `${OPENSEARCH_VERSIONED_DOCS}install/index/`,
// https://opensearch.org/docs/latest/opensearch/install/compatibility/
compatibility: `${OPENSEARCH_VERSIONED_DOCS}install/compatibility/`,
// https://opensearch.org/docs/latest/opensearch/install/docker/
docker: `${OPENSEARCH_VERSIONED_DOCS}install/docker`,
// https://opensearch.org/docs/latest/opensearch/install/docker-security/
dockerSecurity: `${OPENSEARCH_VERSIONED_DOCS}install/docker-security`,
// https://opensearch.org/docs/latest/opensearch/install/helm/
helm: `${OPENSEARCH_VERSIONED_DOCS}install/helm/`,
// https://opensearch.org/docs/latest/opensearch/install/tar/
tar: `${OPENSEARCH_VERSIONED_DOCS}install/tar/`,
// https://opensearch.org/docs/latest/opensearch/install/ansible/
ansible: `${OPENSEARCH_VERSIONED_DOCS}install/ansible/`,
// https://opensearch.org/docs/latest/opensearch/install/important-settings/
settings: `${OPENSEARCH_VERSIONED_DOCS}install/important-settings/`,
// https://opensearch.org/docs/latest/opensearch/install/plugins/
plugins: `${OPENSEARCH_VERSIONED_DOCS}install/plugins/`,
},

@AlexRuiz7 AlexRuiz7 mentioned this issue Feb 9, 2023
19 tasks
@AlexRuiz7 AlexRuiz7 self-assigned this Feb 9, 2023
@AlexRuiz7 AlexRuiz7 added this to the Wazuh Dashboard first steps milestone Feb 16, 2023
@AlexRuiz7 AlexRuiz7 linked a pull request Feb 20, 2023 that will close this issue
8 tasks
@gdiazlo gdiazlo added type/enhancement New feature or request level/task Task issue and removed untriaged labels Mar 9, 2023
@AlexRuiz7
Copy link
Member Author

I found a bug during production that prevents the app from working.

The Wazuh version defined in the package.json file isn't read as the package.json is a different, minimal, version generated during the building process.

@yenienserrano yenienserrano linked a pull request Apr 28, 2023 that will close this issue
8 tasks
@yenienserrano
Copy link
Member

Re-opened in #55

See #1 (comment) for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue type/enhancement New feature or request
Projects
No open projects
Status: Done
3 participants