mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
commit
46a8bf4b11
10 changed files with 98 additions and 84 deletions
36
.github/workflows/updater.sh
vendored
36
.github/workflows/updater.sh
vendored
|
@ -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
|
||||
#=================================================
|
||||
|
|
50
.github/workflows/updater.yml
vendored
Normal file
50
.github/workflows/updater.yml
vendored
Normal file
|
@ -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 <yunohost-bot@users.noreply.github.com>'
|
||||
author: 'yunohost-bot <yunohost-bot@users.noreply.github.com>'
|
||||
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
|
||||
|
25
README.md
25
README.md
|
@ -5,7 +5,7 @@ It shall NOT be edited by hand.
|
|||
|
||||
# Pixelfed for YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/pixelfed)  
|
||||
[](https://dash.yunohost.org/appci/app/pixelfed)  
|
||||
[](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
|
||||
|
||||

|
||||

|
||||
|
||||
## 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: <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>
|
||||
|
||||
## 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
|
||||
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
|
||||
|
|
31
README_fr.md
31
README_fr.md
|
@ -1,10 +1,14 @@
|
|||
<!--
|
||||
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||
It shall NOT be edited by hand.
|
||||
-->
|
||||
|
||||
# Pixelfed pour YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/pixelfed)  
|
||||
[](https://dash.yunohost.org/appci/app/pixelfed)  
|
||||
[](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
|
||||
|
||||

|
||||

|
||||
|
||||
## 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 : <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>
|
||||
|
||||
## 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
|
||||
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue