Skip to content

add auto start of containers#184

Merged
GitGab19 merged 4 commits into
stratum-mining:mainfrom
lucasbalieiro:add-auto-start-of-containers
Jun 10, 2026
Merged

add auto start of containers#184
GitGab19 merged 4 commits into
stratum-mining:mainfrom
lucasbalieiro:add-auto-start-of-containers

Conversation

@lucasbalieiro

@lucasbalieiro lucasbalieiro commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

closes #181 and #182

this is adding and auto-start script when the backend starts to check if it is possible to restart the container automatically.

now if the env var STRATUM_HOST is detected it replaces the instructions on the dashboard:
image

export STRATUM_HOST=google.dev && npm run dev && unset STRATUM_HOST

there is no validation on the string that will be applied just a direct replace.

So we could set this as umbrel.local or a direct IP depending on the case

@lucasbalieiro lucasbalieiro marked this pull request as ready for review June 9, 2026 19:54
@lucasbalieiro

Copy link
Copy Markdown
Collaborator Author

tested on my Umbrel Machine the use of STRATUM_HOST and the autostart of the services.

image

@GitGab19

Copy link
Copy Markdown
Member

This is going in the right direction, but as I told to @lucasbalieiro privately, it can be improved a bit IMO.

The problematic scenario I see is the following: a user running Umbrel shutdowns the machine, and boots it up after a couple of hours. When the machine is back up running, the node has to sync last blocks, the sv2-ui starts automatically, but it stops because of the IBD error (correct thing).

The issue here is that sv2-ui gets stuck there, and user still needs to manually restart the services, by clicking the button on the UI.

A way to improve this is to keep trying the restart every X seconds, and if there's an error, keep showing it in the UI as usual.

I pushed a commit on my fork with this proposal, you can find it here: https://github.com/GitGab19/sv2-ui/tree/gab/auto-start-reconciler

Feel free to cherry-pick the commit, or simply take inspiration from it.

@lucasbalieiro lucasbalieiro force-pushed the add-auto-start-of-containers branch from 69eff7e to 698ee29 Compare June 10, 2026 13:32
@lucasbalieiro lucasbalieiro force-pushed the add-auto-start-of-containers branch from 698ee29 to 45bcdc7 Compare June 10, 2026 13:38
@lucasbalieiro

Copy link
Copy Markdown
Collaborator Author

cherry-picked

@GitGab19

Copy link
Copy Markdown
Member

There can be a race-condition between the manual restart and the auto-restart loop.

The case can be the following:

  • user manually reset the stack/config
  • the api called deletes the config
  • before it does that, the auto-restart kicks-in, loads the "old" config, and restarts the containers

A possible fix could be what I pushed in this commit: GitGab19@1b93454

@lucasbalieiro

Copy link
Copy Markdown
Collaborator Author

rebased and cherry-picked GitGab19@1b93454

@GitGab19 GitGab19 merged commit 051da83 into stratum-mining:main Jun 10, 2026
5 checks passed
@lucasbalieiro lucasbalieiro deleted the add-auto-start-of-containers branch June 10, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fill the current your-machine-ip in the dashboard with the real value sv2-ui doesn't automatically start services after restart

2 participants