2020-11-06 21:41:02 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_app_setting_set --key=php_upload_max_filesize --value=1G
|
|
|
|
|
2020-11-06 21:41:02 +01:00
|
|
|
#=================================================
|
2024-06-19 00:38:49 +02:00
|
|
|
# INITIALIZE AND STORE SETTINGS
|
2020-11-06 21:41:02 +01:00
|
|
|
#=================================================
|
|
|
|
|
2023-03-08 18:21:13 +01:00
|
|
|
timezone="$(cat /etc/timezone)"
|
|
|
|
|
2020-11-06 21:41:02 +01:00
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_script_progression "Setting up source files..."
|
2020-11-06 21:41:02 +01:00
|
|
|
|
2023-03-06 13:22:51 +01:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2021-06-23 11:47:36 +02:00
|
|
|
|
2020-11-06 21:41:02 +01:00
|
|
|
#=================================================
|
2024-06-19 00:38:49 +02:00
|
|
|
# APP INITIAL CONFIGURATION
|
2020-11-06 21:41:02 +01:00
|
|
|
#=================================================
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_script_progression "Adding $app's configuration files..."
|
2021-06-23 11:47:36 +02:00
|
|
|
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_config_add --template=".env" --destination="$install_dir/.env"
|
2020-11-06 21:41:02 +01:00
|
|
|
|
|
|
|
#=================================================
|
2024-06-19 00:38:49 +02:00
|
|
|
# SYSTEM CONFIGURATION
|
2022-08-09 10:57:57 +02:00
|
|
|
#=================================================
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_script_progression "Adding system configurations related to $app..."
|
2020-11-06 21:41:02 +01:00
|
|
|
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_config_add_phpfpm
|
2024-06-19 00:38:49 +02:00
|
|
|
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_config_add_nginx
|
2022-08-09 10:57:57 +02:00
|
|
|
|
2023-01-06 10:27:46 +01:00
|
|
|
#=================================================
|
|
|
|
# INSTALL APP WITH COMPOSER
|
|
|
|
#=================================================
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_script_progression "Installing app with Composer..."
|
2023-01-06 10:27:46 +01:00
|
|
|
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_composer_install
|
|
|
|
ynh_composer_exec install --no-dev
|
2023-01-06 10:27:46 +01:00
|
|
|
|
2020-11-06 21:41:02 +01:00
|
|
|
#=================================================
|
|
|
|
# BUILDING
|
|
|
|
#=================================================
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_script_progression "configuring $app..."
|
2020-11-06 21:41:02 +01:00
|
|
|
|
2024-04-20 19:40:28 +02:00
|
|
|
pushd "$install_dir"
|
2024-09-01 21:29:01 +02:00
|
|
|
"php$php_version" artisan key:generate -n --force --env
|
|
|
|
"php$php_version" artisan migrate -n --force
|
|
|
|
"php$php_version" artisan config:clear -n
|
|
|
|
"php$php_version" artisan config:cache -n
|
2021-01-28 12:57:15 +01:00
|
|
|
popd
|
2020-11-06 21:41:02 +01:00
|
|
|
|
2024-06-19 00:38:49 +02:00
|
|
|
chmod -R 775 /home/yunohost.app/$app/
|
|
|
|
chgrp "$app" -R "$install_dir/storage" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads"
|
|
|
|
chmod -R 2775 "$install_dir/storage" "$install_dir/app" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads" "$install_dir/bootstrap/"
|
2020-11-06 21:41:02 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_script_progression "Installation of $app completed"
|