Ups and Downs with Capistrano

Capistrano is an insanely useful deployment system for Rails (among other things). But I just spent two hours banging against an annoying issue.After Cap extracts the latest code from my source repo (hg), it tries to set the group permissions on the files. Due to some oddness in the setup on my server this fails, even though they already have g+w set on them. It was outputting this:* executing "chmod -R g+w /wwwDocs/foo/releases/20080303233346"And then listing a series of files with “Operation not permitted”. At least I had the benefit of this output. Some stories I ready involved FastCGI failing silently after the permissions changed. Man. I got lucky.Some quick googling led me to a number of stories mentioning that cap is running “set_permissions” after the code update, and that overriding it like so will stop it from doing that:task :set_permissions, :except => { :no_release => true } do # do nothingendHowever, that had zero effect. I tried many different permutations. Once I finally dug into the actual cap recipes file (which I should have done earlier), I discovered that in my (apparently newer [2.2.0]) version of capistrano, they helpfully moved the activation of this code to a flag task :finalize_update, :except => { :no_release => true } do run "chmod -R g+w #{latest_release}" if fetch(:group_writable, true)So, I set that flag and all was finally well. Too bad there is so much info out there that’s misleading. It’s not the fault of the people who posted it, they were being helpful at the time. Anyway, I hope this post helps some other people out of the same jam.

More reasons why browsers and flash suck

Mac Firefox (2.0.0.11) has a few bugs. One of them is this weird font anti-aliasing bug where fonts are anti-aliased at one setting in a normal page, but if you set the opacity of any object on that page, then they swap into a different mode. You can see the font strokes getting thicker or thinner. It’s really obvious with bold fonts. We ran into this issue with a recent release. On our home page were two rotating banners, we use Scriptaculous to Fade() and Appear() each one, so they cross fade into each other. Saves real-estate nicely. However, when it started the cross fade, the fonts would thin, then when it was done, they would thicken back up. It didn’t bother me, but the higher ups thought it was a catastrophe, so I hunted around for a solution. Eventually we hit on setting “-moz-opacity: 99” on the body element, forcing it into one mode all the time. So we cruise along with that for 6 months until we add some flash to another page in the site. Works great for everyone but poor little old me in FF Mac. If the flash has “wmode” set to “transparent” the flash object appears, but then goes blank, and only appears in parts where my mouse drags over it. In that setting our DHTML menus don’t appear in front of it, so it’s useless.So we switch to “wmode=opaque” and it “solves” that problem, now the flash box is completely empty all the time. Some googling around points me to problems between flash and CSS opacity, so my first thought was to take out that -moz-opacity declaration and whaddayaknow, everything works. So we override that opacity setting on the flash page and we’re all good.