From c2e92ffe9127f6b4115a44f3727b982fe747f696 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Tue, 24 May 2022 19:05:27 +0200 Subject: [PATCH 1/9] install libgbm1, dependency of snappdf. fixes #16 --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index ccb44ff..11d5a5f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,7 +8,7 @@ YNH_PHP_VERSION="7.4" # dependencies used by the app -pkg_dependencies="php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql libnss3-dev libatk1.0-0 libatk-bridge2.0-0 libxcomposite1 libxrandr2 libasound2" +pkg_dependencies="php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql libnss3-dev libatk1.0-0 libatk-bridge2.0-0 libxcomposite1 libxrandr2 libasound2 libgbm1" #================================================= # PERSONAL HELPERS From 5a10e72b4306aaf99e2198e1b90c138462b85bf5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 24 May 2022 17:05:35 +0000 Subject: [PATCH 2/9] Auto-update README --- README.md | 21 +++++++++++---------- README_fr.md | 32 +++++++++++++++++--------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 0529ca0..c4cee08 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # InvoiceNinja 5 for YunoHost -[![Integration level](https://dash.yunohost.org/integration/invoiceninja5.svg)](https://dash.yunohost.org/appci/app/invoiceninja5) ![](https://ci-apps.yunohost.org/ci/badges/invoiceninja5.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/invoiceninja5.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/invoiceninja5.svg)](https://dash.yunohost.org/appci/app/invoiceninja5) ![Working status](https://ci-apps.yunohost.org/ci/badges/invoiceninja5.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/invoiceninja5.maintain.svg) [![Install InvoiceNinja 5 with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=invoiceninja5) *[Lire ce readme en français.](./README_fr.md)* @@ -23,7 +23,7 @@ Create and email invoices, track payments, expenses, and time tasks ## Screenshots -![](./doc/screenshots/Create-Invoices-in-Seconds.png) +![Screenshot of InvoiceNinja 5](./doc/screenshots/Create-Invoices-in-Seconds.png) ## Disclaimers / important information @@ -43,22 +43,23 @@ Invoice Ninja is the the leading self-hosted invoicing platform to create & emai ## Documentation and resources -* Official app website: https://invoiceninja.org -* Official user documentation: https://invoiceninja.github.io/ -* Official admin documentation: https://invoiceninja.github.io/ -* Upstream app code repository: https://github.com/invoiceninja/invoiceninja -* YunoHost documentation for this app: https://yunohost.org/app_invoiceninja5 -* Report a bug: https://github.com/YunoHost-Apps/invoiceninja5_ynh/issues +* Official app website: +* Official user documentation: +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/invoiceninja5_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/invoiceninja5_ynh/tree/testing --debug or sudo yunohost app upgrade invoiceninja5 -u https://github.com/YunoHost-Apps/invoiceninja5_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 94904f9..198cf79 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # InvoiceNinja 5 pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/invoiceninja5.svg)](https://dash.yunohost.org/appci/app/invoiceninja5) ![](https://ci-apps.yunohost.org/ci/badges/invoiceninja5.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/invoiceninja5.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/invoiceninja5.svg)](https://dash.yunohost.org/appci/app/invoiceninja5) ![Status du fonctionnement](https://ci-apps.yunohost.org/ci/badges/invoiceninja5.status.svg) ![Status de maintenance](https://ci-apps.yunohost.org/ci/badges/invoiceninja5.maintain.svg) [![Installer InvoiceNinja 5 avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=invoiceninja5) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer InvoiceNinja 5 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.* @@ -19,16 +23,13 @@ Créer et envoyer des factures par e-mail, suivre les paiements, les dépenses e ## Captures d'écran -![](./doc/screenshots/Create-Invoices-in-Seconds.png) +![Capture d'écran de InvoiceNinja 5](./doc/screenshots/Create-Invoices-in-Seconds.png) ## Avertissements / informations importantes ### Warning -This is the new version of InvoiceNinja. There are several things not working at the moment: - -* installation into a sub-directory -* sending mails +This is the new version of InvoiceNinja. Installation into a sub-directory is currently impossible. Invoice Ninja is the the leading self-hosted invoicing platform to create & email invoices, track payments and expenses, and time billable tasks & projects for clients. @@ -42,22 +43,23 @@ Invoice Ninja is the the leading self-hosted invoicing platform to create & emai ## Documentations et ressources -* Site officiel de l'app : https://invoiceninja.org -* Documentation officielle utilisateur : https://invoiceninja.github.io/ -* Documentation officielle de l'admin : https://invoiceninja.github.io/ -* Dépôt de code officiel de l'app : https://github.com/invoiceninja/invoiceninja -* Documentation YunoHost pour cette app : https://yunohost.org/app_invoiceninja5 -* Signaler un bug : https://github.com/YunoHost-Apps/invoiceninja5_ynh/issues +* Site officiel de l'app : +* Documentation officielle utilisateur : +* Documentation officielle de l'admin : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/invoiceninja5_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/invoiceninja5_ynh/tree/testing --debug ou sudo yunohost app upgrade invoiceninja5 -u https://github.com/YunoHost-Apps/invoiceninja5_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** From 5e912988957c2862a0a26040abfb1efae2a2fb44 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Sat, 9 Jul 2022 21:15:27 +0200 Subject: [PATCH 3/9] add autoupdate github action --- .github/workflow/updater.sh | 132 +++++++++++++++++++++++++++++++++++ .github/workflow/updater.yml | 49 +++++++++++++ 2 files changed, 181 insertions(+) create mode 100644 .github/workflow/updater.sh create mode 100644 .github/workflow/updater.yml diff --git a/.github/workflow/updater.sh b/.github/workflow/updater.sh new file mode 100644 index 0000000..6721476 --- /dev/null +++ b/.github/workflow/updater.sh @@ -0,0 +1,132 @@ +#!/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. +# 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 + *"invoiceninja.zip") + src="app" + ;; + *) + 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=false +SOURCE_FILENAME=invoiceninja.zip +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/.github/workflow/updater.yml b/.github/workflow/updater.yml new file mode 100644 index 0000000..fd6ed60 --- /dev/null +++ b/.github/workflow/updater.yml @@ -0,0 +1,49 @@ +# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. +# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. +# This file should be enough by itself, but feel free to tune it to your needs. +# It calls updater.sh, which is where you should put the app-specific update steps. +name: Check for new upstream releases +on: + # Allow to manually trigger the workflow + workflow_dispatch: + # Run it every day at 6:00 UTC + schedule: + - cron: '0 6 * * *' +jobs: + updater: + runs-on: ubuntu-latest + steps: + - name: Fetch the source code + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run the updater script + id: run_updater + run: | + # Setting up Git user + git config --global user.name 'yunohost-bot' + git config --global user.email 'yunohost-bot@users.noreply.github.com' + # Run the updater script + /bin/bash .github/workflows/updater.sh + - name: Commit changes + id: commit + if: ${{ env.PROCEED == 'true' }} + run: | + git commit -am "Upgrade to v$VERSION" + - name: Create Pull Request + id: cpr + if: ${{ env.PROCEED == 'true' }} + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update to version ${{ env.VERSION }} + committer: 'yunohost-bot ' + author: 'yunohost-bot ' + signoff: false + branch: ci-auto-update-v${{ env.VERSION }} + base: testing + delete-branch: true + title: 'Upgrade to version ${{ env.VERSION }}' + body: | + Upgrade to v${{ env.VERSION }} + draft: false From 874f4c5a48d374b14a706b15032d9deeab1471af Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 9 Jul 2022 19:15:47 +0000 Subject: [PATCH 4/9] Auto-update README --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 198cf79..12e2727 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # InvoiceNinja 5 pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/invoiceninja5.svg)](https://dash.yunohost.org/appci/app/invoiceninja5) ![Status du fonctionnement](https://ci-apps.yunohost.org/ci/badges/invoiceninja5.status.svg) ![Status de maintenance](https://ci-apps.yunohost.org/ci/badges/invoiceninja5.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/invoiceninja5.svg)](https://dash.yunohost.org/appci/app/invoiceninja5) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/invoiceninja5.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/invoiceninja5.maintain.svg) [![Installer InvoiceNinja 5 avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=invoiceninja5) *[Read this readme in english.](./README.md)* From d80d9ac89b59e3f6b0a3bab628efaa6a0b3b6780 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Sat, 9 Jul 2022 21:18:52 +0200 Subject: [PATCH 5/9] fix wrong folder name --- .github/{workflow => workflows}/updater.sh | 0 .github/{workflow => workflows}/updater.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/{workflow => workflows}/updater.sh (100%) rename .github/{workflow => workflows}/updater.yml (100%) diff --git a/.github/workflow/updater.sh b/.github/workflows/updater.sh similarity index 100% rename from .github/workflow/updater.sh rename to .github/workflows/updater.sh diff --git a/.github/workflow/updater.yml b/.github/workflows/updater.yml similarity index 100% rename from .github/workflow/updater.yml rename to .github/workflows/updater.yml From 7d85698f83e0d872c37eaf518b8534b0f72c0225 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Mon, 18 Jul 2022 08:25:02 +0200 Subject: [PATCH 6/9] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c4cee08..cdb5aac 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ Invoice Ninja is the the leading self-hosted invoicing platform to create & emai * There is no official LDAP support * The first user gets created after installing Invoice Ninja. The email-address is the one of your administrator user of the app. The password is the administration password you provided while installing. +* The `ÀPI_SECRET` can be found in the settings.yaml (normally `/etc/yunohost/apps/invoiceninja5/settings.yml`). Run the following as root: `grep "api_secret" /etc/yunohost/apps/invoiceninja5/settings.yml | cut -d ":" -f 2` * Other users can be created from inside the application ## Documentation and resources From 292733e18f86bd63f81e44afae740e70f8961824 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 18 Jul 2022 06:25:06 +0000 Subject: [PATCH 7/9] Auto-update README --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index cdb5aac..c4cee08 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,6 @@ Invoice Ninja is the the leading self-hosted invoicing platform to create & emai * There is no official LDAP support * The first user gets created after installing Invoice Ninja. The email-address is the one of your administrator user of the app. The password is the administration password you provided while installing. -* The `ÀPI_SECRET` can be found in the settings.yaml (normally `/etc/yunohost/apps/invoiceninja5/settings.yml`). Run the following as root: `grep "api_secret" /etc/yunohost/apps/invoiceninja5/settings.yml | cut -d ":" -f 2` * Other users can be created from inside the application ## Documentation and resources From 90cca7758b1302cd118c1ad8347c4cbcdbca6075 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Mon, 18 Jul 2022 08:25:31 +0200 Subject: [PATCH 8/9] Update README_fr.md --- README_fr.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README_fr.md b/README_fr.md index 12e2727..08f13bc 100644 --- a/README_fr.md +++ b/README_fr.md @@ -39,6 +39,7 @@ Invoice Ninja is the the leading self-hosted invoicing platform to create & emai * There is no official LDAP support * The first user gets created after installing Invoice Ninja. The email-address is the one of your administrator user of the app. The password is the administration password you provided while installing. +* Le `API_SECRET` peut être trouvé dans le settings.yaml (normalement `/etc/yunohost/apps/invoiceninja5/settings.yml`). Exécutez ce qui suit en tant que root : `grep "api_secret" /etc/yunohost/apps/invoiceninja5/settings.yml | cut -d " :" -f 2` * Other users can be created from inside the application ## Documentations et ressources From fc6140c6755c64f0f78a5bcaa74647da79e651a1 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 18 Jul 2022 06:25:34 +0000 Subject: [PATCH 9/9] Auto-update README --- README_fr.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 08f13bc..12e2727 100644 --- a/README_fr.md +++ b/README_fr.md @@ -39,7 +39,6 @@ Invoice Ninja is the the leading self-hosted invoicing platform to create & emai * There is no official LDAP support * The first user gets created after installing Invoice Ninja. The email-address is the one of your administrator user of the app. The password is the administration password you provided while installing. -* Le `API_SECRET` peut être trouvé dans le settings.yaml (normalement `/etc/yunohost/apps/invoiceninja5/settings.yml`). Exécutez ce qui suit en tant que root : `grep "api_secret" /etc/yunohost/apps/invoiceninja5/settings.yml | cut -d " :" -f 2` * Other users can be created from inside the application ## Documentations et ressources