mirror of
https://github.com/YunoHost-Apps/bookstack_ynh.git
synced 2024-09-03 18:16:02 +02:00
cleaning
This commit is contained in:
parent
4f444ce8d3
commit
9f1168971b
4 changed files with 2 additions and 54 deletions
|
@ -15,18 +15,11 @@ timezone="$(cat /etc/timezone)"
|
|||
redis_db=$(ynh_redis_get_free_db)
|
||||
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||
|
||||
#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | fpm_footprint="low"
|
||||
#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | fpm_free_footprint=0
|
||||
#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | fpm_usage="low"
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
|
||||
ynh_app_setting_set --key=redis_db --value=$redis_db
|
||||
#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_footprint --value=$fpm_footprint
|
||||
#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_free_footprint --value=$fpm_free_footprint
|
||||
#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | ynh_app_setting_set --key=fpm_usage --value=$fpm_usage
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
@ -40,13 +33,10 @@ ynh_setup_source --dest_dir="$install_dir"
|
|||
#=================================================
|
||||
ynh_script_progression "Adding system configurations related to $app ..."
|
||||
|
||||
# Create a dedicated PHP-FPM config
|
||||
ynh_config_add_phpfpm
|
||||
|
||||
# Create a dedicated NGINX config
|
||||
ynh_config_add_nginx
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_config_add_systemd
|
||||
|
||||
yunohost service add $app --description="BookStack Queue Worker" --log="/var/log/$app/$app.log"
|
||||
|
@ -56,7 +46,6 @@ yunohost service add $app --description="BookStack Queue Worker" --log="/var/log
|
|||
#=================================================
|
||||
ynh_script_progression "Installing BookStack with Composer..."
|
||||
|
||||
# Install composer
|
||||
ynh_composer_install
|
||||
ynh_composer_exec install --no-dev
|
||||
|
||||
|
@ -69,9 +58,6 @@ app_url_domain="https://$domain${path%/}"
|
|||
|
||||
ynh_config_add --template=.env --destination=$install_dir/.env
|
||||
|
||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 640 $install_dir/.env
|
||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app $install_dir/.env
|
||||
|
||||
#=================================================
|
||||
# FINAL BOOKSTACK INSTALL
|
||||
#=================================================
|
||||
|
@ -87,15 +73,13 @@ popd
|
|||
# SET PERMISSIONS
|
||||
#=================================================
|
||||
|
||||
#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
|
||||
chmod -R 775 $install_dir/storage $install_dir/bootstrap/cache $install_dir/public/uploads
|
||||
#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
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression "Starting $app's systemd service..."
|
||||
|
||||
# Start a systemd service
|
||||
ynh_systemctl --service=$app --action="start" --log_path="systemd"
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -11,22 +11,18 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
ynh_script_progression "Removing system configurations related to $app..."
|
||||
|
||||
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
||||
if ynh_hide_warnings yunohost service status $app >/dev/null
|
||||
then
|
||||
ynh_script_progression "Removing $app service integration..."
|
||||
yunohost service remove $app
|
||||
fi
|
||||
|
||||
# Remove the dedicated systemd config
|
||||
ynh_config_remove_systemd
|
||||
|
||||
ynh_redis_remove_db "$redis_db"
|
||||
|
||||
# Remove the dedicated NGINX config
|
||||
ynh_config_remove_nginx
|
||||
|
||||
# Remove the dedicated PHP-FPM config
|
||||
ynh_config_remove_phpfpm
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -10,11 +10,7 @@ ynh_script_progression "Restoring the app main directory..."
|
|||
|
||||
ynh_restore "$install_dir"
|
||||
|
||||
# Restore permissions on app files
|
||||
#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
|
||||
chmod -R 775 $install_dir/storage $install_dir/bootstrap/cache $install_dir/public/uploads
|
||||
#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
|
||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 640 $install_dir/.env
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE MYSQL DATABASE
|
||||
|
|
|
@ -7,35 +7,11 @@ ynh_app_setting_set_default --key=php_upload_max_filesize --value=256M
|
|||
|
||||
ynh_app_setting_set_default --key=php_memory_limit --value=256M
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression "Ensuring downward compatibility..."
|
||||
|
||||
# If fpm_footprint doesn't exist, create it
|
||||
if [ -z "${fpm_footprint:-}" ]; then
|
||||
fpm_footprint=low
|
||||
#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_footprint --value=$fpm_footprint
|
||||
fi
|
||||
|
||||
# If fpm_free_footprint doesn't exist, create it
|
||||
if [ -z "${fpm_free_footprint:-}" ]; then
|
||||
fpm_free_footprint=0
|
||||
#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_free_footprint --value=$fpm_free_footprint
|
||||
fi
|
||||
|
||||
# If fpm_usage doesn't exist, create it
|
||||
if [ -z "${fpm_usage:-}" ]; then
|
||||
fpm_usage=low
|
||||
#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | ynh_app_setting_set --key=fpm_usage --value=$fpm_usage
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression "Upgrading source files..."
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$install_dir" --full_replace --keep=".env public/uploads storage/uploads"
|
||||
|
||||
#=================================================
|
||||
|
@ -43,13 +19,10 @@ ynh_setup_source --dest_dir="$install_dir" --full_replace --keep=".env public/up
|
|||
#=================================================
|
||||
ynh_script_progression "Upgrading system configurations related to $app..."
|
||||
|
||||
# Create a dedicated PHP-FPM config
|
||||
ynh_config_add_phpfpm
|
||||
|
||||
# Create a dedicated NGINX config
|
||||
ynh_config_add_nginx
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_config_add_systemd
|
||||
|
||||
yunohost service add $app --description="BookStack Queue Worker" --log="/var/log/$app/$app.log"
|
||||
|
@ -90,9 +63,8 @@ popd
|
|||
# SET PERMISSIONS
|
||||
#=================================================
|
||||
|
||||
#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
|
||||
chmod -R 775 $install_dir/storage $install_dir/bootstrap/cache $install_dir/public/uploads
|
||||
#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
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue