-
Notifications
You must be signed in to change notification settings - Fork 5
Webinterface rest and websocket #9
Comments
try changing the ports in rest.service.ts and ws.service.ts to 4200 in your example |
Ok thanks. Now I don't get a 404 for "api/localsounds" anymore. The ws-endpoint localsounds seems to be found, but the webapp can't authenticate to the websocket (see at the bottom). This is what I did:
Without changing port to 4200 in application.yaml and config.yaml, I get the 404 for "api/localsounds" again. Results: When opening localhost:8080 I get the UI and some ws and rest exception toast-errors. The 4 errors roughly correspond to the toast-errors:
So how do I let the webapp know the credentials of the rest and websocket services? Thanks for reading and possibly thinking about it. |
i am not that familiar with the bot so i can't really give you much information about how it works (i'm not zekro). i have gotten the bot to work though and here are some steps i took:
then, build the web server and move it into bin via the steps zekro provided in the previous issue:
after running the binary, you should be able to connect to the front end via localhost:8080. it should ask for "log in via discord", which is an oauth2 redirect... you will need to add http://localhost:8080/login/authorize to your "OAuth2 Redirects" via: discord developer portal > [your application] > OAuth2. this should help you get it running. the bot also runs the web interface so you shouldn't have to run it via "ng serve". it seems that the cookie generated by authenticating via oAuth2 is used for restApi authentication (see the "docs" folder for more information). |
Thanks so much @yukinose and @zekroTJA for the detailed instructions. The webinterface is running now and is presenting the defined songs in config.yaml->lavalink.sound_locations. I still stumbled on one showstopper:
Edit 2: I guess I have to build lavalink and debug, as it's possible that it receives unexpected JSON by discord or something. Nothing suspicious in lavalink-logs. The chrome debugger wasn't any help, as the only debuggable codepoint was in ws.service.ts->onMessage() where I get just that brief error-message posted before. |
Yay! Huge Success. TL;DR Fix:In the go application in
It's working flawlessly now. @zekroTJA The bot is the only discord soundbot working for me. The source code is really exceptionally clean and very well documented. A really huge effort to interconnect all the parts. I aspire to get to that level with rust or java, especially relating to oauth and websockets some day. A rather boring blurb of how I found the culprit codeline:
|
Hello again.
As you suggested in issue #8 to update go, my dummy-self couldn't find the time to update Go manually and managed it with this helper. The "undefined: sort.SliceStable" is gone and I possess a nice "yuri2" executable now.
What I've done:
In application.yaml:
In config.yaml:
Started the Lavalink.jar:
No error.
Started yuri:
I invited yuri2 to my discord. It entered the building.
Compiled the web-folder with ng.
When I started the development-server, the userinterface is shown on localhost:4200 but it fails to connect to rest and websockets-server on port 8080. Is that the wrong port maybe? I changed it meanwhile to 2333, for testing in rest.service.ts and ws.service.ts. Chrome is giving me this:
This all looks very promising execpt the last step and as soon as I'm able to broadcast the first sound in my server, I make the installation permanent with pm2 (I guess).
I'm also fine without a web-interface, if I could command yuri2 via discord.
Is the latter possible or can you imagine what the root cause of the failing rest and websocket servers is?
Thanks.
The text was updated successfully, but these errors were encountered: