mirror of
https://github.com/YunoHost-Apps/writefreely_ynh.git
synced 2024-09-03 20:36:02 +02:00
parent
a76b050c81
commit
5cc1a49c9c
7 changed files with 18 additions and 65 deletions
|
@ -1,7 +1,7 @@
|
|||
# WriteFreely for YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/writefreely)  
|
||||
[](https://install-app.yunohost.org/?app=writefreely)
|
||||
[](https://install-app.yunohost.org/?app=writefreely)
|
||||
|
||||
> *This package allow you to install WriteFreely quickly and simply on a YunoHost server.
|
||||
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
|
||||
|
@ -63,8 +63,7 @@ If User Mode is configured Multiple users, the app be used by multiple users
|
|||
|
||||
---
|
||||
|
||||
Developer info
|
||||
----------------
|
||||
## Developer info
|
||||
|
||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/writefreely_ynh/tree/testing).
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "For starting a minimalist, federated blog — or an entire community.",
|
||||
"fr": "Permet de créer un blog fédéré minimaliste ou une communauté entière."
|
||||
},
|
||||
"version": "0.12.0~ynh2",
|
||||
"version": "0.12.0~ynh3",
|
||||
"url": "https://writefreely.org",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"maintainer": [
|
||||
|
@ -18,7 +18,7 @@
|
|||
"name": "yalh76"
|
||||
}],
|
||||
"requirements": {
|
||||
"yunohost": ">= 3.5"
|
||||
"yunohost": ">= 3.8.1"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
@ -67,8 +67,8 @@
|
|||
"name": "single_user",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Choose if you want a Single User Blog ?",
|
||||
"fr": "Souhaitez vous un blog pour un seul utilisateur?"
|
||||
"en": "Choose if you want a Single User Blog?",
|
||||
"fr": "Souhaitez vous un blog pour un seul utilisateur ?"
|
||||
},
|
||||
"default": true
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ ynh_setup_source --dest_dir="$final_path" --source_id=$architecture
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring nginx web server..."
|
||||
ynh_script_progression --message="Configuring NGINX web server..."
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
@ -176,7 +176,7 @@ chown -R "$app":"$app" "$final_path"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
|
||||
yunohost service add $app --description "$app daemon for WriteFreely" --log "/var/log/$app/$app.log"
|
||||
yunohost service add $app --description="WriteFreely daemon" --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
@ -201,7 +201,7 @@ fi
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ test ! -d $final_path \
|
|||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the nginx configuration..."
|
||||
ynh_script_progression --message="Restoring the NGINX configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
|
@ -92,14 +92,14 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
|
|||
ynh_script_progression --message="Restoring the systemd configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service
|
||||
systemctl enable $app.service --quiet
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
|
||||
yunohost service add $app --description "$app daemon for WriteFreely" --log_type systemd
|
||||
yunohost service add $app --description="WriteFreely daemon" --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
@ -113,7 +113,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -119,9 +119,9 @@ fi
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading nginx web server configuration..."
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..."
|
||||
|
||||
# Create a dedicated nginx config
|
||||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
|
@ -180,7 +180,7 @@ chown -R "$app":"$app" "$final_path"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
|
||||
yunohost service add $app --description "$app daemon for WriteFreely" --log "/var/log/$app/$app.log"
|
||||
yunohost service add $app --description="WriteFreely daemon" --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
@ -204,7 +204,7 @@ fi
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Checks the app version to upgrade with the existing app version and returns:
|
||||
# - UPGRADE_APP if the upstream app version has changed
|
||||
# - UPGRADE_PACKAGE if only the YunoHost package has changed
|
||||
#
|
||||
## It stops the current script without error if the package is up-to-date
|
||||
#
|
||||
# This helper should be used to avoid an upgrade of an app, or the upstream part
|
||||
# of it, when it's not needed
|
||||
#
|
||||
# To force an upgrade, even if the package is up to date,
|
||||
# you have to set the variable YNH_FORCE_UPGRADE before.
|
||||
# example: sudo YNH_FORCE_UPGRADE=1 yunohost app upgrade MyApp
|
||||
|
||||
# usage: ynh_check_app_version_changed
|
||||
ynh_check_app_version_changed () {
|
||||
local force_upgrade=${YNH_FORCE_UPGRADE:-0}
|
||||
local package_check=${PACKAGE_CHECK_EXEC:-0}
|
||||
|
||||
# By default, upstream app version has changed
|
||||
local return_value="UPGRADE_APP"
|
||||
|
||||
local current_version=$(ynh_read_manifest "/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" "version" || echo 1.0)
|
||||
local current_upstream_version="${current_version/~ynh*/}"
|
||||
local update_version=$(ynh_read_manifest "../manifest.json" "version" || echo 1.0)
|
||||
local update_upstream_version="${update_version/~ynh*/}"
|
||||
|
||||
if [ "$current_version" == "$update_version" ] ; then
|
||||
# Complete versions are the same
|
||||
if [ "$force_upgrade" != "0" ]
|
||||
then
|
||||
echo "Upgrade forced by YNH_FORCE_UPGRADE." >&2
|
||||
unset YNH_FORCE_UPGRADE
|
||||
elif [ "$package_check" != "0" ]
|
||||
then
|
||||
echo "Upgrade forced for package check." >&2
|
||||
else
|
||||
ynh_die "Up-to-date, nothing to do" 0
|
||||
fi
|
||||
elif [ "$current_upstream_version" == "$update_upstream_version" ] ; then
|
||||
# Upstream versions are the same, only YunoHost package versions differ
|
||||
return_value="UPGRADE_PACKAGE"
|
||||
fi
|
||||
echo $return_value
|
||||
}
|
Loading…
Add table
Reference in a new issue