diff --git a/.github/workflows/clean-registry.yml b/.github/workflows/clean-registry.yml index 82e36aef..2595bc66 100644 --- a/.github/workflows/clean-registry.yml +++ b/.github/workflows/clean-registry.yml @@ -15,5 +15,5 @@ jobs: steps: - uses: NethServer/ns8-github-actions/.github/actions/delete-image@v1 with: - images: "kickstart" + images: "imapsync" delete_image_token: ${{ secrets.IMAGES_CLEANUP_TOKEN }} diff --git a/README.md b/README.md index 128203b6..f812de0e 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# ns8-kickstart +# ns8-imapsync 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). +1. Click on [Use this template](https://github.com/NethServer/ns8-imapsync/generate). Name your repo with `ns8-` prefix (e.g. `ns8-mymodule`). Do not end your module name with a number, like ~~`ns8-baaad2`~~! @@ -13,9 +13,9 @@ To start a new module from it: 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 mv imageroot/systemd/user/imapsync.service imageroot/systemd/user/${modulename}.service + git mv tests/imapsync.robot tests/${modulename}.robot + sed -i "s/imapsync/${modulename}/g" $(find .github/ * -type f) git commit -a -m "Repository initialization" ``` @@ -32,16 +32,16 @@ To start a new module from it: Instantiate the module with: - add-module ghcr.io/nethserver/kickstart:latest 1 + add-module ghcr.io/nethserver/imapsync:latest 1 The output of the command will return the instance name. Output example: - {"module_id": "kickstart1", "image_name": "kickstart", "image_url": "ghcr.io/nethserver/kickstart:latest"} + {"module_id": "imapsync1", "image_name": "imapsync", "image_url": "ghcr.io/nethserver/imapsync:latest"} ## Configure -Let's assume that the kickstart instance is named `kickstart1`. +Let's assume that the imapsync instance is named `imapsync1`. Launch `configure-module`, by setting the following parameters: - ``: @@ -50,16 +50,16 @@ Launch `configure-module`, by setting the following parameters: Example: - api-cli run module/kickstart1/configure-module --data '{}' + api-cli run module/imapsync1/configure-module --data '{}' The above command will: -- start and configure the kickstart instance +- start and configure the imapsync instance - (describe configuration process) - ... -Send a test HTTP request to the kickstart backend service: +Send a test HTTP request to the imapsync backend service: - curl http://127.0.0.1/kickstart/ + curl http://127.0.0.1/imapsync/ ## Smarthost setting discovery @@ -68,14 +68,14 @@ Some configuration settings, like the smarthost setup, are not part of the 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 -kickstart starts, the command `bin/discover-smarthost` runs and refreshes +imapsync starts, the command `bin/discover-smarthost` runs and refreshes the `state/smarthost.env` file with fresh values from Redis. -Furthermore if smarthost setup is changed when kickstart is already +Furthermore if smarthost setup is changed when imapsync is already running, the event handler `events/smarthost-changed/10reload_services` restarts the main module service. -See also the `systemd/user/kickstart.service` file. +See also the `systemd/user/imapsync.service` file. This setting discovery is just an example to understand how the module is expected to work: it can be rewritten or discarded completely. @@ -84,14 +84,14 @@ expected to work: it can be rewritten or discarded completely. To uninstall the instance: - remove-module --no-preserve kickstart1 + remove-module --no-preserve imapsync1 ## Testing Test the module using the `test-module.sh` script: - ./test-module.sh ghcr.io/nethserver/kickstart:latest + ./test-module.sh ghcr.io/nethserver/imapsync:latest The tests are made using [Robot Framework](https://robotframework.org/) diff --git a/build-images.sh b/build-images.sh index 013671d9..dfda20c8 100644 --- a/build-images.sh +++ b/build-images.sh @@ -13,22 +13,22 @@ images=() # The image will be pushed to GitHub container registry repobase="${REPOBASE:-ghcr.io/nethserver}" # Configure the image name -reponame="kickstart" +reponame="imapsync" # Create a new empty container image container=$(buildah from scratch) -# Reuse existing nodebuilder-kickstart container, to speed up builds -if ! buildah containers --format "{{.ContainerName}}" | grep -q nodebuilder-kickstart; then +# Reuse existing nodebuilder-imapsync container, to speed up builds +if ! buildah containers --format "{{.ContainerName}}" | grep -q nodebuilder-imapsync; then echo "Pulling NodeJS runtime..." - buildah from --name nodebuilder-kickstart -v "${PWD}:/usr/src:Z" docker.io/library/node:lts + buildah from --name nodebuilder-imapsync -v "${PWD}:/usr/src:Z" docker.io/library/node:lts fi echo "Build static UI files with node..." buildah run \ --workingdir=/usr/src/ui \ --env="NODE_OPTIONS=--openssl-legacy-provider" \ - nodebuilder-kickstart \ + nodebuilder-imapsync \ sh -c "yarn install && yarn build" # Add imageroot directory to the container image diff --git a/imageroot/actions/configure-module/20configure b/imageroot/actions/configure-module/20configure index 55976a87..bb3ead41 100755 --- a/imageroot/actions/configure-module/20configure +++ b/imageroot/actions/configure-module/20configure @@ -15,9 +15,9 @@ request = json.load(sys.stdin) # TODO: do something with the request payload. For example configure a # custom route in our web router. Here the path is hardcoded as -# 'kickstart'. +# 'imapsync'. -# Configure Traefik to route "/kickstart" path requests to the kickstart service +# Configure Traefik to route "/imapsync" path requests to the imapsync service response = agent.tasks.run( agent_id=agent.resolve_agent_id('traefik@node'), action='set-route', @@ -26,7 +26,7 @@ response = agent.tasks.run( 'url': 'http://127.0.0.1:' + os.environ["TCP_PORT"], 'http2https': False, 'lets_encrypt': False, - 'path': '/kickstart', + 'path': '/imapsync', }, ) diff --git a/imageroot/actions/configure-module/80start_services b/imageroot/actions/configure-module/80start_services index 8aed691c..e98e4e47 100755 --- a/imageroot/actions/configure-module/80start_services +++ b/imageroot/actions/configure-module/80start_services @@ -9,4 +9,4 @@ touch smarthost.env -systemctl --user enable --now kickstart.service +systemctl --user enable --now imapsync.service diff --git a/imageroot/actions/configure-module/validate-input.json b/imageroot/actions/configure-module/validate-input.json index e4410994..0860d15d 100644 --- a/imageroot/actions/configure-module/validate-input.json +++ b/imageroot/actions/configure-module/validate-input.json @@ -1,8 +1,8 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "configure-module input", - "$id": "http://schema.nethserver.org/kickstart/configure-module-input.json", - "description": "Configure kickstart", + "$id": "http://schema.nethserver.org/imapsync/configure-module-input.json", + "description": "Configure imapsync", "examples": [], "type": "object" } \ No newline at end of file diff --git a/imageroot/actions/get-configuration/validate-output.json b/imageroot/actions/get-configuration/validate-output.json index 8188b8cc..10c33c5c 100644 --- a/imageroot/actions/get-configuration/validate-output.json +++ b/imageroot/actions/get-configuration/validate-output.json @@ -1,8 +1,8 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "get-configuration output", - "$id": "http://schema.nethserver.org/kickstart/get-configuration-output.json", - "description": "Get kickstart configuration", + "$id": "http://schema.nethserver.org/imapsync/get-configuration-output.json", + "description": "Get imapsync configuration", "examples": [], "type": "object" } \ No newline at end of file diff --git a/imageroot/events/smarthost-changed/10reload_services b/imageroot/events/smarthost-changed/10reload_services index 2132b78e..d3ca5fa1 100755 --- a/imageroot/events/smarthost-changed/10reload_services +++ b/imageroot/events/smarthost-changed/10reload_services @@ -7,4 +7,4 @@ set -e -systemctl --user try-reload-or-restart kickstart.service +systemctl --user try-reload-or-restart imapsync.service diff --git a/imageroot/systemd/user/kickstart.service b/imageroot/systemd/user/imapsync.service similarity index 58% rename from imageroot/systemd/user/kickstart.service rename to imageroot/systemd/user/imapsync.service index 44c20797..ee342ec4 100644 --- a/imageroot/systemd/user/kickstart.service +++ b/imageroot/systemd/user/imapsync.service @@ -4,31 +4,31 @@ # # -# This systemd unit starts a kickstart instance using Podman. +# This systemd unit starts a imapsync instance using Podman. # Most parts of this file come from podman-generate-systemd. # [Unit] -Description=kickstart server +Description=imapsync server [Service] Environment=PODMAN_SYSTEMD_UNIT=%n EnvironmentFile=%S/state/environment WorkingDirectory=%S/state Restart=always -ExecStartPre=/bin/rm -f %t/kickstart.pid %t/kickstart.ctr-id +ExecStartPre=/bin/rm -f %t/imapsync.pid %t/imapsync.ctr-id ExecStartPre=-runagent discover-smarthost ExecStart=/usr/bin/podman run \ --detach \ - --conmon-pidfile=%t/kickstart.pid \ - --cidfile=%t/kickstart.ctr-id \ + --conmon-pidfile=%t/imapsync.pid \ + --cidfile=%t/imapsync.ctr-id \ --cgroups=no-conmon \ --replace --name=%N \ --publish=127.0.0.1:${TCP_PORT}:8080 \ --env-file=smarthost.env ${ECHO_SERVER_IMAGE} -ExecStop=/usr/bin/podman stop --ignore --cidfile %t/kickstart.ctr-id -t 10 -ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/kickstart.ctr-id -PIDFile=%t/kickstart.pid +ExecStop=/usr/bin/podman stop --ignore --cidfile %t/imapsync.ctr-id -t 10 +ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/imapsync.ctr-id +PIDFile=%t/imapsync.pid Type=forking [Install] diff --git a/tests/kickstart.robot b/tests/imapsync.robot similarity index 76% rename from tests/kickstart.robot rename to tests/imapsync.robot index e1984f08..3a320517 100644 --- a/tests/kickstart.robot +++ b/tests/imapsync.robot @@ -2,24 +2,24 @@ Library SSHLibrary *** Test Cases *** -Check if kickstart is installed correctly +Check if imapsync is installed correctly ${output} ${rc} = Execute Command add-module ${IMAGE_URL} 1 ... return_rc=True Should Be Equal As Integers ${rc} 0 &{output} = Evaluate ${output} Set Suite Variable ${module_id} ${output.module_id} -Check if kickstart can be configured +Check if imapsync can be configured ${rc} = Execute Command api-cli run module/${module_id}/configure-module --data '{}' ... return_rc=True return_stdout=False Should Be Equal As Integers ${rc} 0 -Check if kickstart works as expected - ${rc} = Execute Command curl -f http://127.0.0.1/kickstart/ +Check if imapsync works as expected + ${rc} = Execute Command curl -f http://127.0.0.1/imapsync/ ... return_rc=True return_stdout=False Should Be Equal As Integers ${rc} 0 -Check if kickstart is removed correctly +Check if imapsync is removed correctly ${rc} = Execute Command remove-module --no-preserve ${module_id} ... return_rc=True return_stdout=False Should Be Equal As Integers ${rc} 0 diff --git a/ui/README.md b/ui/README.md index 4400e3bc..35a77b3c 100644 --- a/ui/README.md +++ b/ui/README.md @@ -1,3 +1,3 @@ -# NS8 kickstart UI development +# NS8 imapsync UI development -To develop kickstart UI please refer to [this section of the Developer manual](https://nethserver.github.io/ns8-core/ui/modules/#module-ui-development). +To develop imapsync UI please refer to [this section of the Developer manual](https://nethserver.github.io/ns8-core/ui/modules/#module-ui-development). diff --git a/ui/public/metadata.json b/ui/public/metadata.json index 305a6f53..83cdb0e8 100644 --- a/ui/public/metadata.json +++ b/ui/public/metadata.json @@ -1,7 +1,7 @@ { - "name": "kickstart", + "name": "imapsync", "description": { - "en": "My kickstart module" + "en": "My imapsync module" }, "categories": [], "authors": [ @@ -11,9 +11,9 @@ } ], "docs": { - "documentation_url": "https://docs.kickstart.com/", + "documentation_url": "https://docs.imapsync.com/", "bug_url": "https://github.com/NethServer/dev", - "code_url": "https://github.com/author/ns8-kickstart" + "code_url": "https://github.com/author/ns8-imapsync" }, - "source": "ghcr.io/nethserver/kickstart" + "source": "ghcr.io/nethserver/imapsync" }