diff --git a/README.md b/README.md index d04dd8d..fb20371 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,37 @@ + + # Syncthing for YunoHost [![Integration level](https://dash.yunohost.org/integration/syncthing.svg)](https://dash.yunohost.org/appci/app/syncthing) ![](https://ci-apps.yunohost.org/ci/badges/syncthing.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/syncthing.maintain.svg) [![Install Syncthing with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=syncthing) -> *This package allows you to install Syncthing quickly and simply on a YunoHost server. +*[Lire ce readme en français.](./README_fr.md)* + +> *This package allows you to install Syncthing quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview -Syncthing replaces proprietary sync and cloud services with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it's transmitted over the Internet. -**Shipped version:** 1.16.1 +Continuous file synchronization program. + +**Shipped version:** 1.17.0~ynh1 + + ## Screenshots -![](https://docs.syncthing.net/_images/gs1.png) +![](./doc/screenshots/screenshot1.png) -## Documentation +## Documentation and resources - * Official documentation: https://docs.syncthing.net - -## YunoHost specific features - -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/syncthing.svg)](https://ci-apps.yunohost.org/ci/apps/syncthing/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/syncthing.svg)](https://ci-apps-arm.yunohost.org/ci/apps/syncthing/) - -## Links - - * Report a bug: https://github.com/YunoHost-Apps/syncthing_ynh/issues - * App website: https://syncthing.net/ - * Upstream app repository: https://github.com/syncthing/syncthing - * YunoHost website: https://yunohost.org/ - ---- +* Official app website: https://syncthing.net +* Official user documentation: https://docs.syncthing.net +* Upstream app code repository: https://github.com/syncthing/syncthing +* YunoHost documentation for this app: https://yunohost.org/app_syncthing +* Report a bug: https://github.com/YunoHost-Apps/syncthing_ynh/issues ## Developer info @@ -45,3 +43,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/syncthing_ynh/tree/te or sudo yunohost app upgrade syncthing -u https://github.com/YunoHost-Apps/syncthing_ynh/tree/testing --debug ``` + +**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..94362a1 --- /dev/null +++ b/README_fr.md @@ -0,0 +1,43 @@ +# Syncthing pour YunoHost + +[![Niveau d'intégration](https://dash.yunohost.org/integration/syncthing.svg)](https://dash.yunohost.org/appci/app/syncthing) ![](https://ci-apps.yunohost.org/ci/badges/syncthing.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/syncthing.maintain.svg) +[![Installer Syncthing avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=syncthing) + +*[Read this readme in english.](./README.md)* +*[Lire ce readme en français.](./README_fr.md)* + +> *Ce package vous permet d'installer Syncthing rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* + +## Vue d'ensemble + +Programme de synchronisation de fichiers en continu. + +**Version incluse :** 1.17.0~ynh1 + + + +## Captures d'écran + +![](./doc/screenshots/screenshot1.png) + +## Documentations et ressources + +* Site officiel de l'app : https://syncthing.net +* Documentation officielle utilisateur : https://docs.syncthing.net +* Dépôt de code officiel de l'app : https://github.com/syncthing/syncthing +* Documentation YunoHost pour cette app : https://yunohost.org/app_syncthing +* Signaler un bug : https://github.com/YunoHost-Apps/syncthing_ynh/issues + +## Informations pour les développeurs + +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/syncthing_ynh/tree/testing). + +Pour essayer la branche testing, procédez comme suit. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/syncthing_ynh/tree/testing --debug +ou +sudo yunohost app upgrade syncthing -u https://github.com/YunoHost-Apps/syncthing_ynh/tree/testing --debug +``` + +**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/check_process b/check_process index be22d5a..edee87f 100644 --- a/check_process +++ b/check_process @@ -39,6 +39,8 @@ upgrade=1 from_commit=f373714a18c855c936c86b389d1ef0cf46da447b # 1.15.1~ynh2 upgrade=1 from_commit=2a0a768ba1e8c93c2cd1b3ef97ac558c86ddc72c + # 1.16.1~ynh1 + upgrade=1 from_commit=a1a1134571e6f9d274b6772358bedfb4b775fe5a backup_restore=1 multi_instance=0 port_already_use=0 @@ -75,3 +77,5 @@ Notification=all name=1.15.1~ynh1 ; commit=2a0a768ba1e8c93c2cd1b3ef97ac558c86ddc72c name=1.15.1~ynh2 + ; commit=a1a1134571e6f9d274b6772358bedfb4b775fe5a + name=1.16.1~ynh1 diff --git a/conf/arm.src b/conf/arm.src index 1b81e42..60e8346 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.16.1/syncthing-linux-arm-v1.16.1.tar.gz -SOURCE_SUM=a9c45c6af18c179874faf2e4f00f3aeb5ba66add132bc72f460ea5a8be7ba749 +SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.17.0/syncthing-linux-arm-v1.17.0.tar.gz +SOURCE_SUM=e53ebabdc0f0f0cb799efc5cc96644ee7d50c0d4a5ea051e33249d551c2ade74 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/arm64.src b/conf/arm64.src index 5f64df8..d9fc483 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.16.1/syncthing-linux-arm64-v1.16.1.tar.gz -SOURCE_SUM=6e1a4839fe24555cf2c7fc10e8eefae1e5810ffd4bbaccbaf63986b7c7e5e357 +SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.17.0/syncthing-linux-arm64-v1.17.0.tar.gz +SOURCE_SUM=8a21c2c1351cea8d708726f91dcf94a2938c28339e01396ee0213c48d60b23b0 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/i386.src b/conf/i386.src index 34440de..b67952c 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.16.1/syncthing-linux-386-v1.16.1.tar.gz -SOURCE_SUM=88852606067bdcdf8ac8e040df7c2c1fd80764ce5db9a26e3610ed92285dcf9b +SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.17.0/syncthing-linux-386-v1.17.0.tar.gz +SOURCE_SUM=09abe881be878fa759ff3924dc719d969a5cf71c3e6e834da70aa0afff1f8092 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/x86-64.src b/conf/x86-64.src index d46c110..0375f8d 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.16.1/syncthing-linux-amd64-v1.16.1.tar.gz -SOURCE_SUM=b4801f62699946e6c695c01f436ae8ebd6e5c1f741d1176515890d6c0adf143d +SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.17.0/syncthing-linux-amd64-v1.17.0.tar.gz +SOURCE_SUM=7b3e304761440f27137900f3f60c7f16e65de90cc05ae21bc6b046c14e591496 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/doc/.gitkeep b/doc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..e69de29 diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/screenshots/screenshot1.png b/doc/screenshots/screenshot1.png new file mode 100644 index 0000000..d3b6c8b Binary files /dev/null and b/doc/screenshots/screenshot1.png differ diff --git a/manifest.json b/manifest.json index bf55a24..10384c4 100644 --- a/manifest.json +++ b/manifest.json @@ -6,8 +6,15 @@ "en": "Continuous file synchronization program.", "fr": "Programme de synchronisation de fichiers en continu." }, - "version": "1.16.1~ynh1", + "version": "1.17.0~ynh1", "url": "https://syncthing.net/", + "upstream": { + "license": "MPL-2.0", + "website": "https://syncthing.net", + + "userdoc": "https://docs.syncthing.net", + "code": "https://github.com/syncthing/syncthing" + }, "license": "MPL-2.0", "maintainer": [ { diff --git a/scripts/backup b/scripts/backup index cb832ff..11eb9f9 100644 --- a/scripts/backup +++ b/scripts/backup @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ynh_clean_check_starting + true } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -42,6 +42,12 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$final_path" +#================================================= +# BACKUP THE DATA DIRECTORY +#================================================= + +ynh_backup --src_path="$sync_home" --is_big + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= @@ -56,13 +62,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/systemd/system/$app.service" -#================================================= -# BACKUP THE DATA DIRECTORY -#================================================= -ynh_print_info --message="Backing up data directory..." - -ynh_backup --src_path="$sync_home" --is_big - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/change_url b/scripts/change_url index caac7fc..d6bb455 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -93,7 +93,7 @@ then domain="$old_domain" path_url="$new_path" # Create a dedicated NGINX config - ynh_add_nginx_config "gui_port" + ynh_add_nginx_config fi # Change the domain for NGINX diff --git a/scripts/install b/scripts/install index 7a559d6..fe5fbfb 100644 --- a/scripts/install +++ b/scripts/install @@ -30,9 +30,6 @@ admin=$YNH_APP_ARG_ADMIN app=$YNH_APP_INSTANCE_NAME -# Configure sync folder -sync_home="/home/yunohost.app/$app" - #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -52,7 +49,6 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin -ynh_app_setting_set --app=$app --key=sync_home --value=$sync_home #================================================= # STANDARD MODIFICATIONS @@ -78,7 +74,7 @@ ynh_exec_warn_less yunohost firewall allow TCP $sync_port ynh_script_progression --message="Configuring system user..." # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -99,7 +95,7 @@ chown -R $app:$app "$final_path" ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated NGINX config -ynh_add_nginx_config "gui_port" +ynh_add_nginx_config #================================================= # SPECIFIC SETUP @@ -108,8 +104,11 @@ ynh_add_nginx_config "gui_port" #================================================= ynh_script_progression --message="Creating sync directory..." -# Make directories and set rights -mkdir -p "$sync_home" +sync_home=/home/yunohost.app/$app +ynh_app_setting_set --app=$app --key=sync_home --value=$sync_home + +mkdir -p $sync_home + chmod 750 "$sync_home" chmod -R o-rwx "$sync_home" chown -R $app:$app "$sync_home" @@ -147,12 +146,6 @@ ynh_replace_string --match_string="tcp://default" ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= -ynh_script_progression --message="Storing the config file checksum..." - -# Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$config_file" #================================================= diff --git a/scripts/restore b/scripts/restore index f9eaca4..b735318 100644 --- a/scripts/restore +++ b/scripts/restore @@ -79,22 +79,21 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:$app "$final_path" -#================================================= -# SPECIFIC RESTORATION #================================================= # RECREATE SYNC DIRECTORY #================================================= ynh_script_progression --message="Recreating sync directory..." -# Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup. ynh_restore_file --origin_path="$sync_home" --not_mandatory -# Make directories and set rights -mkdir -p "$sync_home" +mkdir -p $sync_home + chmod 750 "$sync_home" chmod -R o-rwx "$sync_home" chown -R $app:$app "$sync_home" +#================================================= +# SPECIFIC RESTORATION #================================================= # RESTORE SYSTEMD #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d38071a..e2b6fa6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,18 +32,34 @@ ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # Restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + +#================================================= +# STANDARD UPGRADE STEPS +#================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Stopping a systemd service..." + +ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= ynh_script_progression --message="Ensuring downward compatibility..." -# Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - # If gui_port doesn't exist, create it if [ -z $gui_port ]; then OLD_SYNCHOME="/home/yunohost.app/syncthing" @@ -85,40 +101,13 @@ if [ -z $gui_port ]; then ynh_remove_app_dependencies -else +fi - #================================================= - # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP - #================================================= - ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." - - # Inform the backup/restore process that it should not save the data directory - # Use only for the previous backup script that doesn't set 'is_big' - ynh_app_setting_set --app=$app --key=backup_core_only --value=1 - - # Backup the current version of the app - ynh_backup_before_upgrade - - # Remove the option backup_core_only after the backup. - ynh_app_setting_delete --app=$app --key=backup_core_only - - ynh_clean_setup () { - ynh_clean_check_starting - # Restore it if the upgrade fails - ynh_restore_upgradebackup - } - # Exit if an error occurs during the execution of the script - ynh_abort_if_errors - - #================================================= - # STANDARD UPGRADE STEPS - #================================================= - # STOP SYSTEMD SERVICE - #================================================= - ynh_script_progression --message="Stopping a systemd service..." - - ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + ynh_app_setting_delete --app=$app --key=is_public fi #================================================= @@ -127,7 +116,7 @@ fi ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -151,7 +140,7 @@ chown -R $app:$app "$final_path" ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated NGINX config -ynh_add_nginx_config "gui_port" +ynh_add_nginx_config #================================================= # SPECIFIC UPGRADE @@ -173,9 +162,7 @@ ynh_script_progression --message="Updating a config file..." config_file="$final_path/.config/syncthing/config.xml" -ynh_backup_if_checksum_is_different --file="$config_file" -# Recalculate and store the checksum of the file for the next upgrade. -ynh_store_file_checksum --file="$config_file" +ynh_add_config --template="../conf/config.xml" --destination="$config_file" chmod 400 "$config_file" chown $app:$app "$config_file"