diff --git a/scripts/backup b/scripts/backup index 9e175ac..847f863 100644 --- a/scripts/backup +++ b/scripts/backup @@ -64,26 +64,6 @@ ynh_mysql_dump_db "$db_name" > db.sql #================================================= # SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= -ynh_print_info "Backing up logrotate configuration..." - -#ynh_backup "/etc/logrotate.d/$app" - -#================================================= -# BACKUP SYSTEMD -#================================================= -ynh_print_info "Backing up systemd configuration..." - -#ynh_backup "/etc/systemd/system/$app.service" - -#================================================= -# BACKUP A CRON FILE -#================================================= - -#ynh_backup "/etc/cron.d/$app" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index 77a5d34..4073862 100644 --- a/scripts/install +++ b/scripts/install @@ -201,76 +201,6 @@ pushd $final_path --allow-as-root popd -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_print_info "Configuring a systemd service..." - -### `ynh_systemd_config` is used to configure a systemd script for an app. -### It can be used for apps that use sysvinit (with adaptation) or systemd. -### Have a look at the app to be sure this app needs a systemd script. -### `ynh_systemd_config` will use the file conf/systemd.service -### If you're not using these lines: -### - You can remove those files in conf/. -### - Remove the section "BACKUP SYSTEMD" in the backup script -### - Remove also the section "STOP AND REMOVE SERVICE" in the remove script -### - As well as the section "RESTORE SYSTEMD" in the restore script -### - And the section "SETUP SYSTEMD" in the upgrade script - -# Create a dedicated systemd config -#ynh_add_systemd_config - -#================================================= -# SETUP APPLICATION WITH CURL -#================================================= - -### Use these lines only if the app installation needs to be finalized through -### web forms. We generally don't want to ask the final user, -### so we're going to use curl to automatically fill the fields and submit the -### forms. - -# Set right permissions for curl install -#chown -R $app: $final_path - -# Set the app as temporarily public for curl call -#ynh_print_info "Configuring SSOwat..." -#ynh_app_setting_set $app skipped_uris "/" -# Reload SSOwat config -#yunohost app ssowatconf - -# Reload Nginx -#systemctl reload nginx - -# Installation with curl -#ynh_print_info "Finalizing installation..." -#ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3" - -# Remove the public access -#if [ $is_public -eq 0 ] -#then -# ynh_app_setting_delete $app skipped_uris -#fi - -#================================================= -# MODIFY A CONFIG FILE -#================================================= - -### `ynh_replace_string` is used to replace a string in a file. -### (It's compatible with sed regular expressions syntax) - -#ynh_replace_string "match_string" "replace_string" "$final_path/CONFIG_FILE" - -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= - -### `ynh_store_file_checksum` is used to store the checksum of a file. -### That way, during the upgrade script, by using `ynh_backup_if_checksum_is_different`, -### you can make a backup of this file before modifying it again if the admin had modified it. - -# Calculate and store the config file checksum into the app settings -#ynh_store_file_checksum "$final_path/CONFIG_FILE" - #================================================= # GENERIC FINALIZATION #================================================= @@ -285,38 +215,6 @@ ynh_print_info "Configuring a systemd service..." sudo chown -R www-data: $final_path sudo chmod 777 $final_path -R -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_print_info "Configuring log rotation..." - -### `ynh_use_logrotate` is used to configure a logrotate configuration for the logs of this app. -### Use this helper only if there is effectively a log file for this app. -### If you're not using this helper: -### - Remove the section "BACKUP LOGROTATE" in the backup script -### - Remove also the section "REMOVE LOGROTATE CONFIGURATION" in the remove script -### - As well as the section "RESTORE THE LOGROTATE CONFIGURATION" in the restore script -### - And the section "SETUP LOGROTATE" in the upgrade script - -# Use logrotate to manage application logfile(s) -#ynh_use_logrotate - -#================================================= -# ADVERTISE SERVICE IN ADMIN PANEL -#================================================= - -### `yunohost service add` is a CLI yunohost command to add a service in the admin panel. -### You'll find the service in the 'services' section of YunoHost admin panel. -### This CLI command would be useless if the app does not have any services (systemd or sysvinit) -### If you're not using these lines: -### - You can remove these files in conf/. -### - Remove the section "REMOVE SERVICE FROM ADMIN PANEL" in the remove script -### - As well as the section "ADVERTISE SERVICE IN ADMIN PANEL" in the restore script - -#yunohost service add $app --log "/var/log/$app/APP.log" -# if using yunohost version 3.2 or more in the 'manifest.json', a description can be added -#yunohost service add $app --description "$app daemon for XXX" --log "/var/log/$app/APP.log" - #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/restore b/scripts/restore index ff21cd6..38d4839 100644 --- a/scripts/restore +++ b/scripts/restore @@ -71,7 +71,7 @@ ynh_system_user_create $app #================================================= # Restore permissions on app files -chown -R $app: $final_path +chown -R www-data: $final_path #================================================= # RESTORE THE PHP-FPM CONFIGURATION @@ -81,14 +81,6 @@ ynh_restore_file "/etc/php/7.0/fpm/pool.d/$app.conf" #================================================= # SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_print_info "Reinstalling dependencies..." - -# Define and install dependencies -#ynh_install_app_dependencies deb1 deb2 - #================================================= # RESTORE THE MYSQL DATABASE #================================================= @@ -98,32 +90,6 @@ db_pwd=$(ynh_app_setting_get $app mysqlpwd) ynh_mysql_setup_db $db_name $db_name $db_pwd ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql -#================================================= -# RESTORE SYSTEMD -#================================================= -ynh_print_info "Restoring the systemd configuration..." - -#ynh_restore_file "/etc/systemd/system/$app.service" -#systemctl enable $app.service - -#================================================= -# ADVERTISE SERVICE IN ADMIN PANEL -#================================================= - -#yunohost service add $app --log "/var/log/$app/APP.log" - -#================================================= -# RESTORE THE CRON FILE -#================================================= - -#ynh_restore_file "/etc/cron.d/$app" - -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= - -#ynh_restore_file "/etc/logrotate.d/$app" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 28272ec..3f12aaf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,13 +89,6 @@ ynh_print_info "Upgrading nginx web server configuration..." # Create a dedicated nginx config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_print_info "Upgrading dependencies..." - -#ynh_install_app_dependencies deb1 deb2 - #================================================= # CREATE DEDICATED USER #================================================= @@ -122,28 +115,6 @@ pushd $final_path sudo ./concrete/bin/concrete5 c5:update --rerun --verbose --allow-as-root popd -### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. -### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it. -#ynh_backup_if_checksum_is_different "$final_path/CONFIG_FILE" -# Recalculate and store the checksum of the file for the next upgrade. -#ynh_store_file_checksum "$final_path/CONFIG_FILE" - -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_print_info "Upgrading logrotate configuration..." - -# Use logrotate to manage app-specific logfile(s) -#ynh_use_logrotate --non-append - -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_print_info "Upgrading systemd configuration..." - -# Create a dedicated systemd config -#ynh_add_systemd_config - #================================================= # GENERIC FINALIZATION #================================================= @@ -151,7 +122,7 @@ ynh_print_info "Upgrading systemd configuration..." #================================================= # Set permissions on app files -chown -R root: $final_path +chown -R www-data: $final_path #================================================= # SETUP SSOWAT