From c470ec38cc83e2e4320a9c988bf55b988bdc16c3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 25 Aug 2023 12:00:11 +0200 Subject: [PATCH] cleaning --- doc/ADMIN_fr.md | 19 +++++++++++++++++++ doc/DESCRIPTION.md | 1 - doc/DESCRIPTION_fr.md | 11 +++++++++++ manifest.toml | 5 ++--- scripts/install | 17 ----------------- scripts/remove | 15 --------------- scripts/restore | 24 ++---------------------- scripts/upgrade | 17 ----------------- 8 files changed, 34 insertions(+), 75 deletions(-) create mode 100644 doc/ADMIN_fr.md create mode 100644 doc/DESCRIPTION_fr.md diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md new file mode 100644 index 0000000..881d76c --- /dev/null +++ b/doc/ADMIN_fr.md @@ -0,0 +1,19 @@ +# Utilisation de la fonction shell + +### Ajouter un alias à `.bashrc` ou `.zshrc` + +Copiez et collez cette fonction dans votre fichier `.bashrc` ou `.zshrc`. + +``` +transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\n transfer \n ... | transfer ">&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "https://__DOMAIN__/$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "https://__DOMAIN__/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "https://__DOMAIN__/$file_name"|tee /dev/null;fi;} +``` + +Vous pouvez maintenant utiliser la fonction de transfert + +``` +$ transfer hello.txt +``` + +### Documentation et exemples + +https://github.com/dutchcoders/transfer.sh/blob/main/examples.md \ No newline at end of file diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index e5f4205..c0a20e9 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -8,5 +8,4 @@ Transfer.sh currently supports the s3 (Amazon S3), gdrive (Google Drive), storj - Unlimited upload - Files stored forever - Encrypt your files -- Maximize amount of downloads - Preview your files in the browser diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..9b22dc0 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1,11 @@ +Partage de fichiers simple et rapide depuis la ligne de commande. Ce code contient le serveur avec tout ce dont vous avez besoin pour créer votre propre instance. +Transfer.sh prend actuellement en charge les fournisseurs Amazon S3, Google Drive, Storj et le système de fichiers local (local). + +### Caractéristiques + +- Conçu pour être utilisé avec un shell +- Partager des fichiers avec une URL +- Téléchargement illimité +- Fichiers stockés pour toujours +- Chiffrez vos fichiers +- Prévisualisez vos fichiers dans le navigateur \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 5231029..0552b33 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,7 @@ admindoc = "https://github.com/dutchcoders/transfer.sh/" code = "https://github.com/dutchcoders/transfer.sh" [integration] -yunohost = ">= 11.1.19" +yunohost = ">= 11.2" architectures = ["amd64", "arm64", "armhf"] multi_instance = true ldap = "not_relevant" @@ -28,8 +28,7 @@ ram.runtime = "50M" [install] [install.domain] type = "domain" - full_domain = true - + [install.init_main_permission] type = "group" default = "visitors" diff --git a/scripts/install b/scripts/install index 52f8330..49dda5b 100755 --- a/scripts/install +++ b/scripts/install @@ -29,29 +29,12 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 - # Use logrotate to manage application logfile(s) ynh_use_logrotate -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Easy and fast file sharing from the command-line" --log="/var/log/$app/$app.log" #================================================= diff --git a/scripts/remove b/scripts/remove index c610610..4a8a7ef 100755 --- a/scripts/remove +++ b/scripts/remove @@ -22,27 +22,12 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index 531361a..19fe714 100755 --- a/scripts/restore +++ b/scripts/restore @@ -36,35 +36,13 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE SYSTEMD -#================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 - ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 - ynh_restore_file --origin_path="/etc/logrotate.d/$app" -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Easy and fast file sharing from the command-line" --log="/var/log/$app/$app.log" -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" - #================================================= # GENERIC FINALIZATION #================================================= @@ -72,6 +50,8 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" + ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 50ca6e5..51cffe4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -48,29 +48,12 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 - # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 - # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Easy and fast file sharing from the command-line" --log="/var/log/$app/$app.log" #=================================================