Skip to content

Conversation

@h8d13
Copy link
Contributor

@h8d13 h8d13 commented Dec 26, 2025

#4035 draft (comes from my dev fork)

This would be especially good for testing ;)

@Torxed
Copy link
Member

Torxed commented Dec 26, 2025

Well holy crap that was fast 😅

@h8d13
Copy link
Contributor Author

h8d13 commented Dec 26, 2025

Comes from a fork so this is passage 2. Also my logic was bad your pre-commit checks help a lot

  ⎿  c848f947 (h8d13 2025-11-14 09:44:17 +0100 292) def load_saved_config() -> dict | None:                     
     c848f947 (h8d13 2025-11-14 09:44:17 +0100 293)     """Load saved config and credentials from hade_box folder"""

@h8d13 h8d13 marked this pull request as ready for review December 26, 2025 17:28
@h8d13 h8d13 requested a review from Torxed as a code owner December 26, 2025 17:28
@h8d13
Copy link
Contributor Author

h8d13 commented Dec 26, 2025

I'll mark this as ready as the logic looks sound and feels correct on testing branch

@Torxed
Copy link
Member

Torxed commented Dec 26, 2025

Thoughts on this one @svartkanin? :)

(Aside from having to move it to the new TUI in #3997)


def has_saved_config() -> bool:
"""Check if there's a saved config in /var/log/archinstall"""
config_file = logger.directory / 'user_configuration.json'
Copy link
Collaborator

Choose a reason for hiding this comment

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

the file names are defined here

self._user_config_file = Path('user_configuration.json')
, to make sure any future changes are easy we should define them once and reuse a variable instead of c/p

from archinstall.tui.types import Alignment


def _check_for_saved_config() -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we want this feature it should be usable in all the provided scripts that ship, so this should go into a generic file so it can be re-used by any script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it only makes sense for guided ? I integrated it to the Class and renamed as you asked
that already makes it re-usable. There are also safeguards for silent and check that this only happens in --debug

Altho it does change the exit behavior slightly with an extra Abort / Cancel which isn't necessarily a bad thing

config_output.save(dest_path, creds=True, password=enc_password)


def has_saved_config() -> bool:
Copy link
Collaborator

@svartkanin svartkanin Dec 27, 2025

Choose a reason for hiding this comment

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

Can we move these into the ConfigurationOutput class and Maybe rename that thing to ConfigurationHandler it will make future refactoring much easier

@svartkanin
Copy link
Collaborator

In addition to the comments, I can see some benefits for it but also it's not fully self-contained for regular users as the user_credentials.json is not saved and so a full "automatic" re-installation cannot be done.
That does not mean that I'm suggesting to store the credentials file as that would be quite bad from a security perspective.

If the intention with this is to "be easier during dev" I'd suggest to put this behind the --debug flag which we have already

@Torxed
Copy link
Member

Torxed commented Dec 27, 2025

In addition to the comments, I can see some benefits for it but also it's not fully self-contained for regular users as the user_credentials.json is not saved and so a full "automatic" re-installation cannot be done. That does not mean that I'm suggesting to store the credentials file as that would be quite bad from a security perspective.

If the intention with this is to "be easier during dev" I'd suggest to put this behind the --debug flag which we have already

I agree, skipping credentials is good and if that's the only step when re-running it still save time.

And putting it behind --debug makes sense for now if nothing else :)

Integrate resume behind --debug flag
  - With --debug: "Save selections and abort", "Abort without saving", "Cancel"
  - Without --debug: "Abort", "Cancel"
Copy link
Contributor Author

@h8d13 h8d13 left a comment

Choose a reason for hiding this comment

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

Address feedback rounds from torxed/svart

from archinstall.tui.types import Alignment


def _check_for_saved_config() -> None:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it only makes sense for guided ? I integrated it to the Class and renamed as you asked
that already makes it re-usable. There are also safeguards for silent and check that this only happens in --debug

Altho it does change the exit behavior slightly with an extra Abort / Cancel which isn't necessarily a bad thing

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.

3 participants