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

[t] Indicate Tailscale install requirement #2845 #2867

Conversation

phillxnet
Copy link
Member

Introduces tailscale binary os.path.isfile sensitivity to inform the associated Web-UI errors: enabling more context regarding our NOT pre-installing tailscale.

Fixes #2845

Introduces `tailscale` binary os.path.isfile sensitivity to
inform the associated Web-UI errors: enabling more context
regarding our NOT pre-installing tailscale.
@phillxnet
Copy link
Member Author

phillxnet commented Jul 10, 2024

Testing

Behaviour appear as-was with a "Tailscale install" as per our recent how-to: https://rockstor.com/docs/howtos/tailscale_install.html

Without Tailscale installed

  1. Fresh-install (rpm origin)
  2. Enable Tailscale

Result is display of Tailscale config dialog

3 Submit defaults:

Houston, we've had a problem.
Tailscale is NOT installed by default. See docs How-tos & guides: `Tailscale install` https://rockstor.com/docs/howtos/tailscale_install.html

            Traceback (most recent call last):
  File "/opt/rockstor/src/rockstor/smart_manager/views/tailscaled_service.py", line 101, in post
    systemctl(self.name, "stop")
  File "/opt/rockstor/src/rockstor/system/services.py", line 107, in systemctl
    return run_command(arg_list, log=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/rockstor/src/rockstor/system/osi.py", line 290, in run_command
    raise CommandException(cmd, out, err, rc)
system.exceptions.CommandException: Error running a command. cmd = /usr/bin/systemctl stop tailscaled. rc = 5. stdout = ['']. stderr = ['Failed to stop tailscaled.service: Unit tailscaled.service not loaded.', '']

Close all dialogs

  1. Tailscale configure (spanner)
  2. Submit defaults

Result is as above.

N.B. I was expecting a FileNotFound in one of the above. Looking into this now.

However: Ready for review as does catch and inform folks:

Tailscale is NOT installed by default. etc

and given, info on how to install. A link would be better: but we do have a doc link via the I icon in the config dialog: which in turn links to the same how-to.

@phillxnet
Copy link
Member Author

N.B. I was expecting a FileNotFound in one of the above. Looking into this now.

In order to trigger this we look to the code comment:

       # Account for install with restored Tailscale config, but no Tailscale installed.

With a fresh install there is no config: and we error out with the prior exception when initially trying to adding one (with no Tailscale install) as per the last comments details.

  1. Install Tailscale as per How-to in error message: https://rockstor.com/docs/howtos/tailscale_install.html
  2. Tailscale spanner - submit config defaults: On/Off replaced by Login button.
  3. zypper --non-interactive remove tailscale
  4. Tailscale "Login" button is replaced by On/OFF (auto-refresh active on services page).
  5. Switch service On (not blocked by config due to above arrangements) - but we trigger the missing tailscale binary fence: FileNotFoundError.
Houston, we've had a problem.
Tailscale is NOT installed by default. See docs How-tos & guides: `Tailscale install` https://rockstor.com/docs/howtos/tailscale_install.html

            Traceback (most recent call last):
  File "/opt/rockstor/src/rockstor/smart_manager/views/tailscaled_service.py", line 130, in post
    tailscale_up(config=config)
  File "/opt/rockstor/src/rockstor/system/tailscale.py", line 69, in tailscale_up
    tailscale_not_found()
  File "/opt/rockstor/src/rockstor/system/tailscale.py", line 58, in tailscale_not_found
    raise FileNotFoundError
FileNotFoundError

@phillxnet
Copy link
Member Author

An rpm originating install was setup on both a 15.5 and 15.6 (both X86_64) install and both were Web-UI configured & enabled to participate in a Tailscale network. They were then able to ping one-another using the Tailscale assigned IPs. Serving as a test to ensure we still have successful Tailscale default config / enable / Login capability via the Web-UI only.

Thanks again to @FroggyFlox for this Tailscale UI implementation/addition. I'm not entirely happy with my modifications here: but they serve an informational purpose which was the aim of the linked issue. We can re-address the in-elegance of only catching exceptions here once we have begun our HTMX 2.0 introduction and enabled SSEs to more interactively/proactively indicate a service's installed state. Enabling far smaller install options in the future. But for now we needed to inform folks of this services non-default install status: our first service of this kind.

Copy link
Member

@FroggyFlox FroggyFlox left a comment

Choose a reason for hiding this comment

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

@phillxnet,
I won't have time to test it myself but your extensive testing and report make me confident it's all good!
I do agreed it's still not the best user experience but it is definitely a big improvement over the current situation and it lays the foundation for a much better and dynamic user experience down the road once we have a proper messaging/notification system in place.

Thanks for taking care of this one too!

@phillxnet phillxnet merged commit 88f05a8 into rockstor:testing Jul 11, 2024
@phillxnet phillxnet deleted the 2845-Indicate-Tailscale-install-requirement branch July 11, 2024 14:27
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.

2 participants