NS8-GLPI App - First Pre Release

They weren’t cut using anything close to “atomic” or nuclear!

The Internet is NOT atomic proof, and never will be!

You are completely right.

After more than 40 trials and attempts, am happy to report that we have a new docker container that implements the suggestions by Steph.

All the download logic is implemented in the dockerfile unit
only the database execution and restore parts have been impleemnte din a seprate db_setup/sh file.

you should technically be in a position to start the container when no connectivity is available.

the contained docker is implemented here: geniusdynamics/docker-glpi at combined (github.com)

and published here with a tag: combined

geniusdynamics/glpi Tags | Docker Hub

NEthserver App that implements this new docker is found here: geniusdynamics/ns8-glpi at genius-glpi (github.com)

under the branch genius-glpi

you can install and test the new container implementation by running

add-module ghcr.io/geniusdynamics/glpi:genius-glpi 1

You can update to this build by running

api-cli run update-module --data '{"module_url":"ghcr.io/geniusdynamics/glpi:genius-glpi","instances":["glpi1"],"force":true}'

TEsted scenarios
A) New instalaltion - seems to work well with no issues
B) Update from existing Image - breaks and presents default apache2 debian webpage

However, accessing the link with /glpi appended, takes you to the login page
and all your data is restored and in place.

Am not sure why this is the case,

@stephdl since you ar emore experienced with the container, could you help Audit the container kindly and suggest areas of improvemnts.

We implemented functions to restore database, if the docker container is run independently as well as if run within the nethserver context to properly handle the restore_db commands.

Afew security warnings, working on the last one, not sure about the second last one

point me the branch of the project, the main has no changes

the install.php can be removed once downloaded from glpi project
the second you needs to make a virtualhost to silent the warning (check my repo on glpu)
and the third I suppose you have to enable it,

immediately after download?!

combined branch of docker-glpi

Edit

i might have pushed an update tryign to impleemnt


# Proper permissions and configurations for GLPI
RUN if [ -f /docker-entrypoint-initdb.d/zz_glpi_restore.sh ]; then \
        echo -e "<VirtualHost *:80>\n\tDocumentRoot /var/www/html/glpi\n\n\t<Directory /var/www/html/glpi>\n\t\tAllowOverride All\n\t\tOrder Allow,Deny\n\t\tAllow from all\n\t</Directory>\n\n\tErrorLog /var/log/apache2/error-glpi.log\n\tLogLevel warn\n\tCustomLog /var/log/apache2/access-glpi.log combined\n</VirtualHost>" > /etc/apache2/sites-available/000-default.conf; \
    else \
        echo -e "<VirtualHost *:80>\n\tDocumentRoot /var/www/html/glpi/public\n\n\t<Directory /var/www/html/glpi/public>\n\t\tRequire all granted\n\t\tRewriteEngine On\n\t\tRewriteCond %{REQUEST_FILENAME} !-f\n\t\n\t\tRewriteRule ^(.*)$ index.php [QSA,L]\n\t</Directory>\n\n\tErrorLog /var/log/apache2/error-glpi.log\n\tLogLevel warn\n\tCustomLog /var/log/apache2/access-glpi.log combined\n</VirtualHost>" > /etc/apache2/sites-available/000-default.conf; \
    fi && \
    chown -R www-data:www-data /var/www/html/glpi/ && \
    chmod -R u+rwx /var/www/html/glpi/

from the previous docker that is causing some issues on install.

working on a resolution…

implementing either
apachectl -D FOREGROUND
and
exec apache2-foreground

on our entrpoint seems to cause an issue, not sure what happened there

Seen the culprit…

resolved
love this part in the logs, meaning backup restore works…
2024-03-19T14:52:58+03:00 [1:glpi10:glpi-app] Database backup found on external database. Restoring...

is this going to be an issue?

2024-03-19T14:52:58+03:00 [1:glpi10:glpi-app] ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)
1 Like

@oneitonitram and team, thanks so much for the dedication and enthusiasm. I really appreciate your (teams) effort. It make the NS8 journey lively and exciting!

2 Likes

Thanks for the kind words, they mean alot. been actually learning alot about how docker work while building these docker files, its interesting, i used to be scared to create own docker files

@kemboielvis22 is the confident one with docker in the team

1 Like

With debian 12 no need to use sury

Install simply php you will have php8.2.7

1 Like

I think you should at the end of dockerfile try to clean tmp apt cache to shrink the size of the image

RUN apt-get clean
&& rm -rf /var/lib/apt/lists/*

Do the same in each tmp folder you can find

1 Like

Try to install with apt install --no-install-recommends like this you could avoid to install deb that you do not need

1 Like

what code does version 2.5.5 of nethserver implement on the update procedure, All of a sudden i cant update my App is there a major new change in that procedure

Not aware of a big change

am getting

Error: copying system image from manifest list: writing blob: adding layer with blob "sha256:78533ca4968fb1a12e9c33c06ad4810a5da8439a0f47e3b35f3cd144fed9bcf1": processing tar file(open /usr/lib/python3.11/__pycache__/functools.cpython-311.pyc: no space left on device): exit status 1
Traceback (most recent call last):
  File "/usr/local/agent/actions/update-module/05pullimages", line 79, in <module>
    ).check_returncode()
      ^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/subprocess.py", line 502, in check_returncode
    raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '('podman', 'pull', 'docker.io/mariadb:10.11.5', 'docker.io/geniusdynamics/glpi:combined')' returned non-zero exit status 125.

Simple One !!!

:slight_smile:

2 Likes

Good shot :wink:

remove-module glpi1 --no-preserve

Binary Storage Devices:

When you buy them they’re empty, when you need them, they’re full…

:slight_smile:

1 Like

I got it myself a lot of time…evident issue is the one we search more

I had not seen one, thanks for the sight.

need to remove lots of modules on my testing server

and it seems you gys fixed a more problematic issue, it was initially not possible to properly habdle low dis space, and the server would crash completely without ability to access or recover web UI, during core updates

this server has been busy testing

2 Likes