Commit Graph

549 Commits

Author SHA1 Message Date
Dane Everitt
001bbfad1b
avoid panic from environment; ref pterodactyl/panel#2307 2020-09-07 15:37:35 -07:00
Dane Everitt
5bead443ad
Handle port bindings correctly when using 127.0.0.1
closes pterodactyl/panel#2307
2020-09-07 15:33:47 -07:00
Dane Everitt
d743d8cfeb
Merge pull request #54 from cyberkitsune/fast-unlimited-disk
Speed up server power on for servers with unlimited size
2020-09-07 13:05:37 -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
490f874128
Prevent bungee output breaking my CLI output...
Theres enough magic ANSI codes in here to kill a horse... this also causes logging ouput to get truncated
2020-09-03 21:18:55 -07:00
CyberKitsune
1d22e84f21 Allow a stale value on startup for disk size if the disk is unlimited. 2020-08-31 22:10:57 -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
Dane Everitt
cbf914e7a1
Additional code cleanup for #53 2020-08-31 20:46:28 -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
c69a0bb107
Don't run install scripts if disabled; closes pterodactyl/panel#2265 2020-08-30 09:41:14 -07:00
CyberKitsune
f1343c1d77 Publish console message on initial startup for disk sizing 2020-08-29 19:45:47 -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
711ee2258c
Minimize code duplication for environment variables; ref pterodactyl/panel#2255 2020-08-27 20:28:29 -07:00
Dane Everitt
0dde54fc8f
Don't blow up if a file gets removed during the backup 2020-08-27 19:57:35 -07:00
Dane Everitt
0e474c8b24
Better error captures 2020-08-27 19:57:22 -07:00
Dane Everitt
68ab705aac
Don't push directories into the backup unless associated with a file 2020-08-27 19:55:43 -07:00
Dane Everitt
a7ca6b2e34
Correctly report backup API errors; ref pterodactyl/panel#2271 2020-08-27 19:35:57 -07:00
Dane Everitt
5f1ceeff90
Add ability for users to disable checking file permissions when starting a server; closes pterodactly/panel#2272 2020-08-27 19:02:22 -07:00
Dane Everitt
c7e732d084
2.5 minutes for lookups, not every minute 2020-08-24 20:52:05 -07:00
Dane Everitt
9eb795b1bb
Re-add disk space function 2020-08-24 20:46:19 -07:00
Dane Everitt
a1288565f0
Significant CPU and syscall performance improvements when iterating large directories 2020-08-24 20:45:54 -07:00
Dane Everitt
f82c91afbe
Merge branch 'develop' of https://github.com/pterodactyl/wings into develop 2020-08-24 19:45:25 -07:00
Dane Everitt
b35ac76720
Optimizations to the filepath walker function to reduce CPU and I/O issues 2020-08-24 19:45:24 -07:00
Matthew Penner
9f27119044 Fix log directory not being created, again.. 2020-08-24 20:22:19 -06:00
Dane Everitt
7aaa51a14f
Less random temp dir locations; cleanup when done 2020-08-23 20:45:07 -07:00
Dane Everitt
3489088703
Update output from socket to use checksum 2020-08-23 18:06:17 -07:00
Dane Everitt
7287b8e198
Pass the checksum type along in the request 2020-08-23 17:52:46 -07:00
Dane Everitt
d1485d7c5f
Limit the number of threads to avoid pinning a host machine 2020-08-23 17:46:35 -07:00
Matthew Penner
08bcb31b9e Change compression level to BestSpeed and use sha1 instead of sha256 2020-08-23 18:34:48 -06:00
Dane Everitt
09826fc7ad
Performance improvements by using a smaller buffer size 2020-08-23 17:18:40 -07:00
Dane Everitt
999947e387
Adjust sizes on the fly when files are written/decompressed 2020-08-23 15:58:56 -07:00
Dane Everitt
3b33e803e3
Handle deleting a directory 2020-08-23 14:34:42 -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
1e39487240
poc: when deleting a file automatically adjust the current disk space being tracked in the cache 2020-08-22 22:56:44 -07:00
Dane Everitt
c73a53dbe3
Replace cache with single int64 2020-08-22 22:50:49 -07:00
Dane Everitt
138080d5e2
return success state of the backup from wings 2020-08-20 21:28:06 -07:00
Dane Everitt
43d8bd656a
Don't actually try to start a server that is already running 2020-08-19 19:20:46 -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
b9fb922e91
Fix the race condition where the race is actually happening 2020-08-18 21:46:17 -07:00
Dane Everitt
0fc1f300f8
Use helper func 2020-08-18 21:43:39 -07:00
Dane Everitt
60212bb08e
Fix race condition when booting wings 2020-08-18 21:42:57 -07:00
Dane Everitt
5b241fdf36
Correctly send stats & proc information back for servers 2020-08-18 21:38:42 -07:00
Dane Everitt
956e87eb93
Handle restarting correctly, ensure power state propagates correctly 2020-08-18 20:43:28 -07:00
Dane Everitt
4a2a0b25bb
Run chown when starting a server 2020-08-18 20:27:42 -07:00
Dane Everitt
a24a5466e5
Remove restart from environment, handle at a server level; also fix pre-boot logic 2020-08-13 21:36:23 -07:00
Dane Everitt
63c09adaa1
Better handling of stop & restart without releasing process locks too soon 2020-08-13 21:10:33 -07:00
Dane Everitt
5fcec86e98
Allow sending a termination signal even if another power action is being processed 2020-08-13 20:37:35 -07:00
Dane Everitt
cf1c671e68
Support changing the /tmp volume size in the config 2020-08-12 20:38:02 -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
919bec2f87
Dependency updates 2020-08-06 18:55:29 -07:00
Matthew Penner
ff7f92895c Fix race condition on startup 2020-08-05 21:13:01 -06:00
Dane Everitt
642e6e6a96
Different implementation of multi-check for done
Co-Authored-By: Matthew Penner <me@matthewp.io>
2020-08-04 21:29:43 -07:00
Matthew Penner
9bd10f1043 Changes to ProcessConfiguration 2020-08-04 21:41:09 -06:00
Matthew Penner
eb975e0cbd Add option to strip ansi colors and split the done line in egg startup configuration 2020-08-04 17:39:54 -06: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
a9c81f37b2
Code cleanup for server mounts; mount more timezone data; closes pterodactyl/panel#2073 2020-08-01 20:24:43 -07:00
Dane Everitt
834bcf251e
Avoid race conditions due to stream not being completely detached correctly 2020-08-01 15:34:14 -07:00
Dane Everitt
78c5fd219a
Remove use of semaphore while restarting; covered by changed power actions handling 2020-08-01 15:22:39 -07:00
Dane Everitt
177aa8e436
Refactor power handling logic to be more robust and able to handle spam clicking and duplicate power actions 2020-08-01 15:20:39 -07:00
Dane Everitt
ecb2cb05ce
Rewrite the file/dir chowing to be less intense on the system and use walker function 2020-07-31 22:06:00 -07:00
Dane Everitt
03ef52c0db
More use of workerpools for loading servers from the API 2020-07-31 21:40:43 -07:00
Dane Everitt
f889a193bf
Use NumCPU and not GOMAXPROCS 2020-07-31 21:31:53 -07:00
Dane Everitt
5366d0f652
Use a workerpool for configuration file updates
Co-Authored-By: Jakob <schrej@users.noreply.github.com>
2020-07-31 21:25:57 -07:00
Dane Everitt
38efb68e8a
Merge branch 'develop' of https://github.com/pterodactyl/wings into develop 2020-07-31 21:02:27 -07:00
Dane Everitt
cf33a2464a
Code cleanup for event listening and publishing
Co-Authored-By: Jakob <schrej@users.noreply.github.com>
2020-07-31 21:02:25 -07:00
Dane Everitt
cecc72110c
Merge pull request #46 from pterodactyl/feature/docker-repo-auth
Add Docker registry authentication
2020-07-31 20:27:35 -07:00
Dane Everitt
da26b4c5c7
Merge pull request #41 from pterodactyl/fix/race-1
Fix a possible race condition when Unsubscribing from the EventBus
2020-07-31 20:11:21 -07:00
Dane Everitt
5889d0585b
Merge pull request #45 from pterodactyl/fix/disk-usage
Force disk usage calculation when loading servers
2020-07-31 20:06:58 -07:00
Dane Everitt
8af26ac864
Merge pull request #43 from pterodactyl/impl/2194
Add the ability to define additional allowed origins
2020-07-31 20:04:10 -07:00
Matthew Penner
5b999db7f3 Add Docker registry authentication 2020-07-31 18:28:40 -06:00
Matthew Penner
afa6fb200e Force disk usage calculation when loading servers 2020-07-31 17:01:02 -06:00
Matthew Penner
b811d2474e Add the ability to define additional allowed origins 2020-07-31 16:19:09 -06:00
Matthew Penner
e85b1cecb7 Fix 500 errors on file routes when accessing a file that doesn't exist 2020-07-31 16:01:32 -06:00
Matthew Penner
5036077152 Hopefully fix a possible race condition when Unsubscribing from the EventBus while an event is being Published 2020-07-29 23:18:11 -06:00
Dane Everitt
373dbd355e
Better handling of subscribers to avoid a slice panic 2020-07-29 21:56:22 -07: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
5079c67aee
Code cleanup and avoid server race 2020-07-19 17:50:39 -07:00
Dane Everitt
e28c05ae56
Address some race conditions 2020-07-19 17:46:39 -07:00
Dane Everitt
21e58b57a1
Whoops, sync correctly 2020-07-19 17:26:53 -07:00
Dane Everitt
16467fa7ff
Code cleanup 2020-07-19 17:09:38 -07:00
Dane Everitt
0cbaad5c72
Completely re-work the server configuration to be separated out better 2020-07-19 16:27:55 -07:00
Dane Everitt
a00288aa64
Require a lock on the restart process to avoid double restarts causing unexpected behavior 2020-07-18 16:46:41 -07:00
Dane Everitt
8315ff8ae1
Misc mutex locking things to avoid data races 2020-07-18 16:03:25 -07:00
Dane Everitt
0b9d923d15
Allow the deletion of a file or directory that is a symlink pointing outside the data dir 2020-07-18 12:19:54 -07:00
Dane Everitt
f0eeaae747
Remove debugging 2020-07-18 11:58:55 -07:00
Dane Everitt
085a02726b
Handle path resolution errors better in the file walker 2020-07-18 11:57:50 -07:00
Dane Everitt
4f1b0c67d6
Address security vulnerabilities allowing certain internal processes to potentiallty escape server data directory 2020-07-18 11:40:38 -07:00
Dane Everitt
6e1844a8c9
Skip over when not exist 2020-07-18 10:54:37 -07:00
Dane Everitt
7c3da84248
chown the cleaned location, not the original path 2020-07-18 10:49:28 -07:00
Dane Everitt
1b5684e6f8
Make sure errors are handled 2020-07-18 10:47:15 -07:00
Dane Everitt
21303dc517
Address race conditions when booting a server process 2020-07-18 10:10:34 -07:00
Dane Everitt
daf682b991
Handle errors and cancel process when encountered 2020-07-16 22:18:47 -07:00
Dane Everitt
a72d6f3768
Make the walk processor act the same as Go's walker 2020-07-16 22:01:50 -07:00
Dane Everitt
d262c12b43
Less confusing waitgroup positioning 2020-07-16 21:53:05 -07:00
Dane Everitt
f3c8220bd9
Change filewalker implementation to use a pool 2020-07-16 21:51:31 -07:00
Dane Everitt
7e1b7e7f36
Prevent race conditions when generating archives 2020-07-16 19:56:53 -07:00
Dane Everitt
b2d34cf8e7
Don't cause a race condition 2020-07-15 21:35:40 -07:00
Dane Everitt
a635cdd6b2
Support unarching in a better fashion with zip-slip protections and size checking 2020-07-15 21:16:08 -07:00
Dane Everitt
ae46add8ef
Remove unnecessary logic 2020-07-15 19:24:13 -07:00
Matthew Penner
f4c10e5a23 Add some missing error handling, fix a few typos 2020-07-15 13:11:12 -06:00
Matthew Penner
b64f1897fb Add endpoint for decompressing archives 2020-07-15 12:28:45 -06:00
Matthew Penner
a98e376593 Calculate disk usage even if server has 'unlimited' disk space 2020-07-12 12:28:38 -06:00
Dane Everitt
eefc11bd0d
Remove accidental debug line 2020-07-12 10:26:26 -07:00
Dane Everitt
b3eba78743
Merge pull request #21 from pterodactyl/feature/server-mounts
Add configurable server mounts
2020-07-11 17:19:51 -07:00
Dane Everitt
233cefd129
Fix renaming to correctly create the base files if missing 2020-07-11 16:19:51 -07:00
Dane Everitt
c1e591c99b
Support generating a compressed archive for a server via the API 2020-07-11 13:13:49 -07:00
Matthew Penner
93228933bf
Merge branch 'develop' into feature/server-mounts 2020-07-11 12:32:34 -06:00
Matthew Penner
f7948939eb Log if a mount isn't allowed 2020-07-04 16:20:58 -06:00
Matthew Penner
f3419495cd Get the logger to log the cleaned mount paths as well 2020-07-04 15:38:50 -06:00
Matthew Penner
9f95efa3ae Clean the source and target paths when adding a mount 2020-07-04 15:37:52 -06:00
Matthew Penner
3a6050446f Add AllowedMounts configuration option, block any custom mounts if they are not in the AllowedMounts list 2020-07-04 15:32:53 -06:00
Matthew Penner
63e7bde39c
Merge branch 'develop' into feature/server-mounts 2020-07-04 15:17:59 -06:00
Matthew Penner
d339996b4e Tweaks to environment_docker.go, change container hostnames to use the server's uuid, add Domainname option 2020-07-04 15:14:22 -06:00
Dane Everitt
65809b5731
Don't crash when passing in an environment variable that isn't a string value 2020-07-02 20:32:17 -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
Dane Everitt
073247e4e1
Use 15 minute context timeout for pulling, not 10 seconds... closes #2130 2020-06-22 20:56:55 -07:00
Dane Everitt
a3d83d23bd
Don't try to send space available when loading from a configuration
Server is not always installed when this function is called, this will cause errors in those cases.
2020-06-22 20:52:23 -07:00
Dane Everitt
db31722cfc
Don't cause a double stacktrace on certain errors 2020-06-22 20:51:41 -07:00
Dane Everitt
7d4a8d7f7e
Update everything expect transfers & sftp to not use zap 2020-06-13 10:40:26 -07:00
Dane Everitt
198a22f446
Replace even more zap occurences 2020-06-13 10:26:35 -07:00
Dane Everitt
0ae286d617
Correctly handle empty values from the API requests; mergo by default thinks these "empty" values should be skipped 2020-05-31 12:42:10 -07:00
Dane Everitt
62e5547c6d
Merge pull request #32 from pterodactyl/issue/1796
Send disk usage when server is offline
2020-05-31 10:54:21 -07:00
Dane Everitt
f8bffd8391
Start the process of migrating from zap to a cleaner CLI output for logs 2020-05-28 22:07:53 -07:00
Dane Everitt
4b366ae19e
Don't cause a crash loop when part of the pre-server-boot process fails 2020-05-28 19:53:12 -07:00
Dane Everitt
54510057bb
Don't block server boot if there is an error pulling an image
Obviously this requires the image to exist locally, but should avoid widespread issues when Quay inevitably goes down again.

closes pterodactyl/panel#2076
2020-05-28 19:26:41 -07:00
Matthew Penner
74097cc4ad Fix sending status event to all subscribers, send disk usage when server is offline 2020-05-22 11:01:27 -06:00
Matthew Penner
4483bfa2aa Make mounts not get overridden when a server is updated 2020-05-21 15:13:27 -06:00
Matthew Penner
662eb17241 Pass server mounts into docker 2020-05-21 14:53:00 -06:00
Dane Everitt
276bd2be33
Don't quote environment variables; it is not needed in docker for this; closes pterodactyl/panel#2030 2020-05-17 17:06:01 -07:00
Dane Everitt
3fe884670d
Fix handling of files with special characters and spaces
closes pterodactyl/panel#2040
closes pterodactyl/panel#2038
2020-05-17 15:07:11 -07:00
Dane Everitt
804f3d5ca9
Always clean up the installer containers, even if there is an error during the process; closes pterodactyl/panel#2015 2020-05-09 19:57:29 -07:00
Dane Everitt
0bd28a4480
Cleanup S3 support; send actual backup details in response 2020-05-09 19:24:30 -07:00
Kawaii Neko Lolis
cfca0d7f07 Added network option to docker configuration 2020-05-10 03:29:56 +02:00
Dane Everitt
d178a0d96b
Don't fail deletion if container doesn't exist; closes pterodactyl/panel#2001 2020-05-09 17:16:41 -07:00
Dane Everitt
483b652087
Report memory stats using the same logic that docker uses for stats output; avoid extreme differences in output 2020-05-08 22:06:26 -07:00
Dane Everitt
ffd7357a1c
Calculate memory swap using the same memory overhead values as the hard cap; pterodactyl/panel#2000 2020-05-08 20:57:00 -07:00
Dane Everitt
b36f0de337
Remove dead code 2020-05-08 20:23:35 -07:00
Dane Everitt
b2cf222a3a
@DaneEveritt Guard against a nil-pointer if the container is not found; references pterodactyl/panel#2000 2020-05-08 20:19:44 -07:00
Dane Everitt
ced8a5bcbd
Formatting update 2020-05-08 20:16:16 -07:00
Dane Everitt
7bba1d4fd6
I guess this error could happen? Just return a crash state and let wings figure it out; closes #2003 (I hope?) 2020-05-07 21:08:06 -07:00
Dane Everitt
2e055cf630
Unsubscribe any open event listeners when deleting a server 2020-05-03 21:30:16 -07:00
Dane Everitt
ac011214f7
Ensure the temp directory exists before trying to make a directory in it 2020-05-03 21:04:16 -07:00
Dane Everitt
b2797ed292
Abstract out shared backup functionality 2020-05-02 15:02:02 -07:00
Dane Everitt
507d0100cf
Hilariously rough code to get a backup pushed into S3 2020-04-26 17:20:26 -07:00
Dane Everitt
91d12ab9a7
More abstract support for backups & misc code cleanup in that area 2020-04-26 16:43:18 -07:00
Dane Everitt
1e2da95d26
Support data coming from the panel better 2020-04-26 16:21:58 -07:00
Dane Everitt
b2f6863399
Set memory overheads higher than the limit so that hard crashes are less likely 2020-04-25 18:20:20 -07:00
Dane Everitt
7321fe1421
Make DNS settings for containers configurable, closes #1965 2020-04-25 12:18:18 -07:00
Dane Everitt
6395b8b56c
Support for .pteroignore files when generating backups 2020-04-19 19:52:19 -07:00
Dane Everitt
df6d98bbda
Add support for ignoring directories/files; fix compression of archives 2020-04-18 23:26:23 -07:00
Dane Everitt
8eaf590f78
Include full path to file in callback 2020-04-18 18:59:10 -07:00
Dane Everitt
3bca54655b
Adjust callback to support continuing or stopping at current depth 2020-04-18 18:51:19 -07:00
Dane Everitt
9dcf06d106
Merge branch 'develop' of https://github.com/pterodactyl/wings into develop 2020-04-18 15:31:37 -07:00
Dane Everitt
71d38ff62e
Cleanup logic for getting a directory size; support cancelation during goroutine 2020-04-18 15:31:34 -07:00
Michael Parker
a60e261a49 fixes tmp dir building
adds a / to the tmp directory
2020-04-18 15:23:56 -04:00
Dane Everitt
4279fa510e
Cleanup data storage locations for daemon 2020-04-17 14:27:06 -07:00
Dane Everitt
4ff7bd2777
Abstract out more of the backup functionality 2020-04-17 13:46:36 -07:00
Dane Everitt
11035b561a
Break out the backup functions of the daemon in prep for S3 support 2020-04-13 22:01:07 -07:00
Dane Everitt
2bf293823f
Fix state handing logic 2020-04-12 17:43:16 -07:00
Dane Everitt
b73f78a832
Fix configuration parsing 2020-04-12 17:39:19 -07:00
Dane Everitt
083bea5504
Add support for modifying daemon configuration on-the-fly 2020-04-11 16:17:46 -07:00
Dane Everitt
03045c94be
Better race condition prevention 2020-04-10 18:22:18 -07:00
Dane Everitt
17d204a631
Little bit of code refactoring 2020-04-10 18:07:57 -07:00
Dane Everitt
af241f3de4
Code cleanup 2020-04-10 18:03:35 -07:00
Dane Everitt
c57708d1e0
Merge pull request #20 from matthewpi/issues/1899
Improved server loading
2020-04-10 17:37:45 -07:00
Matthew Penner
1f4aca8210 Fix issue with config file saving, fix issue with state file saving, fix issue when merging a uuid into a server without one 2020-04-10 17:55:36 -06:00
Dane Everitt
2220eb049c
Avoid race condition when listing a directory 2020-04-10 16:43:05 -07:00
Matthew Penner
4ea1b90560 Merge branch 'develop' into issues/1899 2020-04-10 17:27:39 -06:00
Dane Everitt
d3cbf96c57
Avoid race condition while calculating directory size of server 2020-04-10 16:14:04 -07:00
Matthew Penner
acf425b705 Add a lock to the states file 2020-04-10 16:37:10 -06:00
Matthew Penner
1e12b7b37c Remove server configurations files and add shared state file 2020-04-10 16:33:30 -06:00
Matthew Penner
28c8f3f400 Add the ability to fetch all servers, fix cpu usage leak again.. 2020-04-10 15:39:07 -06:00
Matthew Penner
e719c67e0b Removes SyncServersOnBoot configuration option and requires that servers are synced when the daemon boots 2020-04-10 12:16:04 -06:00
Matthew Penner
9e30d63818 Add debug logs when a non-500 error occurs, force sync the configuration during installation of a new server 2020-04-10 12:00:04 -06:00
Dane Everitt
33875105b6
Fix topic handling for websocket with namespace 2020-04-06 21:22:43 -07:00
Dane Everitt
222091b68c
Fire an event to the websocket when a backup is completed 2020-04-06 21:03:50 -07:00
Dane Everitt
45d441ac32
Check permissions when performing websocket actions 2020-04-06 21:03:39 -07:00
Dane Everitt
03311ecf03
Move over backup and create transfer logic 2020-04-05 19:07:16 -07:00
Dane Everitt
cf2ef1a173
Port most of the HTTP code over to gin 2020-04-05 18:00:33 -07:00
Dane Everitt
223b9e05a1
Merge pull request #16 from matthewpi/feature/server-transfers
Server Transfers (pterodactyl/panel#18)
2020-04-05 11:06:34 -07:00
Dane Everitt
4ad57af990
Support one-time downloads of server backups 2020-04-04 19:55:23 -07:00
Matthew Penner
0ca9c8a114 Delete the server's archive when the server is deleted 2020-04-04 18:31:18 -06:00
Matthew Penner
5693d0431e
Merge branch 'develop' into feature/server-transfers 2020-04-04 17:17:09 -06:00
Dane Everitt
4ce2b73490
Add first implementation of local backups for a server 2020-04-04 16:07:25 -07:00
Matthew Penner
6af3cb2c9b Get transfers 'fully' working, need to add fail request though 2020-04-04 16:15:49 -06:00
Matthew Penner
c096d8802f Add configurable ArchiveDirectory 2020-04-04 00:17:32 -06:00
Matthew Penner
3dba11ac6f Add ability to create archives of servers, add GET and POST /api/servers/:server/archive routes to get and request an archive of a server 2020-04-03 23:17:26 -06:00
Dane Everitt
019d028011
Add support for reinstalling a server 2020-04-03 13:43:13 -07:00
Dane Everitt
ddca34f9e8
Add support for defining specific threads for containers 2020-03-29 12:31:17 -07:00
Matthew Penner
8107532080 Revert style changes due to gofmt 2020-02-02 14:43:13 -07:00
Matthew Penner
07b1876954 Chown directories, not just files 2020-02-02 14:41:15 -07:00
Dane Everitt
ab54d2c416
Avoid triggering crash detection on container destroy 2020-01-19 14:00:59 -08:00
Dane Everitt
59299d3cda
Add code to notify panel when install is completed 2020-01-19 13:30:54 -08:00
Dane Everitt
7533e38543
Add support for running installation process when creating a server 2020-01-19 13:05:49 -08:00
Dane Everitt
99a11f81c3
Improve event emitter/subscription abilities 2020-01-18 14:04:26 -08:00
Dane Everitt
c6fcd8cabb
Send installation data over socket when running 2020-01-18 13:05:44 -08:00
Dane Everitt
5c3823de9a
Only dump pull status in debug 2019-12-28 15:14:56 -08:00
Dane Everitt
5350a2d5a5
Don't block the HTTP request while waiting on the installation 2019-12-28 15:12:12 -08:00
Dane Everitt
6ef2773c01
Very, very basic server installation process 2019-12-28 14:57:19 -08:00
Dane Everitt
d7bd10fcee
Better approach to timezone handling by using a TZ environment variable 2019-12-24 16:57:22 -08:00
Dane Everitt
06f495682c
When mounting timezone data, check for the path first to avoid a fatal error 2019-12-24 16:49:08 -08:00
Dane Everitt
32e389db21
General code cleanup 2019-12-24 16:40:51 -08:00
Dane Everitt
d9ceb9601d
Do not set the default values in the struct we're unmarshaling into
closes pterodactyl/panel#1786

If you set the defaults, you'll override a bunch of values for the server with the original values. For example this code caused servers in a running state to be changed to a non-running state, thus leading to stats not sending.

Just merge in any new values, leave everything else as empty.
2019-12-24 16:35:43 -08:00
Dane Everitt
2d0faadeb6
Always rebuild the container when a server is started 2019-12-22 13:52:22 -08:00
Dane Everitt
fabaf21a0d
Sync all server details when booting daemon or server process 2019-12-22 13:21:21 -08:00
Dane Everitt
0866b84d8e
Implement server deletion 2019-12-21 23:23:56 -08:00
Dane Everitt
189289ad5f
Correctly handle updating server data 2019-12-21 21:02:02 -08:00
Dane Everitt
3fd5b1e92b
Fix crash detection defaults 2019-12-16 21:23:57 -08:00
Dane Everitt
92a7c9d231
Don't freak out if the server doesn't exist on the remote 2019-12-16 20:47:35 -08:00
Dane Everitt
514c16ccc8
Less obtuse error handling from API responses 2019-12-16 20:34:58 -08:00
Dane Everitt
21d8384848
Create the config file if it is missing for the server, then try again 2019-12-07 16:48:26 -08:00
Dane Everitt
c9bff0fa31
Move server tracking in program into global memory state 2019-12-07 16:43:00 -08:00
Dane Everitt
4a68eabd1b
Initial functionality to pull a docker image when booting an environment 2019-12-07 14:19:51 -08:00
Dane Everitt
32c32bb24e
Fix improper goroutine 2019-11-30 21:46:54 -08:00
Dane Everitt
1003abaa63
[#3896bk] Configure base support for properties file parsing 2019-11-30 18:07:05 -08:00
Dane Everitt
11c6738264
[#389686] Show crash output in console 2019-11-30 17:08:11 -08:00
Dane Everitt
8c57583ce9
[#389686] Add crash detection logic to daemon 2019-11-30 16:43:18 -08:00
Dane Everitt
be14811eb4
Fix issues instantiating the server struct 2019-11-30 16:37:11 -08:00
Dane Everitt
4ce9c83fad
[#3896cn] Fix nil pointer when passing data through patch 2019-11-30 15:46:28 -08:00
Dane Everitt
0ce95aa2e3
[#3896cn] Add support for suspending a server and blocking boot when suspended 2019-11-30 15:19:08 -08:00
Dane Everitt
b3de4705ae
Persist configuration when server state is changed 2019-11-24 21:36:33 -08:00
Dane Everitt
85762ba4b9
Server state handling; auto start servers if they were running when the daemon stopped 2019-11-24 21:31:31 -08:00
Dane Everitt
47c7c872fc
Don't track the process state in the yaml 2019-11-24 21:18:51 -08:00
Dane Everitt
ca17d8ca5d
Use correct permission mask to allow docker to execute against bind 2019-11-24 21:18:41 -08:00
Dane Everitt
151be4a458
Recreate the container if rebuild is required 2019-11-24 21:12:02 -08:00
Dane Everitt
a8c16debfb
More logical environment variable checking 2019-11-24 20:59:40 -08:00
Dane Everitt
c684410722
Obliterate mappings/env variables if passed through, since we want to completely replace those arrays 2019-11-24 20:54:03 -08:00
Dane Everitt
65b01e1869
oom is disabled by default 2019-11-24 20:02:53 -08:00
Dane Everitt
3ca6d5d74b
Whoops, if UUID is empty that is fine 2019-11-24 20:01:38 -08:00
Dane Everitt
c96f22787a
Correct logic handling a server resource update 2019-11-24 19:57:20 -08:00
Dane Everitt
35c1e467cd
Logical file rename 2019-11-24 19:32:02 -08:00
Dane Everitt
9f4518fc58
Add (unchecked) code to do an in-situ replacement of build settings 2019-11-24 15:08:38 -08:00
Dane Everitt
7f4c29580a
Create the container if the server is booted and it is missing 2019-11-24 13:04:24 -08:00
Dane Everitt
48a303608a
Wrap errors to ensure a stacktrack is returned where possible 2019-11-16 17:05:21 -08:00
Dane Everitt
cae0090763
Correct some error handling, use package that provides useful stack traces 2019-11-16 17:01:38 -08:00
Dane Everitt
56be65888c
Don't try to truncate a file that doesn't actually exist yet 2019-11-16 16:07:54 -08:00
Dane Everitt
f0da1eeb48
Add basic support for creating a server on wings 2019-11-16 15:48:50 -08:00
Dane Everitt
c9bfb18b1c
Update to match new yaml format 2019-11-16 13:34:05 -08:00
Dane Everitt
9dcda47657
Send the correct signal to the instance 2019-09-28 13:18:09 -07:00
Dane Everitt
4e1b7988bf
Set server to stopping when stop command is sent 2019-09-22 21:33:44 -07:00
Dane Everitt
00bc71afd1
Update stop for servers to use configuration 2019-09-22 21:22:16 -07:00
Dane Everitt
d7753d9c7f
Add initial support for fetching egg configuration from panel for servers 2019-09-22 20:47:38 -07:00
Dane Everitt
2a745c5da1
Fix CPU calculation 2019-09-17 23:10:02 -07:00
Dane Everitt
64f477f423
Send server stat updates over the websocket 2019-09-05 22:08:10 -07:00
Dane Everitt
9a4f1672f7
Fix logic for resource usage -- include disk and reset to 0 when stopped 2019-08-17 16:10:48 -07:00
Dane Everitt
c8e6e29abc
Add support for streaming usage stats back to the calling process 2019-08-17 13:19:56 -07:00
Dane Everitt
a1987f3aef
Return times in RFC3339 format since the default format is not parsable in PHP 2019-08-05 22:22:49 -07:00
Dane Everitt
7c82c6445d
Correctly connect to running containers 2019-06-29 17:52:55 -07:00
Dane Everitt
2db705f697
Send the server logs when the websocket is connected to initially 2019-05-27 18:03:37 -07:00
Dane Everitt
93c71a6ab7
Correct handling of state and console events 2019-05-27 17:12:51 -07:00
Dane Everitt
7b1ebd790d
When connecting to the server socket send the state right away 2019-05-27 16:58:05 -07:00
Dane Everitt
8d8ec70683
Add support for writing to a file (and creating it if not existent) 2019-05-25 15:40:15 -07:00
Dane Everitt
7182b02ce2
Order A-Z not Z-A 2019-05-14 18:43:04 -07:00
Dane Everitt
9c252a5ad7
Truncate the logs when server process is starting 2019-05-09 21:52:24 -07:00
Dane Everitt
7a52e3a9c2
For now, chown the server directory when the server starts 2019-05-09 21:48:58 -07:00
Dane Everitt
e95c22a526
Add support for deleting a file or directory from a server 2019-05-04 17:09:35 -07:00
Dane Everitt
50d16a3dcd
Add support for copying a file 2019-05-04 17:02:01 -07:00
Dane Everitt
4318d9988a
Add support for renaming files/directories 2019-05-04 16:04:41 -07:00
Dane Everitt
857bf45324
Add support for creating a new directory 2019-05-01 22:09:01 -07:00
Dane Everitt
c3515454f2
Fix handling of empty directories to not return null 2019-05-01 22:08:54 -07:00
Dane Everitt
3de40ddf98
Fix handling of kill in daemon 2019-04-21 12:27:53 -07:00
Dane Everitt
8795e7d739
Emit server status events 2019-04-21 12:02:28 -07:00
Dane Everitt
bed30d9229
Get working console websocket implementation and fix race condition 2019-04-20 17:38:12 -07:00
Dane Everitt
49ca2e2404
Cleanup server stuff since that was getting unweildy 2019-04-20 16:26:55 -07:00
Dane Everitt
870adffc14
Significant improvements to attaching/console handling 2019-04-20 16:20:08 -07:00
Dane Everitt
b20bfac36b
Get server logs sending over the socket. wowee 2019-04-20 14:57:37 -07:00
Dane Everitt
7c0acf3f60
Very basic state management for servers 2019-04-07 15:20:21 -07:00
Dane Everitt
729a84b4bf
Output as expected json keys 2019-04-07 15:11:56 -07:00
Dane Everitt
0ace25c117
Add support for listing a directory's contents 2019-04-07 14:45:23 -07:00
Dane Everitt
91afa4d38e
Add basic file stat & mimetype 2019-04-07 13:47:14 -07:00
Dane Everitt
aef9521190
Add support for reading a file's content or downloading it 2019-04-06 17:32:35 -07:00
Dane Everitt
314a5ad546
Add FS logic for determining folder size as well as safe path resolution 2019-04-06 16:53:22 -07:00
Dane Everitt
94223bafec
Fix docker user and write configuration to disk when setting user 2019-04-06 16:03:02 -07:00
Dane Everitt
d534b23606
Move configuration to own directory, modify docker environment setup to be easier to manage 2019-04-06 13:33:54 -07:00
Dane Everitt
fe30c2969d
Add the default environment variables for servers 2019-04-06 12:36:05 -07:00
Dane Everitt
7d67be8382
Add support for getting a server's log file via the API 2019-04-06 12:27:44 -07:00
Dane Everitt
7f50ff1f92
Add support for starting/stopping/killing a server via the API 2019-04-05 22:55:48 -07:00
Dane Everitt
cedbee5080
Add initial API support for listing configured servers 2019-04-05 22:20:26 -07:00
Dane Everitt
ec2407481b
Fix pointer error 2019-04-05 22:20:10 -07:00
Dane Everitt
3b4555344c
Build out the docker environment a bit more 2019-04-05 21:59:27 -07:00
Dane Everitt
447dafc76d
Update deprecated API call 2019-04-03 23:58:45 -07:00
Dane Everitt
4c6f2cf948
Whoops, casting strings like this is incorrect.
For example, 25565 is a rune for 揝 when doing string(port).
2019-04-03 23:54:38 -07:00
Dane Everitt
b69da4f43a
Correctly map to int not string here 2019-04-03 23:45:15 -07:00
Dane Everitt
b84ed20c24
Update docker environment to handle port mapping 2019-04-03 23:09:15 -07:00
Dane Everitt
c683809efc
Get more of the container creation fleshed out 2019-04-03 22:49:15 -07:00
Dane Everitt
3e4fcd527d
Pass through startup as argument 2019-04-03 22:20:39 -07:00
Dane Everitt
08af485c40
Get basic environment creation beginning to work 2019-04-03 22:01:11 -07:00
Dane Everitt
639d9edef5
Better configuration loading process for servers
Loads up to 10 configurations at once in parallel
2019-03-24 18:39:01 -07:00
Dane Everitt
29de97c857
That editorconfig file really butchered the formatting for go 2019-03-24 18:00:21 -07:00
Dane Everitt
4bdf373ab8
Cleanup to better match the revised server data format 2019-03-24 17:39:13 -07:00
Dane Everitt
a3d5bf7982
Migrate very basic environment capabilities 2019-03-24 17:27:14 -07:00