Thursday, May 21, 2015

Ubuntu 15.04, OpenFire and "Unable to validate certificate" problem

While Upgrading to OpenFire 3.10 from 3.9, I encountered this error on my clients running either pidgin or empathy. I'm running OpenFire with a mix of Empathy and Pidgin clients on a corporate LAN.

Took me a bit for figure out that the certificates isn't the problem but the names. Here's the steps, I did:

1. Check your OpenFire server settings and look for the xmpp.domain value. Remember that value.

2. In the clients, flush the certificates folder; I'm running linux so that folder is ~/.purple/certificates/. In hindsight, I think this step can be skipped because I think Empathy or Pidgin overwrites the folder with the most current certificate.

3. Make sure clients don't log in using the ip address. So no accounts in the form of, username@10.209.70.19 but rather username@xmpp.domain. (so if your xmpp.domain is appsvr1 then the username is username@appsvr1). 

4. Edit the host file to satisfy the FQDN requirement. Assuming that your OpenFire server is at 10.209.70.19 and the xmpp.domain is appsvr1, the you have a host entry of 10.209.70.19 appsvr1. You basically alias it.

My users now can bother me again. 

Haiz...


Monday, May 4, 2015

Bootstrapping the View Parts

Time to add a face to our project. So, we break out our favorite framework for the designed-impaired programmer, Bootstrap!

Download the stuff and put it in the public/ folder. I made a bootstrap folder in my public folder to keep it organize. Don't forgot to also get jquery. Bootstrap doesn't work without jquery. This is the easy part.

The next part is kinda hit or miss: Jade

Nodejs with Express uses a templating engine to make views. There are a couple of options but jade is the default. I say hit or miss is because some take to Jade like ducklings to water. Some of you might not be ducklings. 

Here's a sample:

nav(class='navbar navbar-default navbar-static-top')
    .container
        .navbar-header
            button(type='button', class='navbar-toggle collapsed', data-toggle='collapse',                    data-target='#navbar', aria-expanded='false', aria-controls='navbar')
                span(class='sr-only') Toggle navigation
                span(class='icon-bar')
                span(class='icon-bar')
                span(class='icon-bar')
            a(class='navbar-brand', href='#')= title
        div(id='navbar',class='navbar-collapse collapse')
            ul.nav.navbar-nav
                li.active
                    a(href='#') Home
                li
                    a(href='#') About
                li
                    a(href='#') Contact

Jade templating language is quite terse to write compared to raw HTML. It also has a few fun parts like includes, conditionals and mixins.

In the Views/ folder, I made a shared folder and move the common stuff like the layout and navbars. This way I can compose the view like lego bricks AND that's where the fun starts.

Clone the repo at Github.