diff --git a/check_process b/check_process deleted file mode 100644 index 547831e..0000000 --- a/check_process +++ /dev/null @@ -1,21 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - is_public=1 - password="1Strong-Password" - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - #upgrade=1 from_commit=CommitHash - backup_restore=1 - multi_instance=1 - port_already_use=0 - change_url=1 -;;; Options -Email= -Notification=none diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index af2b030..5fad560 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,16 +1,11 @@ -Simple open source self-hosted file sharing solution. -It's an alternative to paid services like Dropbox, WeTransfer. +Simple open source self-hosted file sharing solution. It's an alternative to paid services like Dropbox, WeTransfer. -* No accounts, no logins -* Mobile friendly responsive interface -* Supports many and very big files (Streams ftw) -* Resumable up- and downloads ([tus.io](https://tus.io)) -* Set an expire-time for your upload bucket -* One-time downloads -* Download all files as zip/tar.gz archive -* Modal-style file preview -* Requires Node >=7.4 or use `--harmony-async-await` flag -* Password protected download list ([AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard)) -* `/admin` Page lists bucket information, [Screenshot](https://raw.githubusercontent.com/psi-4ward/psitransfer/master/docs/PsiTransfer-Admin.png) (_disabled until you set `adminPass` config value_) -* Lightweight [Vue](https://vuejs.org) based frontend apps. Gzipped (on by default) less than 100k -* Explicit named bucket IDs with query param `sid=` +### Features: + +- No accounts, no logins +- Mobile friendly responsive interface +- Resumable up- and downloads ([tus.io](https://tus.io)) +- Set an expire-time for your upload bucket +- Download all files as zip/tar.gz archive +- Password protected download list ([AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard)) +- `/admin` Page lists bucket information, [Screenshot](https://raw.githubusercontent.com/psi-4ward/psitransfer/master/docs/PsiTransfer-Admin.png) (_disabled until you set `adminPass` config value_) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/install b/scripts/install index 5c1f777..9ffda45 100644 --- a/scripts/install +++ b/scripts/install @@ -28,23 +28,35 @@ chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" #================================================= -# NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config +ynh_add_systemd_config + +mkdir -p /var/log/$app +touch /var/log/$app/$app.log +chown $app -R /var/log/$app + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate + +yunohost service add $app --description="Transfer files or images" --log="/var/log/$app/$app.log" + #================================================= # SPECIFIC SETUP #================================================= # INSTALL APP #================================================= -ynh_script_progression --message="Installing app..." +ynh_script_progression --message="Installing $app..." -pushd "$install_dir" - ynh_use_nodejs - NODE_ENV=production $ynh_npm install +pushd $install_dir + ynh_use_nodejs + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install popd #================================================= @@ -57,42 +69,13 @@ ynh_add_config --template="../conf/config.production.js" --destination="$install chmod 400 "$install_dir/config.production.js" chown $app:$app "$install_dir/config.production.js" -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." - -mkdir -p /var/log/$app -touch /var/log/$app/$app.log -chown $app -R /var/log/$app - -# Use logrotate to manage application logfile(s) -ynh_use_logrotate - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index e439a8d..c0ac356 100644 --- a/scripts/restore +++ b/scripts/restore @@ -17,7 +17,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Restoring the NGINX web server configuration..." -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # RESTORE THE APP MAIN DIR @@ -39,53 +39,35 @@ ynh_restore_file --origin_path="$data_dir" --not_mandatory chown -R $app:www-data "$data_dir" #================================================= -# SPECIFIC RESTORATION +# RESTORE SYSTEM CONFIGURATIONS #================================================= -# REINSTALL DEPENDENCIES +# RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Reinstalling dependencies..." +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_install_nodejs --nodejs_version=$nodejs_version -#================================================= -# RESTORE SYSTEMD -#================================================= -ynh_script_progression --message="Restoring the systemd configuration..." +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" 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..." - mkdir -p /var/log/$app touch /var/log/$app/$app.log chown $app -R /var/log/$app ynh_restore_file --origin_path="/etc/logrotate.d/$app" -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app --log="/var/log/$app/$app.log" - -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." - -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +yunohost service add $app --description="Transfer files or images" --log="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 4665caf..214117d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -63,7 +63,7 @@ ynh_script_progression --message="Upgrading app..." pushd "$install_dir" ynh_use_nodejs - NODE_ENV=production $ynh_npm install + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install popd #================================================= @@ -99,14 +99,14 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --log="/var/log/$app/$app.log" +yunohost service add $app --description="Transfer files or images" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="PsiTransfer listening on" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="PsiTransfer listening on" #================================================= # END OF SCRIPT