From cdae1b09c44bf286a14f43319061c5277750d64c Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Tue, 19 Mar 2024 09:47:36 +0100 Subject: [PATCH 01/10] add test combined glpi --- build-images.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-images.sh b/build-images.sh index c15e239..49bc8b9 100644 --- a/build-images.sh +++ b/build-images.sh @@ -45,7 +45,7 @@ buildah config --entrypoint=/ \ --label="org.nethserver.authorizations=traefik@node:routeadm" \ --label="org.nethserver.tcp-ports-demand=1" \ --label="org.nethserver.rootfull=0" \ - --label="org.nethserver.images=docker.io/mariadb:10.11.5 docker.io/geniusdynamics/glpi:latest" \ + --label="org.nethserver.images=docker.io/mariadb:10.11.5 docker.io/geniusdynamics/glpi:combined" \ "${container}" # Commit the image buildah commit "${container}" "${repobase}/${reponame}" From cbc4e82ff28d2c29d0e471ecf3e56e536a2c9255 Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Tue, 19 Mar 2024 09:48:31 +0100 Subject: [PATCH 02/10] remove version env because our build does not implemnt it --- imageroot/systemd/user/glpi-app.service | 1 - 1 file changed, 1 deletion(-) diff --git a/imageroot/systemd/user/glpi-app.service b/imageroot/systemd/user/glpi-app.service index 250c6a5..23c3b05 100644 --- a/imageroot/systemd/user/glpi-app.service +++ b/imageroot/systemd/user/glpi-app.service @@ -24,7 +24,6 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/glpi-app.pid \ --pod-id-file %t/glpi.pod-id --replace -d --name glpi-app \ --volume glpi_html:/var/www/html/glpi \ --env=GLPI_* \ - --env VERSION_GLPI=10.0.14 \ --env TIMEZONE=Europe/Brussels \ --env MARIADB_DB_TYPE=mysql \ --env MARIADB_DB_HOST=127.0.0.1 \ From e3a789153c7c250e5eb9f8608fb86049e7fdcd08 Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Sat, 23 Mar 2024 05:21:24 +0100 Subject: [PATCH 03/10] update check instance with /front url --- imageroot/systemd/user/glpi-app.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imageroot/systemd/user/glpi-app.service b/imageroot/systemd/user/glpi-app.service index 23c3b05..d2d9cc2 100644 --- a/imageroot/systemd/user/glpi-app.service +++ b/imageroot/systemd/user/glpi-app.service @@ -18,7 +18,7 @@ TimeoutStopSec=70 ExecStartPre=/bin/mkdir -p config ExecStartPre=/bin/rm -f %t/glpi-app.pid %t/glpi-app.ctr-id ExecStartPre=-runagent discover-smarthost -ExecStartPost=/usr/bin/bash -c "while ! /usr/bin/podman exec glpi-app /usr/bin/curl http://127.0.0.1:80/glpi ; do sleep 3 ; done" +ExecStartPost=/usr/bin/bash -c "while ! /usr/bin/podman exec glpi-app /usr/bin/curl http://127.0.0.1:80/front ; do sleep 3 ; done" ExecStart=/usr/bin/podman run --conmon-pidfile %t/glpi-app.pid \ --cidfile %t/glpi-app.ctr-id --cgroups=no-conmon \ --pod-id-file %t/glpi.pod-id --replace -d --name glpi-app \ From ae6008243fcafc0e408313215280a846b80c8e30 Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Sat, 23 Mar 2024 05:25:51 +0100 Subject: [PATCH 04/10] UI-add host pattern and format --- ui/public/i18n/en/translation.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/public/i18n/en/translation.json b/ui/public/i18n/en/translation.json index 881f589..8c82531 100644 --- a/ui/public/i18n/en/translation.json +++ b/ui/public/i18n/en/translation.json @@ -32,7 +32,9 @@ "advanced": "Advanced", "configuring": "Configuring", "instance_configuration": "Configure glpi", - "domain_already_used_in_traefik": "Domain already used in traefik" + "domain_already_used_in_traefik": "Domain already used in traefik", + "host_pattern": "Must be a valid fully qualified domain name", + "host_format": "Must be a valid fully qualified domain name" }, "about": { "title": "About" From aefef7c61a6150578018f781477226c77ae7334c Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Sat, 23 Mar 2024 06:16:35 +0100 Subject: [PATCH 05/10] update traefik --- imageroot/actions/restore-module/50traefik | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imageroot/actions/restore-module/50traefik b/imageroot/actions/restore-module/50traefik index e6a6fdd..a14d8c8 100755 --- a/imageroot/actions/restore-module/50traefik +++ b/imageroot/actions/restore-module/50traefik @@ -14,8 +14,8 @@ request = json.load(sys.stdin) renv = request['environment'] configure_retval = agent.tasks.run(agent_id=os.environ['AGENT_ID'], action='configure-module', data={ - "lets_encrypt": renv["TRAEFIK_LETS_ENCRYPT"], + "lets_encrypt": renv["TRAEFIK_LETS_ENCRYPT"] == True, "host": renv["TRAEFIK_HOST"], - "http2https": renv["TRAEFIK_HTTP2HTTPS"], + "http2https": renv["TRAEFIK_HTTP2HTTPS"] == True, }) agent.assert_exp(configure_retval['exit_code'] == 0, "The configure-module subtask failed!") From 102aa2f40d0959e698ed699be5139950366a938f Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Sat, 23 Mar 2024 06:55:28 +0100 Subject: [PATCH 06/10] -- --- ui/public/i18n/en/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/public/i18n/en/translation.json b/ui/public/i18n/en/translation.json index 8c82531..b002074 100644 --- a/ui/public/i18n/en/translation.json +++ b/ui/public/i18n/en/translation.json @@ -31,7 +31,7 @@ "disabled": "Disabled", "advanced": "Advanced", "configuring": "Configuring", - "instance_configuration": "Configure glpi", + "instance_configuration": "Configured glpi", "domain_already_used_in_traefik": "Domain already used in traefik", "host_pattern": "Must be a valid fully qualified domain name", "host_format": "Must be a valid fully qualified domain name" From 1ca8979b797d92434e95db38839d4a96fc0feb14 Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Sat, 23 Mar 2024 07:29:05 +0100 Subject: [PATCH 07/10] update configured translation --- ui/public/i18n/en/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/public/i18n/en/translation.json b/ui/public/i18n/en/translation.json index b002074..5727d6a 100644 --- a/ui/public/i18n/en/translation.json +++ b/ui/public/i18n/en/translation.json @@ -31,7 +31,7 @@ "disabled": "Disabled", "advanced": "Advanced", "configuring": "Configuring", - "instance_configuration": "Configured glpi", + "instance_configuration": "Configured glpi Successfully, Please wait for services to start", "domain_already_used_in_traefik": "Domain already used in traefik", "host_pattern": "Must be a valid fully qualified domain name", "host_format": "Must be a valid fully qualified domain name" From 4796450cf09999b3ea859a7e9ddd0fa333a18ab1 Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Sat, 23 Mar 2024 07:53:06 +0100 Subject: [PATCH 08/10] update curl --- imageroot/systemd/user/glpi-app.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imageroot/systemd/user/glpi-app.service b/imageroot/systemd/user/glpi-app.service index d2d9cc2..aba117f 100644 --- a/imageroot/systemd/user/glpi-app.service +++ b/imageroot/systemd/user/glpi-app.service @@ -18,7 +18,7 @@ TimeoutStopSec=70 ExecStartPre=/bin/mkdir -p config ExecStartPre=/bin/rm -f %t/glpi-app.pid %t/glpi-app.ctr-id ExecStartPre=-runagent discover-smarthost -ExecStartPost=/usr/bin/bash -c "while ! /usr/bin/podman exec glpi-app /usr/bin/curl http://127.0.0.1:80/front ; do sleep 3 ; done" +ExecStartPost=/usr/bin/bash -c "while ! /usr/bin/podman exec glpi-app /usr/bin/curl http://127.0.0.1:80/glpi/front ; do sleep 3 ; done" ExecStart=/usr/bin/podman run --conmon-pidfile %t/glpi-app.pid \ --cidfile %t/glpi-app.ctr-id --cgroups=no-conmon \ --pod-id-file %t/glpi.pod-id --replace -d --name glpi-app \ From 6d8024627dcbfb772f857c93c8d6980ae0b54039 Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Sun, 24 Mar 2024 21:04:46 +0100 Subject: [PATCH 09/10] Wait after the table creation in glpi --- imageroot/systemd/user/glpi-app.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imageroot/systemd/user/glpi-app.service b/imageroot/systemd/user/glpi-app.service index aba117f..3e56b95 100644 --- a/imageroot/systemd/user/glpi-app.service +++ b/imageroot/systemd/user/glpi-app.service @@ -18,7 +18,7 @@ TimeoutStopSec=70 ExecStartPre=/bin/mkdir -p config ExecStartPre=/bin/rm -f %t/glpi-app.pid %t/glpi-app.ctr-id ExecStartPre=-runagent discover-smarthost -ExecStartPost=/usr/bin/bash -c "while ! /usr/bin/podman exec glpi-app /usr/bin/curl http://127.0.0.1:80/glpi/front ; do sleep 3 ; done" +ExecStartPost=/usr/bin/bash -c "while ! podman exec -ti mariadb-app mysql -u glpi -pGlpi,1234 -D glpi -e 'SELECT * FROM glpi_users' > /dev/null ; do sleep 3 ; done" ExecStart=/usr/bin/podman run --conmon-pidfile %t/glpi-app.pid \ --cidfile %t/glpi-app.ctr-id --cgroups=no-conmon \ --pod-id-file %t/glpi.pod-id --replace -d --name glpi-app \ From e05b36c28d41f114b829bee4eaa70c219c3d7de6 Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Sun, 24 Mar 2024 21:36:53 +0100 Subject: [PATCH 10/10] Implement Proper Versioning, after contained docker build --- build-images.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-images.sh b/build-images.sh index 49bc8b9..b08b9ae 100644 --- a/build-images.sh +++ b/build-images.sh @@ -14,7 +14,7 @@ images=() repobase="${REPOBASE:-ghcr.io/geniusdynamics}" # Configure the image name reponame="glpi" - +app_version="10.0.14" # Create a new empty container image container=$(buildah from scratch) @@ -45,7 +45,7 @@ buildah config --entrypoint=/ \ --label="org.nethserver.authorizations=traefik@node:routeadm" \ --label="org.nethserver.tcp-ports-demand=1" \ --label="org.nethserver.rootfull=0" \ - --label="org.nethserver.images=docker.io/mariadb:10.11.5 docker.io/geniusdynamics/glpi:combined" \ + --label="org.nethserver.images=docker.io/mariadb:10.11.5 docker.io/geniusdynamics/glpi:${app_version}" \ "${container}" # Commit the image buildah commit "${container}" "${repobase}/${reponame}"