2013-11-24 11:35:48 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-03-16 09:09:09 +01:00
|
|
|
source _common.sh
|
2017-04-20 21:31:08 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
2017-02-19 13:54:21 +01:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_app_setting_set --key=php_upload_max_filesize --value=10M
|
|
|
|
|
2017-08-27 14:42:28 +02:00
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_script_progression "Setting up source files..."
|
2017-08-27 14:42:28 +02:00
|
|
|
|
2023-03-11 13:53:38 +01:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2017-08-27 14:42:28 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
echo "$(ynh_app_upstream_version)" > "$install_dir/version_static.txt"
|
2021-05-18 09:26:51 +02:00
|
|
|
|
2017-08-27 14:42:28 +02:00
|
|
|
#=================================================
|
2023-03-11 13:53:38 +01:00
|
|
|
# SYSTEM CONFIGURATION
|
2017-08-27 14:42:28 +02:00
|
|
|
#=================================================
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_script_progression "Adding system configurations related to $app..."
|
2017-08-27 14:42:28 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_config_add_phpfpm
|
2022-07-06 06:41:20 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_config_add_nginx
|
2022-07-06 06:41:20 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_config_add_systemd
|
2023-03-11 13:53:38 +01:00
|
|
|
|
|
|
|
yunohost service add $app --description="News feed reader and aggregator" --log="/var/log/$app/$app.log"
|
|
|
|
|
2017-08-27 14:42:28 +02:00
|
|
|
#=================================================
|
2021-05-18 09:26:51 +02:00
|
|
|
# ADD A CONFIGURATION
|
2017-08-27 14:42:28 +02:00
|
|
|
#=================================================
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_script_progression "Adding $app's configuration..."
|
2017-08-27 14:42:28 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_config_add --template="config.php" --destination="$install_dir/config.php"
|
2017-08-27 14:42:28 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# INITIALIZE DATABASE
|
|
|
|
#=================================================
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_script_progression "Initializing database..."
|
2017-08-27 14:42:28 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_psql_db_shell < "$install_dir/schema/ttrss_schema_pgsql.sql"
|
2018-05-31 07:32:18 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_exec_as_app php$php_version $install_dir/update.php --update-schema=force-yes
|
2018-05-31 07:32:18 +02:00
|
|
|
|
2021-05-18 09:26:51 +02:00
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_script_progression "Starting $app's systemd service..."
|
2021-05-18 09:26:51 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_systemctl --service=$app --action="start" --log_path="systemd"
|
2021-05-18 09:26:51 +02:00
|
|
|
|
2019-05-01 20:35:48 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2017-08-27 14:42:28 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_script_progression "Installation of $app completed"
|