From ccc1cde547616ccf1de9b8b5300aaac0e9b2dccf Mon Sep 17 00:00:00 2001 From: YouROK <8yourok8@mail.ru> Date: Mon, 15 Mar 2021 14:31:51 +0300 Subject: [PATCH] update modles --- server/go.mod | 8 ++++---- server/go.sum | 7 ++----- server/torr/btserver.go | 6 ++++++ server/web/api/utils/link.go | 3 +++ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/server/go.mod b/server/go.mod index 7832e6f..07df3ea 100644 --- a/server/go.mod +++ b/server/go.mod @@ -1,11 +1,13 @@ module server -replace github.com/anacrolix/torrent v1.2.5 => github.com/yourok/torrent v0.0.0-20210302124413-ade31ee47747 +replace github.com/anacrolix/torrent v1.2.6 => github.com/yourok/torrent v0.0.0-20210315105830-97ae9ed6a436 + +go 1.16 require ( github.com/alexflint/go-arg v1.3.0 github.com/anacrolix/missinggo v1.1.0 - github.com/anacrolix/torrent v1.2.5 + github.com/anacrolix/torrent v1.2.6 github.com/gin-contrib/cors v1.3.1 github.com/gin-gonic/gin v1.6.3 github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 @@ -13,5 +15,3 @@ require ( go.etcd.io/bbolt v1.3.5 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 ) - -go 1.16 diff --git a/server/go.sum b/server/go.sum index 0788793..6423dd6 100644 --- a/server/go.sum +++ b/server/go.sum @@ -27,7 +27,6 @@ github.com/anacrolix/missinggo v0.2.1-0.20190310234110-9fbdc9f242a8/go.mod h1:MB github.com/anacrolix/missinggo v1.1.0 h1:0lZbaNa6zTR1bELAIzCNmRGAtkHuLDPJqTiTtXoAIx8= github.com/anacrolix/missinggo v1.1.0/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo= github.com/anacrolix/mmsg v0.0.0-20180515031531-a4a3ba1fc8bb/go.mod h1:x2/ErsYUmT77kezS63+wzZp8E3byYB0gzirM/WMBLfw= -github.com/anacrolix/mmsg v0.0.0-20180808012353-5adb2c1127c0/go.mod h1:x8kRaJY/dCrY9Al0PEcj1mb/uFHwP6GCJ9fLl4thEPc= github.com/anacrolix/sync v0.0.0-20171108081538-eee974e4f8c1/go.mod h1:+u91KiUuf0lyILI6x3n/XrW7iFROCZCG+TjgK8nW52w= github.com/anacrolix/sync v0.0.0-20180611022320-3c4cb11f5a01/go.mod h1:+u91KiUuf0lyILI6x3n/XrW7iFROCZCG+TjgK8nW52w= github.com/anacrolix/sync v0.0.0-20180808010631-44578de4e778 h1:XpCDEixzXOB8yaTW/4YBzKrJdMcFI0DzpPTYNv75wzk= @@ -114,7 +113,6 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= @@ -169,8 +167,8 @@ github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPy github.com/willf/bloom v0.0.0-20170505221640-54e3b963ee16/go.mod h1:MmAltL9pDMNTrvUkxdg0k0q5I0suxmuwp3KbyrZLOZ8= github.com/willf/bloom v2.0.3+incompatible h1:QDacWdqcAUI1MPOwIQZRy9kOR7yxfyEmxX8Wdm2/JPA= github.com/willf/bloom v2.0.3+incompatible/go.mod h1:MmAltL9pDMNTrvUkxdg0k0q5I0suxmuwp3KbyrZLOZ8= -github.com/yourok/torrent v0.0.0-20210302124413-ade31ee47747 h1:UBwB6QbdORO+ZqE5rU9Lgvo01+Q/aIGYVT1NlDi/ThI= -github.com/yourok/torrent v0.0.0-20210302124413-ade31ee47747/go.mod h1:fctmpB5/VE7vKdFmXaBYQuk9/GozmbOo7Dr7F4P/Q6s= +github.com/yourok/torrent v0.0.0-20210315105830-97ae9ed6a436 h1:ukGbOpJRN154bS1VemmOFAnjBhpA/dk+y4zuPN4YliM= +github.com/yourok/torrent v0.0.0-20210315105830-97ae9ed6a436/go.mod h1:yYeWT/V+KGvBCEjM176HOi5mJJ8s0foBAyRADO3dXlU= go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -180,7 +178,6 @@ golang.org/x/net v0.0.0-20190318221613-d196dffd7c2b h1:ZWpVMTsK0ey5WJCu+vVdfMldW golang.org/x/net v0.0.0-20190318221613-d196dffd7c2b/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sys v0.0.0-20190102155601-82a175fd1598/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190318195719-6c81ef8f67ca/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/server/torr/btserver.go b/server/torr/btserver.go index 134f9df..e24ffb1 100644 --- a/server/torr/btserver.go +++ b/server/torr/btserver.go @@ -78,10 +78,16 @@ func (bt *BTServer) configure() { bt.config.ExtendedHandshakeClientVersion = cliVers bt.config.EstablishedConnsPerTorrent = settings.BTsets.ConnectionsLimit + // Encryption/Obfuscation bt.config.EncryptionPolicy = torrent.EncryptionPolicy{ ForceEncryption: settings.BTsets.ForceEncrypt, } + // bt.config.HeaderObfuscationPolicy = torrent.HeaderObfuscationPolicy{ + // RequirePreferred: settings.BTsets.ForceEncrypt, + // Preferred: true, + // } + if settings.BTsets.DhtConnectionLimit > 0 { bt.config.ConnTracker.SetMaxEntries(settings.BTsets.DhtConnectionLimit) } diff --git a/server/web/api/utils/link.go b/server/web/api/utils/link.go index b0fa65e..bcf4486 100644 --- a/server/web/api/utils/link.go +++ b/server/web/api/utils/link.go @@ -25,6 +25,7 @@ func ParseFile(file multipart.File) (*torrent.TorrentSpec, error) { } mag := minfo.Magnet(info.Name, minfo.HashInfoBytes()) + // mag := minfo.Magnet(nil, &info) return &torrent.TorrentSpec{ InfoBytes: minfo.InfoBytes, Trackers: [][]string{mag.Trackers}, @@ -101,6 +102,7 @@ func fromHttp(url string) (*torrent.TorrentSpec, error) { return nil, err } mag := minfo.Magnet(info.Name, minfo.HashInfoBytes()) + // mag := minfo.Magnet(nil, &info) return &torrent.TorrentSpec{ InfoBytes: minfo.InfoBytes, @@ -124,6 +126,7 @@ func fromFile(path string) (*torrent.TorrentSpec, error) { } mag := minfo.Magnet(info.Name, minfo.HashInfoBytes()) + // mag := minfo.Magnet(nil, &info) return &torrent.TorrentSpec{ InfoBytes: minfo.InfoBytes, Trackers: [][]string{mag.Trackers},