Downloading and configuring Pi-Lib

Just like with the server, we’ll store the Pi-Lib code in the ‘Documents’ folder; if you want to, you can save it elsewhere.

Pi-Lib is the software that will be used as an interface to access the catalogue or ask help to the library’s staff. There are also three other buttons that require a password to trigger an elevated action. These actions are: Closing Pi-Lib, shutting down the machine and rebooting the machine.

  • Download the Pi-Lib software.
  • Extract it in the desired folder.
  • After extraction we’ll have to do two things:
    • Setting the file- and access permissions.
    • Configuring the ‘libwide.ini’ file.

 

1) Setting the file- and access permissions

By now we've done this so many times that I didn't put any screenshots online. 

Setting access permissions is important to ensure that only the sudo user can modify the crucial files, but that the files can be read by any other user (in this case, the public user).

We will start with setting the access permissions to the Pi_Lib folder itself.

  • Right click the extracted folder in your ‘Documents’ folder, click ‘Properties’, then ‘Permissions’.
  • Set the permissions to:
    • View content: ‘Anyone’
    • Change content: ‘Only owner’
    • Access content: ‘Anyone’
  • Click ‘OK’

Now open the Pi_Lib folder, in it you will see three other folders: ‘Configuration’, ‘MEDIA’ and ‘Tools’.

  • Select these folders, right click on one of them, then click ‘Properties’, then ‘Permissions’ and set them to:
    • View content: ‘Anyone’
    • Change content: ‘Only owner’
    • Access content: ‘Anyone’
  • Click ‘OK’

Now we shall verify if ‘Pi-Lib.pyw’ can be run by our visitors.

  • Right click the file, click ‘Properties’, then ‘Permissions’.
    • Set the permissions to:
      • View content: ‘Anyone’
      • Change content: ‘Only owner’
      • Execute: ‘Nobody’
    • Click ‘OK’

Finally we need to ensure the usability of our tools.

  • Open the ‘Tools’ folder.
  • Select the two files, then right click on one of the selected files.
  • Click ‘Properties’, then ‘Permissions’.
    • Set the file permissions to:
      • View content: ‘Anyone’
      • Change content: ‘Only owner’
      • Execute: ‘Nobody’
    • Click ‘OK’

2) Configuring the libwide.ini file

The ‘libwide.ini’ file stores the information that is needed by the system to function properly. It stores three variables that are read and used by the main program and are valid for the entire library. These variables are:

  • The PiLib password: This is needed to access the three elevated actions. You cannot read the password straight from the ‘libwide.ini’ file as the password is stored by using a cipher.
  • The IP of the server: This is needed to send a package to the server to ask for help.
  • The URL of the catalogue: This is needed to open the default browser which will display the catalogue of the library.

This configuration process is done with a simple script, in other words, you’ll just have to type in what the program asks. Terminal window to configure libwide.ini

  • Open the ‘Configuration’ folder inside the ‘Pi_Lib’ folder.
  • Double click the script ‘FIRST Libwide configuration.py’.
  • The terminal window shows up and it will prompt you three times.
    • First provide the URL (or Internet Address of the catalogue of the library)
      • You don’t need to type in ‘http://’ , the program will add it automatically.
      • Press ‘Enter’
    • Then you will be prompted to provide the IP address of the Pi-Lib-server. This is the static IP address we configured in an earlier phase, I’ve asked you to write it down; look for it in ‘Making a static IP.’
      • Enter the correct IP address.
      • Press ‘Enter’
    • Now you are prompted for the master-password
      • Type in a password that consists of numbers [0-9] and/or letters [a-z] [A-Z]; don’t use special characters as this will break the ciphering process.
      • Write down the password in the mnemonic, it should be known to all library’s staff.
      • Press ‘Enter’
    • If you want to verify what you’ve typed, press ‘y’ when prompted, if not, press ‘n’, this will terminate the program.
      • If you have pressed ‘y’, verify that what you’ve typed is correct. Here you can see the output that has been created by the libwide configurator. If you notice a mistake, you can rerun the configurator. Notice that the password is stored as a cipher.
        • Note that the password is stored as a cipher, so it won’t match what you typed in the terminal; this is normal.
      • Close the Text-editor
      • Press any key to close the configurator.
      • Rerun the configurator if you noticed a mistake.

 

 

Next:  Creating the shortcut