From 54869c8c2509ab214f0eeb23d7aef723f4269daa Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 4 Feb 2022 13:41:29 +0100 Subject: [PATCH 1/7] Add auto readme --- doc/DISCLAIMER.md | 3 +++ manifest.json | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 doc/DISCLAIMER.md diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..8136504 --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1,3 @@ +## Configuration + +How to configure this app: In cli \ No newline at end of file diff --git a/manifest.json b/manifest.json index 896459e..1f21260 100644 --- a/manifest.json +++ b/manifest.json @@ -7,6 +7,13 @@ }, "version": "4.22~ynh1", "url": "https://example.com", + "upstream": { + "license": "Apache-2.0", + "website": "https://linuxcontainers.org/lxd/", + "demo": "https://linuxcontainers.org/lxd/try-it/", + "admindoc": "https://linuxcontainers.org/lxd/docs/master/index.html", + "code": "https://github.com/lxc/lxd" + }, "license": "Apache-2.0", "maintainer": { "name": "kay0u", From 2853fcdb0f344f2c5af5bffdbf40a28e78c91c36 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 4 Feb 2022 12:41:37 +0000 Subject: [PATCH 2/7] Auto-update README --- README.md | 64 ++++++++++++++++++---------------------------------- README_fr.md | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 42 deletions(-) create mode 100644 README_fr.md diff --git a/README.md b/README.md index 72ae141..19019af 100644 --- a/README.md +++ b/README.md @@ -1,63 +1,41 @@ + + # LXD for YunoHost [![Integration level](https://dash.yunohost.org/integration/lxd.svg)](https://dash.yunohost.org/appci/app/lxd) ![](https://ci-apps.yunohost.org/ci/badges/lxd.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/lxd.maintain.svg) -[![Install lxd with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lxd) +[![Install LXD with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lxd) -> *This package allows you to install lxd quickly and simply on a YunoHost server. +*[Lire ce readme en français.](./README_fr.md)* + +> *This package allows you to install LXD quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview -LXD is a next generation system container manager. It offers a user experience similar to virtual machines but using Linux containers instead. -**Shipped version:** 4.21 +Offers a user experience similar to virtual machines but using Linux containers instead. -## Demo +**Shipped version:** 4.22~ynh1 -* [Official demo](https://linuxcontainers.org/lxd/try-it/) +**Demo:** https://linuxcontainers.org/lxd/try-it/ + +## Disclaimers / important information ## Configuration How to configure this app: In cli +## Documentation and resources -## Documentation - - * Official documentation: https://linuxcontainers.org/lxd/ - -## YunoHost specific features - -#### Multi-user support - -Are LDAP and HTTP auth supported? -Can the app be used by multiple users? - -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/lxd%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/lxd/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/lxd%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/lxd/) - -## Limitations - -* Any known limitations. - -## Additional information - -* Other info you would like to add about this app. - -**More info on the documentation page:** -https://yunohost.org/packaging_apps - -## Links - - * Report a bug: https://github.com/YunoHost-Apps/lxd_ynh/issues - * App website: https://linuxcontainers.org - * Upstream app repository: https://github.com/lxc/lxd - * YunoHost website: https://yunohost.org/ - ---- +* Official app website: https://linuxcontainers.org/lxd/ +* Official admin documentation: https://linuxcontainers.org/lxd/docs/master/index.html +* Upstream app code repository: https://github.com/lxc/lxd +* YunoHost documentation for this app: https://yunohost.org/app_lxd +* Report a bug: https://github.com/YunoHost-Apps/lxd_ynh/issues ## Developer info -**Only if you want to use a testing branch for coding, instead of merging directly into master.** Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/lxd_ynh/tree/testing). To try the testing branch, please proceed like that. @@ -66,3 +44,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/lxd_ynh/tree/testing or sudo yunohost app upgrade lxd -u https://github.com/YunoHost-Apps/lxd_ynh/tree/testing --debug ``` + +**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..daa7115 --- /dev/null +++ b/README_fr.md @@ -0,0 +1,44 @@ +# LXD pour YunoHost + +[![Niveau d'intégration](https://dash.yunohost.org/integration/lxd.svg)](https://dash.yunohost.org/appci/app/lxd) ![](https://ci-apps.yunohost.org/ci/badges/lxd.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/lxd.maintain.svg) +[![Installer LXD avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lxd) + +*[Read this readme in english.](./README.md)* +*[Lire ce readme en français.](./README_fr.md)* + +> *Ce package vous permet d'installer LXD rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* + +## Vue d'ensemble + + + +**Version incluse :** 4.22~ynh1 + +**Démo :** https://linuxcontainers.org/lxd/try-it/ + +## Avertissements / informations importantes + +## Configuration + +How to configure this app: In cli +## Documentations et ressources + +* Site officiel de l'app : https://linuxcontainers.org/lxd/ +* Documentation officielle de l'admin : https://linuxcontainers.org/lxd/docs/master/index.html +* Dépôt de code officiel de l'app : https://github.com/lxc/lxd +* Documentation YunoHost pour cette app : https://yunohost.org/app_lxd +* Signaler un bug : https://github.com/YunoHost-Apps/lxd_ynh/issues + +## Informations pour les développeurs + +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/lxd_ynh/tree/testing). + +Pour essayer la branche testing, procédez comme suit. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/lxd_ynh/tree/testing --debug +ou +sudo yunohost app upgrade lxd -u https://github.com/YunoHost-Apps/lxd_ynh/tree/testing --debug +``` + +**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file From a0190116b50320936aeb4dbed57b121393347352 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 4 Feb 2022 13:44:35 +0100 Subject: [PATCH 3/7] Auto-readme --- doc/DISCLAIMER.md | 2 +- manifest.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 8136504..a4ffe97 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,3 +1,3 @@ ## Configuration -How to configure this app: In cli \ No newline at end of file +How to configure this app: In cli diff --git a/manifest.json b/manifest.json index 1f21260..f1cf018 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,8 @@ "id": "lxd", "packaging_format": 1, "description": { - "en": "Offers a user experience similar to virtual machines but using Linux containers instead." + "en": "Offers a user experience similar to virtual machines but using Linux containers instead.", + "fr": "Offre une expérience utilisateur similaire aux machines virtuelles mais en utilisant des conteneurs Linux à la place." }, "version": "4.22~ynh1", "url": "https://example.com", From 6799ca8c1da93415cca970174c38b951abc63dbe Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 4 Feb 2022 12:44:43 +0000 Subject: [PATCH 4/7] Auto-update README --- README.md | 1 + README_fr.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 19019af..741fa69 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Offers a user experience similar to virtual machines but using Linux containers ## Configuration How to configure this app: In cli + ## Documentation and resources * Official app website: https://linuxcontainers.org/lxd/ diff --git a/README_fr.md b/README_fr.md index daa7115..1f210cb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble - +Offre une expérience utilisateur similaire aux machines virtuelles mais en utilisant des conteneurs Linux à la place. **Version incluse :** 4.22~ynh1 @@ -22,6 +22,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Configuration How to configure this app: In cli + ## Documentations et ressources * Site officiel de l'app : https://linuxcontainers.org/lxd/ From fc063c001c8f2e8338d887e47cb8654f337bc2fc Mon Sep 17 00:00:00 2001 From: Kay0u Date: Sun, 6 Feb 2022 20:33:55 +0100 Subject: [PATCH 5/7] add auto updater script --- .github/workflows/updater.sh | 115 +++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/workflows/updater.sh diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh new file mode 100644 index 0000000..7511368 --- /dev/null +++ b/.github/workflows/updater.sh @@ -0,0 +1,115 @@ +#!/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. + +#================================================= +# 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:3} == "lxd" ]]; then + version=${version:4} +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" + +src="lxd" + +# 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 + echo "... asset ignored" + continue +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= +SOURCE_EXTRACT=true +EOT +echo "... conf/$src.src updated" + +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 From 53aa3d906c979dd95fd032e506408cef92230572 Mon Sep 17 00:00:00 2001 From: Kayou Date: Sun, 6 Feb 2022 20:41:09 +0100 Subject: [PATCH 6/7] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index f1cf018..2eb8e68 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Offers a user experience similar to virtual machines but using Linux containers instead.", "fr": "Offre une expérience utilisateur similaire aux machines virtuelles mais en utilisant des conteneurs Linux à la place." }, - "version": "4.22~ynh1", + "version": "4.22~ynh2", "url": "https://example.com", "upstream": { "license": "Apache-2.0", From b1d724d06bbc8d4c6a60869b486c7840aee293e1 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sun, 6 Feb 2022 19:41:11 +0000 Subject: [PATCH 7/7] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 741fa69..3a93048 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Offers a user experience similar to virtual machines but using Linux containers instead. -**Shipped version:** 4.22~ynh1 +**Shipped version:** 4.22~ynh2 **Demo:** https://linuxcontainers.org/lxd/try-it/ diff --git a/README_fr.md b/README_fr.md index 1f210cb..6f3a863 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Offre une expérience utilisateur similaire aux machines virtuelles mais en utilisant des conteneurs Linux à la place. -**Version incluse :** 4.22~ynh1 +**Version incluse :** 4.22~ynh2 **Démo :** https://linuxcontainers.org/lxd/try-it/