Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade tool #36

Open
syzop opened this issue Jun 2, 2023 · 1 comment
Open

Upgrade tool #36

syzop opened this issue Jun 2, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@syzop
Copy link
Member

syzop commented Jun 2, 2023

Both from the webpanel and from the new CLI tool: a way to easily update the webpanel to the latest version.

Right now, this could be as easy as running git pull and composer install (may need some detection to search for composer).
When we have releases it would have to download the release from GitHub, extract the .tar.gz, etc..

Ideally do this in a safe manner, creating some sort of backup prior, just in case.

@syzop syzop added the enhancement New feature or request label Jun 2, 2023
@syzop syzop assigned ValwareIRC and unassigned ValwareIRC Jun 2, 2023
@syzop
Copy link
Member Author

syzop commented Jun 2, 2023

One thing that git keeps track of is file renames, so if we move xyz.php to somedir/xyz.php and you did a git pull then it really moved to there. So that's good.

On the contrary, with releases, if you would just extract a .tar.gz over everything, then it would have the new somedir/xyz.php but the old xyz.php would still exist. So that would quickly become a mess after a few upgrades. And not only will it be messy, with old code laying around you may also keep old vulnerabilities that nobody is thinking about anymore.

So, ideally, for releases, if your existing webpanel is in /var/www/html/webpanel you would:

  • Extract the release .tar.gz to become like /var/www/html/webpanel.new
  • Copy /var/www/html/webpanel/config/config.php over to /var/www/html/webpanel.new/config
  • Do the same for the data/ directory
  • When all that is done, rename /var/www/html/webpanel to /var/www/html/webpanel.old
  • And rename /var/www/html/webpanel.new to /var/www/html/webpanel

Unfortunately i think with most file permissions for /var/www/html that is not possible, so.... hmmmm..... either make that possible or.. find some other way, that could be more fragile.

@ValwareIRC ValwareIRC self-assigned this Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants