Skip to content

Commit 5b25a48

Browse files
authored
Siren installation improvement (#7404)
1 parent 5933901 commit 5b25a48

File tree

5 files changed

+76
-27
lines changed

5 files changed

+76
-27
lines changed

book/src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* [Authorization Header](./api_vc_auth_header.md)
3333
* [Prometheus Metrics](./api_metrics.md)
3434
* [Lighthouse UI (Siren)](./ui.md)
35-
* [Configuration](./ui_configuration.md)
35+
* [Installation](./ui_installation.md)
3636
* [Authentication](./ui_authentication.md)
3737
* [Usage](./ui_usage.md)
3838
* [FAQs](./ui_faqs.md)

book/src/ui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The UI is currently in active development. It resides in the
2121
See the following Siren specific topics for more context-specific
2222
information:
2323

24-
- [Configuration Guide](./ui_configuration.md) - Explanation of how to setup
24+
- [Installation Guide](./ui_installation.md) - Explanation of how to setup
2525
and configure Siren.
2626
- [Authentication Guide](./ui_authentication.md) - Explanation of how Siren authentication works and protects validator actions.
2727
- [Usage](./ui_usage.md) - Details various Siren components.

book/src/ui_authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
## Siren Session
44

5-
For enhanced security, Siren will require users to authenticate with their session password to access the dashboard. This is crucial because Siren now includes features that can permanently alter the status of the user's validators. The session password must be set during the [configuration](./ui_configuration.md) process before running the Docker or local build, either in an `.env` file or via Docker flags.
5+
For enhanced security, Siren will require users to authenticate with their session password to access the dashboard. This is crucial because Siren now includes features that can permanently alter the status of the user's validators. The session password must be set during the [installation](./ui_installation.md) process before running the Docker or local build, either in an `.env` file or via Docker flags.
66

77
![exit](imgs/ui-session.png)
88

99
## Protected Actions
1010

11-
Prior to executing any sensitive validator action, Siren will request authentication of the session password. If you wish to update your password please refer to the Siren [configuration process](./ui_configuration.md).
11+
Prior to executing any sensitive validator action, Siren will request authentication of the session password. If you wish to update your password please refer to the Siren [installation process](./ui_installation.md).
1212

1313
![exit](imgs/ui-auth.png)

book/src/ui_faqs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ The required API token may be found in the default data directory of the validat
1010

1111
## 3. How do I fix the Node Network Errors?
1212

13-
If you receive a red notification with a BEACON or VALIDATOR NODE NETWORK ERROR you can refer to the lighthouse ui [`configuration`](./ui_configuration.md#configuration).
13+
If you receive a red notification with a BEACON or VALIDATOR NODE NETWORK ERROR you can refer to the lighthouse ui [`installation`](./ui_installation.md#configuration).
1414

1515
## 4. How do I connect Siren to Lighthouse from a different computer on the same network?
1616

17-
Siren is a webapp, you can access it like any other website. We don't recommend exposing it to the internet; if you require remote access a VPN or (authenticated) reverse proxy is highly recommended.
17+
Siren is a webapp, you can access it like any other website. We don't recommend exposing it to the internet; if you require remote access a VPN or (authenticated) reverse proxy is highly recommended.
1818
That being said, it is entirely possible to have it published over the internet, how to do that goes well beyond the scope of this document but we want to emphasize once more the need for *at least* SSL encryption if you choose to do so.
1919

2020
## 5. How can I use Siren to monitor my validators remotely when I am not at home?
2121

22-
Most contemporary home routers provide options for VPN access in various ways. A VPN permits a remote computer to establish a connection with internal computers within a home network. With a VPN configuration in place, connecting to the VPN enables you to treat your computer as if it is part of your local home network. The connection process involves following the setup steps for connecting via another machine on the same network on the Siren configuration page and [`configuration`](./ui_configuration.md#configuration).
22+
Most contemporary home routers provide options for VPN access in various ways. A VPN permits a remote computer to establish a connection with internal computers within a home network. With a VPN configuration in place, connecting to the VPN enables you to treat your computer as if it is part of your local home network. The connection process involves following the setup steps for connecting via another machine on the same network on the Siren configuration page and [`installation`](./ui_installation.md#configuration).
2323

2424
## 6. Does Siren support reverse proxy or DNS named addresses?
2525

26-
Yes, if you need to access your beacon or validator from an address such as `https://merp-server:9909/eth2-vc` you should configure Siren as follows:
26+
Yes, if you need to access your beacon or validator from an address such as `https://merp-server:9909/eth2-vc` you should configure Siren as follows:
2727
`VALIDATOR_URL=https://merp-server:9909/eth2-vc`
2828

2929
## 7. Why doesn't my validator balance graph show any data?

book/src/ui_configuration.md renamed to book/src/ui_installation.md

Lines changed: 68 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,55 @@ To ensure proper functionality, the Siren app requires Lighthouse v4.3.0 or high
88

99
## Configuration
1010

11-
Siren requires a connection to both a Lighthouse Validator Client and a Lighthouse Beacon Node.
11+
Siren requires a connection to both a Lighthouse Validator Client and a Lighthouse Beacon Node.
1212

13-
Both the Beacon node and the Validator client need to have their HTTP APIs enabled.
13+
Both the Beacon node and the Validator client need to have their HTTP APIs enabled.
1414
These ports should be accessible from Siren. This means adding the flag `--http` on both beacon node and validator client.
1515

1616
To enable the HTTP API for the beacon node, utilize the `--gui` CLI flag. This action ensures that the HTTP API can be accessed by other software on the same machine.
1717

1818
> The Beacon Node must be run with the `--gui` flag set.
1919
20-
## Running the Docker container (Recommended)
20+
## Running Siren with Docker Compose (Recommended)
2121

2222
We recommend running Siren's container next to your beacon node (on the same server), as it's essentially a webapp that you can access with any browser.
2323

24+
1. Clone the Siren repository:
25+
26+
```
27+
git clone https://github.com/sigp/siren
28+
cd siren
29+
```
30+
31+
1. Copy the example `.env.example` file to `.env`:
32+
33+
```
34+
cp .env.example .env
35+
```
36+
37+
1. Edit the `.env` file filling in the required fields. A beacon node and validator url needs to be
38+
specified as well as the validator clients `API_TOKEN`, which can be obtained from the [`Validator Client Authorization Header`](./api_vc_auth_header.md).
39+
Note that the HTTP API ports must be accessible from within docker and cannot just be listening
40+
on localhost. This means using the
41+
`--http-address 0.0.0.0` flag on the beacon node and validator client.
42+
43+
1. Run the containers with docker compose
44+
45+
```
46+
docker compose up -d
47+
```
48+
49+
1. You should now be able to access siren at the url (provided SSL is enabled):
50+
51+
```
52+
https://localhost
53+
```
54+
55+
> Note: If running on a remote host and the port is exposed, you can access Siren remotely via
56+
`https://<IP-OF-REMOTE-HOST>`
57+
58+
## Running Siren in Docker
59+
2460
1. Create a directory to run Siren:
2561
2662
```bash
@@ -29,9 +65,9 @@ We recommend running Siren's container next to your beacon node (on the same ser
2965
cd Siren
3066
```
3167
32-
1. Create a configuration file in the `Siren` directory: `nano .env` and insert the following fields to the `.env` file. The field values are given here as an example, modify the fields as necessary. For example, the `API_TOKEN` can be obtained from [`Validator Client Authorization Header`](./api_vc_auth_header.md)
68+
1. Create a configuration file in the `Siren` directory: `nano .env` and insert the following fields to the `.env` file. The field values are given here as an example, modify the fields as necessary. For example, the `API_TOKEN` can be obtained from [`Validator Client Authorization Header`](./api_vc_auth_header.md).
3369
34-
A full example with all possible configuration options can be found [here](https://github.com/sigp/siren/blob/stable/.env.example).
70+
A full example with all possible configuration options can be found [here](https://github.com/sigp/siren/blob/stable/.env.example).
3571
3672
```
3773
BEACON_URL=http://localhost:5052
@@ -43,32 +79,45 @@ We recommend running Siren's container next to your beacon node (on the same ser
4379
1. You can now start Siren with:
4480
4581
```bash
46-
docker run --rm -ti --name siren --env-file $PWD/.env --net host sigp/siren
82+
docker run -ti --name siren --env-file $PWD/.env -p 443:443 sigp/siren
4783
```
4884
49-
Note that, due to the `--net=host` flag, this will expose Siren on ports 3000, 80, and 443. Preferably, only the latter should be accessible. Adjust your firewall and/or skip the flag wherever possible.
85+
> Note: If you have only exposed your HTTP API ports on the Beacon Node and Validator client to
86+
localhost, i.e via --http-address 127.0.0.1, you must add
87+
`--add-host=host.docker.internal:host-gateway` to the docker command to allow docker to access the
88+
hosts localhost. Alternatively, you should expose the HTTP API to the IP address of the host or
89+
`0.0.0.0`
5090
51-
If it fails to start, an error message will be shown. For example, the error
91+
1. Siren should be accessible at the url:
5292
5393
```
54-
http://localhost:5062 unreachable, check settings and connection
94+
https://localhost
5595
```
5696
57-
means that the validator client is not running, or the `--http` flag is not provided, or otherwise inaccessible from within the container. Another common error is:
97+
> Note: If running on a remote host and the port is exposed, you can access Siren remotely via
98+
`https://<IP-OF-REMOTE-HOST>`
5899
59-
```
60-
validator api issue, server response: 403
61-
```
100+
## Possible Docker Errors
101+
102+
Note that when use SSL, you will get an SSL warning. Advanced users can mount their own certificates or disable SSL altogether, see the `SSL Certificates` section below. This error is safe to ignore.
103+
104+
If it fails to start, an error message will be shown. For example, the error
105+
106+
```
107+
http://localhost:5062 unreachable, check settings and connection
108+
```
62109
63-
which means that the API token is incorrect. Check that you have provided the correct token in the field `API_TOKEN` in `.env`.
110+
means that the validator client is not running, or the `--http` flag is not provided, or otherwise inaccessible from within the container. Another common error is:
64111
65-
When Siren has successfully started, you should see the log `LOG [NestApplication] Nest application successfully started +118ms`, indicating that Siren has started.
112+
```
113+
validator api issue, server response: 403
114+
```
66115
67-
1. Siren is now accessible at `https://<the-servers-ip>` (when used with `--net=host`). You will get a warning about an invalid certificate, this can be safely ignored.
116+
which means that the API token is incorrect. Check that you have provided the correct token in the field `API_TOKEN` in `.env`.
68117
69-
> Note: We recommend setting a strong password when running Siren to protect it from unauthorized access.
118+
When Siren has successfully started, you should see the log `LOG [NestApplication] Nest application successfully started +118ms`, indicating that Siren has started (in the docker logs).
70119
71-
Advanced users can mount their own certificates or disable SSL altogether, see the `SSL Certificates` section below.
120+
> Note: We recommend setting a strong password when running Siren to protect it from unauthorized access.
72121
73122
## Building From Source
74123
@@ -101,7 +150,7 @@ By default, internally, Siren is running on port 80 (plain, behind nginx), port
101150
102151
[mkcert](https://github.com/FiloSottile/mkcert) is a tool that makes it super easy to generate a self-signed certificate that is trusted by your browser.
103152
104-
To use it for `siren`, install it following the instructions. Then, run `mkdir certs; mkcert -cert-file certs/cert.pem -key-file certs/key.pem 127.0.0.1 localhost` (add or replace any IP or hostname that you would use to access it at the end of this command).
153+
To use it for `siren`, install it following the instructions. Then, run `mkdir certs; mkcert -cert-file certs/cert.pem -key-file certs/key.pem 127.0.0.1 localhost` (add or replace any IP or hostname that you would use to access it at the end of this command).
105154
To use these generated certificates, add this to to your `docker run` command: `-v $PWD/certs:/certs`
106155
107156
The nginx SSL config inside Siren's container expects 3 files: `/certs/cert.pem` `/certs/key.pem` `/certs/key.pass`. If `/certs/cert.pem` does not exist, it will generate a self-signed certificate as mentioned above. If `/certs/cert.pem` does exist, it will attempt to use your provided or persisted certificates.

0 commit comments

Comments
 (0)