Aegir forces the Drupal superuser (uid 1) to be called 'admin' in it's install engine. We prefer to call this user 'root' as it more accurately depicts that users privileges.

Because of the ordering of the install engine, even if we change this in our install profiles it's still changed by Aegir to be 'admin'.

It should be really easy to pass some option from the frontend to the backend on install so that this can be configured. The client email is passed in this way.

Comments

Anonymous’s picture

hehehe...

So I once co-wrote with aaronbauman, and committed, a patch to allow this to be configurable from the frontend. It was veto'd as being excessive for Aegir's purposes, so it was reverted

See #699250: Support for admin_user option in order to set user 1 name other than "admin" and #697954: user 1 name is hardcoded. allow provisioners to specify name for admin user.

I still think it's worthwhile: but perhaps the original approach (adding a field to the site node form) was too much. Maybe there is a more elegant way to achieve this from an API-perspective: e.g allowing the ability for a contrib or custom addon at least to the backend to override it. Not sure.

steven jones’s picture

So, I've got a working contrib solution for this, with the only drawback that the email about a new site being created always has the 'admin' username.

Would be good to get #697954: user 1 name is hardcoded. allow provisioners to specify name for admin user. back in, and then we can play in contrib :)

steven jones’s picture

Project: Hostmaster (Aegir) » Provision
Version: 6.x-0.4-alpha3 » 6.x-2.x-dev
ergonlogic’s picture

Status: Active » Needs review
StatusFileSize
new2.59 KB

Patch attached along the lines of #697954: user 1 name is hardcoded. allow provisioners to specify name for admin user..

This allow an override as simply as creating a /var/aegir/.drushrc.php that includes:

$options['admin_user'] = 'other';
anarcat’s picture

Status: Needs review » Needs work

Couldn't we factor this out of the version-specific engines?

ergonlogic’s picture

You mean move the define to includes/install.inc?

anarcat’s picture

yes.

ergonlogic’s picture

Actually, the 'includes/install.inc' in question is the one on the site. Moving it up to install.provision.inc didn't work...

ergonlogic’s picture

Status: Needs work » Needs review
StatusFileSize
new2.84 KB

Alright, so this is weird. I created an install.inc wherein I put our define. Then I included it like so in install_6.inc:

require_once 'includes/install.inc';
require_once 'install.inc';

What I find strange here is that the first require_once, is including the file from the platform, whereas the second one is including it from /var/aegir/.drush/provision/platform/drupal/. Is this expected behaviour?

anarcat’s picture

i have no idea how this works. the engine code is weird. this is why i was so vague. :)

ergonlogic’s picture

Status: Needs review » Fixed

Fixed in d0623c3.

I documented the weirdness with a @todo to figure it out :)

I also added validation of the UID1 name in Drupal 7 install.

ergonlogic’s picture

I documented how to override UID1 username in example.drushrc.php

Also, similar treatment of email addresses during install was addressed in #2038279: Verify "valid email address" during the hostmaster-install script?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit d0623c3 on dev-drupal-8, 6.x-2.x, dev-ssl-ip-allocation-refactor, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by ergonlogic:
    Issue #1201174: Make UID1 username configurable.