From b08b0719caa03aa0395481a0ccc22abf2519d3d4 Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Wed, 12 Jun 2024 14:37:52 +0200 Subject: [PATCH 1/5] update websocket name --- imageroot/systemd/user/erp-next.service | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imageroot/systemd/user/erp-next.service b/imageroot/systemd/user/erp-next.service index 3c6fe4c..531a3e5 100644 --- a/imageroot/systemd/user/erp-next.service +++ b/imageroot/systemd/user/erp-next.service @@ -10,8 +10,8 @@ [Unit] Description=Podman erp-next.service -Requires=redis-queue.service db.service backend.service configurator.service create-site.service frontend.service queue-long.service queue-short.service scheduler.service wesocket.service -Before=redis-queue.service db.service backend.service configurator.service create-site.service frontend.service queue-long.service queue-short.service scheduler.service wesocket.service +Requires=redis-queue.service db.service backend.service configurator.service create-site.service frontend.service queue-long.service queue-short.service scheduler.service websocket.service +Before=redis-queue.service db.service backend.service configurator.service create-site.service frontend.service queue-long.service queue-short.service scheduler.service websocket.service [Service] Environment=PODMAN_SYSTEMD_UNIT=%n From 684df0af97c8d77c572af72396f8be81f99b3132 Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Wed, 12 Jun 2024 14:47:53 +0200 Subject: [PATCH 2/5] update password in create site --- imageroot/systemd/user/create-site.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imageroot/systemd/user/create-site.service b/imageroot/systemd/user/create-site.service index 16a9baa..b8aeaef 100644 --- a/imageroot/systemd/user/create-site.service +++ b/imageroot/systemd/user/create-site.service @@ -30,7 +30,7 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/create-site.pid \ fi done; echo "sites/common_site_config.json found"; - bench new-site --no-mariadb-socket --admin-password=admin --db-root-password=admin --install-app erpnext --set-default frontend; + bench new-site --no-mariadb-socket --admin-password=erpnext --db-root-password=erpnext --install-app erpnext --set-default frontend; ExecStop=/usr/bin/podman stop --ignore --cidfile %t/create-site.ctr-id -t 10 ExecReload=/usr/bin/podman kill -s HUP create-site SyslogIdentifier=%u From c983fed560cd9ac970d38af948190b809dd932a4 Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Wed, 12 Jun 2024 14:53:49 +0200 Subject: [PATCH 3/5] update internal service name --- imageroot/systemd/user/backend.service | 2 +- imageroot/systemd/user/configurator.service | 2 +- imageroot/systemd/user/create-site.service | 2 +- imageroot/systemd/user/db.service | 2 +- imageroot/systemd/user/frontend.service | 2 +- imageroot/systemd/user/queue-long.service | 2 +- imageroot/systemd/user/queue-short.service | 2 +- imageroot/systemd/user/redis-queue.service | 2 +- imageroot/systemd/user/scheduler.service | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/imageroot/systemd/user/backend.service b/imageroot/systemd/user/backend.service index 49207e7..2c3799b 100644 --- a/imageroot/systemd/user/backend.service +++ b/imageroot/systemd/user/backend.service @@ -4,7 +4,7 @@ # [Unit] -Description=Podman erp-next-backend.service +Description=Podman backend.service Requires=erp-next.service After=erp-next.service db.service redis-queue.service diff --git a/imageroot/systemd/user/configurator.service b/imageroot/systemd/user/configurator.service index 3a8fba9..8a2c659 100644 --- a/imageroot/systemd/user/configurator.service +++ b/imageroot/systemd/user/configurator.service @@ -4,7 +4,7 @@ # [Unit] -Description=Podman erp-next-configurator.service +Description=Podman configurator.service Requires=erp-next.service After=erp-next.service redis-queue.service db.service backend.service diff --git a/imageroot/systemd/user/create-site.service b/imageroot/systemd/user/create-site.service index b8aeaef..e89720c 100644 --- a/imageroot/systemd/user/create-site.service +++ b/imageroot/systemd/user/create-site.service @@ -1,5 +1,5 @@ [Unit] -Description=Podman erp-next-create-site.service +Description=Podman create-site.service Requires=erp-next.service After=erp-next.service redis-queue.service db.service backend.service configurator.service diff --git a/imageroot/systemd/user/db.service b/imageroot/systemd/user/db.service index 178e300..e1d2d7d 100644 --- a/imageroot/systemd/user/db.service +++ b/imageroot/systemd/user/db.service @@ -4,7 +4,7 @@ # [Unit] -Description=Podman mariadb-app.service +Description=Podman db.service BindsTo=erp-next.service After=erp-next.service redis-queue.service diff --git a/imageroot/systemd/user/frontend.service b/imageroot/systemd/user/frontend.service index f48038a..54c9a12 100644 --- a/imageroot/systemd/user/frontend.service +++ b/imageroot/systemd/user/frontend.service @@ -1,7 +1,7 @@ # frontend.service [Unit] -Description=Podman erp-next-frontend.service +Description=Podman frontend.service Requires=erp-next.service After=erp-next.service redis-queue.service db.service backend.service configurator.service create-site.service diff --git a/imageroot/systemd/user/queue-long.service b/imageroot/systemd/user/queue-long.service index 16b99ec..1a658f4 100644 --- a/imageroot/systemd/user/queue-long.service +++ b/imageroot/systemd/user/queue-long.service @@ -1,7 +1,7 @@ # queue-long.service [Unit] -Description=Podman erp-next-queue-long.service +Description=Podman queue-long.service Requires=erp-next.service After=erp-next.service redis-queue.service db.service backend.service configurator.service create-site.service frontend.service diff --git a/imageroot/systemd/user/queue-short.service b/imageroot/systemd/user/queue-short.service index 603da1f..6c8a692 100644 --- a/imageroot/systemd/user/queue-short.service +++ b/imageroot/systemd/user/queue-short.service @@ -1,7 +1,7 @@ # queue-short.service [Unit] -Description=Podman erp-next-queue-short.service +Description=Podman queue-short.service Requires=erp-next.service After=erp-next.service redis-queue.service db.service backend.service configurator.service create-site.service frontend.service queue-long.service diff --git a/imageroot/systemd/user/redis-queue.service b/imageroot/systemd/user/redis-queue.service index 21754f4..e4704cd 100644 --- a/imageroot/systemd/user/redis-queue.service +++ b/imageroot/systemd/user/redis-queue.service @@ -1,7 +1,7 @@ # redis-queue.service [Unit] -Description=Podman erp-next-redis-queue.service +Description=Podman redis-queue.service Requires=erp-next.service After=erp-next.service [Service] diff --git a/imageroot/systemd/user/scheduler.service b/imageroot/systemd/user/scheduler.service index 64039a9..c2af788 100644 --- a/imageroot/systemd/user/scheduler.service +++ b/imageroot/systemd/user/scheduler.service @@ -1,7 +1,7 @@ # scheduler.service [Unit] -Description=Podman erp-next-scheduler.service +Description=Podman scheduler.service Requires=erp-next.service After=erp-next.service redis-queue.service db.service backend.service configurator.service create-site.service frontend.service queue-long.service queue-short.service From f3e6a9ddeddf86c02c38abecbf90ea46bb7aa547 Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Wed, 12 Jun 2024 15:16:18 +0200 Subject: [PATCH 4/5] implement redis before db --- imageroot/systemd/user/backend.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imageroot/systemd/user/backend.service b/imageroot/systemd/user/backend.service index 2c3799b..5453558 100644 --- a/imageroot/systemd/user/backend.service +++ b/imageroot/systemd/user/backend.service @@ -6,7 +6,7 @@ [Unit] Description=Podman backend.service Requires=erp-next.service -After=erp-next.service db.service redis-queue.service +After=erp-next.service redis-queue.service db.service [Service] Environment=PODMAN_SYSTEMD_UNIT=%n From 785c0135e73864354e018103bcf05f736c930881 Mon Sep 17 00:00:00 2001 From: Martin Bhuong Date: Wed, 12 Jun 2024 15:31:39 +0200 Subject: [PATCH 5/5] update readme --- README.md | 57 +++++++++++++++---------------------------------------- 1 file changed, 15 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 97cd880..effdc11 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,20 @@ -# ns8-kickstart +# ns8-erpnext -This is a template module for [NethServer 8](https://github.com/NethServer/ns8-core). -To start a new module from it: - -1. Click on [Use this template](https://github.com/NethServer/ns8-kickstart/generate). - Name your repo with `ns8-` prefix (e.g. `ns8-mymodule`). - Do not end your module name with a number, like ~~`ns8-baaad2`~~! - -1. Clone the repository, enter the cloned directory and - [configure your GIT identity](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup#_your_identity) - -1. Rename some references inside the repo: - ``` - modulename=$(basename $(pwd) | sed 's/^ns8-//') - git mv imageroot/systemd/user/kickstart.service imageroot/systemd/user/${modulename}.service - git mv tests/kickstart.robot tests/${modulename}.robot - sed -i "s/kickstart/${modulename}/g" $(find .github/ * -type f) - git commit -a -m "Repository initialization" - ``` - -1. Edit this `README.md` file, by replacing this section with your module - description - -1. Adjust `.github/workflows` to your needs. `clean-registry.yml` might - need the proper list of image names to work correctly. Unused workflows - can be disabled from the GitHub Actions interface. - -1. Commit and push your local changes ## Install Instantiate the module with: - add-module ghcr.io/kemboi22/erpnext:latest 1 + add-module ghcr.io/geniusdynamics/erpnext:latest 1 The output of the command will return the instance name. Output example: - {"module_id": "erpnext1", "image_name": "erpnext", "image_url": "ghcr.io/kemboi22/erpnext:latest"} + {"module_id": "erpnext1", "image_name": "erpnext", "image_url": "ghcr.io/geniusdynamics/erpnext:latest"} ## Configure -Let's assume that the mattermost instance is named `kickstart1`. +Let's assume that the mattermost instance is named `erpnext1`. Launch `configure-module`, by setting the following parameters: - `host`: a fully qualified domain name for the application @@ -54,7 +27,7 @@ Example: ``` api-cli run configure-module --agent module/erpnext1 --data - <80/tcp 80b8de25945f-infra d8df02bf6f4a docker.io/library/mariadb:10.11.5 --character-set-s... 9 minutes ago Up 9 minutes 127.0.0.1:20015->80/tcp mariadb-app -9e58e5bd676f docker.io/library/nginx:stable-alpine3.17 nginx -g daemon o... 9 minutes ago Up 9 minutes 127.0.0.1:20015->80/tcp kickstart-app +9e58e5bd676f docker.io/library/nginx:stable-alpine3.17 nginx -g daemon o... 9 minutes ago Up 9 minutes 127.0.0.1:20015->80/tcp erpnext-app ``` you can see what environment variable is inside the container @@ -133,14 +106,14 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin TERM=xterm PKG_RELEASE=1 MARIADB_DB_HOST=127.0.0.1 -MARIADB_DB_NAME=kickstart +MARIADB_DB_NAME=erpnext MARIADB_IMAGE=docker.io/mariadb:10.11.5 MARIADB_DB_TYPE=mysql container=podman NGINX_VERSION=1.24.0 NJS_VERSION=0.7.12 -MARIADB_DB_USER=kickstart -MARIADB_DB_PASSWORD=kickstart +MARIADB_DB_USER=erpnext +MARIADB_DB_PASSWORD=erpnext MARIADB_DB_PORT=3306 HOME=/root ``` @@ -148,7 +121,7 @@ HOME=/root you can run a shell inside the container ``` -podman exec -ti kickstart-app sh +podman exec -ti erpnext-app sh / # ``` ## Testing @@ -156,7 +129,7 @@ podman exec -ti kickstart-app sh Test the module using the `test-module.sh` script: - ./test-module.sh ghcr.io/nethserver/kickstart:latest + ./test-module.sh ghcr.io/nethserver/erpnext:latest The tests are made using [Robot Framework](https://robotframework.org/)