1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pixelfed_ynh.git synced 2024-09-03 20:06:04 +02:00

Apply example_ynh

This commit is contained in:
yalh76 2022-05-24 23:36:53 +02:00
parent b69cbfb05b
commit 088973097d
7 changed files with 8 additions and 32 deletions

View file

@ -1,7 +0,0 @@
language: python
before_install:
- git clone https://github.com/YunoHost/package_linter /tmp/package_linter
script:
- /tmp/package_linter/package_linter.py ./

View file

@ -17,10 +17,6 @@
},
"license": "AGPL-3.0-or-later",
"maintainer": [
{
"name": "Jean-Baptiste Holcroft",
"email": "jean-baptiste@holcroft.fr"
},
{
"name": "yalh76"
},
@ -34,10 +30,10 @@
"multi_instance": true,
"services": [
"nginx",
"php7.3-fpm"
"php7.4-fpm"
],
"arguments": {
"install" : [
"install": [
{
"name": "domain",
"type": "domain"
@ -45,9 +41,6 @@
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Should this application be visible by visitors, without a Yunohost login ?",
"fr": "Cette application devrait-elle être visible par les visiteurs n'ayant pas de compte Yunohost ?"},
"default": true
}
]

View file

@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors

View file

@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
#=================================================
old_domain=$YNH_APP_OLD_DOMAIN
old_path="/"
old_path=$YNH_APP_OLD_PATH
new_domain=$YNH_APP_NEW_DOMAIN
new_path="/"
@ -40,6 +40,7 @@ ynh_script_progression --message="Backing up the app before changing its URL (ma
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"

View file

@ -67,7 +67,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=$app --home_dir=$final_path
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# CREATE A POSTGRESQL DATABASE

View file

@ -34,7 +34,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
@ -61,7 +60,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$final_path
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# RESTORE THE APP MAIN DIR

View file

@ -146,7 +146,7 @@ fi
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$final_path
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -200,16 +200,6 @@ ynh_script_progression --message="Updating composer dependencies..."
ynh_exec_warn_less ynh_composer_exec --workdir="$final_path" --commands="update"
#=================================================
# UPDATE A CONFIG FILE
#=================================================
# ynh_script_progression --message="Updating a config file..."
# ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
# chmod 400 "$final_path/.env"
# chown $app:$app "$final_path/.env"
#=================================================
# DEPLOYMENT
#=================================================