mirror of
https://github.com/YunoHost-Apps/freshrss_ynh.git
synced 2024-09-03 18:36:33 +02:00
dcdbeb73a5
* v2 * v2 * Auto-update README * Update manifest.toml * cleaning * Update upgrade * manifest: we probably want actual bools for permissions auth_header / show_tile / protected * "additional_urls" should be a list * Update manifest.toml * cleaning * PHP 8.1 (security fixes) (#165) * Update to php8.1 * Auto-update README --------- Co-authored-by: yunohost-bot <yunohost@yunohost.org> --------- Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org> Co-authored-by: lapineige <lapineige@users.noreply.github.com>
63 lines
2.2 KiB
Bash
Executable file
63 lines
2.2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
#=================================================
|
|
ynh_script_progression --message="Setting up source files..." --weight=1
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
|
ynh_setup_source --dest_dir="$install_dir"
|
|
|
|
chmod -R o-rwx "$install_dir"
|
|
chown -R $app:www-data "$install_dir"
|
|
|
|
#=================================================
|
|
# SYSTEM CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
|
|
|
# Create a dedicated PHP-FPM config
|
|
ynh_add_fpm_config --usage=low --footprint=low
|
|
|
|
# Create a dedicated NGINX config
|
|
ynh_add_nginx_config
|
|
|
|
ynh_add_config --template="../conf/freshrss.cron" --destination="/etc/cron.d/$app"
|
|
chown root: "/etc/cron.d/$app"
|
|
chmod 644 "/etc/cron.d/$app"
|
|
|
|
log_path="/var/log/$app"
|
|
mkdir -p $log_path
|
|
chown $app:www-data $log_path
|
|
# Use logrotate to manage application logfile(s)
|
|
ynh_use_logrotate
|
|
|
|
#=================================================
|
|
# SPECIFIC SETUP
|
|
#=================================================
|
|
# SETUPING FRESHRSS
|
|
#=================================================
|
|
ynh_script_progression --message="FreshRSS setup..." --weight=1
|
|
|
|
ynh_exec_as $app $install_dir/cli/do-install.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
|
|
|
|
for myuser in $(ynh_user_list)
|
|
do
|
|
user_token=$(ynh_string_random)
|
|
ynh_exec_as $app $install_dir/cli/create-user.php --user $myuser --language $language --token $user_token
|
|
done
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|