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

A password must be supplied for cPanel migrations - make mandatory #927

Open
shoulders opened this issue Oct 18, 2024 · 14 comments
Open

A password must be supplied for cPanel migrations - make mandatory #927

shoulders opened this issue Oct 18, 2024 · 14 comments

Comments

@shoulders
Copy link

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.5
Usermin version 2.102
Virtualmin version 7.20.2 Pro
Theme version 21.20.7
Apache version 2.4.52
Package updates 10 package updates are available

the issue

If you do not enter a password for cpanel migrations you get this error

image

proposed solution

Make the password field mandatory when cpanel backup is selected

image

additional

maybe remove the option to try and figure out the password automatically? most backups will have this hashed nowadays (or should).

@jcameron
Copy link
Collaborator

The hashed password isn't good enough in most cases though - Virtualmin needs the original so it can be re-hashed for MySQL or the local /etc/shadow file format.

@shoulders
Copy link
Author

The hashed password isn't good enough in most cases though - Virtualmin needs the original so it can be re-hashed for MySQL or the local /etc/shadow file format.

I should of been more specific, remove work out from backup option because most backups should not have the password present in the archive.

@jcameron
Copy link
Collaborator

In some cases we can get the password from the backup though, so I don't think it would make sense to remove that option entirely.

@shoulders
Copy link
Author

  • defiantly make password mandatory on cPanel because I keep forgetting to add the password, do a large upload and then it says I need a password.
  • I am guessing the new version of Plesk and DirectAdmin will be the same, so perhaps make password mandatory for these aswell.
  • The other imports for dead systems don't need to have any change made to them.

@jcameron
Copy link
Collaborator

Unfortunately due to the way browser form uploads work, we can't check for the password field until the whole backup file has been uploaded. Unless we were to do it on the form in Javascript...

@shoulders
Copy link
Author

Unless we were to do it on the form in Javascript...

That how I thought you did some of the stuff anyway, using Javascript. This would do for me. So if cpanel (maybe plesk and direct admin) was selected then:

  • hide pick automatically
  • make input field mandatory and selected

Do you not have a client-side validation framework? If not, when a new webmin/virtualmin theme gets done then maybe add one in then. Joomla has a good example, their forms are built with xml and in the configuration you specify client-side and server-side validation.

@iliajie
Copy link
Collaborator

iliajie commented Oct 22, 2024

Unless we were to do it on the form in Javascript...

No, we can’t reliably do that either! The information is inside the uploaded file, and there’s not much we can do about it.

@shoulders
Copy link
Author

You don't need to look in the file, all cpanel archives will need a password.

@iliajie
Copy link
Collaborator

iliajie commented Oct 22, 2024

You don't need to look in the file, all cpanel archives will need a password.

You cannot create a backup in cPanel without a password? What format is it?

@shoulders
Copy link
Author

When you create cpanel backup it does not need a password.

When you import/migrate a cpanel backup into virtualmin and do not give the cpanel account password, the migration will fail because virtualmin says it needs the cpanel password.

So that is why I say make the password filed when importing a cpanel account mandatory.

@jcameron
Copy link
Collaborator

I've checked in a fix here that should speed up the process by detecting if a password wasn't provided sooner : fbbd72c

@shoulders
Copy link
Author

I see, you have added the Password check before the upload, this is a good workaround.

@iliajie
Copy link
Collaborator

iliajie commented Oct 23, 2024

I've checked in a fix here that should speed up the process by detecting if a password wasn't provided sooner : fbbd72c

Why is it acceptable for $parent not to have a password? Do passwords on the cPanel backups exist for the parent domain but not for subdomains?

@jcameron
Copy link
Collaborator

Why is it acceptable for $parent not to have a password? Do passwords on the cPanel backups exist for the parent domain but not for subdomains?

If $parent is set then the domain being migrated is a sub-server of an existing domain, so doesn't need it's own password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants