Skip to content
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

Setup mode #479

Open
n8maninger opened this issue Oct 7, 2024 · 8 comments
Open

Setup mode #479

n8maninger opened this issue Oct 7, 2024 · 8 comments
Labels
feature A new feature request or enhancement
Milestone

Comments

@n8maninger
Copy link
Member

n8maninger commented Oct 7, 2024

If the user has not configured a seed or API password, hostd should enter a setup mode with a single endpoint that allows the user to configure the yaml file via the web UI instead of failing to start. After the user has completed the initial setup, hostd should start normally without needing to be restarted.

@n8maninger n8maninger added the feature A new feature request or enhancement label Oct 7, 2024
@n8maninger n8maninger added this to Sia Oct 7, 2024
@n8maninger n8maninger moved this to Triage in Sia Oct 7, 2024
@n8maninger
Copy link
Member Author

@ChrisSchinnerl @peterjan @alexfreska this is a feature I would like to discuss. We have this for the desktop apps, but configuring the apps on headless devices is still a friction point.

@ChrisSchinnerl
Copy link
Member

That's interesting. Do you want to spin up the regular UI or a special page only for settings and submitting the config after which it gets written to disk and the actual UI and hostd get spin up?

@alexfreska
Copy link
Member

alexfreska commented Oct 21, 2024

The way I understand:

Pre setup:

  • The daemon starts with 1 /api/setup endpoint.
  • Also serves the regular UI as normal.
  • The daemon can open the UI to a special route localhost:9980/setup.
    • This page is part of the regular UI but only interacts only with the /api/setup endpoint.

Post setup:

  • On successful submission to /api/setup:
  • The setup UI page closes itself.
  • The daemon spins up the full API, without /api/setup.
  • The daemon opens the normal UI root page localhost:9980/setup.
  • Manually visiting the UI setup page would just 404/redirect back to root.

Is this in line with your thinking? Do you both envision this is as only for first time config? Or could the user visit this page post setup and modify the config/trigger restart?

@n8maninger
Copy link
Member Author

n8maninger commented Oct 21, 2024

That’s pretty much exactly the workflow I envisioned. A one time API and setup flow that disappears after it’s complete and writes a yaml config to disk. The regular UI will be redirected to a setup page since the user can’t login.

We could add a config endpoint to the regular API to update the YAML, but it should not expose the wallet seed.

@ChrisSchinnerl
Copy link
Member

Since serving the regular UI doesn't make sense during the setup stage, should we just serve the setup page on localhost:9980? Then users can just visit the same URL they usually would without having to add the extra /setup. I imagine that is a bit nicer for when the daemon can't auto-open a browser.

@n8maninger
Copy link
Member Author

@alexfreska would creating a distinct UI overcomplicate the UI packaging and build process? Having one external UI package is already a bit of a pain.

@alexfreska
Copy link
Member

We can make the setup load on localhost:9980 (or at least instantly redirect etc). Yeah I would really want to make it part of the current UI so that we don't add more complexity to matching up all the versions and dependencies - this shouldn't prevent us from doing anything we need, including making it feel separate or loading on the same route etc.

@n8maninger n8maninger modified the milestones: v2.0.0, v2.1.0 Oct 22, 2024
@pcfreak30
Copy link

IMO if you do this on hostd, should probably apply it to renterd as well, 🤷‍♂ .

@ChrisSchinnerl ChrisSchinnerl moved this from Triage to Backlog in Sia Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature request or enhancement
Projects
Status: Backlog
Development

No branches or pull requests

4 participants