Merge ~ballot/ubuntu-mirror-charm/+git/ubuntu-mirror-charm:disable_default into ubuntu-mirror-charm:master

Proposed by Benjamin Allot
Status: Merged
Approved by: Benjamin Allot
Approved revision: 1ce485543c4e7f608e4eab1c346bd8124bb51844
Merged at revision: eec9c03dff923a088b3c54ec95ae465c9db40dcd
Proposed branch: ~ballot/ubuntu-mirror-charm/+git/ubuntu-mirror-charm:disable_default
Merge into: ubuntu-mirror-charm:master
Diff against target: 15 lines (+4/-0)
1 file modified
hooks/hooks.py (+4/-0)
Reviewer Review Type Date Requested Status
Haw Loeung +1 Approve
Canonical IS Reviewers Pending
Review via email: mp+382933@code.launchpad.net

Commit message

Always disable the default apache website

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Haw Loeung (hloeung) :
Revision history for this message
Haw Loeung (hloeung) wrote :

Also see James' comment here:

| https://code.launchpad.net/~hloeung/canonical-is-charms/ubuntu-mirror-default-vhost-and-server-status/+merge/254717

Maybe the default vhost could just be a blank page and not display the apache2 default page?

Revision history for this message
Benjamin Allot (ballot) wrote :

> Also see James' comment here:
>
> | https://code.launchpad.net/~hloeung/canonical-is-charms/ubuntu-mirror-
> default-vhost-and-server-status/+merge/254717
>
> Maybe the default vhost could just be a blank page and not display the apache2
> default page?

I'm completely fine with adding a blank page instead. I thought it was not providing any value at the moment and I had to fix this as PVG after a Reddit thread started to booooo us for letting this default page visible so I quickly worked on this fix (and disabled live the default site).

AFAIU, James comment was mostly about the Host header thing rather than the default page ?

Revision history for this message
Benjamin Allot (ballot) wrote :

Comment inline on the .conf stuff

Revision history for this message
Haw Loeung (hloeung) wrote :

Works for me, we'll have to address it differently now that the charm supports multiple roles (releases, archive, security).

Filed LP:1879801 to address and fix the charm to not allow requests by IP.

Revision history for this message
Haw Loeung (hloeung) :
review: Approve (+1)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision eec9c03dff923a088b3c54ec95ae465c9db40dcd

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/hooks/hooks.py b/hooks/hooks.py
2index 2befc02..7dfa42a 100755
3--- a/hooks/hooks.py
4+++ b/hooks/hooks.py
5@@ -395,6 +395,10 @@ def configure_apache():
6
7 # Remove all other vhosts
8 unwanted_vhosts = set(conf.role_list()) - set(wanted_vhosts)
9+ # always disable default
10+ default_site = "000-default.conf"
11+ if os.path.exists(os.path.join(enabled_dir, default_site)):
12+ unwanted_vhosts.add(default_site)
13 for vhost in unwanted_vhosts:
14 check_call(["/usr/sbin/a2dissite", vhost])
15 if os.path.isfile(os.path.join(available_dir, vhost)):

Subscribers

People subscribed via source and target branches