1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/transfersh_ynh.git synced 2024-09-04 01:35:59 +02:00
This commit is contained in:
Éric Gaspar 2024-08-31 09:13:51 +02:00
parent 74f3daeb7e
commit 2f60a65355
6 changed files with 6 additions and 39 deletions

View file

@ -16,12 +16,15 @@ admindoc = "https://github.com/dutchcoders/transfer.sh/"
code = "https://github.com/dutchcoders/transfer.sh" code = "https://github.com/dutchcoders/transfer.sh"
[integration] [integration]
yunohost = ">= 11.2.18" yunohost = ">= 11.2.29"
helpers_version = "2.1" helpers_version = "2.1"
architectures = ["amd64", "arm64", "armhf"] architectures = ["amd64", "arm64", "armhf"]
multi_instance = true multi_instance = true
ldap = "not_relevant" ldap = "not_relevant"
sso = "not_relevant" sso = "not_relevant"
disk = "50M" disk = "50M"
ram.build = "50M" ram.build = "50M"
ram.runtime = "50M" ram.runtime = "50M"

View file

@ -1,6 +1,5 @@
#!/bin/bash #!/bin/bash
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -24,18 +23,8 @@ ynh_backup "$data_dir"
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup "/etc/logrotate.d/$app" ynh_backup "/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup "/etc/systemd/system/$app.service" ynh_backup "/etc/systemd/system/$app.service"
#================================================= #=================================================

View file

@ -8,11 +8,8 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression "Setting up source files..." 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" ynh_setup_source --dest_dir="$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"
chmod +x $install_dir/transfersh chmod +x $install_dir/transfersh
#================================================= #=================================================
@ -20,13 +17,10 @@ chmod +x $install_dir/transfersh
#================================================= #=================================================
ynh_script_progression "Configuring NGINX web server..." ynh_script_progression "Configuring NGINX web server..."
# Create a dedicated NGINX config
ynh_config_add_nginx ynh_config_add_nginx
# Create a dedicated systemd config
ynh_config_add_systemd ynh_config_add_systemd
# Use logrotate to manage application logfile(s)
ynh_config_add_logrotate ynh_config_add_logrotate
yunohost service add $app --description="Easy and fast file sharing from the command-line" --log="/var/log/$app/$app.log" yunohost service add $app --description="Easy and fast file sharing from the command-line" --log="/var/log/$app/$app.log"
@ -36,7 +30,6 @@ yunohost service add $app --description="Easy and fast file sharing from the com
#================================================= #=================================================
ynh_script_progression "Starting $app's systemd service..." ynh_script_progression "Starting $app's systemd service..."
# Start a systemd service
ynh_systemctl --service=$app --action="start" ynh_systemctl --service=$app --action="start"
#================================================= #=================================================

View file

@ -9,20 +9,16 @@ source /usr/share/yunohost/helpers
# REMOVE SERVICE INTEGRATION IN YUNOHOST # REMOVE SERVICE INTEGRATION IN YUNOHOST
#================================================= #=================================================
# 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 if ynh_hide_warnings yunohost service status $app >/dev/null
then then
ynh_script_progression "Removing $app service integration..." ynh_script_progression "Removing $app service integration..."
yunohost service remove $app yunohost service remove $app
fi fi
# Remove the dedicated systemd config
ynh_config_remove_systemd ynh_config_remove_systemd
# Remove the app-specific logrotate config
ynh_config_remove_logrotate ynh_config_remove_logrotate
# Remove the dedicated NGINX config
ynh_config_remove_nginx ynh_config_remove_nginx
#================================================= #=================================================

View file

@ -1,6 +1,5 @@
#!/bin/bash #!/bin/bash
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -11,8 +10,6 @@ ynh_script_progression "Restoring the app main directory..."
ynh_restore "$install_dir" 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 DATA DIRECTORY # RESTORE THE DATA DIRECTORY
#================================================= #=================================================

View file

@ -13,18 +13,10 @@ ynh_systemctl --service=$app --action="stop"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression "Upgrading source files..."
# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed ynh_setup_source --dest_dir="$install_dir"
if ynh_app_upstream_version_changed
then
ynh_script_progression "Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
fi
#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"
chmod +x $install_dir/transfersh chmod +x $install_dir/transfersh
#================================================= #=================================================
@ -32,13 +24,10 @@ chmod +x $install_dir/transfersh
#================================================= #=================================================
ynh_script_progression "Upgrading NGINX web server configuration..." ynh_script_progression "Upgrading NGINX web server configuration..."
# Create a dedicated NGINX config
ynh_config_add_nginx ynh_config_add_nginx
# Create a dedicated systemd config
ynh_config_add_systemd ynh_config_add_systemd
# Use logrotate to manage app-specific logfile(s)
ynh_config_add_logrotate ynh_config_add_logrotate
yunohost service add $app --description="Easy and fast file sharing from the command-line" --log="/var/log/$app/$app.log" yunohost service add $app --description="Easy and fast file sharing from the command-line" --log="/var/log/$app/$app.log"