pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.7k stars 1.7k forks source link

Allow adjusting wings data format by access type to allow for advanced file features. #3538

Closed PurpleIsEverything closed 2 years ago

PurpleIsEverything commented 3 years ago

Is there an existing feature request for this?

Describe the feature you would like to see.

Way back in the early days of the original Pterodactyl daemon there was a data format change from /srv/daemon-data/<short-uuid>/data/ to /srv/daemon-data/<uuid>/ that greatly effected users extending the feature set of the Pterodactyl panel/daemon.

These adjustable data formats allowed for better and cleaner access to not active server related data in a per-server fashion that was accessible to the end user via SFTP while file managers provided more basic server access.

A use case of this feature involving the filesystems BTRFS or ZFS would make an active and instant data saving snapshot of a server and store it under /srv/daemon-data/<uuid>/snapshots/<time>/ making it available to regular users via SFTP, while the server operated actively in /srv/daemon-data/<uuid>/data/. Use of provided backup features are simply to space inefficient for larger installs.

We've also made install container data formats adjustable to allow for quick egg switching to provide a simple way to restore these snapshots as well as provide server file updating and customization outside of what is available from your average egg. Users can provide modified configs or diff stored in a /srv/daemon-data/<uuid>/scripts/ folder that is merged during an egg installation into updated server files to maintain their changes across updates in one click.

Outside of backup and installation use cases we have also seen it actively used with the new mounts feature to provide a location for file databases, config backups and more while keeping the server data in the host backend well organized per server.

Describe the solution you'd like.

What we are proposing is something we have been actively maintaining for some time through private forks allowing more people to use these alternative data formats for more advanced folder structures to better organize and provide more unattended features to users.

I've linked below to a patch to add this very basic feature, unfortunately it is a breaking change but we believe it could be adjusted to not be for the masses.

In our use cases we'd adjust the following config values:

data: /var/lib/pterodactyl/volumes/%uuid%/data/
sftp_data: /var/lib/pterodactyl/volumes/%uuid%/
install_data: /var/lib/pterodactyl/volumes/%uuid%/

Additional context to this request.

https://gist.github.com/PurpleIsEverything/54d4f3c47778dc4abacd13b33e26edc0

Thank you for considering this feature request, we hope this feature can be added for all to enjoy.

matthewpi commented 3 years ago

Is there a reason you don't just use another folder in /var/lib/pterodactyl? The way it is currently setup functions almost identically to what you described except that it doesn't store it within a single parent server folder.

For example, wings by default uses the /var/lib/pterodactyl/{backups,volumes}/{uuid} folders for storing server data and backups. You could just create a snapshots folder in /var/lib/pterodactyl and then another server folder within that to achieve your goals. This also has the added benefit of being easier to partition or mount on a separate drive if you would like to store backups, snapshots, etc on another drive.

PurpleIsEverything commented 3 years ago

The reason we do this over what you described is accessibility, right now users are able to connect via SFTP navigate into the snapshots folder and find up to 2 full weeks of hourly entirely uncompressed server files to browse and recover individual configurations and player files as needed.

With the adjustment of installation data folders we can also allow one-time use eggs and reinstalls to restore entire servers from these snapshots and with mounts we can create in-game plugins that can access the snapshot data to restore individual player files.

It's already possible for us to take snapshots of server filesystem subvolumes on the host side and place them in /var/lib/pterodactyl/snapshots/{uuid} but that would not be user accessible via SFTP nor would any built in backup solutions in Pterodactyl be able to show them without SFTP.

In this case this was the least invasive way to achieve this goal completely without specifically writing a purpose built feature just for snapshots allowing flexibility for everyone.

DaneEveritt commented 2 years ago

Sorry, but I'm going to close this out. I just don't have the bandwidth to go back and add configuration to things like this for such a highly specific use case.

PurpleIsEverything commented 2 years ago

That's very unfortunately, this is a very simple patch/feature that would provide lots of customization.