Commit Graph

116 Commits

Author SHA1 Message Date
Arnaud Lier
934bf2493d
fix: properly use base2 (1024, *bibyte) when calculating memory limits (#190) 2024-06-29 12:34:20 -06:00
Daniel Barton
29e4425e21
fix: overhaul docker container termination signals (#192)
Fixes https://github.com/pterodactyl/panel/issues/4783

Requires https://github.com/pterodactyl/panel/pull/5132 to work
2024-06-29 12:31:36 -06:00
Matthew Penner
639ad76be3
go: update dependencies 2023-03-07 15:36:35 -07:00
Matthew Penner
9b8b3c90fb
environment(docker): improve logging and stacks 2023-01-17 11:47:27 -07:00
Matthew Penner
2fd0edbff9
environment(docker): fix timeout when sending a stop signal
Previously, Docker would terminate the container when it's stop
configuration was configured to send a signal to the container.
This was due to Docker's API wanting the value as a duration string
(`1s`) rather than a number, so our value of `-1` was being formatted
to `0s` rather than `-1s` like we needed.

Closes https://github.com/pterodactyl/panel/issues/4555
2022-11-21 15:06:38 -07:00
Matthew Penner
1457470fff
environment(docker): fix outgoing ip not changing
Fixes an issue where when a server has it's primary allocation
changed, the outgoing ip is not updated on the Docker network.

The only downside of this change is old networks are not cleaned up.

Closes https://github.com/pterodactyl/panel/issues/4547
2022-11-21 14:59:53 -07:00
Matthew Penner
3337362955
environment(docker): fix podman compatibility (#151) 2022-11-06 13:33:01 -07:00
Cubxity
5a760a0dcc
Add customizable container labels (#146) 2022-10-16 17:17:27 -06:00
Matthew Penner
058f643e65
chore: reformat code 2022-10-06 09:58:42 -06:00
argetlam-coder
0637eebefe
docker: add configuration for user namespace remapping (#121) 2022-10-04 18:12:13 -06:00
Matthew Penner
b6edf3acf9
environment(docker): set outgoing ip correctly (#135)
Closes https://github.com/pterodactyl/panel/issues/3841
2022-09-25 18:49:48 -06:00
Michael
204a4375fc
Make the Docker network MTU configurable (#130) 2022-07-09 18:08:52 -04:00
DaneEveritt
203a2091a0
Use the correct CPU period when throttling servers; closes pterodactyl/panel#4102 2022-05-30 17:45:41 -04:00
DaneEveritt
6c98a955e3
Only set cpu limits if specified; closes pterodactyl/panel#3988 2022-05-07 15:23:56 -04:00
Matthew Penner
3a738e44d6
run gofumpt 2022-02-23 15:02:19 -07:00
Dane Everitt
cd67e5fdb9 Fix logic for context based environment stopping
Uses dual contexts to handle stopping using a timed context, and also terminating the entire process loop if the parent context gets canceled.
2022-01-31 19:09:08 -05:00
Dane Everitt
84bbefdadc Pass a context through to the start/stop/terminate actions 2022-01-31 18:40:15 -05:00
Dane Everitt
1e52ffef64 Fix panic condition when no response is returned 2022-01-31 18:37:02 -05:00
Dane Everitt
7ee6c48fb0 Use a more efficient logging format for containers
JSON has a huge amount of overhead from Docker when we're trying to process large amounts of log data. It makes more sense to just use a better format.
2022-01-30 19:51:23 -05:00
Dane Everitt
c4ee82c4dc Code cleanup, providing better commentary to decisions 2022-01-30 12:56:25 -05:00
Matthew Penner
136540111d
docker: attach to container before starting 2022-01-24 19:01:33 -07:00
Dane Everitt
34ecf20467
Re-implement ContainerInspect call in Wings to use more performant json encoder (#119)
* First pass at re-implementing the Docker inspect call to use more efficient json parser

* Improve logic
2022-01-23 14:13:49 -08:00
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