Dane Everitt
9f985ae044
Check for error before prefix; fixes abandoned routine; closes pterodactyl/panel#3911
...
Due to the order of the previous logic in ScanReader, an error not caused by EOF would effectively get ignored since an error will always be returned with `isPrefix` equal to false, thus triggering the first break, and error checking is not performed beyond that point.
Thus, canceling an installation process for a server while this process was running would hang the routine and cause the loop to run endlessly, even with a canceled context.
2022-02-05 11:56:17 -05:00
Dane Everitt
0f2e9fcc0b
Move the sink pool to be a shared tool
2022-02-02 19:16:34 -05: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
a4904365c9
Sink pool cleanup and organization; better future support when we add more sinks
2022-01-23 09:57:25 -05:00
Matthew Penner
649dc9663e
Server Event Optimizations ( #116 )
2022-01-17 20:23:29 -07:00
Matthew Penner
04b9ef69a1
run gofumpt
2021-11-15 10:37:56 -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
49dd1f7bde
Better support for retrying failed requests with the API
...
Also implements more logic error returns from the Get/Post functions in the client, rather than making the developer call r.Error() on responses.
2021-05-02 15:41:02 -07:00
Matthew Penner
471886dd34
internally mark if a server is restoring to restrict actions
2021-03-12 16:19:35 -07:00
Dane Everitt
2eb721bbe7
Merge branch 'dane/api-cleanup' into develop
2021-02-23 21:25:10 -08:00
Matthew Penner
5c56ddf5d6
fs: only mkdir and chown if not exists
2021-02-10 13:58:47 -07: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
5d070cbdc5
Handle edge case where a user triggers an install when the server has no data directory
2021-01-21 20:58:52 -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
Jakob Schrettenbrunner
648072436f
organize imports with gopls format
2021-01-10 01:22:39 +00:00
Matthew Penner
a4c8b8714b
Bump all dependencies
2020-12-27 11:49:08 -07:00
Dane Everitt
22c53c365a
Fix installer to not explode on long lines; closes pterodactyl/panel#2773
2020-12-25 17:05:01 -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
59a111de39
Invite our lord and savior emperror back to the table
2020-12-15 21:56:53 -08: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
40c70673cd
Use registry authentication when pulling install image, fixes https://github.com/pterodactyl/panel/issues/2589
2020-11-20 14:36:29 -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
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
944d381778
Improve server state logical handling; allow setting state directly on the environment
2020-11-06 21:53:00 -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
c031d37b91
Use single call to create/return the docker client
2020-10-17 14:04:56 -07:00
Jakob
e185f597ba
add version negotiation to server install docker client
2020-10-17 21:41:01 +02:00
Keyton Stanier
b92fab83c8
Removed stray .
in ./mnt/install
2020-10-01 18:00:26 -04:00
Dane Everitt
0f7bb1a371
Refactor filesystem to not be dependent on a server struct
2020-09-27 12:24:08 -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
c69a0bb107
Don't run install scripts if disabled; closes pterodactyl/panel#2265
2020-08-30 09:41:14 -07:00
Dane Everitt
7aaa51a14f
Less random temp dir locations; cleanup when done
2020-08-23 20:45:07 -07:00
Dane Everitt
09826fc7ad
Performance improvements by using a smaller buffer size
2020-08-23 17:18:40 -07:00
Dane Everitt
37fbae0fcd
closes #2241
2020-08-23 14:18:59 -07:00
Dane Everitt
ebc0e82772
Handle errors during the before install process a little better
2020-08-23 14:07:03 -07:00
Dane Everitt
9d2321f357
Correctly set the server state on install; closes pterodactyl/panel#2236
2020-08-19 19:08:15 -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
cf1c671e68
Support changing the /tmp volume size in the config
2020-08-12 20:38:02 -07:00
Matthew Penner
234fbfa8ec
Fix servers getting marked as Stopping when they should be Offline
2020-08-04 17:19:13 -06:00
Dane Everitt
7f9ec4402a
Add emitters for install started/stopped
2020-07-29 21:39:27 -07:00
Dane Everitt
db0dc17937
Fix exception when writing install logs
2020-07-29 20:54:15 -07:00
Dane Everitt
cb850fd81a
Update all of the old UUID refs to new
2020-07-19 17:53:41 -07:00
Dane Everitt
ea2630946a
Sync server state with Panel before performing installation to ensure information is up to date
2020-06-30 20:56:55 -07:00
Dane Everitt
79a582a5f2
Generate a nicer install log with more detailed information
2020-06-30 20:45:36 -07:00
Dane Everitt
1f6789cba3
Acquire exclusive lock when installing a server
...
Also allows aborting a server install mid-process when the server is deleted before the process finishes.
2020-06-22 21:38:16 -07:00