Commit Graph

223 Commits

Author SHA1 Message Date
Matthew Penner
a4c8b8714b Bump all dependencies 2020-12-27 11:49:08 -07:00
Matthew Penner
5be6e20b03 Send archive status request before sending the transfer status event 2020-12-26 11:42:44 -07:00
Dane Everitt
3842f054a5
These need spaces? 2020-12-25 15:14:21 -08:00
Dane Everitt
510d46289b
security: don't reveal wings version in remote API calls 2020-12-25 15:06:17 -08:00
Dane Everitt
6e5b14c466
Prevent malicious code from causing a server UUID to be used that is not valid 2020-12-25 15:01:43 -08:00
Dane Everitt
b3922864f2
Simplify origin checking 2020-12-25 14:40:28 -08:00
Dane Everitt
bb132243ed
Merge branch 'develop' of https://github.com/pterodactyl/wings into develop 2020-12-25 13:57:33 -08:00
Dane Everitt
d96115325a
Add file helper 2020-12-25 13:57:26 -08:00
Matthew Penner
a450abc080 Don't read directories either, add completion log for transfers 2020-12-25 14:46:33 -07:00
Matthew Penner
0a45ea44a4 Return a user-friendly error for an invalid file mode 2020-12-25 14:41:38 -07: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
c0523df696
Add a server context that gets canceled when a server is deleted 2020-12-25 11:21:09 -08:00
Dane Everitt
f7f5623c71
Set UA and limit simultaneous downloads 2020-12-24 09:01:00 -08:00
Dane Everitt
184013b652
Include endpoints for getting active downloads for a server 2020-12-20 13:14:07 -08:00
Dane Everitt
c8d297a056
Support canceling an in-progress download 2020-12-20 12:53:40 -08:00
Dane Everitt
c718da20e3
Check disk space before trying a write from the downloader; don't make empty directories if we can't even write the file 2020-12-20 11:17:53 -08:00
Dane Everitt
9c53436470
Check disk before even trying to run the download 2020-12-20 11:08:01 -08:00
Dane Everitt
17daa2071f
Update base logic for handling server file downloads 2020-12-20 10:59:07 -08:00
Dane Everitt
3495fb1c76
Less racey logic for resource usage 2020-12-16 22:03:35 -08:00
Dane Everitt
0c93e5ed02
Properly handle decoding paths 2020-12-16 21:38:56 -08:00
Dane Everitt
59a111de39
Invite our lord and savior emperror back to the table 2020-12-15 21:56:53 -08:00
Dane Everitt
c0a641247b
Different handling of errors on routes; push towards using middleware 2020-12-15 21:53:34 -08:00
Dane Everitt
057cdbd927
Use the underlying error 2020-12-15 21:14:20 -08:00
Dane Everitt
0ecc166dcd
Update error reporting middleware 2020-12-15 21:08:00 -08:00
Dane Everitt
3a26a5d39d
Convert all filesystem error types into the same Error struct 2020-12-15 20:51:13 -08:00
Dane Everitt
9ae75a399b
Update middleware.go 2020-12-15 20:20:47 -08:00
Dane Everitt
01b766dacc
Remove dupe 2020-12-15 20:20:22 -08:00
Dane Everitt
904e0a574d
Merge branch 'develop' of https://github.com/pterodactyl/wings into develop 2020-12-15 20:20:16 -08:00
Dane Everitt
acd6dc62d0
Update middleware logic 2020-12-15 20:19:09 -08:00
Caleb
8f26c31df6
Support downloading remote files to a server via the API
Co-authored-by: Dane Everitt <dane@daneeveritt.com>
2020-12-15 19:59:18 -08:00
Matthew Penner
e936f22419 Tweaks to server transfer logging 2020-12-11 17:24:35 -07:00
Dane Everitt
73f1399e47
Don't expect double-encoded values here 2020-12-08 21:24:31 -08:00
Dane Everitt
bcf0c72e47
Correctly report errors to admin users over the websocket; closes pterodactyl/panel#2709 2020-12-06 15:10:08 -08:00
Matthew Penner
169e8b8f8b Fix chmod endpoint mode value 2020-11-29 13:48:15 -07:00
Matthew Penner
c6e2889075 Fix chmod endpoint 2020-11-29 13:44:28 -07:00
Matthew Penner
f62f714863 Add chmod endpoint to server files 2020-11-29 13:07:45 -07:00
Dane Everitt
97345123ce
Merge branch 'develop' of https://github.com/pterodactyl/wings into develop 2020-11-29 11:48:03 -08:00
Dane Everitt
8aa9105ed3
Make paths lowercase for cert serving; closes pterodactyl/panel#2745 2020-11-29 11:47:52 -08:00
Matthew Penner
e8088f85d0 Lets not try to log the server ID twice 2020-11-29 12:35:02 -07:00
Matthew Penner
0c8476c79b Cleanup router/router_transfer.go 2020-11-29 12:33:44 -07:00
Matthew Penner
a7a66e8bc0 Notify panel of failed archive generation when transferring a server 2020-11-29 12:31:54 -07:00
Matthew Penner
65a861a9b6 Remove temporary transfer archives; closes https://github.com/pterodactyl/panel/issues/2742 2020-11-28 17:00:52 -07:00
Matthew Penner
de51fd1c51
Error handling improvements (#71)
* Remove `emperror.dev/errors`, remove all `errors#Wrap` and `errors#WithStack` calls
* Improve logging in `server/backup.go`
2020-11-28 16:57:10 -07:00
Matthew Penner
73b221d022 Switch old Server#GetState() calls over to Server#Environment#State() 2020-11-20 14:35:29 -07:00
Dane Everitt
20ece60a72
Fix files not being editable correctly in the panel; closes pterodactyl/panel#2679 2020-11-08 17:06:40 -08:00
Dane Everitt
68bdcb3cbc
Fix error handling and get tests back to working 2020-11-08 15:15:39 -08:00
Dane Everitt
be9d1a3986
Replace error handling package with emperror; add better reporting for errors escaping server root 2020-11-08 13:52:20 -08:00
Dane Everitt
a74be8f4eb
configurable socket log count; closes pterodactyl/panel#2659 2020-11-06 20:56:21 -08:00
Dane Everitt
af9ed4bff1
less weird log message 2020-11-03 21:02:10 -08:00
Dane Everitt
08d1efb475
Support denying a JWT JTI via the API 2020-11-03 21:01:50 -08:00
Dane Everitt
65664b63e7
Add support for denying JWT JTI's that are generated before a specific time 2020-11-03 20:33:33 -08:00
Dane Everitt
384b9a3c28
Correctly report errors when uploading files 2020-11-01 16:33:02 -08:00
Dane Everitt
334b3e8d10
Refactor HTTP endpoints to be less complicated and follow better standards 2020-10-31 10:04:20 -07: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
9b7c0fb7f3
Steal tests from other branch that is being discarded, attempt to get at least one of them to pass; WIP 2020-09-30 21:46:32 -07:00
Dane Everitt
0f7bb1a371
Refactor filesystem to not be dependent on a server struct 2020-09-27 12:24:08 -07:00
Dane Everitt
de30e2fcc9
Dont attempt to get size within archive process, will return empty; ref pterodactyl/panel#2420
The stat call is operating against an unflushed file if called in the archive function, so you'll just get the emtpy archive size, rather than the final size.

Plus, we only used the file stat in one place, so slight efficiency win?
2020-09-27 11:16:38 -07:00
Dane Everitt
a0fa5a94b6
Support websocket event to send server stats; ref pterodactyl/panel#2414 2020-09-27 09:46:00 -07:00
Dane Everitt
3655b172f3
Send JWT errors as specific event type 2020-09-27 09:09:34 -07:00
Dane Everitt
4748d7cb29
Don't spam errors to the output if attempting to send a command to an unattached starting instance; closes pterodactyl/panel#2385 2020-09-26 17:35:11 -07:00
Dane Everitt
62d0c7fa24
Mask errors from websocket being closed; closes pterodactyl/panel#2387 2020-09-26 16:10:32 -07:00
Dane Everitt
0b9ad3de05
More file size confirmations before performing some actions; closes pterodactyl/panel#2420 2020-09-26 16:02:41 -07:00
Dane Everitt
fb24ad58b4
Don't allow a reinstall while server is processing a power action; closes pterodactyl/panel#2409 2020-09-25 20:03:04 -07:00
Dane Everitt
ae5005baa3
Don't log disk space errors 2020-09-25 20:02:38 -07:00
Dane Everitt
2cc06e0528
closes pterodactyl/panel#2413 2020-09-25 19:23:31 -07:00
Dane Everitt
bf1233def4
Don't ignore disk space limits when copying/archiving; closes pterodactyl/panel#2400 2020-09-24 21:18:10 -07:00
Matthew Penner
1a3ba9efca Better handle readdirent errors 2020-09-24 21:48:59 -06:00
Dane Everitt
897c4869de
Return a nicer error if the file name is too long; closes pterodactyl/panel#2403 2020-09-24 20:02:42 -07:00
Dane Everitt
522c6c17e4
Merge branch 'develop' of https://github.com/pterodactyl/wings into develop 2020-09-22 20:41:16 -07:00
Dane Everitt
d8cd8ae36a
Don't treat certain "expected" errors from the filesystem as 500 errors; closes pterodactyl/panel#2376 2020-09-22 20:41:14 -07:00
Matthew Penner
ff597672db Fix #2380 2020-09-20 12:51:12 -06:00
Dane Everitt
6b25ac3665
Fix websocket error spam; only send known JWT issues along to the socket itself, not to wings console; closes pterodactyl/panel#2354 2020-09-17 20:30:51 -07:00
Dane Everitt
6ba1b75696
Add console throttling; closes pterodactyl/panel#2214 (#60) 2020-09-17 20:13:04 -07:00
Dane Everitt
ce76b9339e
better error handling for busy files; closes pterodactyl/panel#2332 2020-09-15 19:53:00 -07:00
Dane Everitt
f2a6d6b3c5
Websocket cleanup 2020-09-12 22:12:23 -07:00
Dane Everitt
ce2659fdd7
Simplify environment creation for server 2020-09-12 21:48:04 -07:00
Dane Everitt
d02e37620d
Use workerpools to enforce FIFO without blocking other topics 2020-09-12 20:13:59 -07:00
Dane Everitt
4ac19bd29d
Refactor confusing & fragile event bus logic to use callbacks and not channels; ref pterodactyl/panel#2298 2020-09-12 09:26:17 -07:00
Dane Everitt
fa6f56caa8
Remove pointless debug log 2020-09-11 23:18:51 -07:00
Dane Everitt
5a62f83ec8
Don't run pre-boot actions if the server is already running 2020-09-11 23:11:57 -07:00
Dane Everitt
b2eebcaf6d
Fix deadlocks in event listener system; closes pterodactyl/panel#2298
Fixes deadlocks that occurred when events were registered while other events were being unsubscribed and data was being flooded to these listeners. A complete mess, I hate this code, it is going to break again, but jesus I'm so tired.
2020-09-11 23:01:54 -07:00
Matthew Penner
45bcb9cd68 Lets not attempt to pull 16384 log lines 2020-09-11 22:52:07 -06:00
Matthew Penner
e10844d32c Fix problems with CORS and websocket allowed origins 2020-09-10 21:08:00 -06:00
Dane Everitt
a31e805c5a
Return 400 error not 304 when bad data is passed 2020-09-09 21:12:06 -07:00
Matthew Penner
a81146d730
Potential fix for console becoming unresponsive (#55)
* Potentially fix console logs not being pulled after a server has been running for a while

* Add container_id to resource polling debug logs
2020-09-07 13:04:56 -07:00
Matthew Penner
7ba32aca84 Fix some typos and run gofmt on all .go files 2020-09-05 13:08:40 -06:00
Dane Everitt
d99225c0fb
Add additional logging around resource polling 2020-09-03 21:19:06 -07:00
Dane Everitt
70afbbfc68
Remove last zap references 2020-09-03 20:29:53 -07:00
Dane Everitt
481df3d543
Only create the directory structure if it is a file being renamed; closes pterodactyl/panel#2292 2020-08-31 21:02:06 -07:00
CyberKitsune
d742acf308
Minimize blocking in Filesystem.getCachedDiskUsage (#53) 2020-08-31 20:27:41 -07:00
Dane Everitt
5f1d9ff151
Don't throw a 500 error if the backup is missing; closes pterodactyl/panel#2280 2020-08-31 20:24:07 -07:00
Dane Everitt
7d084e3049
Correctly return the suspension status of the server 2020-08-30 09:54:33 -07:00
Dane Everitt
7d8710824c
Fix startup variables not being properly updated on server reboot; closes pterodactyl/panel#2255 2020-08-27 21:08:33 -07:00
Dane Everitt
09826fc7ad
Performance improvements by using a smaller buffer size 2020-08-23 17:18:40 -07:00
Dane Everitt
4d3a860604
Use environment namespace for power state, don't duplicate them across server 2020-08-19 18:58:48 -07:00
Dane Everitt
b9fb922e91
Fix the race condition where the race is actually happening 2020-08-18 21:46:17 -07:00
Dane Everitt
cc52954a2a
Refactor environment handling logic to separate a server from the environment handler itself
This change makes the environment handling logic execute independent of the server itself and should make it much easier for people to contribute changes and additional environment handlers down the road without polluting the server object even more.

There is still a lot of work to do on this front to make things easier to work with, and there are some questionable design decisions at play I'm sure.

Welcome to additional modifications and cleanup to make this code easier to reason about and work with.
2020-08-10 21:38:42 -07:00
Dane Everitt
9d350d845f
Merge branch 'develop' of https://github.com/pterodactyl/wings into develop 2020-08-01 16:53:28 -07:00
Dane Everitt
8b0b40e377
Update router_server_files.go 2020-08-01 16:53:14 -07:00
Dane Everitt
fef3b001c1
Merge pull request #44 from pterodactyl/feature/file-uploads
Add a upload file endpoint
2020-08-01 15:35:28 -07:00