Skip to content

Commit

Permalink
Merge branch 'main' into address-react-router-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
daniele-mng authored Jan 16, 2025
2 parents c1861cc + 5082f8f commit f08dedb
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 22 deletions.
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ and the fingerprint is `8AE4 BE42 9B60 A59B 311C 2E73 9823 FAA6 0ED1 E580`.
## Installation

Prerequisites for GSA:
* node.js >= 18.0

- node.js >= 18.0

To install nodejs the following commands can be used

Expand Down Expand Up @@ -132,10 +133,10 @@ file](#config-file). The following lines can be used for a local gsad running
with HTTP on port 9392:

```javascript
config = {
apiProtocol: 'http',
apiServer: '127.0.0.1:9392',
};
config = {
apiProtocol: 'http',
apiServer: '127.0.0.1:9392',
};
```

For HTTPS only the protocol property must be `'https'` accordingly.
Expand Down Expand Up @@ -202,7 +203,7 @@ This sections lists all settings and explains their behavior.
### Config File

The config file is a normal JavaScript file (with a .js suffix). It is named
`config.js` and will be loaded from the `/usr/share/gvm/gsad/web/` (or
`config.js` and will be loaded from the `/usr/share/gvm/gsad/web/` (or
`/usr/local/share/gvm/gsad/web/`) directory when using [gsad] for providing GSA
e.g. in production environments.

Expand All @@ -216,16 +217,17 @@ properties e.g.
config = {
// javascript files in contrast to JSON files allow comments
foo: 'bar',
}
};
```

It is evaluated in the `GmpSettings` object implemented in the
[gmpsettings.js](./src/gmp/gmpsettings.js) file. The `GmpSettings` object is
instantiated once for the [GSA application](./src/web/app.js#L53)

### Config Variables

| Name | Type | Default | Changeable during runtime | Persistent after reload |
|---------------------------------------------------|----------------------------|----------------------------------------------------------------------------------|---------------------------|-------------------------|
| ------------------------------------------------- | -------------------------- | -------------------------------------------------------------------------------- | ------------------------- | ----------------------- |
| [apiProtocol](#apiprotocol) | String ('http' or 'https') | `global.location.protocol` | - | x |
| [apiServer](#apiserver) | String | `global.location.host` | - | x |
| enableGreenboneSensor | Boolean | false | - | x |
Expand All @@ -239,9 +241,9 @@ instantiated once for the [GSA application](./src/web/app.js#L53)
| [manualUrl](#manualurl) | String | [https://docs.greenbone.net/GSM-Manual/gos-22.04/](./src/gmp/gmpsettings.js#L24) | - | x |
| [manualLanguageMapping](#manuallanguagemapping) | Object | undefined | - | x |
| [protocolDocUrl](#protocoldocurl) | String | [https://docs.greenbone.net/API/GMP/gmp-22.4.html](./src/gmp/gmpsettings.js#L25) | - | x |
| [reloadInterval](#reloadinterval) | Integer | [15 * 1000; // fifteen seconds](./src/gmp/gmpsettings.js#L21) | x | - |
| [reloadIntervalActive](#reloadintervalactive) | Integer | [3 * 1000; // three seconds](./src/gmp/gmpsettings.js#L22) | x | - |
| [reloadIntervalInactive](#reloadintervalinactive) | Integer | [60 * 1000; // one minute](./src/gmp/gmpsettings.js#L22) | x | - |
| [reloadInterval](#reloadinterval) | Integer | [15 \* 1000; // fifteen seconds](./src/gmp/gmpsettings.js#L21) | x | - |
| [reloadIntervalActive](#reloadintervalactive) | Integer | [3 \* 1000; // three seconds](./src/gmp/gmpsettings.js#L22) | x | - |
| [reloadIntervalInactive](#reloadintervalinactive) | Integer | [60 \* 1000; // one minute](./src/gmp/gmpsettings.js#L22) | x | - |
| [reportResultsThreshold](#reportresultsthreshold) | Integer | [25000](./src/gmp/gmpsettings.js#L26) | x | - |
| [timeout](#timeout) | Integer | [300000; // 5 minutes](./src/gmp/gmpsettings.js#L28) | x | - |
| [vendorVersion](#vendorversion) | String | undefined | - | x |
Expand All @@ -268,7 +270,7 @@ will be shown.
#### disableLoginForm

This setting allows to deactivate the username password form at the Login page.
It can be used to deactivate login for *normal* users.
It can be used to deactivate login for _normal_ users.

#### enableEPSS

Expand Down Expand Up @@ -327,12 +329,11 @@ English (`en`) locale.
#### protocolDocUrl

This setting contains the URL to the public Greenbone Management Protocol (GMP)
documentation. It is https://docs.greenbone.net/API/GMP/gmp-22.4.html and only
used at the About page.
documentation. It is only used at the About page.

#### reloadInterval

The *standard* interval for reloading data. The default is 15 seconds
The _standard_ interval for reloading data. The default is 15 seconds
(15000 ms).

#### reloadIntervalActive
Expand Down
6 changes: 1 addition & 5 deletions src/web/pages/reports/auditreportslistpage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/




import Filter, {AUDIT_REPORTS_FILTER_FILTER} from 'gmp/models/filter';
import {isActive} from 'gmp/models/task';
import {isDefined} from 'gmp/utils/identity';
Expand Down Expand Up @@ -41,8 +38,7 @@ const ToolBarIcons = () => {
return (
<IconDivider>
<ManualIcon
anchor="using-and-managing-audit-reports"
page="reports"
page="compliance-and-special-scans"
title={_('Help: Audit Reports')}
/>
</IconDivider>
Expand Down
10 changes: 8 additions & 2 deletions src/web/pages/usersettings/usersettingspage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,10 @@ UserSettings.propTypes = {
credentials: PropTypes.array,
credentialsFilter: PropTypes.object,
cveFilter: PropTypes.object,
userInterfaceDateFormat: PropTypes.oneOf(['wdmy', 'wmdy', SYSTEM_DEFAULT]),
userInterfaceDateFormat: PropTypes.shape({
comment: PropTypes.string,
value: PropTypes.oneOf(['wdmy', 'wmdy', SYSTEM_DEFAULT]),
}),
defaultAlert: PropTypes.object,
defaultEsxiCredential: PropTypes.object,
defaultOpenvasScanConfig: PropTypes.object,
Expand Down Expand Up @@ -883,7 +886,10 @@ UserSettings.propTypes = {
tasksFilter: PropTypes.object,
ticketsFilter: PropTypes.object,
timezone: PropTypes.string,
userInterfaceTimeFormat: PropTypes.oneOf([12, 24, SYSTEM_DEFAULT]),
userInterfaceTimeFormat: PropTypes.shape({
comment: PropTypes.string,
value: PropTypes.oneOf([12, 24, SYSTEM_DEFAULT]),
}),
tlsCertificatesFilter: PropTypes.object,
userInterfaceLanguage: PropTypes.object,
usersFilter: PropTypes.object,
Expand Down
7 changes: 7 additions & 0 deletions src/web/store/pages/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@

export const CHANGE_PAGE_FILTER = 'CHANGE_PAGE_FILTER';

/**
* Action creator to set a filter for a page
*
* @param {String} page
* @param {Filter} filter
* @returns A dispatchable action
*/
export const pageFilter = (page, filter) => ({
type: CHANGE_PAGE_FILTER,
page,
Expand Down
6 changes: 6 additions & 0 deletions src/web/store/pages/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ class PageSelector {
}
}

/**
* Get a PageSelector from the root state
*
* @param {Object} rootState
* @returns {PageSelector} A PageSelector instance
*/
const getPage = (rootState = {}) => new PageSelector(rootState.pages);

export default getPage;
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default defineConfig({
},
server: {
port: 8080,
host: '127.0.0.1',
},
build: {
outDir: 'build',
Expand Down

0 comments on commit f08dedb

Please sign in to comment.