Skip to content

Commit 19ec801

Browse files
hgy59acolomb
andauthored
syncthing: update to v1.23.4 and include next-gen-gui (#5523)
* syncthing: update to v1.22.2 and include next-gen-gui - update syncthing to v1.22.2 - include next-get-gui and provide it under /tech-ui - fix parameter of ca_reloader.sh - fix link in wizard files * syncthing #3320 - avoid the creation of a default folder on first startup * fix usage text in ca_reloader.sh * clarify that the parameter --no-default-folder is ignored after the first start of syncthing * Update spk/syncthing/Makefile Co-authored-by: André Colomb <[email protected]> * Update cross/syncthing/PLIST Co-authored-by: André Colomb <[email protected]> * avoid to use $HOME as default sync folder * update syncthing configuration - avoid the use of '--home' argument as not related to HOME env. variable - enable to define custom HOME folder in options.conf * create options.conf.new on package update for DSM<7 * update wizard pages - add customization information to wizard - fix install_uifile_fre (add wizard_username and wizard_password) - add information for options.conf.new to upgrade wizard * Update spk/syncthing/src/service-setup.sh Co-authored-by: André Colomb <[email protected]> * move tech-ui to dedicated module and download prebuilt release - omit to compile synchthing --with-next-gen-gui * syncthing: udpate to v1.23.4 Co-authored-by: André Colomb <[email protected]> * final cleanup - avoid running ca_reloader.sh on DSM 7+ --------- Co-authored-by: André Colomb <[email protected]>
1 parent d3423ac commit 19ec801

14 files changed

+212
-43
lines changed

cross/syncthing-tech-ui/Makefile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
PKG_NAME = syncthing-tech-ui
2+
PKG_REAL_NAME = tech-ui
3+
PKG_VERS = 1.0.0
4+
PKG_EXT = zip
5+
PKG_DIST_NAME = $(PKG_REAL_NAME)-v$(PKG_VERS).$(PKG_EXT)
6+
PKG_DIST_SITE = https://github.com/syncthing/tech-ui/releases/download/v$(PKG_VERS)
7+
PKG_DIR = $(PKG_REAL_NAME)-v$(PKG_VERS)
8+
9+
# Remarks:
10+
# The repository https://github.com/syncthing/tech-ui is archived
11+
# Current development is in https://github.com/syncthing/syncthing/tree/main/next-gen-gui
12+
# but there are no downloadable releases for tech-ui in the syncthing repository.
13+
#
14+
# Until otherwise requested, we take the only official release published on Apr 17, 2020.
15+
#
16+
17+
HOMEPAGE = https://github.com/syncthing/syncthing/tree/main/next-gen-gui
18+
COMMENT = Alternative, stripped down status UI for large setups.
19+
LICENSE = MPL-2.0
20+
21+
INSTALL_TARGET = syncthing-tech-ui_install
22+
23+
include ../../mk/spksrc.install-resources.mk
24+
25+
.PHONY: syncthing-tech-ui_install
26+
syncthing-tech-ui_install:
27+
@$(MSG) Install tech-ui
28+
@install -d -m 755 $(STAGING_INSTALL_PREFIX)/gui/default/tech-ui
29+
@tar -cf - -C $(WORK_DIR)/tech-ui . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/gui/default/tech-ui

cross/syncthing-tech-ui/PLIST

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rsc:gui/default/tech-ui/

cross/syncthing-tech-ui/digests

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tech-ui-v1.0.0.zip SHA1 155679ebd818c736208cb57ac29e8d2ffb7351b9
2+
tech-ui-v1.0.0.zip SHA256 aab6df18f9d82ec6ea72414ab9cfaedce963d27e3d87a1b729d2f30f43b16558
3+
tech-ui-v1.0.0.zip MD5 159e7acfe7333f5051acaa56e2a83453

cross/syncthing/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
PKG_NAME = syncthing
2-
PKG_VERS = 1.22.1
2+
PKG_VERS = 1.23.4
33
PKG_EXT = tar.gz
44
PKG_DIST_NAME = $(PKG_NAME)-source-v$(PKG_VERS).$(PKG_EXT)
55
PKG_DIST_SITE = https://github.com/syncthing/syncthing/releases/download/v$(PKG_VERS)
6-
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
76
PKG_DIR = src/github.com/$(PKG_NAME)
87
EXTRACT_PATH = $(WORK_DIR)/$(PKG_DIR)
98

10-
DEPENDS = native/go
9+
BUILD_DEPENDS = native/go
1110

1211
HOMEPAGE = https://www.syncthing.net/
1312
COMMENT = Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers.
@@ -22,6 +21,7 @@ include ../../mk/spksrc.cross-go.mk
2221

2322
BUILD_ARGS = -goos=$(GOOS) -goarch=$(GO_ARCH) -version=v$(PKG_VERS)
2423

24+
.PHONY: syncthing_compile
2525
# use custom build to remove GOARCH from ENV and for custom BUILD_ARGS
2626
syncthing_compile:
2727
cd $(GO_SRC_DIR) && env $(filter-out GOARCH=%, $(ENV)) go run build.go $(BUILD_ARGS) build

cross/syncthing/digests

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
syncthing-1.22.1.tar.gz SHA1 c8e0e75b0ba5b04f4f7ce8a98dcf7212733dce37
2-
syncthing-1.22.1.tar.gz SHA256 b024d112167e0e81a785ab98c1a044aee1ac041dfe57a62772c08284f875a5bd
3-
syncthing-1.22.1.tar.gz MD5 6947b7b3a1eaf03d8e6f371894c37b41
1+
syncthing-source-v1.23.4.tar.gz SHA1 e4aead28fa927acc618d69d702a75703faa37bc0
2+
syncthing-source-v1.23.4.tar.gz SHA256 06a2882f8ac49e15faf96025b01d0edcd4cc190a419d5de98fbe8271695329fa
3+
syncthing-source-v1.23.4.tar.gz MD5 59280b2e551a8001ce84867c27398aa3

spk/syncthing/Makefile

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
SPK_NAME = syncthing
2-
SPK_VERS = 1.22.1
3-
SPK_REV = 28
2+
SPK_VERS = 1.23.4
3+
SPK_REV = 29
44
SPK_ICON = src/syncthing.png
55
DSM_UI_DIR = app
66

7-
DEPENDS = cross/$(SPK_NAME)
7+
DEPENDS = cross/syncthing
8+
DEPENDS += cross/syncthing-tech-ui
89

10+
# archs not supported by go
911
UNSUPPORTED_ARCHS = $(PPC_ARCHS)
1012

1113
MAINTAINER = acolomb
1214
DESCRIPTION = Automatically sync files via secure, distributed technology.
1315
DESCRIPTION_FRE = Synchronisation automatique de fichiers via une technologie sécurisée et distribuée.
1416
DISPLAY_NAME = Syncthing
15-
CHANGELOG = "1. Update syncthing to v1.22.1."
17+
CHANGELOG = "1. Update syncthing to v1.23.4.<br/>2. Include next gen gui (path: /tech-ui)."
1618
HOMEPAGE = https://www.syncthing.net
1719
LICENSE = MPLv2.0
1820
STARTABLE = yes
@@ -22,7 +24,7 @@ WIZARDS_DIR = src/wizard/
2224
SERVICE_USER = auto
2325
SERVICE_SETUP = src/service-setup.sh
2426
SERVICE_PORT = 8384
25-
SERVICE_PORT_TITLE = $(DISPLAY_NAME)
27+
SERVICE_PORT_TITLE = Syncthing Web GUI
2628
SERVICE_CERT = syncthing_webui
2729
SERVICE_CERT_RELOAD = tools/ca_reloader.sh
2830

spk/syncthing/src/ca_reloader.sh

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
#!/bin/sh
22

3+
source /etc.defaults/VERSION
4+
if [ ${majorversion} -ge 7 ]; then
5+
echo "ERROR: ${0} does not work on DSM 7+" >&2
6+
exit -1
7+
fi
8+
39
CERT_DIR=/usr/local/etc/certificate/syncthing/syncthing_webui
410
CONF_DIR=/var/packages/syncthing/var
5-
if [ ! -d "$CONF_DIR" ]; then
6-
CONF_DIR=/var/packages/syncthing/target/var
7-
fi
811
SYNCTHING=/var/packages/syncthing/target/bin/syncthing
912

1013
case $1 in
1114
syncthing_webui)
1215
# Forcefully overwrite certificate files by symlinks
13-
ln -sf $CERT_DIR/cert.pem $CONF_DIR/https-cert.pem
14-
ln -sf $CERT_DIR/privkey.pem $CONF_DIR/https-key.pem
16+
ln -sf ${CERT_DIR}/cert.pem ${CONF_DIR}/https-cert.pem
17+
ln -sf ${CERT_DIR}/privkey.pem ${CONF_DIR}/https-key.pem
1518

1619
# Required: set $HOME environment variable
17-
HOME=$CONF_DIR
20+
HOME=${CONF_DIR}
1821
export HOME
1922

20-
$SYNCTHING cli --home=$CONF_DIR operations restart
23+
${SYNCTHING} cli --config=${CONF_DIR} --data=${CONF_DIR} operations restart
2124
RESTART_STATUS=$?
22-
exit $RESTART_STATUS
25+
exit ${RESTART_STATUS}
2326
;;
2427
*)
25-
echo "Usage: $0 syncthing-webui" >&2
28+
echo "Usage: $0 syncthing_webui" >&2
2629
exit 1
2730
;;
2831
esac

spk/syncthing/src/config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<insecureAllowOldTLSVersions>false</insecureAllowOldTLSVersions>
5252
</options>
5353
<defaults>
54-
<folder ignorePerms="true">
54+
<folder ignorePerms="true" path="">
5555
</folder>
5656
</defaults>
5757
</configuration>

spk/syncthing/src/options.conf

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1-
#!/bin/sh
2-
# This file will be added to start-stop-status script
1+
# This file is included in the start-stop-status script
2+
# for customization of syncthing service
3+
4+
# To add additional parameters to start syncthing with, define the variable SYNCTHING_OPTIONS
35
# For possible options see syncthing --help
46

5-
# Example: uncomment this to start syncthing with all devices paused
6-
# SYNCTHING_OPTIONS="-paused"
7+
# Example: to start syncthing with all devices paused
8+
#SYNCTHING_OPTIONS="--paused"
9+
10+
11+
# Additionally you can define environment variables for the syncthing service
12+
# REMARKS:
13+
# HOME is the only variable that is exported by the start-stop-status script
14+
# other environment variables must be exported here.
15+
#
16+
# Example: set a custom folder for the web gui
17+
# - this folder needs a subfolder with the template name (default is "default")
18+
# containing the web page resources
19+
#export STGUIASSETS=/my_custom_web_gui_folder
20+
#
21+
# Example: set your custom HOME folder:
22+
#HOME=/volume1/my_syncthing_home_folder

spk/syncthing/src/service-setup.sh

+42-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
# syncthing service definition
22
SYNCTHING="${SYNOPKG_PKGDEST}/bin/syncthing"
3-
SERVICE_COMMAND="${SYNCTHING} serve --home=${SYNOPKG_PKGVAR}"
3+
# define folder for configuration (config, keys, database, logs)
4+
SYNCTHING_CONFIG="--config=${SYNOPKG_PKGVAR} --data=${SYNOPKG_PKGVAR}"
5+
SERVICE_COMMAND="${SYNCTHING} serve ${SYNCTHING_CONFIG}"
46
SVC_BACKGROUND=y
57
SVC_WRITE_PID=y
68

79
GROUP="sc-syncthing"
810

9-
# Required to run any syncthing command: set $HOME environment variable
10-
HOME=${SYNOPKG_PKGVAR}
11-
export HOME
12-
11+
# include next gen gui
12+
export STGUIASSETS=${SYNOPKG_PKGDEST}/gui
1313

1414
set_credentials() {
1515
if [ -n "${wizard_username}" -a -n "${wizard_password}" ]; then
16+
echo "set user name ${wizard_username} for syncthing Web GUI access"
1617
# Password needs to be hashed for config entry
17-
${SYNCTHING} generate --home=${SYNOPKG_PKGVAR} \
18-
--gui-user="${wizard_username}" --gui-password="${wizard_password}"
18+
# Required to run any syncthing command: set $HOME environment variable
19+
HOME=${SYNOPKG_PKGVAR} ${SYNCTHING} generate \
20+
--config=${SYNOPKG_PKGVAR} \
21+
--gui-user="${wizard_username}" \
22+
--gui-password="${wizard_password}"
1923
fi
2024
}
2125

@@ -27,12 +31,20 @@ service_postinst() {
2731

2832
service_prestart ()
2933
{
30-
# Read additional startup options from var/options.conf
34+
# Read additional startup options and variables from var/options.conf
3135
if [ -f ${SYNOPKG_PKGVAR}/options.conf ]; then
3236
. ${SYNOPKG_PKGVAR}/options.conf
3337
SERVICE_COMMAND="${SERVICE_COMMAND} ${SYNCTHING_OPTIONS}"
3438
fi
3539

40+
# Required to run any syncthing command: set $HOME environment variable
41+
if [ -z "${HOME}" ]; then
42+
# if HOME is not set in options.conf
43+
# use a default folder the package user has permissions for
44+
HOME=${SYNOPKG_PKGVAR}
45+
fi
46+
export HOME
47+
3648
# If the system has a TLS certificate for us, force its usage
3749
cert_dir=/usr/local/etc/certificate/${SYNOPKG_PKGNAME}/${SERVICE_CERT}
3850
if [ -f ${cert_dir}/cert.pem -a -f ${cert_dir}/privkey.pem ]; then
@@ -41,6 +53,25 @@ service_prestart ()
4153
fi
4254
}
4355

56+
57+
service_save ()
58+
{
59+
if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 7 ]; then
60+
if [ -e ${SYNOPKG_PKGVAR}/options.conf.new ]; then
61+
echo "remove former version of options.conf.new"
62+
rm -f ${SYNOPKG_PKGVAR}/options.conf.new
63+
fi
64+
fi
65+
}
66+
67+
service_restore ()
68+
{
69+
if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 7 ]; then
70+
echo "install updated options.conf as options.conf.new"
71+
mv -f ${SYNOPKG_PKGVAR}/options.conf ${SYNOPKG_PKGVAR}/options.conf.new
72+
fi
73+
}
74+
4475
version_le()
4576
{
4677
if printf '%s\n' "$1" "$2" | sort -VC ; then
@@ -51,8 +82,9 @@ version_le()
5182

5283
service_preupgrade()
5384
{
54-
CUR_VER=$(${SYNCTHING} --version | awk '{print $2}' | awk --field-separator=- '{print $1}')
55-
PKG_VER=$(${SYNOPKG_PKGINST_TEMP_DIR}/bin/syncthing --version | awk '{print $2}' | awk --field-separator=- '{print $1}')
85+
# Required to run any syncthing command: set $HOME environment variable
86+
CUR_VER=$(HOME=${SYNOPKG_PKGVAR} ${SYNCTHING} --version | awk '{print $2}' | awk --field-separator=- '{print $1}')
87+
PKG_VER=$(HOME=${SYNOPKG_PKGVAR} ${SYNOPKG_PKGINST_TEMP_DIR}/bin/syncthing --version | awk '{print $2}' | awk --field-separator=- '{print $1}')
5688
if version_le $CUR_VER $PKG_VER; then
5789
echo "Package ${PKG_VER} is newer than or same as installed binary ${CUR_VER}"
5890
else

spk/syncthing/src/wizard/install_uifile

+11-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,19 @@
4242
]
4343
},
4444
{
45-
"step_title": "DSM Permissions",
45+
"step_title": "Permissions and Customization",
4646
"items": [
4747
{
48-
"desc": "Permissions for this package are handled by the <b>'sc-syncthing'</b> group. <br>Using File Station, add this group to every folder Syncthing should be allowed to access.<br>Please read <a <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details."
48+
"desc": "<b>Permissions</b>"
49+
},
50+
{
51+
"desc": "Permissions for this package are handled by the <b>'sc-syncthing'</b> group. <br>Using File Station, add this group to every folder Syncthing should be allowed to access. <br/>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details."
52+
},
53+
{
54+
"desc": "<b>Customization</b>"
55+
},
56+
{
57+
"desc": "For advanced customization you can edit the file <code>/var/packages/syncthing/var/options.conf</code>. For example, you can define a custom <code>HOME</code> folder or additional parameters to start Syncthing with. <br/>To modify the options file, you need <code>SSH</code> access with a privileged user account. To apply your modifications, you have to restart Syncthing in the Package Center."
4958
}
5059
]
5160
}

spk/syncthing/src/wizard/install_uifile_fre

+52-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,60 @@
11
[
22
{
3-
"step_title": "Permissions DSM",
3+
"step_title": "Authentification pour interface graphique",
4+
"invalid_next_disabled": true,
45
"items": [
56
{
6-
"desc": "Les permissions de toutes les applications de téléchargement sont gérées par le groupe <b>'sc-syncthing'</b> dans DSM.<br>Depuis File Station, ajouter ce groupe à tout répertoire auquel Syncthing doit avoir accès.<br>Merci de lire <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> pour plus de détails."
7+
"desc": "L'interface graphique Syncthing ne doit pas être accessible sans authentification. Ce serait dangereux car avec l'accès à l'interface graphique Web, n'importe quel dossier peut être configuré pour être partagé par un tiers malveillant.<br/>Veuillez fournir un nom d'utilisateur et un mot de passe pour vous protéger contre les connexions non autorisées. Il sera requis à chaque ouverture de l'interface graphique de Syncthing.<br/><br/>(Laisser l'un ou l'autre des champs vide désactive l'authentification.)"
8+
},
9+
{
10+
"type": "textfield",
11+
"subitems": [
12+
{
13+
"key": "wizard_username",
14+
"desc": "Nom d'utilisateur",
15+
"defaultValue": "syncthing",
16+
"validator": {
17+
"allowBlank": true,
18+
"regex": {
19+
"expr": "/^[^<>:*/?\"|]*$/",
20+
"errorText": "Caractère non autorisé dans le nom d'utilisateur"
21+
}
22+
}
23+
}
24+
]
25+
},
26+
{
27+
"type": "password",
28+
"subitems": [
29+
{
30+
"key": "wizard_password",
31+
"desc": "Le mot de passe",
32+
"validator": {
33+
"allowBlank": true,
34+
"regex": {
35+
"expr": "/^[^<>:*/?\"|]*$/",
36+
"errorText": "Caractère non autorisé dans le mot de passe"
37+
}
38+
}
39+
}
40+
]
741
}
842
]
43+
},
44+
{
45+
"step_title": "Permissions et Personnalisation",
46+
"items": [
47+
{
48+
"desc": "<b>Permissions</b>"
49+
},
50+
{
51+
"desc": "Les permissions pour cette application sont gérées par le groupe <b>'sc-syncthing'</b>.<br>Depuis File Station, ajouter ce groupe à tout répertoire auquel Syncthing doit avoir accès.<br>Merci de lire <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> pour plus de détails."
52+
},
53+
{
54+
"desc": "<b>Personnalisation</b>"
55+
},
56+
{
57+
"desc": "Pour une personnalisation avancée, vous pouvez modifier le fichier <code>/var/packages/syncthing/var/options.conf</code>. Par exemple, vous pouvez définir un dossier <code>HOME</code> personnalisé ou des paramètres supplémentaires avec lesquels démarrer Syncthing. <br/>Pour modifier le fichier d'options, vous avez besoin d'un accès <code>SSH</code> avec un compte utilisateur privilégié. <br/>Pour appliquer vos modifications, vous devez redémarrer Syncthing dans le Centre de paquets." }
58+
]
959
}
1060
]

spk/syncthing/src/wizard/upgrade_uifile

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
[
22
{
3-
"step_title": "DSM Permissions",
3+
"step_title": "Permissions and Customization",
44
"items": [
55
{
6-
"desc": "Permissions for this package are handled by the <b>'sc-syncthing'</b> group. <br>Using File Station, add this group to every folder Syncthing should be allowed to access.<br>Please read <a <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details."
6+
"desc": "<b>Permissions</b>"
7+
},
8+
{
9+
"desc": "Permissions for this package are handled by the <b>'sc-syncthing'</b> group. <br>Using File Station, add this group to every folder Syncthing should be allowed to access. <br/>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details."
10+
},
11+
{
12+
"desc": "<b>Customization</b>"
13+
},
14+
{
15+
"desc": "For advanced customization you can edit the file <code>/var/packages/syncthing/var/options.conf</code>. For example, you can define a custom <code>HOME</code> folder or additional parameters to start Syncthing with. <br/>To modify the options file, you need <code>SSH</code> access with a privileged user. To apply your modifications, you have to restart Syncthing in the Package Center."
16+
},
17+
{
18+
"desc": "<b>This update does not modify your existing <code>options.conf</code> file. Please find additional examples in the provided file <code>options.conf.new</code> in the same folder.</b>"
719
}
820
]
921
}

0 commit comments

Comments
 (0)