[SOLVED] Dynamic Hostnames

'User made' tutorials related to Porteus Kiosk edition.
Official kiosk documentation can be find here: http://porteus-kiosk.org/documentation.html
Forum rules
Porteus Kiosk section of the forum is unmaintained now. Its kept in a 'read only' mode for archival purposes.
Please use the kiosk contact page for directing your queries: https://porteus-kiosk.org/contact.html
Aik
Ronin
Ronin
Posts: 2
Joined: 06 Mar 2019, 14:19
Distribution: huh?

[SOLVED] Dynamic Hostnames

Post#1 by Aik » 06 Mar 2019, 14:25

Hey guys,

I'm having trouble understanding what I need to do here. I am in the process of setting up configs for what will eventually be 2400 kiosks. The way the developers have their code set up on our homepage is it grabs the hostname out of the user agent. But I'm very green to Porteus, as each homepage will set the kiosks homepage to have their store location saved on the page based off it's hostname.

Right now I know I can set one config file to have a hostname, but it makes all 3 testers I have to that hostname. Is there a way I can do this where I can set the hostname in there another way? We need the hostname to append the userAgent string, and we need that userAgent string to have the right store number (from the hostname) so it can pass secret keys and authenticate.

As I see it right now, I need to have a separate config file for each store, which has me in a bit of a panic from a workload/management standpoint.
Last edited by Aik on 06 Mar 2019, 22:12, edited 1 time in total.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Dynamic Hostnames

Post#2 by fanthom » 06 Mar 2019, 16:52

Hello Aik,

You could automatically generate dynamic and unique hostnames only from the hardware, e.g. MAC address or UUID:
Universally unique identifier

As far as i understand you need to set the hostname as per store where kiosk is located so you must use the kiosk config (not possible to get the store info from the hardware unless you find a way to flash motherboard BIOS and hardcode the string you want in it).

Your best solution would be to use single kiosk config with nested configurations enabled:
https://porteus-kiosk.org/remote-management.html#nested

So your remote config would look like:

Code: Select all

[[ GLOBAL ]]
all_parameters_here
run_command=code to set user agent from hostname

[[ PCID1 ]]
hostname=store1-kiosk_A

[[ PCID2 ]]
hostname=store1-kiosk_B

[[ PCID3 ]]
hostname=store2-kiosk_A

[[ PCID4 ]]
hostname=store3-kiosk_A

[[ PCID2400 ]]
hostname=store700-kiosk_A

Fastest way for deployment and configuration would be to:

a) connect all kiosks to the server using [[ GLOBAL ]] parameters only (same hostname for everybody)

b) export client list using Admin Panel of PK Server and copy PCIDs from it

c) add [[ PCID ]] sections to the config (to override GLOBAL hostname) for each kiosk as shown above.

You may prepare the config on your desktop using favorite editor and then copy it directly to PK Server over VNC (editing 2400 config entries through the Admin Panel is not that user friendly).

Thanks
Please add [Solved] to your thread title if the solution was found.

Aik
Ronin
Ronin
Posts: 2
Joined: 06 Mar 2019, 14:19
Distribution: huh?

Dynamic Hostnames

Post#3 by Aik » 06 Mar 2019, 22:12

Thanks for letting me know. I kind of had a feeling this was the case. Once it's all in place though maintaining it will be easy.

Locked