-
-
Notifications
You must be signed in to change notification settings - Fork 402
Token Management, Database, ... #578
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
Token Management, Database, ... #578
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great :)
@b1rdhous3 Thanks for testing on MacOS. |
@Paulchen-Panther I still got the same error when I initially open the webui. I have to press F5 to proceed. After that all is working. Also I noticed that a change of the activation/deactivation of auth is only set if I restart Hyperion. Example: If I enable auth I can still access with my nodejs api to Hyperion. If I now restart Hyperion the access is denied. Also vice versa. I noticed something other: (if I refresh the page all tokens are gone. Only visible if you generate a new one) |
@b1rdhous3 edit: schaue doch einfach mal in deinem home directory nach ob es im directory .hyperion ein ordner mit dem namen db gibt |
Ich denke ich habe dir nicht völlig detaillos Informationen gegeben, aber gut:
Dies scheint allerdings nur beim ersten Aufruf so zu sein. Danach ist mir das beim Navigieren in der Software nicht aufgefallen.
Meine Browser: Safari und Chrome. OS weiterhin macOS (sowohl als Client, als auch als Server) Edit: im .hyperion Verzeichnis hab ich nachgeschaut. Hier gibt es ein db Verzeichnis und eine Datenbank. Die hab ich mir auch angeschaut. Neue Einträge (wie meine tokens) werden erfolgreich geschrieben. |
Yeah cool :) |
@b1rdhous3 |
@@ -50,6 +50,7 @@ $(document).ready( function() { | |||
$(window.hyperion).one("cmd-config-getschema", function(event) { | |||
window.serverSchema = event.response.info; | |||
requestServerConfig(); | |||
requestTokenInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funktioniert das wirklich? Ich konnte bei mir noch nie 2 requests gleichzeitig abschicken, der zweite wurde immer von Hyperion gefressen. Hab da nie eine Antwort drauf gefunden.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scheint zu funktionieren. Könnte natürlich auch an der (Browser) Websocket Implementierung liegen.
@Paulchen-Panther alles gut! Der andere Fehler beim initialen Laden der WebUi ist leider geblieben. Dieser tritt nur auf, wenn die WebUi das erste mal nach dem Start von hyperiond aufgerufen wird. Danach ist der weg. Die Fehlermeldung bleibt die gleiche wie ein paar Kommentare weiter oben. Ich hab vom Netzverkehr mal zwei Gifs gemacht. Das erste Gif zeigt den Netzverkehr beim initialen Aufruf nach dem Start von hyperiond. Das zweite Gif den Netzverkehr bei der normalen Benutzung der Webui. |
@@ -28,6 +28,7 @@ $(document).ready( function() { | |||
// Token handling | |||
function buildTokenList() | |||
{ | |||
console.log(tokenList) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please delete this line?
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. no Problem
edit: thanks for reporting. i forgot this totaly
It's an interesting error, especially as Hyperion should throw a runtime error when the database can't be opened Super strange |
Second part is online @b1rdhous3 Nochmals vielen dank für so viel Feedback. Was wäre Hyperion ohne deine Hilfe. 😄 @brindosch Unter MacOS scheint die Datenbank von QT etwas empfindlicher zu sein. Auf meinem Linux Testsystem macht die Datenbank keine zicken. Kann natürlich auch an der QT version liegen. Mal schauen wie sich das gestaltet. 😉 |
@Paulchen-Panther vielen Dank! Aber ich denke der noch größere Dank gebührt dir ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit: messed up, sorry
// also used for watchdog | ||
function requestAuthorization() | ||
{ | ||
sendToHyperion("authorize","login",'"username": "Hyperion", "password": "hyperion"'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like like to start a discussion on this:
I think it is not good practice to give the webui a fixed password which is visible and transmitted in clear text. With this you can fake the webui. I would suggest something like this:
- On default after install you can login to webui without an account
- If you like you can activate logging in with an password on webui frontend by providing an own password which is transmitted and stored in db.
- After this you have to login if you startup the webui and the stored pw is used to authenticate through the api. Maybe we can use a cookie for this with a session id which acts as a token
- We should implement a SMALL binary on server side to either activate, deactivate or change pw. This is useful if you forgot your password. Or if it is possible to set it on webui after initial install someone could "steal" your webui by setting a password you don't know. We should use an extra binary to separate this from running Hyperiond service.
I would be more than happy to assist with this as I think this would be a very good feature. Especially for security.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edge note: The password and username thing isn't fully implemented. Currently it's useless, as you can't change it anyway :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I noticed that the username / password for the webui is initially set in the db which is delivered with compiling so to say.
So you just can check if the combination is right but you can't create a new user or change on at the moment with hyperion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, no logic, no API, no UI :)
I never finished it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i see. So we would have to do some work there before ;)
@Paulchen-Panther ich habe gerade auf macOS und auf Ubuntu 19.04 versucht deine Neuerungen auszuprobieren. Leider kann ich auf beiden Maschinen Hyperion nicht mehr starten. Sowohl auf macOS als auch auf Ubuntu erhalte ich folgende Meldung:
Auf macOS hab ich qt mal auf 5.13 aktualisiert. Auf ubuntu nutze ich 5.12.2 Ich weiß nicht was ich dir sonst noch für Infos geben kann. Wenn du noch was brauchst sag gern bescheid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvement all around 👍
@b1rdhous3 edit: Hab gerade gesehen, du benutzt Ubuntu 19 . Das basiert ja uahc auf Debian Buster. Ich teste das gleich mal. edit2: Kannst ja mal schauen ob eines der unten aufgelisteten Pakete bei dir fehlt: libqt5sql5 |
Hab es ohne einen Timer gelöst. Kodi benutzt auch keinen. Die Zusammenfassung der Nachrichten wird ausgegeben sobald eine neue rein kommt die nicht gleich ist wie die vorherigen. Damit der counter nicht endlos läuft, habe ich so wie im syslog eine obergrenze von 200 angegeben. Ist zwar "lachs" aber ist erst mal ein Anfang, ohne alles neu zu schreiben. 😁 |
Stimme dir zu. Sehr gut. Aber so allgemein per Name unterstützen? Ursprünglich hab ich nicht darüber nachgedacht, ob ein Nutzer mit dem in Kontakt kommt oder nicht. Ich mein einem Entwickler ist das egal, der hat eh die serverinfo um das schick darzustellen. |
Ein Name ist auf jeden Fall benutzerfreundlicher. Kannst ja erst mal nur in der hyperion-remote den namen gegen checken. Dafür musst du nicht alles umkrempeln in der API. |
@brindosch bitte bedenke, dass bei den Namen auch Leerzeichen und Umlaute erlaubt sind. :) |
@b1rdhous3 Hast du mal testen können ob bei dir der WebUI log Stream funktioniert? |
Ich kompiliere gerade den aktuellen Master und schaue mal, aber ja, in den Versionen sonst ging das eigentlich. Hatte aber immer auf Debug stehen. edit: jap, geht. |
Leerzeichen sind kein Problem (Effektnamen zb). Umlaute haben noch nie funktioniert. Hab den Fehler schon gefunden. In der webui beim senden zerlegt utf8() die Umlaute. Ich nehms gleich mit auf Oh ich wollte noch was anmerken. In den |
Alles klar. Ich probiere mir das zu merken! 👍 |
#596 |
Die Funktionalität stelle ich bei dir nicht in frage. Wäre es evtl. noch möglich einen Hinweis in der hyperion-remote zu bringen, wenn der Benutzer mal wieder zu däm.... war seinen Instanznamen ein zugeben? Bis jetzt, geht bei Fehleingabe des namens der Befehl unwissend an die Instanz 0. |
Berechtigt, hab auch drüber nachgedacht. Ich füge es hinzu :) |
@Paulchen-Panther |
Hyperion.ng ist doch schon in poeditor drin. Warum dann noch mal webUI? |
Du missverstehst die Situation, ich hab nicht gesehen, dass du ein eigenes Projekt geöffnet hast :) |
OK. Hast du schon gesehen das 2 neue sprachen hinzugefügt wurden sind? |
Ja, immer schön antreiben :) |
Oh ich wollte noch was allgemeines fragen. Machen wir noch etwas "cleanup"?
Mein Hauptproblem damit ist, brauch "keiner" aber läuft in jedem Hyperion::update() mit. Edit: Weitere Optimierungen:
|
Ich dachte der ist dafür da individuell (color managment) leds zu konfigurieren.
Der kann von mir aus raus.
Spielt das so sehr eine Rolle, jetzt wo wir auf DB setzen? |
Ich meine ja, aber letztlich hat man den vector index. Gegenwertig wird der index meine ich nicht beachtet von unserer UI.
Grundsätzlich nicht nein. Man wäre vielleicht schneller im layout editieren, wenn man es von Hand macht :) |
JSON Objekte sind AFAIK nicht sort save. Aber die eigentliche Sortierung passiert über h und v scan, richtig? Dann sollte das ja ausreichend sein. |
Die leds sind in einem array und damit sorted. Das macht den index ja so witzig. Man kann nicht über hscan und vscan gehen.
|
Stimmt, da hast du recht. Dann sehe ich den Sinn von dem Index auch nicht so :) |
Hab den index und clone entfernt. Läuft noch alles :) Also der clone ist wie gesagt nur dafür da die die LEDs zu kopieren, ständig. Ich weiß echt nicht was man damit machen soll. Der Index war tatsächlich nur für das neu sortieren der LEDs zuständig. Mal schauen was ich noch kaputt optimieren kann 👍 |
This draft PR contains
3 parts.2 parts.The first part:
The second part:
The last part:
- Comming soonpostponedI hope there are again many volunteer testers (and feedbacks) so this PR will be my last (before the first official release). And last but not least a special thanks to @brindosch.
Let there be light!