diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh deleted file mode 100755 index c4d53fc..0000000 --- a/.github/workflows/updater.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/bash - -#================================================= -# PACKAGE UPDATING HELPER -#================================================= - -# This script is meant to be run by GitHub Actions -# The YunoHost-Apps organisation offers a template Action to run this script periodically -# Since each app is different, maintainers can adapt its contents so as to perform -# automatic actions when a new upstream release is detected. - -# Remove this exit command when you are ready to run this Action -exit 1 - -#================================================= -# FETCHING LATEST RELEASE AND ITS ASSETS -#================================================= - -# Fetching information -current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') -repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') -# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) -version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) -assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'")) - -# Later down the script, we assume the version has only digits and dots -# Sometimes the release name starts with a "v", so let's filter it out. -# You may need more tweaks here if the upstream repository has different naming conventions. -if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then - version=${version:1} -fi - -# Setting up the environment variables -echo "Current version: $current_version" -echo "Latest release from upstream: $version" -echo "VERSION=$version" >> $GITHUB_ENV -# For the time being, let's assume the script will fail -echo "PROCEED=false" >> $GITHUB_ENV - -# Proceed only if the retrieved version is greater than the current one -if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then - echo "::warning ::No new version available" - exit 0 -# Proceed only if a PR for this new version does not already exist -elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then - echo "::warning ::A branch already exists for this update" - exit 0 -fi - -# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) -echo "${#assets[@]} available asset(s)" - -#================================================= -# UPDATE SOURCE FILES -#================================================= - -# Here we use the $assets variable to get the resources published in the upstream release. -# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like. - -# Let's loop over the array of assets URLs -for asset_url in ${assets[@]}; do - -echo "Handling asset at $asset_url" - -# Assign the asset to a source file in conf/ directory -# Here we base the source file name upon a unique keyword in the assets url (admin vs. update) -# Leave $src empty to ignore the asset -case $asset_url in - *"admin"*) - src="app" - ;; - *"update"*) - src="app-upgrade" - ;; - *) - src="" - ;; -esac - -# If $src is not empty, let's process the asset -if [ ! -z "$src" ]; then - -# Create the temporary directory -tempdir="$(mktemp -d)" - -# Download sources and calculate checksum -filename=${asset_url##*/} -curl --silent -4 -L $asset_url -o "$tempdir/$filename" -checksum=$(sha256sum "$tempdir/$filename" | head -c 64) - -# Delete temporary directory -rm -rf $tempdir - -# Get extension -if [[ $filename == *.tar.gz ]]; then - extension=tar.gz -else - extension=${filename##*.} -fi - -# Rewrite source file -cat < conf/$src.src -SOURCE_URL=$asset_url -SOURCE_SUM=$checksum -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=$extension -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -EOT -echo "... conf/$src.src updated" - -else -echo "... asset ignored" -fi - -done - -#================================================= -# SPECIFIC UPDATE STEPS -#================================================= - -# Any action on the app's source code can be done. -# The GitHub Action workflow takes care of committing all changes after this script ends. - -#================================================= -# GENERIC FINALIZATION -#================================================= - -# Replace new version in manifest -echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json - -# No need to update the README, yunohost-bot takes care of it - -# The Action will proceed only if the PROCEED environment variable is set to true -echo "PROCEED=true" >> $GITHUB_ENV -exit 0 diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index c9bad6b..629d97b 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1 +1 @@ -Listmonk is a standalone, self-hosted, newsletter and mailing list manager. It is fast, feature-rich, and packed into a single binary. It uses a PostgreSQL (⩾ v9.4) database as its data store. +Listmonk is a standalone, self-hosted, newsletter and mailing list manager. It is fast, feature-rich, and packed into a single binary. It uses a PostgreSQL database as its data base. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..af7b41a --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1 @@ +Listmonk est un gestionnaire de newsletter et de liste de diffusion autonome et auto-hébergé. Il est rapide, riche en fonctionnalités et emballé dans un seul binaire. Il utilise une base de données PostgreSQL comme base de données. diff --git a/manifest.toml b/manifest.toml index 5ffe108..7e51cd3 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Listmonk" description.en = "Newsletter and mailing list manager" description.fr = "Manager de newsletter et mailing list" -version = "2.4.0~ynh3" +version = "2.5.1~ynh1" maintainers = ["Navan Chauhan"] @@ -17,7 +17,7 @@ admindoc = "https://listmonk.app/docs/" code = "https://github.com/knadh/listmonk" [integration] -yunohost = ">= 11.1.18" +yunohost = ">= 11.2" architectures = ["amd64", "armhf", "arm64"] multi_instance = true ldap = false @@ -43,12 +43,12 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - amd64.url = "https://github.com/knadh/listmonk/releases/download/v2.4.0/listmonk_2.4.0_linux_amd64.tar.gz" - amd64.sha256 = "acdfd0f4549c15e3cd77a28778ac9904cc54abf3bec98074ee96edc64242971b" - armhf.url = "https://github.com/knadh/listmonk/archive/refs/tags/v2.4.0.tar.gz" - armhf.sha256 = "60571f7e279524bee81be066bbc27929042dbe7bf4740cabeb734a0269b81939" - arm64.url = "https://github.com/knadh/listmonk/archive/refs/tags/v2.4.0.tar.gz" - arm64.sha256 = "60571f7e279524bee81be066bbc27929042dbe7bf4740cabeb734a0269b81939" + amd64.url = "https://github.com/knadh/listmonk/releases/download/v2.5.1/listmonk_2.5.1_linux_amd64.tar.gz" + amd64.sha256 = "552bb7cb47d7b55be7b48a4ccc19d69b96491065433dafd8cc6a0f39869e4113" + armhf.url = "https://github.com/knadh/listmonk/archive/refs/tags/v2.5.1.tar.gz" + armhf.sha256 = "c4ce4e283dd924f1a3df62b1a019dd95a366d13b75a7776e206b3320e1edcd41" + arm64.url = "https://github.com/knadh/listmonk/archive/refs/tags/v2.5.1.tar.gz" + arm64.sha256 = "c4ce4e283dd924f1a3df62b1a019dd95a366d13b75a7776e206b3320e1edcd41" in_subdir = false [resources.system_user] diff --git a/scripts/_common.sh b/scripts/_common.sh index ee6cfc8..22ede99 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,8 @@ #================================================= nodejs_version=16 -GO_VERSION="1.18" + +GO_VERSION="1.20" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 8194146..1dc2a4d 100755 --- a/scripts/install +++ b/scripts/install @@ -55,14 +55,6 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x "$install_dir/listmonk" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # ADD A CONFIGURATION #================================================= @@ -87,14 +79,12 @@ popd #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 +# Create a dedicated NGINX config +ynh_add_nginx_config + # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Newsletter and mailing list manager" --log="/var/log/$app/$app.log" #================================================= diff --git a/scripts/remove b/scripts/remove index 4fec55d..2e81091 100755 --- a/scripts/remove +++ b/scripts/remove @@ -22,19 +22,9 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=2 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index 4593439..86c1a34 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,15 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=2 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -42,14 +33,11 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 - yunohost service add $app --description="Newsletter and mailing list manager" --log="/var/log/$app/$app.log" #================================================= @@ -59,13 +47,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - ynh_systemd_action --service_name=nginx --action=reload #=================================================