Skip to content

RUSTIC_REPOSITORY_BASE_PATH is documented from pyrodactyl but ignored for local Rustic backups #89

Description

@meemkade

Current Behavior

The documented RUSTIC_REPOSITORY_BASE_PATH environment variable does
not affect local Rustic backup repositories.

RusticConfigController reads:

backups.disks.rustic_local.repository_base_path

However, config/backups.php does not define a rustic_local disk, so the
controller always uses the fallback:

/var/lib/pterodactyl/rustic-repos

In my installation, this caused approximately 76 GB of backups to fill
the node OS disk until there was nothing left, even though RUSTIC_REPOSITORY_BASE_PATH pointed to an
NFS mount.

Adding the following block fixes the API output and backups then write
successfully to NFS:

'rustic_local' => [
'adapter' => 'rustic_local',
'repository_base_path' => env(
'RUSTIC_REPOSITORY_BASE_PATH',
'/var/lib/pterodactyl/rustic-repos'
),
],

Expected Behavior

Setting:

RUSTIC_REPOSITORY_BASE_PATH=/mnt/PteroFiles/Backups/rustic-repos (this is my directory in this case)

Should cause the remote Rustic configuration endpoint to return:

/mnt/PteroFiles/Backups/rustic-repos/

Elytra should then create and update each server’s rustic_local repository at that configured path instead of using the default local OS path:

/var/lib/pterodactyl/rustic-repos/

Steps to Reproduce

  1. deploy hydrodactyl using the current docker image

  2. configure a writable backup location that is mounted on the elytra node, for example, and in my case: /mnt/PteroFiles/Backups/rustic-repos

  3. add the documented environment variable to the panel service:
    environment:
    RUSTIC_REPOSITORY_BASE_PATH: /mnt/PteroFiles/Backups/rustic-repos

  4. recreate the panel container so the environment variable is applied:
    docker compose up -d --force-recreate --no-deps panel

  5. verify that the variable is present inside the panel container:
    docker exec
    printenv RUSTIC_REPOSITORY_BASE_PATH
    should be, in my case:
    output:
    /mnt/PteroFiles/Backups/rustic-repos

  6. clear the laravel configuration cache:
    docker exec php artisan config:clear

  7. query the remote Rustic configuration endpoint for a server:
    curl -fsS
    -H "Accept: application/vnd.pterodactyl.v1+json"
    -H "Authorization: Bearer ."
    "https:///api/remote/servers//rustic-config?type=local"

  8. observe that the response still contains the default OS path:
    {
    "repository_path": "/var/lib/pterodactyl/rustic-repos/"
    }

  9. create a rustic_local backup through the panel

  10. observe that elytra writes the actual rustic repository to:
    /var/lib/pterodactyl/rustic-repos/
    instead of the configured path.

  11. inspect the installed configuration and controller:

grep -Rns "repository_base_path"
/app/app/Http/Controllers/Api/Remote
/app/config

RusticConfigController reads:

config(
'backups.disks.rustic_local.repository_base_path',
'/var/lib/pterodactyl/rustic-repos'
)

however, the shipped config/backups.php does not define a
backups.disks.rustic_local entry

  1. add the missing configuration block to config/backups.php:

'rustic_local' => [
'adapter' => 'rustic_local',
'repository_base_path' => env(
'RUSTIC_REPOSITORY_BASE_PATH',
'/var/lib/pterodactyl/rustic-repos'
),
],

  1. clear the configuration cache and repeat the API request

  2. the endpoint now correctly returns:
    /mnt/PteroFiles/Backups/rustic-repos/

  3. creating another backup then writes the repository to the configured
    NFS path successfully

Panel Version

number system invalid as "canary", Commit : 4056b9f

Panel Installation Type

  • Official Panel Docker image.
  • native install for Panel.
  • I used a third party installation script or Docker image.

Daemon Version

1.4.0

Daemon Installation Type

  • Offical Docker image.
  • Native install.
  • Pyrodactyl Elytra
  • Pterodactyl Wings
  • I used a third party installation script or Docker image.
  • Daemon Version does not apply to this Bug

Games and/or Eggs Affected

Minecraft (Neoforge)

Docker Image

No response

Error Logs

Is there an existing issue for this?

  • I have searched the existing issues before opening this issue.
  • I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
  • I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions