NEthserver 8 Modules Generator

We are Happy to Announce that there now exists a way through which nethserver developers can quickly generate new Nethsrver 8 Modules

Modules Generator here Release v0.1.1 · geniusdynamics/ns8-module-generator

Takes an Input of an existing compose yaml file, then uses the data within t, to generate nethserver 8 Apps, specific code, which only requires allitle fine tuning to achieve a complete Application.

This reduces Module Development TIme By upto 70%

This Generator was significant Efforts by @kemboielvis22 to simplify and increase our efficiency in how fast we can bring new Apps into the Nethserver Ecosystem.
When launched the first time,

you will be prompted o choose a compose file
image

A series of Prompt quetions will be asked

Shoutout to @stephdl Who provided simplified and imporved templates to work with
@davidep Who we asked so many trivial questions to achieve this work
@mrmarkuz whose brain we generously borrowed to brainstorm on ideas.
@Shane_Treweek for testing and providing feedback on initial version.

Happy testing Developers, and Happy Holidays All

11 Likes

This is to help making of modules faster.
Hoping in future and in later updates to be able to generate a full module that works out of the box on the initial generation.

As per now the module generates:

  1. services
  2. env variables
  3. Actions
  4. etc (for back up)

For any issues and improvements you can create an issue and will be glad to solve

Happy testing Developers and Happy holidays :partying_face: :partying_face:

6 Likes

https://github.com/geniusdynamics/ns8-module-generator/releases/tag/v0.1.3

The ns8 module generator has been updated.
The module currently supports

  • Using config.toml to generate module
  • Using remote docker compose to generate the ns8-module

SSH

Currently pushing using ssh is still in beta testing

Happy hacking :upside_down_face:

1 Like

I wanted to test to create a Wordpress module. I copy/pasted the compose.yaml from https://hub.docker.com/_/wordpress to ~/compose.yaml

I selected the local file but got an error:

  You selected: /home/markus/compose.yaml

The name of the app(Should be one word or separated by hyphen)?

> Wordpress            

Enter the relative output path(use `pwd` )?

> generated-module2    

Initialise and Push to Git(yes or no)

> no                   
Progress: +Inf% (1/0)
Copy complete! 1 items copied.
Parsing through service: wordpress 
Parsed Environment for wordpress: map[WORDPRESS_DB_HOST:db WORDPRESS_DB_NAME:exampledb WORDPRESS_DB_PASSWORD:examplepass WORDPRESS_DB_USER:exampleuser]
Parsing through service: db 
Parsed Environment for db: map[MYSQL_DATABASE:exampledb MYSQL_PASSWORD:examplepass MYSQL_RANDOM_ROOT_PASSWORD:1 MYSQL_USER:exampleuser]
Volume:  wordpress
Value: <nil> 
Volume:  db
Value: <nil> 
Error processing NS8 module: error while processing build image: error while replacing content in the file: File Path does not exist: generated-module2/build-images.sh
exit status 1

The directory generated-module2 is empty.

Can you retry now have updated and released a new version to fix that

1 Like

You can suggest on improvements that can be made to make the generator much better

1 Like

There’s still the same error with Wordpress.

I tried nginx with following docker-compose.yaml…

web:
  image: nginx
  volumes:
    - ./nginx.conf:/etc/nginx/nginx.conf:ro
  command: [nginx-debug, '-g', 'daemon off;']

…but also same error:

Progress: +Inf% (1/0)
Copy complete! 1 items copied.
Error processing NS8 module: error while processing build image: error while replacing content in the file: File Path does not exist: generated-module/build-images.sh
exit status 1

I tested it on OpenSuse with Go 1.24.
Could you share a working docker-compose.yaml file?

Can you remove the template folder and retry

hopefully that will fix the issue

1 Like

Or inside the template folder make sure its like this

template/
├── .devcontainer/
├── .github/
└── imageroot/
1 Like

Thanks, that was the issue, after removing the template directory, it gets downloaded again and works.

I tried uploading the “Wordpress” project to github using a token and it worked, see see GitHub - mrmarkuz/ns8-wordpress
I needed to delete my old ns8-wordpress before.

I found that in build-images.sh the repo isn’t updated to my repo, see ns8-wordpress/build-images.sh at master · mrmarkuz/ns8-wordpress · GitHub

repobase="${REPOBASE:-ghcr.io/geniusdynamics}"

I need to test more…to be continued…

Thank you for highlighting this
Will change

1 Like

I tried to build uptime-kuma using your nice module generator and it worked!

After creating the repo which uploaded the module I needed to do following changes:

I found that following is not working in ../actions/get-configuration/20read.
The last line needs to be intended correctly and there shouldn’t be an empty line in between.

if os.path.exists("uptime-kuma.env"):
        data = agent.read_envfile("uptime-kuma.env")
else:

json.dump(config, fp=sys.stdout)

In ../actions/configure-module/10configure_environment_vars I needed to comment out the following as there are no variables used.

uptime-kuma = {
}
agent.write_envfile("uptime-kuma.env", uptime-kuma)

A version tag with just one digit seems to not work in build-images.sh

docker.io/louislam/uptime-kuma:1

Working:

docker.io/louislam/uptime-kuma:1.23.16

Error:

2025-07-04T08:49:25+02:00 [1:update-kuma1:update-kuma1] Error: parsing reference "": repository name must have at least one component

EDIT:

I found that

podman pull docker.io/louislam/uptime-kuma:1

is working so maybe there was another issue…

Edit /home/uptime-kuma1/.config/systemd/user/uptime-kuma-app.service:

ExecStart=/usr/bin/podman run --conmon-pidfile %t/uptime-kuma-app.pid --cidfile %t/uptime-kuma-app.ctr-id --cgroups=no-conmon --pod-id-file %t/uptime-kuma.pod-id --replace -d --name uptime-kuma-app \ --volume ./uptime-kuma-data:/app/data --env uptime-kuma.env ${UPTIME-KUMA_IMAGE}

It should be UPTIME_KUMA_IMAGE, see Images | NS8 dev manual
As volume just use uptime-kuma-data instead of ./uptime-kuma-data to create a data volume.
If you use “./uptime-kuma-data” the directory needs to exist inside the state dir.
Auto-appending “:Z” to the volume would be nice too.

The right port needs to be set (3001 instead of 80), maybe this could be automated, the port is in the compose file.

Edit /home/uptime-kuma1/.config/systemd/user/uptime-kuma.service to set the port:

ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/uptime-kuma.pid --pod-id-file %t/uptime-kuma.pod-id --name uptime-kuma --publish 127.0.0.1:${TCP_PORT}:3001 --replace

Here are the needed changes, sorry for 2 commits, note to myself: amend before push

After configuring it in the app settings:

Create admin:

Uptime kuma is ready to use:

The module generator is great, it’s possible to create a basic module very fast.

1 Like

@mrmarkuz Thank you very much for the feedback let me work on the changes.
I want it to be able for it also to create much complex applications

1 Like

Also what other features should i add. Was thinking to integrate automated testing for modules.

1 Like

This is wonderful news. Thank you @mrmarkuz for testing.

@kemboielvis22 took all the knowledge and experience from building hundreds of NS8 Modules, and Applied it to implement Automations for Modules Creation. This is truly forward thinking. Kudos @kemboielvis22 for your work on the module generator, this will surely save hundreds of hours of dev time for implementing new Modules, and Make NS8 truly the de facto server for hosting business Applications.

Hopefully, scratchpad could also be improved to feature these works @davidep

2 Likes

Feature wishlist:

That would be nice but I don’t know if it’s possible as the generator doesn’t know what the app does so it’s hard to automatically create tests I think.

I don’t know if it’s needed as those are different approaches.

Scratchpad provides a playground inside NS8 to play around with podman and check if module creation is possible etc.
This is nice for beginners to get into podman and developing modules.

The module generator creates a module that preconfigures a lot and lets you install a module on NS8. One already needs to know stuff about modules.

2 Likes

this could utilze the Self-Hosted Dashboard Icons library

On the Module testing, we are not looking at generally the module functionality, but the module adherence to defined rules for a module, we already have working templates, we have a complete yaml and env file, we can be able to test if the built module has everything necessary for the module to function. Of course the actual testing needs the module to be installed, but we could in actual sense, implement, SSh into server, install module, Configure Module, get config files, to verify the module can be installed and can be configured on an NS8 instance.

We could then wait, and run curl(fqdn) and listen to response

1 Like

I have added reference to this, in NS8-Generic Containers-: Install Uptime-kuma - #8 by oneitonitram to maintain consistency of shared information

1 Like

Now the backup issue has been resolved

1 Like

Thanks for your great work! I tried to integrate planka (see Twenty CRM 1.0.2 - #2 by transocean) using the generator and it worked but there were some minor things:

  • Please allow to also open .yml files, not only .yaml.

  • Maybe it’s just style but I think using \ line breaks to be able to see all parameters at a glance in the podman run command makes sense.

ExecStart=/usr/bin/podman run --conmon-pidfile %t/postgres-app.pid \
  --cidfile %t/postgres-app.ctr-id --cgroups=no-conmon \
  --pod-id-file %t/planka.pod-id --replace -d --name  postgres-app \
  --volume db-data:/var/lib/postgresql/data \
  --env postgres.env \
${POSTGRES_IMAGE}

instead of

ExecStart=/usr/bin/podman run --conmon-pidfile %t/postgres-app.pid  --cidfile %t/postgres-app.ctr-id --cgroups=no-conmon  --pod-id-file %t/planka.pod-id --replace -d --name  postgres-app  --volume db-data:/var/lib/postgresql/data   --env postgres.env  ${POSTGRES_IMAGE}

There’s a database.env created, which makes no sense as postgres is used. It contains:

MARIADB_DATABASE=planka
MARIADB_PASSWORD=c1adfd2672b205cc
MARIADB_ROOT_PASSWORD=72965f909a203636
MARIADB_USER=planka
  • At the end of the podman run statement there’s a wrong option: --env postgres.env but it should be --env-file postgres.env

  • Add :Z or :z to the volume statement. If the volume is shared (used in more containers) it’s lower case :z

1 Like