mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
commit
800162e69c
6 changed files with 40 additions and 15 deletions
|
@ -9,7 +9,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
|
||||||
## Overview
|
## Overview
|
||||||
The federated image sharing service Pixelfed, for YunoHost
|
The federated image sharing service Pixelfed, for YunoHost
|
||||||
|
|
||||||
**Shipped version:** 0.8.6
|
**Shipped version:** 0.9.0
|
||||||
|
|
||||||
I'm waiting for an official release (alpha/beta or stable) to invest more time on this package.
|
I'm waiting for an official release (alpha/beta or stable) to invest more time on this package.
|
||||||
Don't hesitate to give a hand if you wish, I assume only the nginx file needs improvments.
|
Don't hesitate to give a hand if you wish, I assume only the nginx file needs improvments.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://github.com/pixelfed/pixelfed/archive/v0.8.6.tar.gz
|
SOURCE_URL=https://github.com/pixelfed/pixelfed/archive/v0.9.0.tar.gz
|
||||||
SOURCE_SUM=56acbfe18752693d3312207d6955e65c9f6aa73c7e801a224248b2d4b8e2884f
|
SOURCE_SUM=ea69f3441991c9122638b1476ba11ec1b7847fac569fa77a8ed7b03481b19d88
|
||||||
OURCE_SUM_PRG=sha256sum
|
OURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
|
@ -5,7 +5,7 @@
|
||||||
"description": {
|
"description": {
|
||||||
"en": "ActivityPub Federated Image Sharing"
|
"en": "ActivityPub Federated Image Sharing"
|
||||||
},
|
},
|
||||||
"version": "0.8.6~ynh3",
|
"version": "0.9.0~ynh1",
|
||||||
"url": "https://pixelfed.org/",
|
"url": "https://pixelfed.org/",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
|
|
@ -21,13 +21,14 @@ extra_pkg_dependencies="php7.2-bcmath php7.2-cli php7.2-curl php7.2-exif php7.2-
|
||||||
|
|
||||||
# Execute a command with Composer
|
# Execute a command with Composer
|
||||||
#
|
#
|
||||||
# usage: ynh_composer_exec [--workdir=$final_path] --commands="commands"
|
# usage: ynh_composer_exec --phpversion=phpversion [--workdir=$final_path] --commands="commands"
|
||||||
# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path.
|
# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path.
|
||||||
# | arg: -c, --commands - Commands to execute.
|
# | arg: -c, --commands - Commands to execute.
|
||||||
ynh_composer_exec () {
|
ynh_composer_exec () {
|
||||||
# Declare an array to define the options of this helper.
|
# Declare an array to define the options of this helper.
|
||||||
local legacy_args=wc
|
local legacy_args=vwc
|
||||||
declare -Ar args_array=( [w]=workdir= [c]=commands= )
|
declare -Ar args_array=( [v]=phpversion= [w]=workdir= [c]=commands= )
|
||||||
|
local phpversion
|
||||||
local workdir
|
local workdir
|
||||||
local commands
|
local commands
|
||||||
# Manage arguments with getopts
|
# Manage arguments with getopts
|
||||||
|
@ -35,18 +36,19 @@ ynh_composer_exec () {
|
||||||
workdir="${workdir:-$final_path}"
|
workdir="${workdir:-$final_path}"
|
||||||
|
|
||||||
COMPOSER_HOME="$workdir/.composer" \
|
COMPOSER_HOME="$workdir/.composer" \
|
||||||
php "$workdir/composer.phar" $commands \
|
php${phpversion} "$workdir/composer.phar" $commands \
|
||||||
-d "$workdir" --quiet --no-interaction
|
-d "$workdir" --quiet --no-interaction
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install and initialize Composer in the given directory
|
# Install and initialize Composer in the given directory
|
||||||
#
|
#
|
||||||
# usage: ynh_install_composer [--workdir=$final_path]
|
# usage: ynh_install_composer --phpversion=phpversion [--workdir=$final_path]
|
||||||
# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path.
|
# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path.
|
||||||
ynh_install_composer () {
|
ynh_install_composer () {
|
||||||
# Declare an array to define the options of this helper.
|
# Declare an array to define the options of this helper.
|
||||||
local legacy_args=w
|
local legacy_args=vw
|
||||||
declare -Ar args_array=( [w]=workdir= )
|
declare -Ar args_array=( [v]=phpversion= [w]=workdir= )
|
||||||
|
local phpversion
|
||||||
local workdir
|
local workdir
|
||||||
# Manage arguments with getopts
|
# Manage arguments with getopts
|
||||||
ynh_handle_getopts_args "$@"
|
ynh_handle_getopts_args "$@"
|
||||||
|
@ -54,14 +56,15 @@ ynh_install_composer () {
|
||||||
|
|
||||||
curl -sS https://getcomposer.org/installer \
|
curl -sS https://getcomposer.org/installer \
|
||||||
| COMPOSER_HOME="$workdir/.composer" \
|
| COMPOSER_HOME="$workdir/.composer" \
|
||||||
php -- --quiet --install-dir="$workdir" \
|
php${phpversion} -- --quiet --install-dir="$workdir" \
|
||||||
|| ynh_die "Unable to install Composer."
|
|| ynh_die "Unable to install Composer."
|
||||||
|
|
||||||
# update dependencies to create composer.lock
|
# update dependencies to create composer.lock
|
||||||
ynh_composer_exec --workdir="$workdir" --commands="install --no-dev" \
|
ynh_composer_exec --phpversion="${phpversion}" --workdir="$workdir" --commands="install --no-dev" \
|
||||||
|| ynh_die "Unable to update core dependencies with Composer."
|
|| ynh_die "Unable to update core dependencies with Composer."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Install another version of php.
|
# Install another version of php.
|
||||||
#
|
#
|
||||||
# usage: ynh_install_php --phpversion=phpversion [--package=packages]
|
# usage: ynh_install_php --phpversion=phpversion [--package=packages]
|
||||||
|
@ -96,6 +99,9 @@ ynh_install_php () {
|
||||||
ynh_add_app_dependencies --package="php${phpversion}-fpm"
|
ynh_add_app_dependencies --package="php${phpversion}-fpm"
|
||||||
ynh_add_app_dependencies --package="php$phpversion php${phpversion}-common $package"
|
ynh_add_app_dependencies --package="php$phpversion php${phpversion}-common $package"
|
||||||
|
|
||||||
|
# Set php7.0 back as the default version for php-cli.
|
||||||
|
update-alternatives --set php /usr/bin/php7.0
|
||||||
|
|
||||||
# Remove this extra repository after packages are installed
|
# Remove this extra repository after packages are installed
|
||||||
ynh_remove_extra_repo --name=extra_php_version
|
ynh_remove_extra_repo --name=extra_php_version
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,10 @@ source /usr/share/yunohost/helpers
|
||||||
# MANAGE SCRIPT FAILURE
|
# MANAGE SCRIPT FAILURE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
ynh_clean_setup () {
|
||||||
|
### Remove this function if there's nothing to clean before calling the remove script.
|
||||||
|
read -p "key"
|
||||||
|
}
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
|
@ -120,7 +124,7 @@ ynh_add_fpm_config --phpversion="7.2"
|
||||||
|
|
||||||
chown -R "$app": "$final_path"
|
chown -R "$app": "$final_path"
|
||||||
|
|
||||||
ynh_install_composer --workdir="$final_path"
|
ynh_install_composer --phpversion="7.2" --workdir="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
|
|
|
@ -141,7 +141,22 @@ ynh_add_fpm_config --phpversion="7.2"
|
||||||
|
|
||||||
chown -R "$app": "$final_path"
|
chown -R "$app": "$final_path"
|
||||||
|
|
||||||
ynh_install_composer --workdir="$final_path"
|
ynh_install_composer --phpversion="7.2" --workdir="$final_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# MODIFY A CONFIG FILE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
config="$final_path/.env"
|
||||||
|
cp ../conf/.env "$config"
|
||||||
|
|
||||||
|
ynh_replace_string "__APP__" "$app" "$config"
|
||||||
|
ynh_replace_string "__APP_KEY__" "$app_key" "$config"
|
||||||
|
ynh_replace_string "__DOMAIN__" "$domain" "$config"
|
||||||
|
ynh_replace_string "__PATH__" "$path_url" "$config"
|
||||||
|
ynh_replace_string "__DB_NAME__" "$db_name" "$config"
|
||||||
|
ynh_replace_string "__DB_USER__" "$db_user" "$config"
|
||||||
|
ynh_replace_string "__DB_PWD__" "$db_pwd" "$config"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY A CONFIG FILE
|
# MODIFY A CONFIG FILE
|
||||||
|
|
Loading…
Add table
Reference in a new issue