Dane Everitt
32d6594476
fix incorrect error handling logic when a JWT is created wrongly; closes pterodactyl/panel#3295
...
Prior to this logic not only was the error response incorrect for events, but we registered event listeners before the authentication event; so if auth failed we flooded the socket with tons of output that was never going to be sent anyways.
This change now waits to register listeners until the socket is fully authenticated and we're guaranteed to have a token present.
2021-10-25 21:23:45 -07:00
Dane Everitt
023d7ec1ec
Close websocket connections and allow the client to re-connect on send errors; ref pterodactyl/panel#3596
2021-10-24 16:14:00 -07:00
Dane Everitt
09e1ba6f34
Use the request context for cancelation, not a background context
...
This also fixes an improperly written server deletion listener to look at the correct context cancelation.
Theoretically this should help address the issues in pterodactyl/panel#3596 but I'm not really sure how that happens, and theres no steps for reproduction.
2021-09-12 11:14:00 -07:00
Matthew Penner
3c54c1f840
break everything
...
- upgrade dependencies
- run gofmt and goimports to organize code
- fix typos
- other small tweaks
2021-08-02 15:07:00 -06:00
Dane Everitt
f3a6ee7a45
re-refactor code
2021-01-25 20:28:24 -08:00
Jakob Schrettenbrunner
c9c949a091
rename ServerManagerFromContext from ExtractServerManager
2021-01-10 02:18:02 +00:00
Jakob Schrettenbrunner
8192244fec
replace servers.servers singleton with server.Manager
2021-01-10 02:37:02 +01:00
Jakob Schrettenbrunner
648072436f
organize imports with gopls format
2021-01-10 01:22:39 +00:00
Matthew Penner
5c78cb9ab3
Add transfer logging output ( #77 )
...
Co-authored-by: Dane Everitt <dane@daneeveritt.com>
2020-12-25 13:32:41 -08:00
Dane Everitt
0ecc166dcd
Update error reporting middleware
2020-12-15 21:08:00 -08:00
Dane Everitt
acd6dc62d0
Update middleware logic
2020-12-15 20:19:09 -08:00
Dane Everitt
37e59e6928
Close connected sockets when a server is deleted; closes pterodactyl/panel#2428
2020-10-03 20:46:29 -07:00
Dane Everitt
6de18f09e5
Don't block websocket from handling another message when a long running proccess is triggered
2020-07-18 16:45:10 -07:00
Dane Everitt
198a22f446
Replace even more zap occurences
2020-06-13 10:26:35 -07:00
Dane Everitt
82ffb9804d
Don't lock up websocket when sending error json; ref pterodactyl/panel#2076
2020-05-28 19:52:47 -07:00
Matthew Penner
28c8f3f400
Add the ability to fetch all servers, fix cpu usage leak again..
2020-04-10 15:39:07 -06:00
Dane Everitt
cf2ef1a173
Port most of the HTTP code over to gin
2020-04-05 18:00:33 -07:00