sábado, 13 de junho de 2015

Customizing NetScaler Gateway GUI




Customizing NetScaler Gateway GUI

Hello folks!!

Today I started to customize my NetScaler Gateway Graphical User Interface... As you can see below, I am using a NetScaler VPX 10.5.



The process to customize NS Gui is similar to customize the StoreWeb  on Storefront. You have to find the right places and files to change...

After you access the NetScaler Gateway menu, you are gonna see the Global Settings.



UI themes are configurable through this menu, so you click on Change Global Settings and look forward Client Experience tab:


On bottom of this page you have the option to select the UI Them. This option has thre themes, Default (black), Green Bubble (breen) and custom...



At this point I will show you how to configure and use the Custom theme.

In my case, I used Green Bubble theme as start point. So I selected Green Bubble and applied it. Note this selection is global, so If you have more than one VIPs for NS Gateway, this configuration will be applied to all of them..

From this part, we have to access NetScaler through SSH protocolo to edit and create some files, it is recomended you have WinSCP to transfer files to NS because it is more user friendly...

Once inside NetScaler through SSH, we need to create the ns_gui_custom directory into /var. To perform this task you have to issue this command line:

mkdir /var/ns_gui_custom

Looking into this directory with LS command, it might looks like this:


Now we need to copy our theme files from /netscaler/ns_gui and to perform this I suggest you zip this directory without to remove files from there.. So to do this you can issue:

cd /netscaler

tar -zcvf /var/ns_gui_custom/customtheme.tar.gz ns_gui/*

Doing this way, you should see the customtheme.tar.gz file inside your previous created directory named ns_gui_custom. look: # ls /var/ns_gui_custom



Now you go again to management gui and change your theme to custom.. probably you will not notice any change because we didn't change anything properly... Ok Let's go ahead...

Look, now we have another folder into /var/ns_gui_custom. this folder ns_gui, is the previous compacted directory. So now, we can edit from this point without to compromise our default files...

Now we are going to start the editing theme process... the easiest way is replacing files, if you really wanna edit this theme, you should know more than basic stuffs regarding CSS Styles, JavaScript and HTML.

So I Started changing the background... to do it, you have to replace the bg_bubbles file, located on /var/ns_gui_custom/vpn/media.

Note our base URL to NetScaler Gateway should seems like:

https://myvpn.mydomain.com/vpn/index.html.

Knowing this, we have this vpn directory and index.html as tip to start our job...

Firstly, you can replace bg_bubbles file with you own background, So I created my file and gave it the same name to replace...



As I said before, I used WinSCP to browse and replace files in NetScaler. As I chose a different background color, maybe it is better to customize font colors to get a better experience... Now you have to look some CSS basic stuffs...



NetScaler contains three important CSS files:
ctxs.authentication.css - ctxs.mainstyle.css - ctxs.ui.messagebox.css

 








Remember all you need to change is into /var/ns_gui_custom/.

Another good tip is to use the browser developer mode (F12 in most cases) to investigate where to look for a customization property...

Example you wanna change the size this title "Please log On". Press F12 and find it or Righ Click and select Inspec Element. You should find something like this:



It is pointing the class that we are looking for: class="label plain CTX_ContentTitleHeader" and if you look to right pane, you are gonna see the reference to CSS file: "ctxs.mainstyle.css" on line 83.







So I am using font-size 16pt and font-weight: bold to strong this font.

Next step was to change the size of Username and Passoword:

The username is inside index.html. So I looking on browser developer mode I found it is on '<span id="Username" ' So I opened index.html and added style="font-size:13pt" to span tag.

Like: <span id="User_name" style="font-size:13pt"></span>



The Password text is on another file... It is located into login.js. This text is created by this javascript during the page loading....

The process to customize is the same, you add CSS Style parameters to span tag..

this file is /var/ns_gui_custom/vpn/login.js




Things to know:

you can reference another jpg as backgrount in ctxs.mainstyle.css file.



if you wanna change the Citrix Receiver logo on authentication screen, you have to go to ctxs.authentication.css



It's recommended you work with files but keep all extensions the same... note that one is JPG and another PNG..

To finish... remember, you need to keep this customtheme.tar.gz in this directory "/var/ns_gui_custom/". Example, if you change to default theme and change again to this custom, NetScaler will extract files from this zip in this directory to use as theme...

So finally I created a script to help me with boring operations:

rm customtheme.tar.gz
tar -zcvf /var/ns_gui_custom/customtheme2.tar.gz ns_gui/*
mv customtheme2.tar.gz customtheme.tar.gz






after script creation you need to give permissions as chmod 777 background.sh

My process... I edit my theme, run the script to remove previous .tar.gz , create a new tar from ns_gui edited, switch back to default theme and switch again to custom... doing this, my zipped will be applied again overwrithing previous ns_gui directory inside /var/ns_gui_custom...

If you have any doubts, feel free to ask me...

Tks Peluffo....

















Nenhum comentário:

Postar um comentário