diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 525ef97f..94afbdf6 100755 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -9,9 +9,6 @@ # 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 #================================================= @@ -21,7 +18,7 @@ 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 "'")) +assets="https://github.com/pixelfed/pixelfed/archive/refs/tags/$version.tar.gz" # 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. @@ -34,6 +31,7 @@ fi echo "Current version: $current_version" echo "Latest release from upstream: $version" echo "VERSION=$version" >> $GITHUB_ENV +echo "REPO=$repo" >> $GITHUB_ENV # For the time being, let's assume the script will fail echo "PROCEED=false" >> $GITHUB_ENV @@ -47,32 +45,16 @@ elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY. 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 +# Let's download source tarball +asset_url=$assets 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 - v"*".tar.gz) v0.11.1.tar.gz - src="app" - ;; -esac - -# If $src is not empty, let's process the asset -if [ ! -z "$src" ]; then +src="app" # Create the temporary directory tempdir="$(mktemp -d)" @@ -99,16 +81,10 @@ SOURCE_SUM=$checksum SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=$extension SOURCE_IN_SUBDIR=true -SOURCE_EXTRACT=true +SOURCE_FILENAME= EOT echo "... conf/$src.src updated" -else -echo "... asset ignored" -fi - -done - #================================================= # SPECIFIC UPDATE STEPS #================================================= diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml new file mode 100644 index 00000000..5f1dcc17 --- /dev/null +++ b/.github/workflows/updater.yml @@ -0,0 +1,50 @@ +# 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 + base: testing + branch: ci-auto-update-v${{ env.VERSION }} + delete-branch: true + title: 'Upgrade to version ${{ env.VERSION }}' + body: | + Upgrade to v${{ env.VERSION }} + draft: false + diff --git a/README.md b/README.md index ccb879a5..e6a4d08a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Pixelfed for YunoHost -[![Integration level](https://dash.yunohost.org/integration/pixelfed.svg)](https://dash.yunohost.org/appci/app/pixelfed) ![](https://ci-apps.yunohost.org/ci/badges/pixelfed.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/pixelfed.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/pixelfed.svg)](https://dash.yunohost.org/appci/app/pixelfed) ![Working status](https://ci-apps.yunohost.org/ci/badges/pixelfed.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/pixelfed.maintain.svg) [![Install Pixelfed with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pixelfed) *[Lire ce readme en français.](./README_fr.md)* @@ -24,13 +24,11 @@ In addition to taking over the functionality of Instagram, the functioning of Pi It is also possible to import your data from Instagram. -**Shipped version:** 0.11.2~ynh1 - - +**Shipped version:** 0.11.3~ynh1 ## Screenshots -![](./doc/screenshots/screenshots.jpg) +![Screenshot of Pixelfed](./doc/screenshots/screenshots.jpg) ## Disclaimers / important information @@ -67,22 +65,23 @@ Since 0.10.10, by default `/discover/places/`, `/stories/` and `/i/` are present ## Documentation and resources -* Official app website: https://pixelfed.org/ -* Official user documentation: https://docs.pixelfed.org/ -* Official admin documentation: https://docs.pixelfed.org/running-pixelfed/administration.html -* Upstream app code repository: https://github.com/pixelfed/pixelfed -* YunoHost documentation for this app: https://yunohost.org/app_pixelfed -* Report a bug: https://github.com/YunoHost-Apps/pixelfed_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/pixelfed_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/pixelfed_ynh/tree/testing --debug or sudo yunohost app upgrade pixelfed -u https://github.com/YunoHost-Apps/pixelfed_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 67bb3ae5..8387aa06 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # Pixelfed pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/pixelfed.svg)](https://dash.yunohost.org/appci/app/pixelfed) ![](https://ci-apps.yunohost.org/ci/badges/pixelfed.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/pixelfed.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/pixelfed.svg)](https://dash.yunohost.org/appci/app/pixelfed) ![Status du fonctionnement](https://ci-apps.yunohost.org/ci/badges/pixelfed.status.svg) ![Status de maintenance](https://ci-apps.yunohost.org/ci/badges/pixelfed.maintain.svg) [![Installer Pixelfed avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pixelfed) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer Pixelfed 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.* @@ -21,13 +25,11 @@ En plus de reprendre les fonctionnalités d'Instagram, le fonctionnement de Pixe Il est également possible d'importer ses données depuis Instagram. -**Version incluse :** 0.11.2~ynh1 - - +**Version incluse :** 0.11.3~ynh1 ## Captures d'écran -![](./doc/screenshots/screenshots.jpg) +![Capture d'écran de Pixelfed](./doc/screenshots/screenshots.jpg) ## Avertissements / informations importantes @@ -64,22 +66,23 @@ Depuis la 0.10.10, par défaut `/discover/places/`, `/stories/` et `/i/` sont pr ## Documentations et ressources -* Site officiel de l'app : https://pixelfed.org/ -* Documentation officielle utilisateur : https://docs.pixelfed.org/ -* Documentation officielle de l'admin : https://docs.pixelfed.org/running-pixelfed/administration.html -* Dépôt de code officiel de l'app : https://github.com/pixelfed/pixelfed -* Documentation YunoHost pour cette app : https://yunohost.org/app_pixelfed -* Signaler un bug : https://github.com/YunoHost-Apps/pixelfed_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/pixelfed_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/pixelfed_ynh/tree/testing --debug ou sudo yunohost app upgrade pixelfed -u https://github.com/YunoHost-Apps/pixelfed_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 :** diff --git a/check_process b/check_process index f2a27629..cac92289 100644 --- a/check_process +++ b/check_process @@ -29,11 +29,13 @@ # 0.10.10~ynh4 # upgrade=1 from_commit=8ef41895fbd38008f3718e164d0bf3f0d97a2c03 # 0.11.0~ynh1 - upgrade=1 from_commit=c7181d1c7cb6cba53bb65e622c78b0309a53b76a + # upgrade=1 from_commit=c7181d1c7cb6cba53bb65e622c78b0309a53b76a # 0.11.0~ynh2 - upgrade=1 from_commit=d85b0b112afd19313dbf4cfba954e255789dfb88 + # upgrade=1 from_commit=d85b0b112afd19313dbf4cfba954e255789dfb88 # 0.11.1~ynh2 upgrade=1 from_commit=f8ecb9a95fe6430fb9d93ca674e4f0d475ecd332 + # 0.11.2~ynh1 + upgrade=1 from_commit=7a4833633f76d050296c783e565f8cdfc913c75a backup_restore=1 multi_instance=1 port_already_use=0 @@ -41,24 +43,3 @@ ;;; Options Email=yalh@yahoo.com Notification=all -;;; Upgrade options - ; commit=10c3703567d1e9504ea4f298778464c7dd561470 - name=0.10.8 - ; commit=8c5e710060da43a946336d66a30b9c311cfdbc37 - name=0.10.9~ynh1 - ; commit=c81ed6b760a1a68b8993917e808434166766a37a - name=0.10.9~ynh2 - ; commit=9c7d0ff114bb0bd3482901fde4bd82b494aa2e6d - name=0.10.9~ynh3 - ; commit=1aa406fb124b92f03b1bb69fc3462936d5227278 - name=0.10.10~ynh1 - ; commit=2a796e30dd521a5022586bc7fe59d189210028a4 - name=0.10.10~ynh3 - ; commit=8ef41895fbd38008f3718e164d0bf3f0d97a2c03 - name=0.10.10~ynh4 - ; commit=c7181d1c7cb6cba53bb65e622c78b0309a53b76a - name=0.11.0~ynh1 - ; commit=d85b0b112afd19313dbf4cfba954e255789dfb88 - name=0.11.0~ynh2 - ; commit=f8ecb9a95fe6430fb9d93ca674e4f0d475ecd332 - name=0.11.1~ynh2 diff --git a/conf/app.src b/conf/app.src index e4a4d124..674e6a7e 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/pixelfed/pixelfed/archive/v0.11.2.tar.gz -SOURCE_SUM=04eca99fa8a725ae97cf01ad8c8b26b28f02a2b579dcff9320a172433afe0de2 +SOURCE_URL=https://github.com/pixelfed/pixelfed/archive/v0.11.3.tar.gz +SOURCE_SUM=cbe5b878e8afcbc5d3e6219ed061e7c98dc7c2c5a2d5925d49ae9cfcdca71d30 OURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 4e323a05..cb6a2d2e 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "ActivityPub Federated Image Sharing", "fr": "Logiciel de partage d'image fédéré via ActivityPub" }, - "version": "0.11.2~ynh1", + "version": "0.11.3~ynh1", "url": "https://pixelfed.org/", "upstream": { "license": "AGPL-3.0-or-later", diff --git a/scripts/install b/scripts/install index 68e7eb48..bf0cd7fa 100644 --- a/scripts/install +++ b/scripts/install @@ -143,7 +143,8 @@ ynh_script_progression --message="Adding a config file..." ynh_add_config --template="../conf/.env" --destination="$final_path/.env" -chmod 400 "$final_path/.env" +# Pixelfed app should be able to edit its settings from the admin panel +chmod 600 "$final_path/.env" chown $app:$app "$final_path/.env" #================================================= diff --git a/scripts/remove b/scripts/remove index 06262450..7c21d622 100644 --- a/scripts/remove +++ b/scripts/remove @@ -22,6 +22,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) +redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) #================================================= # STANDARD REMOVE diff --git a/scripts/upgrade b/scripts/upgrade index f2933c51..70a5c09b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -163,6 +163,9 @@ fi chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +# Pixelfed app should be able to edit its settings from the admin panel +chmod 600 "$final_path"/.env + #================================================= # NGINX CONFIGURATION