Monday, August 12, 2013

How to create Jitsi Mac installer

Requirements for building source code and create installer

  1. Java ->> by default mac ships with Java (Make sure it is up-to date update)
  2. Ant ->> by default mac ships with ant
  3. Command line developer tools ->> you can install this from Xcode or download the developer command line tools package and install. We need "SetFile" tool for creating the installer, by default these tool is install under "/usr/bin/" but "ant" looks for this tool under "/Developer/tools/" directory. So, to over come this issue, create a soft link ->> create directory  "/Developer/tools", then run this command "sudo ln -s /usr/bin/SetFile /Developer/Tools/SetFile"
  4. jarbundler 2.2.0 ->> you can download it from here http://sourceforge.net/projects/jarbundler/ extract the zip and Move the file jarbundler-2.2.0.jar into /usr/share/ant/lib

Tested on Mac

  • OS X 10.8.3 
  • Java - version "1.6.0_45"  
    • Java(TM) SE Runtime Environment (build 1.6.0_45-b06-451-11M4406)  
    • Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01-451, mixed mode) 
  • Apache Ant(TM) version 1.8.2 compiled on June 20 2012

Before you start creating a installer

  1. Get the source code (zip) from GitHub ->> https://github.com/jitsi/jitsi
  2. Extract the downloaded zip package to "jitsi-master" directory
  3. Open terminal and go to the extracted "jitsi-master" directory
  4. Run "ant rebuild" ->> to build(compile) the jitsi source code
  5. If  "ant" builds the source code with out any issues, then you are go to follow steps to create installer

Steps to create Installer(dmg) on mac

  1. Create a directory called "classes" under "jitsi-master/resources/install" directory
  2. Copy "jitsi-master/sc-bundles" directory to "jitsi-master/resources/install" directory
  3. Run this command "rm -rf resources/install/sc-bundles/*-slick.jar" ->> to remove all unit test files
  4. Copy "jitsi-master/lib/" directory contents(files & directories) except "installer-exclude" directory to "jitsi-master/resources/install/lib/" directory
  5. Copy the logo image "jitsi-master/resources/images/logo/logosc_logo_128x128.icns" to "jitsi-master/resources/install/"
  6. Edit "jitsi-master/resources/install/build.xml" and replace ' icon="resources/images/logo/sc_logo_128x128.icns" ' with ' icon="sc_logo_128x128.icns" '
  7. In Terminal go to this directory "jitsi-master/resources/install"
  8. Run this command "sudo ant dmg" ->> you need to run this command as sudo user because as a normal user you may not have the permissions to create the dmg files
  9. Once the command has finished and you see "BUILD SUCCESSFUL", then you are done. 

You have created the installer for mac. Go to "jitsi-master/resources/install/release/macosx" directory you can find the "dmg" mac installer for jitsi.


Wednesday, June 5, 2013

Openfire Jitsi provisioning plugin

Overview

The Jitsi Provisioning Plugin for Openfire server provides the ability to authenticate users and provision the Jitsi client according to the Enterprise Needs. Provisioning is the feature that allows network and provider administrators to remotely configure Jitsi instances that they are responsible for. Jitsi’s provisioning module uses http. This means that, based on a few parameters like an IP or a mac layer address, or a user name and a password, this Plugin can feed to a freshly installed Jitsi all the details that it needs in order to start making calls, downloading updates or configure codec preferences.

Download

GitHub

Installation

Copy jitsiprovisioning.jar into the plugins directory of your Openfire server. The plugin will then be automatically deployed. To upgrade to a new version, copy the new jitsiprovisioning.jar file over the existing file.

Configuration

Access to the service is restricted with a "secret" that can be viewed and set from the User Service page in the Openfire admin console. This page is located on the admin console under "Server" and then "Server Settings". This should really only be considered weak security. The plugin was initially written with the assumption that http access to the Openfire service was only available to trusted machines. In the case of the plugin's author, a web application running on the same server as Openfire makes the request.

Using the Plugin

To authenticate users and get the Jitsi provisioning details, submit HTTP/HTTPS requests to the jitsiprovisioning provisioning service. A provisioning service is an HTTP or HTTPS URL optionally followed by several parameters. The URI would most often point to a provisioning server-side script. Please note that we strongly recommend you only use HTTPS unless you have very good reasons not to. Provisioning POST requests generally contain sensitive information like passwords and you definitely don’t want that being sent in clear text. The service address is [hostname]plugins/jitsiProvisioning/provision. For example, if your server name is "example.com", the URL is http://example.com/plugins/jitsiProvisioning/provision/?user=${username}&password=${password}&secret=bigsecret

Provisioning URI and parameters

The easiest way to have Jitsi connect to a provisioning server is to configure the provisioning URL in its configuration form. Jitsi also supports automatic provisioning discovery via DHCP and Bonjour. To do so, go to options => advanced => provisioning and check “Enable provisioning” (if not already checked), then select “Manually specify provisioning URI” and enter a URI.

Sample HTML

The following example athenticates user xyx and on success server returns provisioning data



* When sending double characters (Chinese/Japanese/Korean etc) you should URLEncode the string as utf8.
In Java this is done like this
URLEncoder.encode(username, "UTF-8"));
If the strings are encoded incorrectly, double byte characters will look garbeled in the Admin Console.

Server Reply

The server will reply to all User Service requests with an plain/text. If the request was processed successfully the return will be a provisioning text. If the request was unsuccessful, the response will be 401 and plain/text with error message.

Error String 401 responseDescription
ConnectionException Unable to connect to the Database/LDAP to authenticate the user
InternalUnauthenticatedException Internal authentication error
UnauthorizedException Invalid Username/Password.
RequestNotAuthorised The supplied secret does not match the secret specified in the Admin Console or the requester is not a valid IP address.

References

Click here to know more about Jitsi Provisioning
Click here to know more about Openfire server