I am the debian developer who maintains the Drupal debian package. I need a reduced upgrade.php script less smart than the one included in version 4.2.0. This upgrade script for debian should apply all upgrades from update_46() function till the end to reach 4.2.0 db format, without user interact. I mean, the upgrades should be applied automatically only by calling the upgrade.php script in a browser, giving an output page with a succesful or failure message for each update function.

It should be an easy task for the upgrade.php author.

Hugo Espuny
hec@debian.org

Comments

dries’s picture

Component: Installation/Configuration » base system

I already made some first simplifications to the update script. There is two more things I want to look at:

  • Eliminate the dropdown menu to select the start date.
  • Add a mechanism so you can run the update script without user interaction.

For the latter to be secure, we need some authentication mechanism or check to prevent that non-authorized people can upgrade your database. What about adding support for some parameters such that you can do:

wget http://sitename/update.php?username=$username&password=$password

The username and password could be that of user #1 or of the Drupal database. Which one is preferred? Other thoughts or ideas?

Anonymous’s picture

variable.module (See contrib) uses a similar technique in order allow external apps to update the variable table. I like it. -moshe

hec-1’s picture

Assigned: Unassigned » dries

Really i think this is not needed, as the installation scripts copy the upgrade.php to the web tree just before we call it to perform the upgrade, and deletes it just after. Also this won't add any security as this user and pass are publicly known, and there is no an easy way to change them to random ones on the fly. Also the attacker only have some microsecs to perform a call to upgrade.php.

But i will add an Apache directive to allow calling to upgrade.php only fron localhost. This should be enough.

Thanks for your work here, Dries.

dries’s picture

True but in the regular distribution (ie. Drupal's own distribution) we don't copy or remove the update.php script. We need a security check.

Now that I know how Debian updates a Drupal site (copy update.php, execute update.php, remove update.php), I guess I can make it so that (1) you can easily comment out the security check and (2) perform an upgrade without user interaction.

killes@www.drop.org’s picture

Assigned: dries » killes@www.drop.org

The update functions were moved to update.inc.

Anonymous’s picture