Skip to content

Commit 507c5c9

Browse files
committed
syncthing: bump to 2.0.9
Major version change that switches DB backend from LevelDB to SQLite. Requires golang 1.24+. - improve syncthing argument parsing to be more robust - remove unused and add updated config options Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.0 Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.1 Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.2 Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.3 Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.4 Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.5 Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.6 Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.7 Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.8 Changelog: https://github.com/syncthing/syncthing/releases/tag/v2.0.9 Signed-off-by: George Sapkin <george@sapk.in> wip Signed-off-by: George Sapkin <george@sapk.in>
1 parent 1fd9f95 commit 507c5c9

5 files changed

Lines changed: 57 additions & 71 deletions

File tree

utils/syncthing/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
include $(TOPDIR)/rules.mk
22

33
PKG_NAME:=syncthing
4-
PKG_VERSION:=1.30.0
5-
PKG_RELEASE:=3
4+
PKG_VERSION:=2.0.9
5+
PKG_RELEASE:=1
66

77
PKG_SOURCE:=syncthing-source-v$(PKG_VERSION).tar.gz
88
PKG_SOURCE_URL:=https://github.com/syncthing/syncthing/releases/download/v$(PKG_VERSION)
9-
PKG_HASH:=ef1be71c66753c04212ab1c9c548e678d468bad98dc5461e83540a4ef5c2fcba
9+
PKG_HASH:=803ea5e50c0cdb465b03245a75715d3a9c69f929876d0956ef07c6f3a25dee69
1010

1111
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)
1212

utils/syncthing/files/stdiscosrv.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ config stdiscosrv 'stdiscosrv'
44
option listen ':8443'
55
option db_dir '/etc/stdiscosrv/discovery.db'
66

7-
# Find the documents from: https://docs.syncthing.net/users/stdiscosrv.html
7+
# More info: https://docs.syncthing.net/users/stdiscosrv.html
88
# option cert '/etc/stdiscosrv/cert.pem'
99
# option key '/etc/stdiscosrv/key.pem'
1010
# option db_flush_interval '5m'

utils/syncthing/files/strelaysrv.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ config strelaysrv 'strelaysrv'
44
option keys '/etc/strelaysrv'
55
option listen ':22067'
66

7-
# Find the documents from: https://docs.syncthing.net/users/strelaysrv.html
7+
# More info: https://docs.syncthing.net/users/strelaysrv.html
88
# option ext_address ''
99
# option global_rate ''
1010
# option message_timeout '1m0s'

utils/syncthing/files/syncthing.conf

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,30 @@ config syncthing 'syncthing'
44

55
option gui_address 'http://0.0.0.0:8384'
66

7-
# Use internal flash for evaluation purpouses. Use external storage
8-
# for production.
9-
# This filesystem must either support ownership/attributes or
10-
# be readable/writable by the user specified in
11-
# 'option user'.
7+
# Use internal flash for evaluation purposes. Use external storage for
8+
# production. This filesystem must either support ownership/attributes or
9+
# be readable/writable by the user specified in 'option user'.
1210
# Consult syslog if things go wrong.
1311
option home '/etc/syncthing'
1412

15-
# Changes to "niceness"/macprocs are not picked up by "reload_config"
16-
# nor by "restart": the service has to be stopped/started
17-
# for those to take effect
13+
# Changes to "niceness"/macprocs are not picked up by "reload_config" or by
14+
# "restart": the service has to be stopped/started for those to take effect.
1815
option nice '19'
1916

2017
# 0 to match the number of CPUs (default)
2118
# >0 to explicitly specify concurrency
2219
option macprocs '0'
2320

21+
# More info: https://docs.syncthing.net/users/syncthing.html
22+
# option db_delete_retention_interval ''
23+
# option db_maintenance_interval ''
24+
# option gui_apikey ''
25+
2426
# Running as 'root' is possible, but not recommended
25-
option user 'syncthing'
27+
# option user 'syncthing'
2628

27-
option logfile '/var/log/syncthing.log'
28-
option log_max_old_files 7
29+
option log_file '/var/log/syncthing.log'
30+
# option log_level 'INFO'
31+
option log_max_old_files '7'
2932
# Size in bytes
30-
option log_max_size 1048576
31-
32-
# # CLI options with no value should be defined as booleans and theirs
33-
# # names should be prefixed with '_'.
34-
option _no_default_folder '1'
35-
36-
# # Extra settings
37-
# list _ 'verbose'
38-
33+
option log_max_size '1048576'

utils/syncthing/files/syncthing.init

Lines changed: 37 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,89 +13,80 @@ config_cb() {
1313
option_cb() {
1414
local option="$1"
1515
local value="$2"
16+
1617
case $option in
17-
enabled|gui_address|home|logfile|macprocs|nice|user)
18-
eval $option=$value
19-
;;
20-
debug)
21-
extra_args="$extra_args --${option//_/-}-$value"
22-
;;
23-
_*)
24-
[ "$value" = "0" ] || extra_args="$extra_args -${option//_/-}"
25-
;;
26-
*)
27-
extra_args="$extra_args --${option//_/-}=$value"
18+
19+
# Support old option names
20+
logfile)
21+
option='log_file'
2822
;;
23+
2924
esac
30-
}
3125

32-
list_cb() {
33-
local name="$1"
34-
local value="$2"
35-
[ "$name" = "_" ] && extra_args="$extra_args --${value//_/-}" || return 0
26+
eval $option="$value"
3627
}
3728
}
3829

39-
service_triggers()
40-
{
41-
procd_add_reload_trigger "syncthing"
30+
service_triggers() {
31+
procd_add_reload_trigger 'syncthing'
4232
}
4333

4434
start_service() {
45-
local extra_args="--no-browser"
46-
47-
# Options with default value different with the syncthing should be defined explicitly here
35+
# Options with default value different with the syncthing should be defined
36+
# explicitly here
4837
local enabled=0
49-
local gui_address="http://0.0.0.0:8384"
50-
local home="/etc/syncthing"
51-
local logfile="/var/log/syncthing.log"
38+
local db_delete_retention_interval=''
39+
local db_maintenance_interval=''
40+
local gui_address='http://0.0.0.0:8384'
41+
local gui_apikey=''
42+
local home='/etc/syncthing'
43+
local log_file='/var/log/syncthing.log'
44+
local log_level='INFO'
45+
local log_max_old_files=7
46+
local log_max_size=1048576
5247
local macprocs=0
5348
local nice=0
54-
local user="syncthing"
49+
local user='syncthing'
5550

56-
config_load "syncthing"
51+
config_load 'syncthing'
5752

5853
local group=$(id -gn $user)
5954

60-
# Some of the default values below might not match the defaults
61-
# in /etc/config/syncthing: the reason is to remain backwards
62-
# compatible with the older versions of this service as it
63-
# evolves.
6455
[ "$enabled" -gt 0 ] || return 0
6556

66-
# For backwards compatibility
67-
IDX_DB=$(readlink -n "$home"/index-v0.14.0.db)
68-
if [ ! -z "$IDX_DB" ]; then
69-
[ -d "$IDX_DB" ] || mkdir -p "$IDX_DB"
70-
71-
# A separate step to handle an upgrade use case
72-
[ -d "$IDX_DB" ] && chown -R $user:$group "$IDX_DB"
73-
fi
74-
7557
[ -d "$home" ] || mkdir -p "$home"
7658
# A separate step to handle an upgrade use case
7759
[ -d "$home" ] && chown -R $user:$group "$home"
7860

79-
# Changes to "niceness"/macprocs are not picked up by "reload_config"
80-
# nor by "restart": the service has to be stopped/started
81-
# for it to take effect
61+
# Changes to "niceness"/macprocs are not picked up either by reload_config
62+
# or by restart: the service has to be stopped/started for it to take effect
8263
if [ $macprocs -le 0 ]; then
8364
# Default to the number of cores in this case
8465
macprocs=$(grep -c ^processor /proc/cpuinfo)
8566
fi
8667

8768
procd_open_instance
8869
procd_set_param command "$PROG"
89-
procd_set_param env GOMAXPROCS="$macprocs" STNOUPGRADE=1
70+
procd_set_param env GOMAXPROCS="$macprocs"
9071
procd_append_param command serve
72+
[ -z "$db_delete_retention_interval" ] || procd_append_param command --db-delete-retention-interval="$db_delete_retention_interval"
73+
[ -z "$db_maintenance_interval" ] || procd_append_param command --db-maintenance-interval="$db_maintenance_interval"
9174
procd_append_param command --gui-address="$gui_address"
75+
[ -z "$gui_apikey" ] || procd_append_param command --gui_apikey="$gui_apikey"
9276
procd_append_param command --home="$home"
93-
procd_append_param command --logfile="$logfile"
94-
[ -z "$extra_args" ] || procd_append_param command $extra_args
77+
procd_append_param command --log-file="$log_file"
78+
[ -z "$log_level" ] || procd_append_param command --log-level="$log_level"
79+
[ -z "$log_max_old_files" ] || procd_append_param command --log-max-old-files="$log_max_old_files"
80+
[ -z "$log_max_size" ] || procd_append_param command --log-max-size="$log_max_size"
81+
procd_append_param command --no-browser
82+
procd_append_param command --no-port-probing
83+
procd_append_param command --no-restart
84+
# The package is built with noupgrade tag so --no-upgrade is not necessary
9585

9686
procd_set_param nice "$nice"
9787
procd_set_param term_timeout 15
9888
procd_set_param user "$user"
89+
procd_set_param group "$group"
9990
procd_set_param respawn
10091
procd_set_param stdout 0
10192
procd_set_param stderr 1

0 commit comments

Comments
 (0)