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

93 lines
2.9 KiB
Text
Raw Normal View History

2014-01-13 13:50:38 +01:00
#!/bin/bash
2017-09-28 18:02:10 +02:00
#=================================================
# GENERIC START
2017-09-28 18:02:10 +02:00
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2019-02-13 21:13:59 +01:00
source _common.sh
2017-09-28 18:02:10 +02:00
source /usr/share/yunohost/helpers
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
Testing (#107) * 4.4.0 (#94) * 4.4.0 * Auto-update README * Apply example_ynh * Auto-update README * Update manifest.json * [autopatch] Add Common Platform Enumeration id to `manifest.json` (#99) * Upgrade (#98) * 4.4.0 (#94) * 4.4.0 * Auto-update README * Apply example_ynh * Auto-update README * Update manifest.json Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: yunohost-bot <yunohost@yunohost.org> * [autopatch] Add Common Platform Enumeration id to `manifest.json` Co-authored-by: yalh76 <yalh@yahoo.com> Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> * Auto-update README * Bullseye (#100) * Auto-update README * PHP shouldn't allow `array(foobar)` to work if foobar is undefined... * Upgrade to bullseye * Auto-update README * Auto-update README * Fix Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org> * set relative path for --keep opt * 4.5.0 * Auto-update README * Auto-update README * Fix PHP * Version 2 (#105) * v2 * Auto-update README * v2 * Auto-update README * Update upgrade --------- Co-authored-by: yunohost-bot <yunohost@yunohost.org> * add crypt (#106) * add crypt * Update manifest.toml * Update install * cleaning * Auto-update README --------- Co-authored-by: yalh76 <yalh@yahoo.com> Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com> Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-07-29 12:58:16 +02:00
enable_crypt="false"
fpm_footprint="low"
fpm_free_footprint=0
fpm_usage="low"
2017-09-28 18:02:10 +02:00
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
2021-11-04 20:15:49 +01:00
Testing (#107) * 4.4.0 (#94) * 4.4.0 * Auto-update README * Apply example_ynh * Auto-update README * Update manifest.json * [autopatch] Add Common Platform Enumeration id to `manifest.json` (#99) * Upgrade (#98) * 4.4.0 (#94) * 4.4.0 * Auto-update README * Apply example_ynh * Auto-update README * Update manifest.json Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: yunohost-bot <yunohost@yunohost.org> * [autopatch] Add Common Platform Enumeration id to `manifest.json` Co-authored-by: yalh76 <yalh@yahoo.com> Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> * Auto-update README * Bullseye (#100) * Auto-update README * PHP shouldn't allow `array(foobar)` to work if foobar is undefined... * Upgrade to bullseye * Auto-update README * Auto-update README * Fix Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org> * set relative path for --keep opt * 4.5.0 * Auto-update README * Auto-update README * Fix PHP * Version 2 (#105) * v2 * Auto-update README * v2 * Auto-update README * Update upgrade --------- Co-authored-by: yunohost-bot <yunohost@yunohost.org> * add crypt (#106) * add crypt * Update manifest.toml * Update install * cleaning * Auto-update README --------- Co-authored-by: yalh76 <yalh@yahoo.com> Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com> Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-07-29 12:58:16 +02:00
ynh_app_setting_set --app=$app --key=enable_crypt --value=$enable_crypt
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
2021-11-04 20:15:49 +01:00
2017-09-28 18:02:10 +02:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2019-05-06 14:14:36 +02:00
ynh_script_progression --message="Setting up source files..." --weight=3
2017-09-28 18:02:10 +02:00
2019-05-06 14:14:36 +02:00
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
2017-09-28 18:02:10 +02:00
# Remove the install.php
ynh_secure_remove --file=$install_dir/install.php
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
2021-11-04 20:15:49 +01:00
2017-09-28 18:02:10 +02:00
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
2017-09-28 18:02:10 +02:00
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
2017-09-28 18:02:10 +02:00
#=================================================
# NGINX CONFIGURATION
2017-09-28 18:02:10 +02:00
#=================================================
ynh_script_progression --message="Configuring NGINX web server..."
2017-09-28 18:02:10 +02:00
# Create a dedicated NGINX config
ynh_add_nginx_config
2021-11-04 20:15:49 +01:00
2017-09-28 18:02:10 +02:00
#=================================================
# ADD A CONFIGURATION
2017-09-28 18:02:10 +02:00
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=2
2017-09-28 18:02:10 +02:00
if [ "$path" = "/" ]
2017-09-28 18:02:10 +02:00
then
jirafeau_path=""
else
jirafeau_path="$path"
fi
2017-09-28 18:02:10 +02:00
ynh_add_config --template="../conf/config.local.php" --destination="$install_dir/lib/config.local.php"
2017-09-28 18:02:10 +02:00
chmod 400 "$install_dir/lib/config.local.php"
chown $app:$app "$install_dir/lib/config.local.php"
2021-11-04 20:15:49 +01:00
2020-03-03 20:23:09 +01:00
#=================================================
# SET THE CRON FILE
#=================================================
ynh_script_progression --message="Configuring the cron file..." --weight=2
2020-03-03 20:23:09 +01:00
2021-04-11 18:58:39 +02:00
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
2021-11-04 20:15:49 +01:00
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
2017-09-28 18:02:10 +02:00
2019-02-17 20:55:13 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of Jirafeau completed" --last