mirror of
https://github.com/YunoHost-Apps/vikunja_ynh.git
synced 2024-09-03 18:06:26 +02:00
cleaning
This commit is contained in:
parent
8a93dc6a48
commit
b978b23c87
6 changed files with 15 additions and 73 deletions
|
@ -19,12 +19,15 @@ admindoc = "https://vikunja.io/docs/"
|
|||
code = "https://kolaente.dev/vikunja/vikunja"
|
||||
|
||||
[integration]
|
||||
yunohost = ">= 11.2.18"
|
||||
yunohost = ">= 11.2.29"
|
||||
helpers_version = "2.1"
|
||||
architectures = "all"
|
||||
multi_instance = true
|
||||
|
||||
ldap = false
|
||||
|
||||
sso = false
|
||||
|
||||
disk = "50M"
|
||||
ram.build = "1500M"
|
||||
ram.runtime = "50M"
|
||||
|
|
|
@ -34,14 +34,11 @@ domain="$new_domain"
|
|||
path="$new_path"
|
||||
ynh_config_add --template="config.yml" --destination="$install_dir/config.yml"
|
||||
|
||||
#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 600 "$install_dir/config.yml"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression "Starting $app's systemd service..."
|
||||
|
||||
# Start a systemd service
|
||||
ynh_systemctl --service=$app --action=start --log_path=systemd
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -40,14 +40,12 @@ ynh_app_setting_set --key=maxitemsperpage --value=$maxitemsperpage
|
|||
#=================================================
|
||||
ynh_script_progression "Setting up source files..."
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$install_dir"
|
||||
executable="$(find $install_dir -name "vikunja-*" \! -name "*.sha256")"
|
||||
mv "$executable" "$install_dir/vikunja"
|
||||
|
||||
chmod +x "$install_dir/vikunja"
|
||||
#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"
|
||||
#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"
|
||||
|
||||
#=================================================
|
||||
# ADD A CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -55,9 +53,6 @@ ynh_script_progression "Adding $app's configuration..."
|
|||
|
||||
ynh_config_add --template="config.yml" --destination="$install_dir/config.yml"
|
||||
|
||||
#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 400 "$install_dir/config.yml"
|
||||
#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/config.yml"
|
||||
|
||||
#=================================================
|
||||
# SYSTEM CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -74,7 +69,6 @@ yunohost service add $app --description="Self-hosted To-Do list application" --l
|
|||
#=================================================
|
||||
ynh_script_progression "Starting $app's systemd service..."
|
||||
|
||||
# Start a systemd service
|
||||
ynh_systemctl --service="$app" --action=start --log_path=systemd #--wait_until="server started on"
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -10,19 +10,16 @@ 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..."
|
||||
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
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -10,8 +10,6 @@ ynh_script_progression "Restoring $app main directory..."
|
|||
|
||||
ynh_restore "$install_dir"
|
||||
|
||||
#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"
|
||||
#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"
|
||||
#=================================================
|
||||
# RESTORE THE POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
|
@ -22,8 +20,6 @@ ynh_psql_db_shell < ./db.sql
|
|||
#=================================================
|
||||
# RESTORE SYSTEM CONFIGURATIONS
|
||||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression "Restoring system configurations related to $app..."
|
||||
|
||||
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
|
|
@ -16,65 +16,25 @@ redis_db=$(ynh_redis_get_free_db)
|
|||
#=================================================
|
||||
ynh_script_progression "Ensuring downward compatibility..."
|
||||
|
||||
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=set_motd --value=""
|
||||
if [ -z "${set_motd:-}" ]; then
|
||||
set_motd=""
|
||||
ynh_app_setting_set --key="set_motd" --value="$set_motd"
|
||||
fi
|
||||
ynh_app_setting_set_default --key=set_motd --value=""
|
||||
|
||||
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_registration --value="true"
|
||||
if [ -z "${enable_registration:-}" ]; then
|
||||
enable_registration="true"
|
||||
ynh_app_setting_set --key="enable_registration" --value="$enable_registration"
|
||||
fi
|
||||
ynh_app_setting_set_default --key=enable_registration --value="true"
|
||||
|
||||
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_linksharing --value="true"
|
||||
if [ -z "${enable_linksharing:-}" ]; then
|
||||
enable_linksharing="true"
|
||||
ynh_app_setting_set --key="enable_linksharing" --value="$enable_linksharing"
|
||||
fi
|
||||
ynh_app_setting_set_default --key=enable_linksharing --value="true"
|
||||
|
||||
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_taskattachments --value="true"
|
||||
if [ -z "${enable_taskattachments:-}" ]; then
|
||||
enable_taskattachments="true"
|
||||
ynh_app_setting_set --key="enable_taskattachments" --value="$enable_taskattachments"
|
||||
fi
|
||||
ynh_app_setting_set_default --key=enable_taskattachments --value="true"
|
||||
|
||||
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_taskcomments --value="true"
|
||||
if [ -z "${enable_taskcomments:-}" ]; then
|
||||
enable_taskcomments="true"
|
||||
ynh_app_setting_set --key="enable_taskcomments" --value="$enable_taskcomments"
|
||||
fi
|
||||
ynh_app_setting_set_default --key=enable_taskcomments --value="true"
|
||||
|
||||
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_emailreminders --value="true"
|
||||
if [ -z "${enable_emailreminders:-}" ]; then
|
||||
enable_emailreminders="true"
|
||||
ynh_app_setting_set --key="enable_emailreminders" --value="$enable_emailreminders"
|
||||
fi
|
||||
ynh_app_setting_set_default --key=enable_emailreminders --value="true"
|
||||
|
||||
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=enable_userdeletion --value="true"
|
||||
if [ -z "${enable_userdeletion:-}" ]; then
|
||||
enable_userdeletion="true"
|
||||
ynh_app_setting_set --key="enable_userdeletion" --value="$enable_userdeletion"
|
||||
fi
|
||||
ynh_app_setting_set_default --key=enable_userdeletion --value="true"
|
||||
|
||||
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=maxavatarsize --value=1024
|
||||
if [ -z "${maxavatarsize:-}" ]; then
|
||||
maxavatarsize=1024
|
||||
ynh_app_setting_set --key="maxavatarsize" --value="$maxavatarsize"
|
||||
fi
|
||||
ynh_app_setting_set_default --key=maxavatarsize --value=1024
|
||||
|
||||
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=maxitemsperpage --value=50
|
||||
if [ -z "${maxitemsperpage:-}" ]; then
|
||||
maxitemsperpage=50
|
||||
ynh_app_setting_set --key="maxitemsperpage" --value="$maxitemsperpage"
|
||||
fi
|
||||
ynh_app_setting_set_default --key=maxitemsperpage --value=50
|
||||
|
||||
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=language --value="en"
|
||||
if [ -z "${language:-}" ]; then
|
||||
language="en"
|
||||
ynh_app_setting_set --key="language" --value="$language"
|
||||
fi
|
||||
ynh_app_setting_set_default --key=language --value="en"
|
||||
|
||||
if ynh_app_upgrading_from_version_before 0.23.0~ynh1; then
|
||||
mv "$backend_path/config.yml" "$install_dir/config.yml"
|
||||
|
@ -100,8 +60,6 @@ mv "$executable" "$install_dir/vikunja"
|
|||
|
||||
chmod +x "$install_dir/vikunja"
|
||||
|
||||
#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"
|
||||
#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"
|
||||
#=================================================
|
||||
# UPDATE A CONFIG FILE
|
||||
#=================================================
|
||||
|
@ -109,9 +67,6 @@ ynh_script_progression "Updating $app's configuration files..."
|
|||
|
||||
ynh_config_add --template="config.yml" --destination="$install_dir/config.yml"
|
||||
|
||||
#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 400 "$install_dir/config.yml"
|
||||
#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/config.yml"
|
||||
|
||||
#=================================================
|
||||
# REAPPLY SYSTEM CONFIGURATIONS
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue