mirror of
https://github.com/YunoHost-Apps/chatonsinfos_ynh.git
synced 2024-09-03 18:15:58 +02:00
cleaning
This commit is contained in:
parent
bde37cb9d0
commit
f234ffaba5
7 changed files with 21 additions and 45 deletions
|
@ -16,11 +16,14 @@ admindoc = "https://framagit.org/chatons/chatonsinfos/-/blob/master/README.md"
|
||||||
code = "https://framagit.org/chatons/chatonsinfos"
|
code = "https://framagit.org/chatons/chatonsinfos"
|
||||||
|
|
||||||
[integration]
|
[integration]
|
||||||
yunohost = ">= 11.1.0"
|
yunohost = ">= 11.2"
|
||||||
architectures = "all"
|
architectures = "all"
|
||||||
multi_instance = false
|
multi_instance = false
|
||||||
|
|
||||||
ldap = "not_relevant"
|
ldap = "not_relevant"
|
||||||
|
|
||||||
sso = "not_relevant"
|
sso = "not_relevant"
|
||||||
|
|
||||||
disk = "50M"
|
disk = "50M"
|
||||||
ram.build = "50M"
|
ram.build = "50M"
|
||||||
ram.runtime = "50M"
|
ram.runtime = "50M"
|
||||||
|
|
|
@ -15,11 +15,6 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Declaring files to be backed up..."
|
ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs
|
|
||||||
### to be backuped and not an actual copy of any file. The actual backup that
|
|
||||||
### creates and fill the archive with the files happens in the core after this
|
|
||||||
### script is called. Hence ynh_backups calls takes basically 0 seconds to run.
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -3,6 +3,15 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# MODIFY URL IN NGINX CONF
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
||||||
|
|
||||||
ynh_change_url_nginx_config
|
ynh_change_url_nginx_config
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Change of URL completed for $app" --last
|
ynh_script_progression --message="Change of URL completed for $app" --last
|
||||||
|
|
|
@ -9,18 +9,12 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STORE SETTINGS FROM MANIFEST
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE SETTINGS FROM MANIFEST
|
# STORE SETTINGS FROM MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=host_server_distribution --value="YunoHost"
|
ynh_app_setting_set --app=$app --key=host_server_distribution --value="YunoHost"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
|
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -28,13 +22,10 @@ ynh_app_setting_set --app=$app --key=host_server_distribution --value="YunoHost"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..." --weight=1
|
ynh_script_progression --message="Setting up source files..." --weight=1
|
||||||
|
|
||||||
### `ynh_setup_source` is used to install an app from a zip or tar.gz file,
|
|
||||||
### downloaded from an upstream source, like a git repository.
|
|
||||||
### `ynh_setup_source` use the file conf/app.src
|
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$install_dir/sources"
|
ynh_setup_source --dest_dir="$install_dir/sources"
|
||||||
mkdir $install_dir/public
|
mkdir $install_dir/public
|
||||||
|
|
||||||
# Empty html page to fix the CI
|
# Empty html page to fix the CI
|
||||||
echo "<html><body>ChatonsInfos</body></html>" > $install_dir/public/index.html
|
echo "<html><body>ChatonsInfos</body></html>" > $install_dir/public/index.html
|
||||||
# $install_dir will automatically be initialized with some decent
|
# $install_dir will automatically be initialized with some decent
|
||||||
|
@ -66,7 +57,6 @@ orga_path="$install_dir/public/organization.properties"
|
||||||
ynh_write_var_in_file --file="$orga_path" --key="file.datetime" --value="$(date '+%Y-%m-%dT%H:%M:%S')"
|
ynh_write_var_in_file --file="$orga_path" --key="file.datetime" --value="$(date '+%Y-%m-%dT%H:%M:%S')"
|
||||||
ynh_write_var_in_file --file="$orga_path" --key="file.generator" --value="chatonsinfos_ynh"
|
ynh_write_var_in_file --file="$orga_path" --key="file.generator" --value="chatonsinfos_ynh"
|
||||||
|
|
||||||
|
|
||||||
chown -R $app:www-data "$install_dir/public"
|
chown -R $app:www-data "$install_dir/public"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -82,14 +72,12 @@ generate_config_panel
|
||||||
ynh_script_progression --message="Adding cron job to generate metrics..." --weight=1
|
ynh_script_progression --message="Adding cron job to generate metrics..." --weight=1
|
||||||
|
|
||||||
cron_path="/etc/cron.daily/$app"
|
cron_path="/etc/cron.daily/$app"
|
||||||
ynh_add_config --template="../conf/cron" --destination="$cron_path"
|
ynh_add_config --template="cron" --destination="$cron_path"
|
||||||
chown root: "$cron_path"
|
chown root: "$cron_path"
|
||||||
chmod 644 "$cron_path"
|
chmod 644 "$cron_path"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Installation of $app completed" --last
|
ynh_script_progression --message="Installation of $app completed" --last
|
||||||
|
|
|
@ -9,6 +9,11 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE SYSTEM CONFIGURATIONS
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
ynh_secure_remove --file="/etc/cron.daily/$app"
|
ynh_secure_remove --file="/etc/cron.daily/$app"
|
||||||
|
|
|
@ -17,13 +17,9 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$install_dir"
|
ynh_restore_file --origin_path="$install_dir"
|
||||||
|
|
||||||
# $install_dir will automatically be initialized with some decent
|
|
||||||
# permission by default ... however, you may need to recursively reapply
|
|
||||||
# ownership to all files such as after the ynh_setup_source step
|
|
||||||
chown -R root:root "$install_dir/sources"
|
chown -R root:root "$install_dir/sources"
|
||||||
chown -R $app:www-data "$install_dir/public"
|
chown -R $app:www-data "$install_dir/public"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEM CONFIGURATIONS
|
# RESTORE SYSTEM CONFIGURATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -31,7 +27,6 @@ chown -R $app:www-data "$install_dir/public"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
ynh_restore_file --origin_path="/etc/cron.daily/$app"
|
ynh_restore_file --origin_path="/etc/cron.daily/$app"
|
||||||
|
|
||||||
|
|
|
@ -11,25 +11,6 @@ source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD UPGRADE STEPS
|
|
||||||
#=================================================
|
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
|
||||||
#=================================================
|
|
||||||
#ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
|
||||||
|
|
||||||
#
|
|
||||||
# N.B. : the followings setting migrations snippets are provided as *EXAMPLES*
|
|
||||||
# of what you may want to do in some cases (e.g. a setting was not defined on
|
|
||||||
# some legacy installs and you therefore want to initiaze stuff during upgrade)
|
|
||||||
#
|
|
||||||
|
|
||||||
# If db_name doesn't exist, create it
|
|
||||||
#if [ -z "$db_name" ]; then
|
|
||||||
# db_name=$(ynh_sanitize_dbid --db_name=$app)
|
|
||||||
#REMOVEME? # ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
|
||||||
#fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
|
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue