By default, the homepage of a hostmaster site is not present (or not reachable to anonymous users), so the site displays a 403 error because one is not logged in.

This makes monitoring tools complain when checking for HTTP on the server.

It's also very weird for users to get to a site and have an "Access denied" message thrown into their faces. It would be better to have some kind of basic page that says welcome and maybe explains what the site is used for.

So, how about having hostmaster start up with a default homepage?



ergonlogic’s picture

We could treat this front page as content. So, add the 'access content' permission to anonymous users, add a new content type, add a default node with a welcome message (or whatever), then point the front page to it... However, this would also mean that this welcome page becomes the home page for logged-in users, rather than the current hosting/sites. Also, by enabling 'access content', we'd be granting access by default to any content added outside the Aegir contents types, where access is controlled natively (largely by the 'clients' functionality, I believe).

So, it looks like treating it as content isn't the way to go. Suggestions?

ergonlogic’s picture

Something like this looks more promising:

  $items['hosting/front_page'] = array(
    'title' => 'Welcome',
    'page callback' => 'hosting_front_page',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,


function hosting_front_page() {
  return 'front page.';

I'd think that we'd want the title and content to be configurable, so we'll need to add some admin config...
ergonlogic’s picture

Version:6.x-1.9» 6.x-2.x-dev
Status:Active» Needs review
new3.5 KB

This appears to work. It could be a contrib module, I suppose.

anarcat’s picture

Couldn't we leverage the way Drupal itself is doing things now? If the sites page is a problem, why not simply have a regular Drupal welcome page?

Creating a new menu, page and configuration page seems like over-engineering for me.

ergonlogic’s picture

Assigned:Unassigned» ergonlogic
Status:Needs review» Needs work

The way Drupal 6 and 7 handles anonymous users without 'access content'/'View published content' is to present a 403 Access Denied. I'd discussed some of the problems I see with using a node for this in #1. Is there some other method you're suggesting?

Also, the current patch break Drush on the hostmaster, so it obviously 'needs work'.

ergonlogic’s picture

Status:Needs work» Needs review
new6.98 KB

We need to let Drush through (php_sapi_name() != 'cli'), and it's only relevant on the front page (drupal_is_front_page()).

So, fwiw, here's a new patch.

anarcat’s picture

Status:Needs review» Needs work

Okay, I see where you're going with this. This seems fair, although I am worried that making this customizable is over-engineering it a little - people can just change the site_frontpage to a node or other handler if they need to customize that page...

So I would make the code much simpler and get rid of a few variables from your patch. hosting_front_page, _title and_content seem unnecessary. Instead, we should just do a variable_set in the hostmaster.install. The hack in hosting_init() would also be unnecessary...

anarcat’s picture


ergonlogic’s picture

So, I like what devshop does with the anonymous front_page, turn it into a login page. That's probably a better solution than some arbitrary welcome message. I'll look into porting that, unless there's an objection.

anarcat’s picture

Login page is good, I guess.. But I also like to have a little introduction...

Also, I was thinking that the site listing isn't that useful - maybe the frontpage should be a site creation form?

ergonlogic’s picture

Status:Needs work» Fixed

Fixed in 664f4e1ffd30a0b5.

@anarcat, we can discuss changing the default front_page in another issue, if you like.

anarcat’s picture

Assigned:ergonlogic» anarcat
Status:Fixed» Needs work

yeah, another issue is fine.

i am still not sure we want to have variable_set/get stuff in there - i'd rather have a hardcoded page (but with t() so it can be translated) and people can change the site_frontpage setting to point to another page they can customize if they want to....

i'll commit so you see what i mean, feel free to revert.

anarcat’s picture

Status:Needs work» Fixed

Status:Fixed» Closed (fixed)

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