+
Skip to content

Conversation

phillxnet
Copy link
Member

@phillxnet phillxnet commented Feb 25, 2025

Move associated code from Python 2.7 to 3.

Fixes #2958

Includes:

  • Adding typehints.
  • User facing text refinement through-out.
  • Reword/simplify Pincard Manager dialog.
  • Move code comments to DocStrings.
  • Use String.format.
  • Add pincard icon colour flag. Green exists, red indicates no pincard exists.
  • Pincard logging tweaks.
  • Add info log to all smbpasswd calls.

Caveat: on final testing we have working root user and initial setup-created/webui admin user password reset.

But there remains a bug in non-webui managed user reset where-by no response is given after valid codes are entered. It is proposed that this be addressed at a later date under another issue as this is a less common scenario and does not pertain to the original issue addressed here: in that a pincode is successfully generated and presented for a non-webui-user during tests against this branch: see #2959 (comment) below.

Move associated code from Python 2.7 to 3.
Includes:
- Adding typehints.
- User facing text refinement through-out.
- Reword/simplify Pincard Manager dialog.
- Move code comments to DocStrings.
- Use String.format.
- Add pincard icon colour flag. Green exists,
  red indicates no pincard exists.
- Pincard logging tweaks.
- Add info log to all smbpasswd calls.
@phillxnet
Copy link
Member Author

phillxnet commented Feb 25, 2025

Testing

An rpm was build and installed on a Leap 15.6 host, x86_64 arch.

Initial pincard indicators

Web-UI admin user created during setup:

Web-UI-user-no-pincard

Non-Web-UI user created via Web-UI (managed user):

Non-Web-UI-user-managed-no-pincard

Root user:

root-user-no-pincard

Clicking on the above 'root' user Pincard icon resulted in the display of the System -> Email Alerts config setup page.
Once the Email Alerts system was configured, the 'root' user Pincard icon appears the same as the above detailed user Pincard Icons & tooltip text. [EDIT] We look to have an outstanding but trivial user-facing typo in the root user pincard tooltip text.

@phillxnet
Copy link
Member Author

Pincard display

When cliicking on the Pincard icon the following is presented, randomly generated with each creation/recreation.

non-webui-user_pincard_presentation

And a highlight cut-paste of the text only version results in, in this case:

HdX 6xq _=' pgY w;b &7T
rWO )'P /z< t5Z j@% :oI
Zph YV7 EB# #{I U~T 5f?
a"@ gCd Y4r 4\o <AA W+\

@phillxnet
Copy link
Member Author

Path to reset via pincard

reset-password-link_login-screen

Initial-password-reset-options-dialog

enter-username-for-password-reset

N.B. once the above dialog is confirmed, the username field returns to being empty:

@phillxnet
Copy link
Member Author

Presentation of the new password:

webui-user-pincode-entry

webui-user-new-password-presentation

@phillxnet phillxnet added the needs review Ideally by prior rockstor-core contributor label Feb 28, 2025
@FroggyFlox
Copy link
Member

Works a treat. thanks again @phillxnet!

For some reason, Right-clicking and "Save Image as..." on my machine does not do anything... no response from the browser or error in the JS console. I'm not sure what's going on. It's something on my end, though, as I can still use the text version of take a screenshot and use that pincard to reset the password for a managed user just fine!

But there remains a bug in non-webui managed user reset where-by no response is given after valid codes are entered.

I created a new user testuser0 without giving it access to Rockstor UI.
I created a pincard for it.
I logged out of Rockstor and could go through the whole password reset process for that user, get the new password and see in the logs that it was processed OK (see snippets below). The modal disappeared and I see again the Rockstor login screen... am I testing this wrong? It seems to work on my end...

==> var/log/rockstor.log <==
[01/Mar/2025 14:22:12] DEBUG [storageadmin.views.pincard:32] Command (reset) received for username: (testuser01).
[01/Mar/2025 14:22:12] DEBUG [system.osi:261] Running command: /usr/sbin/usermod -p $6$qXYKREmYReDPSzGL$uatyrE8vSrOsCEqD99eKUPiWlGq6eaHJ757S8LnAEASvyOxCr9TPI6EG7lZS0WsQ9ivfoWVkY/k/00U6RDYxw0 testuser01
[01/Mar/2025 14:22:13] INFO [system.users:205] Command (smbpasswd -s -a) run for username: (testuser01).
[01/Mar/2025 14:22:13] DEBUG [storageadmin.views.pincard:42] Processed password reset request for username (testuser01).
[01/Mar/2025 14:22:13] DEBUG [storageadmin.views.pincard:43] reset status: (True).

@phillxnet
Copy link
Member Author

@FroggyFlox Thanks for taking a look at this PR, much appreciated.
Re:

I created a new user testuser0 without giving it access to Rockstor UI. ... created a pincard for it.

OK, this worked for me also, addressing the referenced issue.

for that user, get the new password and see in the logs that it was processed OK (see snippets below).

OK, that was the bit that failed for me: but only for managed non-web ui users. So we likely need to proper reproducer for the failure I saw. Great that it may have been at my end some how thought. Lets keep an eye out for reports of this particular failure to see if we can get to a reproducer. For now it may well have been some caching issue at my end perhaps.

Strange you browser refused to enact the right-click save on the image version of the pincard. Again we should keep an eye out for this in reports to get more info. But as stated there is the text option and screen pic approach. I'll try to include that in the accompanying doc section; when time allows.

I'll take this as a functional review: which is all we need really; given we had abject failure previously. I was keen to avoid that with any key feature prior to our pending stable release.

I'll merge shortly so we can get this fix in the next release.

@phillxnet phillxnet removed the needs review Ideally by prior rockstor-core contributor label Mar 2, 2025
@phillxnet phillxnet merged commit 830ea8c into rockstor:testing Mar 2, 2025
@phillxnet phillxnet deleted the 2958-User-Pincard-generation-fails branch March 2, 2025 16:44
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

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载