Commit Graph

94 Commits

Author SHA1 Message Date
Dane Everitt
34c0db9dff Replace encoding/json with goccy/go-json for cpu and memory usage improvement
This new package has significant better resource usage, and we do a _lot_ of JSON parsing in this application, so any amount of improvement becomes significant
2022-01-23 15:17:40 -05:00
Noah van der Aa
13a9ee9474
Use GID from config for container (#106) 2022-01-19 17:05:53 -08:00
Matthew Penner
649dc9663e
Server Event Optimizations (#116) 2022-01-17 20:23:29 -07:00
Matthew Penner
1892b270b1
environment: allow overriding memory overhead; closes pterodactyl/panel#3728 (#111) 2022-01-17 20:20:30 -07:00
Matthew Penner
04b9ef69a1
run gofumpt 2021-11-15 10:37:56 -07:00
Dane Everitt
d9ebf693e0 Make uptime available in the stat output for a container 2021-10-03 12:59:03 -07:00
Dane Everitt
ee91224eb6 add context timeouts to avoid hanging wings boot process if docker has a hiccup; closes pterodactyl/panel#3358 2021-09-11 14:13:19 -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
8336f6ff29 Apply container limits to install containers, defaulting to minimums if the server's resources are set too low 2021-06-20 17:21:51 -07:00
Dane Everitt
e0078eee0a [security] enforce process limits at a per-container level to avoid abusive clients impacting other instances 2021-06-20 16:54:00 -07:00
Dane Everitt
da74ac8291 Trim "~" from container prefix; closes pterodactyl/panel#3310 2021-05-02 11:00:10 -07:00
Dane Everitt
4c3b497652 Better error handling and reporting for image pull errors 2021-04-03 12:52:32 -07:00
Dane Everitt
5f5b2bc84e Quick little code cleanup and adding some commentary 2021-03-07 17:31:45 -08:00
Dane Everitt
37c6b85489 Don't throw back errors on termination if the container doesn't exist; closes pterodactyl/panel#3149 2021-03-07 17:24:45 -08:00
Dane Everitt
0919fb2da6 Improve error handling and reporting for server installation & process boot 2021-03-03 20:56:18 -08:00
Dane Everitt
bfff094216
Get wings booting properly 2021-02-01 21:32:34 -08:00
Dane Everitt
98c68142cd
Remove all of the remaining API logic and port it all to the remote.Client type 2021-02-01 21:28:46 -08:00
Dane Everitt
ba6cec9615
Merge branch 'dane/backup-restore' into develop 2021-01-30 18:51:35 -08:00
Dane Everitt
225f8aa904
Support some additional signal types for stopping a server; ref pterodactyl/panel#3042 2021-01-28 21:26:02 -08:00
Dane Everitt
f7788e10a0
Fix broken error handling when creating network 2021-01-21 20:46:15 -08:00
Dane Everitt
bcca2550d1
Fix broken error handling when creating network 2021-01-21 20:45:56 -08:00
Dane Everitt
5021ea6a86
Code cleanup unrelated to changes for backup restoration 2021-01-18 21:27:00 -08:00
Dane Everitt
05c04c4350
Update remaining logic using viper 2021-01-14 20:19:28 -08:00
Dane Everitt
80faea3286
yoink viper back out of code, simplify some config logic 2021-01-14 20:11:01 -08:00
Dane Everitt
9480ccdbba
Initial WIP logic to handle loading configuration from the disk using viper 2021-01-12 21:14:57 -08:00
Jakob Schrettenbrunner
648072436f organize imports with gopls format 2021-01-10 01:22:39 +00:00
Dane Everitt
044c46fc9a
Merge branch 'develop' of https://github.com/pterodactyl/wings into develop 2021-01-08 21:21:37 -08:00
Dane Everitt
c9d972d544
Revert usage of ContainerWait, return to io.Copy blocking
Until https://github.com/moby/moby/issues/41827 is resolved this code causes chaos to unfold on machines and causes servers to be non-terminatable.

This logic was intially changed to logical purposes, but this io.Copy logic works perfectly fine (even if not immediately intuitive).
2021-01-08 21:21:09 -08:00
Matthew Penner
0aab4b1ac2 environment(docker): re-attach to container logs after EOF 2021-01-08 08:19:33 -07:00
Matthew Penner
4f4b4fd2e6 environment(docker): cleanup code 2021-01-08 08:15:40 -07:00
Matthew Penner
66c9be357c Potential fix for servers being marked as stopping after being marked as offline 2021-01-07 19:32:15 -07:00
Dane Everitt
1937d0366d
cleanup; fix environment stats not reporting network TX correctly 2021-01-06 20:47:44 -08:00
Dane Everitt
963a906c30
Less obtuse logic for polling resource usage when attaching a container 2021-01-06 20:36:29 -08:00
Matthew Penner
a4c8b8714b Bump all dependencies 2020-12-27 11:49:08 -07:00
Dane Everitt
1ba3631cc1
Don't follow if there is an error 2020-12-25 17:09:35 -08:00
Dane Everitt
94d41bc1f5
Use the system.ScanReader function to replace this logic 2020-12-25 17:07:57 -08:00
Dane Everitt
a4c68eed16
Use sync.Once here to instantiate the event handler 2020-12-25 17:07:40 -08:00
Dane Everitt
59c30c2842
Fix use of atomics in codebase 2020-12-25 17:04:18 -08: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
3495fb1c76
Less racey logic for resource usage 2020-12-16 22:03:35 -08:00
Dane Everitt
59a111de39
Invite our lord and savior emperror back to the table 2020-12-15 21:56:53 -08:00
Yannick Schinko
c253a4bac0
Explictily disable log compression
Log compression is only relevant when `max-file` is 2 or higher.

Older versions of docker (Docker version 19.03.14, build 5eb3275d40 for example (currently the latest version on Debian 9)) error out when compression is enabled in the ``/etc/docker/daemon.json`` file:

```
Error response from daemon: failed to initialize logging driver: compress cannot be true when max-file is less than 2 or max-size is not set
```

While newer docker versions just don't care setting this explicitly to false like in ``intsall.go``, it doesn't hurt being explicit here:

de51fd1c51/server/install.go (L481-L485)
2020-12-12 00:51:11 +01:00
TortleWortle
da4c542724 Update allocations.go 2020-12-02 14:27:37 +01:00
Tortle
e7d93a5248
Update allocations.go 2020-12-01 23:03:05 +01:00
Tortle
51aa4c73cd
Update allocations.go 2020-12-01 21:20:01 +01:00
Tortle
4a7510d36f
Allow multiple publishing on multiple interfaces on same port.
Fixes the issue where you cannot have multiple ip addresses on the same port for a server.
2020-12-01 20:43:40 +01: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
Dane Everitt
e2872e786e
Tiny optimization for handling string output from server console 2020-11-12 21:41:35 -08:00
Dane Everitt
672fb860ea
Don't add a stack for deadline exceeded when terminating 2020-11-12 20:50:15 -08:00