Skip to content

Siren installation improvement #7404

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

Merged
merged 8 commits into from
May 12, 2025
Merged

Conversation

AgeManning
Copy link
Member

I think its cleaner and easier to use the docker-compose setup we have in Siren.

I also think it's not great to recommend using docker run --rm as the container will be nuked when it closes.

I've added installation instructions for docker compose and modified the docker run command.

This should work once sigp/siren#371 is merged to stable.

@AgeManning AgeManning requested review from rickimoore and chong-he May 6, 2025 07:03
Copy link
Member

@chong-he chong-he left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will need some inputs from @antondlr too

@@ -43,32 +70,35 @@ We recommend running Siren's container next to your beacon node (on the same ser
1. You can now start Siren with:

```bash
docker run --rm -ti --name siren --env-file $PWD/.env --net host sigp/siren
docker run -ti --name siren --env-file $PWD/.env -p 443:443 sigp/siren
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this will still work, without the --net host. @antondlr and I have discussed about this before. Because there are users running BN and VC not using docker (e.g., systemd), so --net host is somehow required

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I guess maybe its the container trying to access local instances. I use the docker compose for this and it works fine.

I guess @antondlr will have to chime in for --net host. My understanding is that it's not needed, but I might be missing something.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, age is 100% right. --net=host is dangerous and should not be used lightly.
the problem is, a LOT of our users have setup their nodes with the somer esat guides, which runs CL/EL though systemd and limits the api ports to 127.0.0.1 ... which is not accessible through docker.

a solution for that is to use --add-host=host.docker.internal:host-gateway on linux hosts, buuuutttt that doesn't work when Docker was installed as a Snap (which used to be default on Ubuntu but I think it no longer is?)

I'm not sure how --net=host ever became the default, almost recommended way to run Siren... it should be a last resort fix, and only for people who understand the implications.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For those running BN and VC without docker (systemd), without --net=host, will it work? I get how --net host is no good, is there another way to get around?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I run BN and VC without docker using systemd and what I've written here works perfectly fine.

I think the only case is if they set their HTTP IP in the CLI of BN and VC to 127.0.0.1 then it won't work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a comment about handling this edge case. I dont think we need --net host. People just need to expose their HTTP API I guess, or add the flag that anton said.

I've commented on this in the docs now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antondlr could you chime in on this? We discussed before that without --net host, those running systemd will not be able to connect to Siren. Changing the BEACON_URL to http://docker.host.internal:5052 or adding --add-host=host.docker.internal:host-gateway sigp/siren also doesn't work

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we discussed this in detail at devcon, and it is indeed as age says:
either expose the api on 0.0.0.0 (or, their specific IP, or anything else more broad than 127.0.0.1 really), or run Siren with --net=host.

Changing the BEACON_URL to http://docker.host.internal:5052 or adding --add-host=host.docker.internal:host-gateway sigp/siren also doesn't work

you'd have to do both, simultaneously, and this only works for regular docker installs iirc, not for "snap" installs (like you have on your server?). (and it's host.docker.internal not docker.host.internal but that's just a typo I assume?)

I can help debug / find a way for a specific setup like yours but there are no magic solutions here that preserve max security. the tradeoff is between exposing the BN/VC API more broadly, or running Siren with net=host, that will always be the crux of it for setups where Lighthouse doesn't run in Docker.
which of those is "best" is a personal choice; we landed on (ab)using net=host to unblock people because that way, no change to people's running Lighthouse instance would be necessary, but it's definitely not without downsides.
lmk if you want to go over it again why and how this all happens; I can explain in a call but typing it all out would be a course in itself :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I remember, the "lesser of the two evils" - either exposing the API or using --net host

So long as it works, then it's good.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record, this doesn't have anything do with Systemd. I run lighthouse with systemd and without. I don't use the net=host and everything works fine. It is only for users who are not exposing their API, i.e have not set --http-address to .

I expose my HTTP API so I can access it and query things, its only accessible on my internal LAN.

@AgeManning
Copy link
Member Author

I'm going to merge this, because I think its an improvement and users who are starting to use Siren might see an immediate benefit.

Happy to do more PRs to resolve the net=host thing. Maybe we can add it as a note for users who really want to not expose their HTTP APIs.

@AgeManning
Copy link
Member Author

@Mergifyio queue

Copy link

mergify bot commented May 12, 2025

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 5b25a48

@michaelsproul michaelsproul added docs Documentation ready-for-merge This PR is ready to merge. labels May 12, 2025
@AgeManning
Copy link
Member Author

@Mergifyio refresh

mergify bot added a commit that referenced this pull request May 12, 2025
Copy link

mergify bot commented May 12, 2025

refresh

✅ Pull request refreshed

@mergify mergify bot merged commit 5b25a48 into sigp:unstable May 12, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants