Client rebranding image download question
This is a question for @Joe-Schmitt to try to clarify the operation of the FOG clients’ intended interaction with the FOG server relative to the client rebranding image file banner.png.
Joe, I have recently tested using a 650x120 pixel banner.png client rebranding image which works just fine. Thank you for adding this nice feature! However, I have noticed in the fog.log on the clients that they appear to be redownloading the banner.png file from the server upon every client check-in event whenever a banner.png file is specified in the server’s web gui. So I was wondering if this is the intended mode of operation for this feature or if it may be a bug.
First indicator - Client fog.log excerpt that repeats for every client check-in event:
4/4/2017 9:08 AM Middleware::Communication Download: http://server_IP_address_removed/fog/management/other/banner.png
Second indicator - The client’s banner.png file timestamp is continuously updated to match the timestamp of the client’s fog.log.
It seems to me that the SHA-512 checksum (which I have verified matches what is shown in the web gui) would be used not only to identify tampering with the banner.png file on the client, but also as a check to see if the file on the client matches the file on the server in order to determine whether or not redownloading the file is necessary when the client checks in with the server. Am I correct in this assumption? If so, then my observed activity would indicate a bug. If not, then perhaps this may be a potential area of improvement to help reduce unnecessary network bandwidth usage between the FOG client and server, and unnecessary file system writes on the clients.
Some additional testing environment context FYI:
FOG Server OS: Ubuntu 14.04 LTS
FOG Version: 1.3.5 (svn 6067)
FOG Client: 0.11.11
In the FOG web gui, I have only uploaded the FOG_CLIENT_BANNER_IMAGE and verified that its calculated checksum shown in FOG_CLIENT_BANNER_SHA matches the checksum I calculate for the source banner.png file. I have left the remaining four rebranding fields blank:
Also, I get the same consistent file redownloading activity regardless of whether the rebranding image is named banner.png or whether I give it another name such as MyTest_banner.png prior to uploading it. When testing an alternate name, I notice that the file gets renamed to the generic name of banner.png on the clients.
Lastly, if I clear the FOG_CLIENT_BANNER_IMAGE entry from the web gui, the generically renamed banner.png file remains on the clients. But since it is not specified anymore in the web gui, the rebranding image is then correctly NOT displayed in the clients’ shutdown/reboot prompt.
Thank you again for this useful new feature. I’m just curious to find out if it is actually working as intended in my environment.
@Joe-Schmitt Yes I can, #wiki worthy.
@Wayne-Workman Here is some info I’ve gathered for consideration as a potential starting point for a Wiki article on FOG Rebranding.
Rebranding was introduced to the FOG client in version 0.11.6 of the client. It has since been improved with additional features. So to clarify, the information in this posting refers to FOG client version 0.11.12, and FOG version 1.4.0-RC-5 (dev-branch).
The following was pulled from fogproject/packages/web/commons/schema.php found at
sections 240 through 243 (currently lines 3499 through 3574).
The first quote for each setting is the popup text currently displayed in the web GUI, except for
settingDescquotes which are used as the GUI popup text for their respective settings.
FOG_CLIENT_BANNER_IMAGE ‘This setting defines an image for the banner on the fog client.’
settingDesc=‘This setting defines an image for the banner on the fog client. The width must be 650 pixels, and the height must be 120 pixels.’
FOG_CLIENT_BANNER_SHA ‘This setting stores the sha value of the banner to be applied.’
FOG_COMPANY_NAME ‘This setting defines the name you would like presented on the client.’
FOG_COMPANY_COLOR ‘This setting is the hex color code you want progress bar colors to display as.’
FOG_COMPANY_TOS ‘This allows setting the company terms of service.’
FOG_COMPANY_SUBNAME ‘This allows setting the company sub unit.’
settingDesc=‘This allows setting the sub unit, and is only used on the Equipment loan report for tracking.’
The following was pulled from the original announcement at https://news.fogproject.org/fog-client-v0-11-6-released/
This release includes the ability to rebrand the shutdown prompt. This means you can change the colors, text, and images of the prompt to match your company’s. While this feature is free, we ask that if plan on using the rebranding option please consider providing a donation https://sourceforge.net/donate/index.php?group_id=201099 .
To set these options, go to FOG Configuration -> FOG Settings -> Rebranding.
FOG_COMPANY_COLOR: This option is a hex value of your company’s color
FOG_CLIENT_BANNER_IMAGE: This should be a PNG image with 650x120 dimensions, note that the background can be transparent. See the default banner for an example. https://github.com/FOGProject/fog-client/blob/master/resources/banner.png (fog-client/resources/banner.png).
Additional notes and info.
This setting is used for more that just the FOG client shutdown/reboot prompt. For example, it is also used as a heading within the PDF exports of certain reports. It is NOT used to rebrand the background image during network/PXE booting (that screen continues to use the default FOG branding). As noted above, the background for the banner image can be transparent. This is an option, not a requirement. The PNG file can have any arbitrary name when uploaded into the web GUI. However, when automatically copied to the clients, the image gets renamed to “banner.png” and is saved to the clients’ program installation folder (depending upon a check-box selection during the initial client installation). On the server, uploaded files are saved in the directory /var/www/fog/management/other. One can disable the custom banner image (which returns to using the default FOG banner image) from within the web GUI via the browse button (up arrow). To do so, simply submit a blank path. The banner.png file remains on the clients even if the FOG_CLIENT_BANNER_IMAGE setting is cleared. But the remaining banner.png file will not be used by the clients unless it is enabled/resubmitted via the web GUI.
This field uses the SHA512 algorithm to automatically generate and display a hash value when a banner image is uploaded via the web GUI. This field is used to detect differences between the source banner image file on the server and the copies on the clients. Upon each and every client check-in event with the server, the client recalculates the SHA512 value of its current banner.png file and compares it against the SHA512 value calculated on the server. If the hash values do not match (or if there is no banner.png file on the client), the client will download the banner image file from the server, rename it and overwrite any existing banner.png file on the client. This effectively identifies and self-corrects for cases of tampering with the banner.png file on the client, and it automatically keeps the banner image file on the clients up-to-date whenever the file gets changed on the server.
I don’t have immediate plans to use the remaining four rebranding settings. So I have not tested them, and therefore don’t have anything additional to add for them.
I hope this is useful as a potential starting point for a Wiki article on FOG Rebranding.
@Joe-Schmitt I suspected that it was the mismatch between the server’s SHA512 and the client’s SHA256 that needed correcting at https://github.com/FOGProject/fog-client/blob/master/Service/FOGSystemService.cs#L65 . I won’t be back on-site to test against my clients until later this week. But I’m sure that’s it.
Wayne Workman last edited by
@Joe-Schmitt Yes I can, #wiki worthy.
@utopia 0.11.12 fixes the banner downloading issue. I agree the wiki could use some updating on rebranding, @Wayne-Workman would you be able to add a section on it when you have some spare time? You can use https://news.fogproject.org/fog-client-v0-11-6-released/ as a template.
@Joe-Schmitt I’m glad to hear that you’re on top of it. I’ll be looking forward to the patch.
Also, while on this subject, do you have any plans to update the client wiki at https://wiki.fogproject.org/wiki/index.php?title=FOG_Client to reflect this new feature? I haven’t been able to find much on it since the announcement https://news.fogproject.org/fog-client-v0-11-6-released/
If so, then may I suggest:
- Let everyone know the requirements for the FOG_CLIENT_BANNER_IMAGE / banner.png file, and
- For the six Rebranding fields in the web gui, perhaps a little more detailed description than what is given by the mouse hovering popups or what is listed in the actual code on github?
Either way, thank you so much for your great work! I especially really appreciate your work on security and snapins.
@utopia you are correct that the client should be using the SHA512 to see if it needs to re-download the banner. It would seem I forgot to put that into production. When 0.11.12 is released I will also include a patch for this, thanks for bringing it up!