1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/miniflux_ynh.git synced 2024-09-03 19:45:58 +02:00
miniflux_ynh/scripts/install

66 lines
2.3 KiB
Text
Raw Normal View History

2021-05-21 14:13:08 +02:00
#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
2023-04-07 14:32:57 +02:00
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
password=$YNH_APP_ARG_PASSWORD
2024-08-19 09:15:13 +02:00
ynh_app_setting_set --key=password --value=$password
2023-04-07 14:32:57 +02:00
2021-05-21 14:13:08 +02:00
#=================================================
# CREATE A POSTGRESQL DATABASE
#=================================================
2024-08-19 09:15:13 +02:00
ynh_script_progression "Creating a PostgreSQL database..."
2021-05-21 14:13:08 +02:00
2024-08-19 09:15:13 +02:00
ynh_psql_db_shell <<< "CREATE EXTENSION hstore;"
2021-05-21 14:13:08 +02:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2024-08-19 09:15:13 +02:00
ynh_script_progression "Setting up source files..."
2021-05-21 14:13:08 +02:00
2023-04-07 13:30:21 +02:00
ynh_setup_source --dest_dir="$install_dir"
2021-05-21 14:13:08 +02:00
2024-08-19 09:15:13 +02:00
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
2023-12-09 22:13:31 +01:00
chmod +x "$install_dir/miniflux"
2021-05-21 14:13:08 +02:00
#=================================================
# ADD A CONFIGURATION
#=================================================
2024-08-19 09:15:13 +02:00
ynh_script_progression "Adding $app's configuration..."
2021-05-21 14:13:08 +02:00
2024-08-19 09:15:13 +02:00
ynh_config_add --template="miniflux.conf" --destination="$install_dir/$app.conf"
2022-07-02 08:46:52 +02:00
2023-04-07 13:22:55 +02:00
chmod 600 "$install_dir/$app.conf"
chown $app "$install_dir/$app.conf"
2021-05-21 14:13:08 +02:00
#=================================================
2023-08-21 09:17:20 +02:00
# SYSTEM CONFIGURATION
2021-05-21 14:13:08 +02:00
#=================================================
2024-08-19 09:15:13 +02:00
ynh_script_progression "Adding system configurations related to $app..."
2021-05-21 14:13:08 +02:00
2024-08-19 09:15:13 +02:00
ynh_config_add_nginx
2021-05-21 14:13:08 +02:00
2024-08-19 09:15:13 +02:00
ynh_config_add_systemd
2021-11-16 20:34:36 +01:00
2024-08-19 09:15:13 +02:00
ynh_config_add_logrotate
2021-11-16 20:34:36 +01:00
2021-05-21 14:13:08 +02:00
yunohost service add $app --description="Minimalist feed reader" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
2024-08-19 09:15:13 +02:00
ynh_script_progression "Starting $app's systemd service..."
2021-05-21 14:13:08 +02:00
2024-08-19 09:15:13 +02:00
ynh_systemctl --service=$app --action=start --log_path=systemd
2021-05-21 14:13:08 +02:00
#=================================================
# END OF SCRIPT
#=================================================
2024-08-19 09:15:13 +02:00
ynh_script_progression "Installation of $app completed"