1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/syncthing_ynh.git synced 2024-09-03 20:26:23 +02:00

Merge pull request #81 from YunoHost-Apps/testing

Upgrade to 1.17.0~ynh1
This commit is contained in:
yalh76 2021-06-27 19:21:36 +02:00 committed by GitHub
commit 31f3c46fc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 135 additions and 103 deletions

View file

@ -1,39 +1,37 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# Syncthing for YunoHost # 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) [![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) [![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.* If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview ## 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 ## Screenshots
![](https://docs.syncthing.net/_images/gs1.png) ![](./doc/screenshots/screenshot1.png)
## Documentation ## Documentation and resources
* Official documentation: https://docs.syncthing.net * Official app website: https://syncthing.net
* Official user documentation: https://docs.syncthing.net
## YunoHost specific features * Upstream app code repository: https://github.com/syncthing/syncthing
* YunoHost documentation for this app: https://yunohost.org/app_syncthing
#### Supported architectures * Report a bug: https://github.com/YunoHost-Apps/syncthing_ynh/issues
* 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/
---
## Developer info ## Developer info
@ -45,3 +43,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/syncthing_ynh/tree/te
or or
sudo yunohost app upgrade syncthing -u https://github.com/YunoHost-Apps/syncthing_ynh/tree/testing --debug 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

43
README_fr.md Normal file
View file

@ -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

View file

@ -39,6 +39,8 @@
upgrade=1 from_commit=f373714a18c855c936c86b389d1ef0cf46da447b upgrade=1 from_commit=f373714a18c855c936c86b389d1ef0cf46da447b
# 1.15.1~ynh2 # 1.15.1~ynh2
upgrade=1 from_commit=2a0a768ba1e8c93c2cd1b3ef97ac558c86ddc72c upgrade=1 from_commit=2a0a768ba1e8c93c2cd1b3ef97ac558c86ddc72c
# 1.16.1~ynh1
upgrade=1 from_commit=a1a1134571e6f9d274b6772358bedfb4b775fe5a
backup_restore=1 backup_restore=1
multi_instance=0 multi_instance=0
port_already_use=0 port_already_use=0
@ -75,3 +77,5 @@ Notification=all
name=1.15.1~ynh1 name=1.15.1~ynh1
; commit=2a0a768ba1e8c93c2cd1b3ef97ac558c86ddc72c ; commit=2a0a768ba1e8c93c2cd1b3ef97ac558c86ddc72c
name=1.15.1~ynh2 name=1.15.1~ynh2
; commit=a1a1134571e6f9d274b6772358bedfb4b775fe5a
name=1.16.1~ynh1

View file

@ -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_URL=https://github.com/syncthing/syncthing/releases/download/v1.17.0/syncthing-linux-arm-v1.17.0.tar.gz
SOURCE_SUM=a9c45c6af18c179874faf2e4f00f3aeb5ba66add132bc72f460ea5a8be7ba749 SOURCE_SUM=e53ebabdc0f0f0cb799efc5cc96644ee7d50c0d4a5ea051e33249d551c2ade74
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -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_URL=https://github.com/syncthing/syncthing/releases/download/v1.17.0/syncthing-linux-arm64-v1.17.0.tar.gz
SOURCE_SUM=6e1a4839fe24555cf2c7fc10e8eefae1e5810ffd4bbaccbaf63986b7c7e5e357 SOURCE_SUM=8a21c2c1351cea8d708726f91dcf94a2938c28339e01396ee0213c48d60b23b0
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -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_URL=https://github.com/syncthing/syncthing/releases/download/v1.17.0/syncthing-linux-386-v1.17.0.tar.gz
SOURCE_SUM=88852606067bdcdf8ac8e040df7c2c1fd80764ce5db9a26e3610ed92285dcf9b SOURCE_SUM=09abe881be878fa759ff3924dc719d969a5cf71c3e6e834da70aa0afff1f8092
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -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_URL=https://github.com/syncthing/syncthing/releases/download/v1.17.0/syncthing-linux-amd64-v1.17.0.tar.gz
SOURCE_SUM=b4801f62699946e6c695c01f436ae8ebd6e5c1f741d1176515890d6c0adf143d SOURCE_SUM=7b3e304761440f27137900f3f60c7f16e65de90cc05ae21bc6b046c14e591496
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

0
doc/.gitkeep Normal file
View file

0
doc/DISCLAIMER.md Normal file
View file

0
doc/screenshots/.gitkeep Normal file
View file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -6,8 +6,15 @@
"en": "Continuous file synchronization program.", "en": "Continuous file synchronization program.",
"fr": "Programme de synchronisation de fichiers en continu." "fr": "Programme de synchronisation de fichiers en continu."
}, },
"version": "1.16.1~ynh1", "version": "1.17.0~ynh1",
"url": "https://syncthing.net/", "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", "license": "MPL-2.0",
"maintainer": [ "maintainer": [
{ {

View file

@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_clean_setup () { ynh_clean_setup () {
ynh_clean_check_starting true
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
@ -42,6 +42,12 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
#=================================================
# BACKUP THE DATA DIRECTORY
#=================================================
ynh_backup --src_path="$sync_home" --is_big
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # 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" 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 # END OF SCRIPT
#================================================= #=================================================

View file

@ -93,7 +93,7 @@ then
domain="$old_domain" domain="$old_domain"
path_url="$new_path" path_url="$new_path"
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config "gui_port" ynh_add_nginx_config
fi fi
# Change the domain for NGINX # Change the domain for NGINX

View file

@ -30,9 +30,6 @@ admin=$YNH_APP_ARG_ADMIN
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
# Configure sync folder
sync_home="/home/yunohost.app/$app"
#================================================= #=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS # 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=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url 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=admin --value=$admin
ynh_app_setting_set --app=$app --key=sync_home --value=$sync_home
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
@ -78,7 +74,7 @@ ynh_exec_warn_less yunohost firewall allow TCP $sync_port
ynh_script_progression --message="Configuring system user..." ynh_script_progression --message="Configuring system user..."
# Create a 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 # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -99,7 +95,7 @@ chown -R $app:$app "$final_path"
ynh_script_progression --message="Configuring NGINX web server..." ynh_script_progression --message="Configuring NGINX web server..."
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config "gui_port" ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
@ -108,8 +104,11 @@ ynh_add_nginx_config "gui_port"
#================================================= #=================================================
ynh_script_progression --message="Creating sync directory..." ynh_script_progression --message="Creating sync directory..."
# Make directories and set rights sync_home=/home/yunohost.app/$app
mkdir -p "$sync_home" ynh_app_setting_set --app=$app --key=sync_home --value=$sync_home
mkdir -p $sync_home
chmod 750 "$sync_home" chmod 750 "$sync_home"
chmod -R o-rwx "$sync_home" chmod -R o-rwx "$sync_home"
chown -R $app:$app "$sync_home" chown -R $app:$app "$sync_home"
@ -147,12 +146,6 @@ ynh_replace_string --match_string="<listenAddress>tcp://default</listenAddress>"
ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd 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" ynh_store_file_checksum --file="$config_file"
#================================================= #=================================================

View file

@ -79,22 +79,21 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:$app "$final_path" chown -R $app:$app "$final_path"
#=================================================
# SPECIFIC RESTORATION
#================================================= #=================================================
# RECREATE SYNC DIRECTORY # RECREATE SYNC DIRECTORY
#================================================= #=================================================
ynh_script_progression --message="Recreating 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 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 750 "$sync_home"
chmod -R o-rwx "$sync_home" chmod -R o-rwx "$sync_home"
chown -R $app:$app "$sync_home" chown -R $app:$app "$sync_home"
#=================================================
# SPECIFIC RESTORATION
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
#================================================= #=================================================

View file

@ -32,18 +32,34 @@ ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed) 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 # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
ynh_script_progression --message="Ensuring 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 gui_port doesn't exist, create it
if [ -z $gui_port ]; then if [ -z $gui_port ]; then
OLD_SYNCHOME="/home/yunohost.app/syncthing" OLD_SYNCHOME="/home/yunohost.app/syncthing"
@ -85,40 +101,13 @@ if [ -z $gui_port ]; then
ynh_remove_app_dependencies ynh_remove_app_dependencies
else fi
#================================================= # Cleaning legacy permissions
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP if ynh_legacy_permissions_exists; then
#================================================= ynh_legacy_permissions_delete_all
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
ynh_app_setting_delete --app=$app --key=is_public
fi fi
#================================================= #=================================================
@ -127,7 +116,7 @@ fi
ynh_script_progression --message="Making sure dedicated system user exists..." ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing) # 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 # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -151,7 +140,7 @@ chown -R $app:$app "$final_path"
ynh_script_progression --message="Upgrading NGINX web server configuration..." ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config "gui_port" ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
@ -173,9 +162,7 @@ ynh_script_progression --message="Updating a config file..."
config_file="$final_path/.config/syncthing/config.xml" config_file="$final_path/.config/syncthing/config.xml"
ynh_backup_if_checksum_is_different --file="$config_file" ynh_add_config --template="../conf/config.xml" --destination="$config_file"
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$config_file"
chmod 400 "$config_file" chmod 400 "$config_file"
chown $app:$app "$config_file" chown $app:$app "$config_file"