Day: November 27, 2024

  • ITSM – GLPI – agent

    I didn’t realize that this system has an agent, but I’m happy it does. Looks to be fairly simple to setup.

    C:\winget install glpi-agent --custom="SERVER='http://glpi/' RUNNOW=1"
  • ITSM – GLPI – config

    ITSM – GLPI – config

    After installation I loaded up the URL, set the language and ran environment checks. Now I have to go through the output and make sure I’m cool with the warnings and such. I’m guessing I need to fix the permissions issue first, lol.

    sudo chown www-data:www-data -R glpi for the permissions. The rest don’t look that serious since I don’t have the thing accessible from the web, but I may revisit.

    DB

    Next step is the DB config. I could just feed it the root password to my mysql server, but I’m going to create a user just for this DB.

    mysql> CREATE USER 'glpi_db'@'localhost' IDENTIFIED BY '********';
    mysql> GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE,  SELECT, REFERENCES, RELOAD on *.* TO 'glpi_db'@'localhost' WITH GRANT OPTION;
    mysql> FLUSH PRIVILEGES;

    I don’t often get to do the rest with a GUI!

    It created the DB without error. A couple other generic questions and a sales pitch and we’re done.

    App config

    After signing in we get this nice little message so I gotta change some passwords to get rid of all that red.

  • ITSM – GLPI – Installation

    ITSM – GLPI – Installation

    I have a couple fairly complicated and hopefully long-term projects I’d like to do, and things are much easier to work on if I have a good way to store information about various components and incidents, so I’m going to see how hard it is to roll my own install of GLPI(Gestionnaire Libre de Parc Informatique, or “Free IT Equipment Manager”).

    screenshot stolen from official docs

    Installation

    Downloaded this. Moved extracted folder to /var/www.

    Create directories for configs, data, and logs.

    • GLPI_CONFIG_DIR: set path to the configuration directory;
      • /etc/glpi
      • GLPI requires read rights on this directory to work; and write rights during the installation process.
      • copy the contents of the config directory to this place.
    • GLPI_VAR_DIR : set path to the files directory;
      • /var/lib/glpi
      • GLPI requires read and write rights on this directory.
      • copy the contents of the files directory to this place.
    • GLPI_LOG_DIR : set path to logs files.
      • /var/log/glpi
      • GLPI requires read and write access on this directory.

    Create a inc/downstream.php file into GLPI directory with the following contents:

    <?php
    define('GLPI_CONFIG_DIR', '/etc/glpi/');
    
    if (file_exists(GLPI_CONFIG_DIR . '/local_define.php')) {
       require_once GLPI_CONFIG_DIR . '/local_define.php';
    }

    Create a file in /etc/glpi/local_define.php with the following contents:

    <?php
    define('GLPI_VAR_DIR', '/var/lib/glpi');
    define('GLPI_LOG_DIR', '/var/log/glpi');

    Add info Apache virtual server. I’ll lock it down to my local network, so this won’t be accessible from the internet for now. Added to /etc/apache2/sites-enabled/glpi.conf.

    <VirtualHost *:80>
            ServerName glpi
    
            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/glpi/public
    
            ErrorLog ${APACHE_LOG_DIR}/glpi-error.log
            CustomLog ${APACHE_LOG_DIR}/glpi-access.log combined
    
        # If you want to place GLPI in a subfolder of your site (e.g. your virtual host is serving multiple applications),
        # you can use an Alias directive. If you do this, the DocumentRoot directive MUST NOT target the GLPI directory itself.
        # Alias "/glpi" "/var/www/glpi/public"
    
        <Directory /var/www/glpi/public>
            Require all granted
    
            RewriteEngine On
    
            # Ensure authorization headers are passed to PHP.
            # Some Apache configurations may filter them and break usage of API, CalDAV, ...
            RewriteCond %{HTTP:Authorization} ^(.+)$
            RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
            # Redirect all requests to GLPI router, unless file exists.
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ index.php [QSA,L]
        </Directory>
    
    
    </VirtualHost>

    I of course had to add an entry for glpi in the hosts file on my laptop for this to work.

    Looks like it’s installed!

  • Research

    Just a place to organize links.

    Information about kit

    Youtube video about a Marshydro kit very similar to the one I bought.

    Video on how to setup a grow tent kit.

    Automation

    ESPGarden – GitHub page where a person made their own garden software with the ESP32.