summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/net-p2p/syncthing/files/systemd/syncthing.service12
-rw-r--r--packages/net-p2p/syncthing/files/tls_params.patch28
-rw-r--r--packages/net-p2p/syncthing/syncthing-scm.exheres-042
3 files changed, 82 insertions, 0 deletions
diff --git a/packages/net-p2p/syncthing/files/systemd/syncthing.service b/packages/net-p2p/syncthing/files/systemd/syncthing.service
new file mode 100644
index 0000000..e5ff0ae
--- /dev/null
+++ b/packages/net-p2p/syncthing/files/systemd/syncthing.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Syncthing service for %i
+After=network.target
+
+[Service]
+User=%i
+Environment=STNORESTART=yes
+ExecStart=/usr/bin/syncthing
+Restart=always
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file
diff --git a/packages/net-p2p/syncthing/files/tls_params.patch b/packages/net-p2p/syncthing/files/tls_params.patch
new file mode 100644
index 0000000..92b79ed
--- /dev/null
+++ b/packages/net-p2p/syncthing/files/tls_params.patch
@@ -0,0 +1,28 @@
+diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go
+index 29fc35b9..8e080237 100644
+--- a/cmd/syncthing/gui.go
++++ b/cmd/syncthing/gui.go
+@@ -187,19 +187,14 @@ func (s *apiService) getListener(guiCfg config.GUIConfiguration) (net.Listener,
+ }
+ tlsCfg := &tls.Config{
+ Certificates: []tls.Certificate{cert},
+- MinVersion: tls.VersionTLS10, // No SSLv3
++ MinVersion: tls.VersionTLS11,
+ CipherSuites: []uint16{
+ // No RC4
++ tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
++ tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
++ tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
+ tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
+- tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
+- tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
+- tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
+- tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
+- tls.TLS_RSA_WITH_AES_128_CBC_SHA,
+- tls.TLS_RSA_WITH_AES_256_CBC_SHA,
+- tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
+- tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
+ },
+ }
+
diff --git a/packages/net-p2p/syncthing/syncthing-scm.exheres-0 b/packages/net-p2p/syncthing/syncthing-scm.exheres-0
new file mode 100644
index 0000000..3295d06
--- /dev/null
+++ b/packages/net-p2p/syncthing/syncthing-scm.exheres-0
@@ -0,0 +1,42 @@
+# Distributed under the terms of the GNU General Public License v2
+
+SCM_REPOSITORY="https://github.com/syncthing/syncthing.git"
+
+
+require scm-git systemd-service
+
+DOWNLOADS=""
+SLOT="0"
+PLATFORMS="~amd64 ~x86"
+SUMMARY="Open, trustworthy and decentralized syncing engine"
+DESCRIPTION=""
+HOMEPAGE="http://syncthing.net"
+#LICENSE="MIT"
+DEPENDENCIES="
+ dev-lang/go
+"
+
+export GOPATH="${WORK}"
+
+GO_PN="github.com/${PN}/${PN}"
+
+#SCM_CHECKOUT_TO="${WORK}/src/github.com/syncthing/syncthing"
+DEFAULT_SRC_PREPARE_PATCHES=(
+ ${FILES}/tls_params.patch
+)
+
+src_prepare() {
+ default
+ WORK=${WORK}/src/github.com/syncthing/syncthing
+ edo mkdir -p ${WORK}
+ mv * ${WORK}/
+}
+
+src_compile() {
+ edo go run build.go
+}
+
+src_install() {
+ dobin bin/syncthing
+ base_src_install_docs
+}