1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ttrss_ynh.git synced 2024-10-01 13:34:46 +02:00
ttrss_ynh/scripts/install
Éric Gaspar 6c2e258383 cleaning
2024-09-08 12:51:04 +02:00

57 lines
1.8 KiB
Bash

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
ynh_app_setting_set --key=php_upload_max_filesize --value=10M
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Setting up source files..."
ynh_setup_source --dest_dir="$install_dir"
echo "$(ynh_app_upstream_version)" > "$install_dir/version_static.txt"
#=================================================
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression "Adding system configurations related to $app..."
ynh_config_add_phpfpm
ynh_config_add_nginx
ynh_config_add_systemd
yunohost service add $app --description="News feed reader and aggregator" --log="/var/log/$app/$app.log"
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression "Adding $app's configuration..."
ynh_config_add --template="config.php" --destination="$install_dir/config.php"
#=================================================
# INITIALIZE DATABASE
#=================================================
ynh_script_progression "Initializing database..."
ynh_psql_db_shell < "$install_dir/schema/ttrss_schema_pgsql.sql"
ynh_exec_as_app php$php_version $install_dir/update.php --update-schema=force-yes
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Starting $app's systemd service..."
ynh_systemctl --service=$app --action="start" --log_path="systemd"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Installation of $app completed"