A tale of two travesties

I have been looking for an easy and reliable way to develop and test Launchpad with Internet Explorer. Neither of the two common approaches used by Ubuntu users allows a Launchpad developer to  easily verify that a change works with Internet Explorer. The challenge is to install a working version of Internet Explorer 8 and browse the local development instance of Launchpad. Maybe you can help me find a way to do this?

While Internet Explorer only represents 4% of Launchpad users, recent changes to make Launchpad easier to use made many tasks for IE users impossible to complete. This was unintended. It is a regression, and we treat all regressions as critical issues. The Purple squad reviewed the code and found that a lot of Launchpad JavaScript is disabled for all versions of Internet Explorer without an explanation nor fall-back behaviour. There is no documented way to ensure Launchpad works with Internet Explore, so most developers do not try to make it work.

Microsoft’s developer image of Windows 7 + IE8

Microsoft provides many images of Windows and IE so that Web developers can ensure their code works. The images are compatible with VirtualBox. The installation of the required software is easy, though configuration is tricky. The greatest challenge is creating a reusable Apache2 config for the many Launchpad domains.

Microsoft provides VPC compatible IE images to anyone who wants to verify that a website works with a specific version of IE. You will need about 13GB of disk space to install and run this bloatware that we all have come to expect with Windows. I installed the needed software using these commands:

$ cd /path/to/lots/of/disk/space/VirtualBox/HardDrives

$ sudo apt-get install virtualbox unrar curl

$ curl -L -O "http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_7_IE8.part0{1.exe,2.rar,3.rar,4.rar}"

$ unrar e Windows_7_IE8.part01.exe

I started VirtualBox and changed the preferences to use the path where I had lots of disk space. I created a new Windows 7 instance using the virtual disk. The disk had to be mounted as IDE (SATA failed) and the network was set as bridged.

IE worked perfectly with Ubuntu’s SSO. I could use Launchpad as I expected. In the cases where I expected a problem, I could see behaviours that confirmed my suspicion about the nature of the defect. This setup is ideal for verifying changes on Launchpad’s qastaging and production servers.

Making this setup work with the Launchpad development instance was very difficult. I hard-coded IP addresses to ensure that Windows and Apache knew the *.launchpad.dev sites. My IP address on my local network was 192.168.1.7 at that moment.

  • Windows: Added
    c:\windows\system32\drivers\etc\hosts
    which contained
    192.168.1.7 testopenid.dev launchpad.dev code.launchpad.dev answers.launchpad.dev blueprints.launchpad.dev bugs.launchpad.dev translations.launchpad.dev
  • Ubuntu: Copied
    /etc/apache2/ssl/launchpad.crt
    to a device that I could mount in Windows [1]
  • Windows: Added the launchpad SSL certificate to the Trusted root certificate store
    Internet Options → Content → Certificates → Trusted Root Certification Authorities
  • Ubuntu: Updated all references in
    /etc/apache2/sites-enabled/local-launchpad
    of
    127.0.0.88
    to
    192.168.1.7
  • Ubuntu: Added
    Allow from 192.168.1.*
    after all occurrences of
    Allow from localhost 127.0.0.0/255.0.0.0

I could login but I discovered that I occasionally needed to rearrange the entries in the Windows hosts file because it has a character limit! Every time my computer’s IP address changes, I need to update the Windows hosts file and the Ubuntu Apache config. I do not mind editing my IP in the Windows host file, but I do not like editing the entries or updating the Apache config. I doubt this setup works for developers using LXCs or other VMs to run Launchpad. I am planning to switch to LXC when Precise is released so this solution may not work for me in a few weeks.

Wine + Winetricks + IE8

Winetricks is a tool that can install and configure IE8 so that it runs on Ubuntu. Installation is very easy, but the UI’s controls and menus are broken. The greatest challenge is that the security behaviour is different from real Windows and IE — the browser thinks real Ubuntu SSO and the entire Launchpad development site is insecure so does not send the required REFERER header.

I installed the needed software using these commands:

$ sudo apt-get install wine winetricks
$ winetricks corefonts ie8

Configure Wine to work with launchpad development instance:

  • Add the Launchpad SSL certificate to Wine [1]
    $ wine control
    Internet Settings → Content → Certificates → Trusted Root Certification Authorities
  • Run IE
    $ wine iexplore

The UI does not look like IE8, and the broken buttons and menus certainly do not lend any confidence that this works. I can see from the Apache log that my request to https://launchpad.dev/claims to be MSIE 8. I cannot login to the website though. I can see in the logs that the REFERER header was not sent, so the post was rejected. The same is true for posting to the real Ubuntu SSO and Launchpad website — all posted forms fail. IE does this when it believes the browser is posting across a security boundary; it is protecting the user. Since the real Windows 7 + IE8 does not see either the development or production instance as unsecure, I know that something is misconfigured in Wine. I believe the SSL was install correctly because the real IE8 accepted it as did my Ubuntu browsers.

I can make the Launchpad development instance work with the broken Wine IE8 by hacking lp.services.webapp.publication to not requiring the REFERER header for MSIE 8 when the launchpad instance’s host end with “.dev”. This permits me to verify that JavaScript works, but is it really verifying that real IE8 works? I have no confidence in this hack. What else is broken in the setup?

[1] The default Launchpad SSL certificate in the Launchpad tree that is installed by rocketfuel-setup is incomplete. I generated a certificate that properly specified the sites it was for. I installed the better certificate in /etc/apache2/ssl and in my local OpenSSL store. The immediate benefit is that all of my development browsers accept the SSL certificate; not warning about wrong domains. I will add the better certificate to the Launchpad development tree and the script I used to generate and install it.

Tags: ,

8 Responses to “A tale of two travesties”

  1. lazarus Says:

    why bother with IE? Those 4% of users should switch to a *DECENT* browser. i’m really sick of seeing all those work-arounds just to make it work for that damn browser.

  2. Curtis Hovey Says:

    I don’t like defending IE more than the next Web developer, but this issue is not about creating work arounds to support IE. This issue is about Launchpad engineers who claimed IE was broken when they failed to recognise their poor understanding of browsers and the library we use to ensure our code works. We do not need workarounds to fix Launchpad’s support of code; we need developers to understand what is returned by YUI methods and how W3C and EcmaScript3/3 works. None of the fixes landed last month were IE specific.

  3. Michael Hudson-Doyle Says:

    I’ve made the first approach work better — but only for an Ubuntu VM — by giving your VM two network interfaces: one that’s bridged (“eth0”) and so appears on the same network as the guest (for communication to the wider internet) and a host-only adapter (“vboxnet0”) (for talking to processes i.e. Launchpad running on the host). You give the host a fixed address & netmask and either lock down virtualbox’s DHCP server so that it gives the VM the same address each time, or give the corresponding adapter a static configuration in the VM. This means that you can just put the ip of the host end of vboxnet0 in the guests /etc/hosts equivalent, and the configured IP for the guest in the apache config.

    It can help to use slightly obscure addresses in the 10.*.*.* space to avoid getting tripped up if you connect to a wifi network that happens to use the same bit of private space as you (i.e. don’t give the host end of vboxnet0 an address of 10.0.0.1).

  4. Marius Kruger Says:

    Maybe selenium ( http://seleniumhq.org/ ) can help automating this for you..

  5. Curtis Hovey Says:

    Launchpad has automated JavaScript tests. We could use some browser integration tests and Selenium is out choice, it is just not a priority to install. We already know the code does not work in IE though. The issue is that Launchpad developers do not have access to a way to create a new feature and verify it work in all browsers. I can play Launchpad’s YUI tests in any browser if I can get the browser installed and looking at the development tree.

  6. Richard Says:

    You can use https://github.com/xdissent/ievms to set up IE virtual machines more easily.

  7. Curtis Hovey Says:

    I did not find it easier. It installs lots of unneeded things, VirtualBox “just works” with IE VMs under precise. My initial attempt to use it littered my home directory and stole disk space.

  8. Sinzui » Common mistakes that broke Launchpad’s browser compatibility Says:

    […] user, lazarus, responded to my A tale of two travesties post asking “why bother with IE? Those 4% of users should switch to a *DECENT* […]

Leave a Reply