framework icon indicating copy to clipboard operation
framework copied to clipboard

Blueprint should not assume certain things about the environment

Open itsvic-dev opened this issue 1 year ago • 11 comments

  • Certain distros do not have a /usr/local directory (such as NixOS), or even a /usr/bin! (NixOS has it, but it only contains env) Because of this, the blueprint alias does not get installed if /usr/local/bin is not present or if it's not writable to by the current user.
  • ~~The installer falls apart anywhere outside of /var/www/pterodactyl. A safer assumption would be setting FOLDER="$(dirname $0)".~~ #40
  • ~~When setting up symlinks to .blueprint, Blueprint will create absolute links. If the panel directory is renamed, Blueprint will partially break.~~ #30

itsvic-dev avatar Mar 28 '24 17:03 itsvic-dev

In all honestly, I doubt people would run Pterodactyl on NixOS.

prplwtf avatar Mar 28 '24 17:03 prplwtf

In all honestly, I doubt people would run Pterodactyl on NixOS.

I do -- but that's not the point. Point is, Blueprint shouldn't assume certain things about the environment. Another one is, Blueprint assumes that www-data is the owner of the panel directory. Doesn't break anything, but is annoying nonetheless.

itsvic-dev avatar Mar 28 '24 17:03 itsvic-dev

Works on my machine

Ahwxorg avatar Mar 28 '24 17:03 Ahwxorg

In all seriousness:

@prplwtf we/you could just add a simple if-statement, or tell people that NixOS is unsupported? Also possible to make the directories a variable and define the variable using a interactive script?

Ahwxorg avatar Mar 28 '24 17:03 Ahwxorg

Non-standard directory support has been implemented since ages ago.

Non-standard file ownership has been implemented recently, but is waiting for the next release.

prplwtf avatar Mar 28 '24 17:03 prplwtf

Non-standard directory support has been implemented since ages ago.

It's a bit wonky in my experience. When running with _FOLDER set, it breaks. Running it a second time, with or without _FOLDER, gets it to actually install. This still doesn't address my initial complaint that the directory can change, and you should avoid absolute symlinks.

Non-standard file ownership has been implemented recently, but is waiting for the next release.

Glad to hear that.

we/you could just add a simple if-statement, or tell people that NixOS is unsupported?

This isn't a NixOS-specific issue. If the user running Blueprint does not have write permissions to /usr/local/bin, it will also fail to install the blueprint tool, as was the case for me as I was running it as myself, not as root.

itsvic-dev avatar Mar 28 '24 19:03 itsvic-dev

We could switch to a .env-like config file for Blueprint which would store settings like these in a readable manner:

For the "blueprint" command issue, we could just add a statement to check from a list of directories, and if it exists, place it in there.

prplwtf avatar Mar 28 '24 21:03 prplwtf

_FOLDER functionality has now been removed in commit 6faa0c3 in favor of :sparkles: sed commands :sparkles:.

prplwtf avatar Jun 09 '24 21:06 prplwtf