Skip to content

Commit

Permalink
feat: updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kemboi22 committed Aug 13, 2024
1 parent 4c69989 commit 6a1e55a
Showing 1 changed file with 5 additions and 30 deletions.
35 changes: 5 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,17 @@
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-listmonk/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/listmonk.service imageroot/systemd/user/${modulename}.service &&
git mv imageroot/systemd/user/listmonk-app.service imageroot/systemd/user/${modulename}-app.service &&
git mv tests/listmonk.robot tests/${modulename}.robot &&
sed -i "s/listmonk/${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/nethserver/listmonk:latest 1
add-module ghcr.io/geniusdynamics/listmonk:latest 1

The output of the command will return the instance name.
Output example:

{"module_id": "listmonk1", "image_name": "listmonk", "image_url": "ghcr.io/nethserver/listmonk:latest"}
{"module_id": "listmonk1", "image_name": "listmonk", "image_url": "ghcr.io/geniusdynamics/listmonk:latest"}

## Configure

Expand Down Expand Up @@ -83,15 +58,15 @@ To uninstall the instance:

To Update the instance:

api-cli run update-module --data '{"module_url":"ghcr.io/nethserver/listmonk:latest","instances":["listmonk1"],"force":true}'
api-cli run update-module --data '{"module_url":"ghcr.io/geniusdynamics/listmonk:latest","instances":["listmonk1"],"force":true}'

## Smarthost setting discovery

Some configuration settings, like the smarthost setup, are not part of the
`configure-module` action input: they are discovered by looking at some
Redis keys. To ensure the module is always up-to-date with the
centralized [smarthost
setup](https://nethserver.github.io/ns8-core/core/smarthost/) every time
setup](https://geniusdynamics.github.io/ns8-core/core/smarthost/) every time
listmonk starts, the command `bin/discover-smarthost` runs and refreshes
the `state/smarthost.env` file with fresh values from Redis.

Expand Down Expand Up @@ -158,7 +133,7 @@ podman exec -ti listmonk-app sh
Test the module using the `test-module.sh` script:


./test-module.sh <NODE_ADDR> ghcr.io/nethserver/listmonk:latest
./test-module.sh <NODE_ADDR> ghcr.io/geniusdynamics/listmonk:latest

The tests are made using [Robot Framework](https://robotframework.org/)

Expand Down

0 comments on commit 6a1e55a

Please sign in to comment.