helloSystem / hello

Desktop system for creators with a focus on simplicity, elegance, and usability. Based on FreeBSD. Less, but better!
2.32k stars 57 forks source link

Enter password to perform administrative tasks interface. #422

Closed louies0623 closed 1 year ago

louies0623 commented 1 year ago

Although there is already this thing, but it is not easy to notice, and there is no sign in the window that any program needs permission. If it suddenly appears in your unexpected work, it will be dangerous. I hope it is like ubuntu 10.04 The same attention to visuality as the screen. image

probonopd commented 1 year ago

You mean, make all other windows dimmed in the background?

louies0623 commented 1 year ago

Yes, and need to explain what program or software needs permission.

louies0623 commented 1 year ago

Another thing is to display the account of the administrator, so as to know which account password to enter. image image image

probonopd commented 1 year ago

The Windows examples show too much text. Which no one really reads nor understands. helloSystem is meant to be simple.

Changing it to this:

image

We are now also using the optional SUDO_ASKPASS_TEXT) variable. Applications can use this variable to show a more user-friendly explanation text.

probonopd commented 1 year ago

We still need to find a way to dim the rest of the screen, or add another visual clue about the importance of this window.

louies0623 commented 1 year ago

like a welcome video overlay, just that it's transparent

probonopd commented 1 year ago

Exactly. How to do it in PyQt5?

louies0623 commented 1 year ago

I hope this network problem can help .youhttps://stackoverflow.com/questions/33982167/pyqt5-create-semi-transparent-window-with-non-transparent-children

probonopd commented 1 year ago

Thanks for the hint. Have you tried it out? No one was born as a developer. We all started by trying out things... trial end error until something works.

louies0623 commented 1 year ago

I've touched it before but held back because I'm poor at comprehension.

louies0623 commented 1 year ago

image You can refer to this think_工作區域 1

probonopd commented 1 year ago

Looks like it also doesn't have this functionality.

image

louies0623 commented 1 year ago

Maybe generate a transparent black window in the background.

louies0623 commented 1 year ago

image Maybe it's possible to just show the background, e.g. like Windows 8 UAC

probonopd commented 1 year ago

If anyone wants to work on this, I will consider pull requests, but it is not important enough for me to work on it.

louies0623 commented 1 year ago

@Hierosme You have a good job, can you help @probonopd this question? image

Hierosme commented 1 year ago

Not sure, but let me explain some basics arround it.

Only the QDesktop class can speack about a entry screen + virtual desktop. Normaly NO Windows are allowed to touch the entire screen.

The split is clear, The QDesktop class work with the entire screen, where a QWindow can't. In general that done by use Dbus + Session Manager + Desktop Agent ready for it type of event (a bit Like Notification finaly)

That is not rare to see Desktop respect the FreeDektop recommandation about it topic... https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html Polkit is a huge Gaz engine and nobody has never know if that really working ...

helloSystem use Sudo, that is totaly a oposit method, and from my point it have no chance to get the same type of result. (Far away, really sorry about that)

It have globaly two method

1) change owner execution of child programme (Sudo)

or

2) Ask to somthing it allow or not the exchange. (Polkit)

if helloSystem want the same type of result freedesktop provide framework. Unfortunally Polkit is a FreeDektop core component, it have nothing relatif with a Application Window.

Deporte the responssability to the application, mean use Sudo, but the design of Sudo not permit to a allready started application to change it owner, it must create a child process via sudo command.

Nobody have say it was simple ....

Regards

Hierosme commented 1 year ago

My recommendation is to follow FreeDesktop recommendation, and in that case, take a look on the terrific Polkit ....

That a big pain....

probonopd commented 1 year ago

We don't want Polkit in helloSystem. sudo is much simpler.

https://github.com/helloSystem/hello/wiki/Welcome-and-unwelcome-technologies

Also, we don't follow FreeDesktop (xdg) (these standards are often the root cause why Linux desktops are not Mac-like) but https://dl.acm.org/doi/book/10.5555/573097

Hierosme commented 1 year ago

Hooo that insteresting.

If the choise is all ready done. >>> SUDO <<< , then the fixe is to askpass before the start of the application...

I really want to be clear Sudo / Polkit is TOTALY not similar... Nothing is similar really, the method is diffrent and the result is different etc ....

It exist a project call Ansible it have really push the use of sudo. I fact want we can optain with sudo is near whar the Ansible roject have optian.

Sudo have 2 huge limitation:

What is possible to do is restart the Application in place syscall HUP great permission, and restart again. Normaly THAT is possible.

for better understanding, a QT Application use signal anf by change the PID (Process ID, PRocess is a application execute under a environement) signals will be lost. Normaly the way is to use a BUS.

What is important is A Process is a application execute under a environement , that mean wew can restart in place and IMPOSE the contain a environement variables. <-------- Here is the key.

Normlay a True Security Policy should stop us here ..... But it look to not under helloSystem that mean out of the box we can use the sudo option -E --preserverve-env. It certainly add chainning security issue, but it look possible.

Soon i'll be in front of the trouble with a hammer... Regards

probonopd commented 1 year ago

We want things to be simple.

Hierosme commented 1 year ago

I'll do my best for that ....