Skip to content

Commit

Permalink
doc(proxy-server): improve documentation for proxy server
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerni10 committed Jan 20, 2025
1 parent 8bfb424 commit 3cb2cb2
Show file tree
Hide file tree
Showing 13 changed files with 675 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ registrations page, complete the registration by copying the 6 characters code a
**OIBus needs API access**.
4. OIBus regularly checks if the registration is completed on OIAnalytics.
5. On completion, OIBus sends the full configuration to OIAnalytics and activate the logs (if enabled in
the [engine settings](../engine/engine-settings.md#logging-parameters)).
the [engine settings](../engine/engine-settings.mdx#logging-parameters)).
6. OIBus regularly retrieves [commands from OIAnalytics](#commands).

<div style={{ textAlign: 'center' }}>

![OIAnalytics registration process](../../../static/img/guide/engine/oianalytics-registration.svg)
![OIAnalytics registration process](../../../static/img/guide/advanced/oianalytics-registration.svg)

</div>

Expand Down Expand Up @@ -55,7 +55,7 @@ list of available commands [here](#commands).
## OIAnalytics logs

If configured within the logging parameters section of
the [OIBus Engine settings](../engine/engine-settings.md#logging-parameters), logs have the capability to be transmitted via
the [OIBus Engine settings](../engine/engine-settings.mdx#logging-parameters), logs have the capability to be transmitted via
HTTPS to OIAnalytics, allowing access to them on the OIAnalytics OIBus log page.

## Commands
Expand Down Expand Up @@ -84,7 +84,7 @@ The restart command kills the current process of OIBus. The OIBus launcher then

### Update engine settings

Apply the settings set on OIAnalytics for the [engine settings](../engine/engine-settings.md).
Apply the settings set on OIAnalytics for the [engine settings](../engine/engine-settings.mdx).

### Regenerate cipher keys

Expand Down
79 changes: 0 additions & 79 deletions documentation/docs/guide/engine/engine-settings.md

This file was deleted.

140 changes: 140 additions & 0 deletions documentation/docs/guide/engine/engine-settings.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
sidebar_position: 1
---

# Engine settings

## OIBus port

The default port for accessing OIBus settings through a web interface is 2223, and it is accessible
at `http://localhost:2223`.
You have the option to modify this port in the event of conflicts or for security purposes.

## OIBus Proxy Server Configuration
OIBus can act as a proxy server by enabling the proxy option and configuring the listening port. This allows OIBus to
forward HTTP(S) requests to the targeted host specified in the request.

The proxy server functionality is particularly useful when two OIBus instances are deployed in separate networks:
- `OIBus1`: Installed in a network with internet access.
- `OIBus2`: Installed in a network without internet access.
By configuring OIBus1 as a proxy server, OIBus2 can send data to the internet via OIBus1, provided the North connector
allows it.

To ensure proper operation:
1. Firewall Configuration: If you have a firewall between `OIBus1` and `OIBus2`, make sure your firewall allows inbound
connections (from `OIBus2` machine) on the specified proxy port for the `OIBus1` machine.
2. IP Filter: Ensure the IP address of the source system (`OIBus2`) is authorized in the [IP Filter](./ip-filters.md)
section of `OIBus1`.

### Configuration Steps
1. On `OIBus1` (Proxy Server):
- Enable the proxy server option.
- Set the listening port (e.g., 2224).
- Ensure the firewall allows inbound connections on this port.
- Authorize the IP address of `OIBus2` in the IP Filter section.

2. On `OIBus2` (Proxy Client):
- Configure the North connector or OIAnalytics registration settings to use the proxy server.
- Specify the address and port of OIBus1’s proxy server (e.g., http://oibus1.fr:2224).


### Example: Azure Blob North Connector

Here’s a practical example using an Azure Blob North Connector configured on `OIBus2.

#### Scenario
- OIBus1:
- Acts as a proxy server.
- Listens on port 2224.
- Accessible at http://oibus1.fr.
- OIBus2:
- Configured with an [Azure Blob North Connector](../north-connectors/azure-blob.md) and an [OIAnalytics North Connector](../north-connectors/oianalytics.md).
- Sends data to Azure and OIAnalytics through the proxy server of `OIBus1`.

<div style={{ textAlign: 'center' }}>

![Network proxy example](../../../static/img/guide/engine/proxy-network.svg)

</div>


#### Configuration
1. On `OIBus1`:
- Enable the proxy server and set it to listen on port 2224.
- Authorize `OIBus2`'s IP address in the IP Filter.

<div style={{ textAlign: 'center' }}>

![Proxy server example](../../../static/img/guide/engine/proxy-server-example.png)

</div>

2. On `OIBus2`:
- In the Azure Blob North Connector settings, specify the proxy server:
- Proxy URL: http://oibus1.fr:2224

<div style={{ textAlign: 'center' }}>

![North proxy example](../../../static/img/guide/engine/north-proxy-example.png)

</div>

This setup allows `OIBus2` to send data to Azure using `OIBus1` as an intermediary, even if `OIBus2`'s network lacks
direct internet access.

:::tip OIAnalytics
If you use a [North OIAnalytics](../north-connectors/oianalytics.md) with
[OIAnalytics registration](../advanced/oianalytics-registration.mdx), the proxy client settings are located in the
registration settings.
:::


## Logging parameters

OIBus logs encompass six levels, ranging from the most critical to the least:

- None (deactivates the logs)
- Error
- Warning
- Info
- Debug
- Trace

Activating **Info** logs will automatically enable **Warning** and **Error** logs. Enabling **Error** logs will
exclusively
display Error logs. It's worth noting that activating **Trace** logs will generate highly detailed and verbose logs,
primarily intended for advanced troubleshooting. Therefore, it's advisable to use **Trace** and **Debug** log levels
specifically for troubleshooting purposes.

### Console

This section displays logs in the Console, alongside values if a [North Console connector
](../../guide/north-connectors/console) is used. To access these logs, execute OIBus from a terminal.

### File

To store logs in one or more files, you can configure the maximum file size and specify the number of files for log
rotation.

### SQLite

To save logs in a local SQLite database for viewing in the **Logs tab** of OIBus, you can set a **maximum number of logs
**
to prevent the database from becoming overly large. Older entries will be automatically purged.

### Loki

To transmit logs to a remote **Loki** instance, the logs are sent to the designated host in batches at a configurable
time interval (default is 60 seconds). You have the flexibility to adjust this interval to control the batch size.

Loki can be accessed directly using Basic Auth, where you provide a **username** and **password**.

:::caution Loki logs with multiple OIBus
Logs sent to Loki are identified by the OIBus ID. The name is sent alongside the ID. Ensure that you update this name
correctly to locate your OIBus logs within your Loki instance, specially if you have several OIBus.
:::

### OIAnalytics

If OIBus [is registered](../advanced/oianalytics-registration.mdx), logs can be forwarded to OIAnalytics. Otherwise,
these settings will be disregarded.
2 changes: 1 addition & 1 deletion documentation/docs/guide/engine/ip-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ curl --location --request POST "http://localhost:2223/api/ip-filters" --header "
```

:::caution Allowing all with proxy server
Be careful when allowing all IP addresses and using the [proxy server](./engine-settings.md#proxy-server): since the
Be careful when allowing all IP addresses and using the [proxy server](./engine-settings.mdx#proxy-server): since the
proxy simply forward without authenticating the request, it may be dangerous to accept all sources.
:::
2 changes: 1 addition & 1 deletion documentation/docs/guide/installation/first-access.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The restart button and the shutdown button has an effect on the engine only, not
the connectors, but not the web service, which allows you to still access the OIBus interface.

When installing OIBus, remember to choose an appropriate name. The _Engine name_ is important mainly if you use several
OIBus and send the logs to a remote [loki instance](../engine/engine-settings.md#loki) or when you register OIBus into OIAnalytics.
OIBus and send the logs to a remote [loki instance](../engine/engine-settings.mdx#loki) or when you register OIBus into OIAnalytics.

[Registering OIBus into OIAnalytics](../advanced/oianalytics-registration) is useful when sending data to a [North OIAnalytics](../north-connectors/oianalytics)
connector and when sending logs to OIAnalytics. From OIAnalytics, once registered, you can update OIBus remotely or parse the logs.
Expand Down
21 changes: 17 additions & 4 deletions documentation/docs/guide/north-connectors/oianalytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,25 @@ If OIAnalytics module is not used, the following fields will be used:
- **Proxy password**: The password linked to the proxy.

## OIAnalytics access
### Best Practice for Connecting OIBus to OIAnalytics
To securely connect OIBus to OIAnalytics, follow these steps:
1. Register OIBus on OIAnalytics:
- This ensures seamless integration and secure communication between OIBus and OIAnalytics.
2. Enable the Use OIAnalytics Module Option:
- In the North connector settings, enable the Use OIAnalytics Module option to establish the connection.
- By doing this, you eliminate the need to manually transfer API keys, simplifying the process and enhancing security.

:::tip Proxy client
If you want to pass data through a proxy, be sure to set the proxy in the
[OIAnalytics registration](../advanced/oianalytics-registration.mdx).
:::

### Alternative Approach: Obtaining an API Key
If you choose not to register OIBus on OIAnalytics, you can still connect by obtaining an API Key. Here’s how.

Data sent to OIAnalytics is transmitted through the OIAnalytics public API. API access in OIAnalytics is linked to a
user
account. Instead of conventional login credentials, an API key must be established within OIAnalytics using the
following
steps:
user account. Instead of conventional login credentials, an API key must be established within OIAnalytics using the
following steps:

1. Navigate to Configuration -> Users.
2. Locate the user for whom you intend to generate an API key, and click on the key icon.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The OIAnalytics Module is accessible through the OIBus Engine page by clicking o
## OIAnalytics logs

If configured within the logging parameters section of
the [OIBus Engine settings](../engine/engine-settings.md#日誌參數), logs have the capability to be transmitted via
the [OIBus Engine settings](../engine/engine-settings.mdx#日誌參數), logs have the capability to be transmitted via
HTTPS to OIAnalytics, allowing access to them on the OIAnalytics OIBus log page.

## Commands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ OIBus主页显示启用的连接器和它们关联的指标的引擎。

重启按钮和关闭按钮只影响引擎,不影响服务。这意味着它会关闭连接器,但不会关闭网络服务,这允许您仍然可以访问OIBus界面。

在安装OIBus时,记得选择一个合适的名字。_引擎名称_ 主要在您使用多个OIBus并将日志发送到远程[loki实例](../engine/engine-settings.md#loki)时很重要。
在安装OIBus时,记得选择一个合适的名字。_引擎名称_ 主要在您使用多个OIBus并将日志发送到远程[loki实例](../engine/engine-settings.mdx#loki)时很重要。

### 北向
要添加一个北向连接器,只需点击 "+" 按钮。
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3cb2cb2

Please sign in to comment.