mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
Merge branch 'master' into old-engine
This commit is contained in:
@@ -23,7 +23,7 @@ import (
|
||||
)
|
||||
|
||||
type args struct {
|
||||
Port string `arg:"-p" help:"web server port"`
|
||||
Port string `arg:"-p" help:"web server port, default 8090"`
|
||||
Path string `arg:"-d" help:"database dir path"`
|
||||
LogPath string `arg:"-l" help:"server log file path"`
|
||||
WebLogPath string `arg:"-w" help:"web access log file path"`
|
||||
@@ -32,7 +32,7 @@ type args struct {
|
||||
DontKill bool `arg:"-k" help:"don't kill server on signal"`
|
||||
UI bool `arg:"-u" help:"open torrserver page in browser"`
|
||||
TorrentsDir string `arg:"-t" help:"autoload torrents from dir"`
|
||||
TorrentAddr string `default:":32000" help:"Torrent client address"`
|
||||
TorrentAddr string `help:"Torrent client address, default :32000"`
|
||||
PubIPv4 string `arg:"-4" help:"set public IPv4 addr"`
|
||||
PubIPv6 string `arg:"-6" help:"set public IPv6 addr"`
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package settings
|
||||
import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"server/log"
|
||||
|
||||
@@ -15,7 +16,7 @@ type TDB struct {
|
||||
}
|
||||
|
||||
func NewTDB() *TDB {
|
||||
db, err := bolt.Open(filepath.Join(Path, "config.db"), 0666, nil)
|
||||
db, err := bolt.Open(filepath.Join(Path, "config.db"), 0666, &bolt.Options{Timeout: 5 * time.Second})
|
||||
if err != nil {
|
||||
log.TLogln(err)
|
||||
return nil
|
||||
|
||||
@@ -77,7 +77,7 @@ func (bt *BTServer) Disconnect() {
|
||||
}
|
||||
}
|
||||
|
||||
func (bt *BTServer) configure(ctx context.Context) (err error) {
|
||||
func (bt *BTServer) configure(ctx context.Context) {
|
||||
blocklist, _ := utils.ReadBlockedIP()
|
||||
bt.config = torrent.NewDefaultClientConfig()
|
||||
|
||||
@@ -124,31 +124,34 @@ func (bt *BTServer) configure(ctx context.Context) (err error) {
|
||||
bt.config.UploadRateLimiter = utils.Limit(settings.BTsets.UploadRateLimit * 1024)
|
||||
}
|
||||
if settings.TorAddr != "" {
|
||||
log.Println("Set listen addr", settings.TorAddr)
|
||||
bt.config.SetListenAddr(settings.TorAddr)
|
||||
} else {
|
||||
if settings.BTsets.PeersListenPort > 0 {
|
||||
log.Println("Set listen port", settings.BTsets.PeersListenPort)
|
||||
bt.config.ListenPort = settings.BTsets.PeersListenPort
|
||||
} else {
|
||||
upnpport := 32000
|
||||
lport := 32000
|
||||
for {
|
||||
log.Println("Check upnp port", upnpport)
|
||||
l, err := net.Listen("tcp", ":"+strconv.Itoa(upnpport))
|
||||
log.Println("Check listen port", lport)
|
||||
l, err := net.Listen("tcp", ":"+strconv.Itoa(lport))
|
||||
if l != nil {
|
||||
l.Close()
|
||||
}
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
upnpport++
|
||||
lport++
|
||||
}
|
||||
log.Println("Set upnp port", upnpport)
|
||||
bt.config.ListenPort = upnpport
|
||||
log.Println("Set listen port", lport)
|
||||
bt.config.ListenPort = lport
|
||||
}
|
||||
}
|
||||
|
||||
log.Println("Client config:", settings.BTsets)
|
||||
|
||||
var err error
|
||||
|
||||
// set public IPv4
|
||||
if settings.PubIPv4 != "" {
|
||||
if ip4 := net.ParseIP(settings.PubIPv4); ip4.To4() != nil && !isPrivateIP(ip4) {
|
||||
@@ -171,7 +174,7 @@ func (bt *BTServer) configure(ctx context.Context) (err error) {
|
||||
bt.config.PublicIp6 = ip6
|
||||
}
|
||||
}
|
||||
if bt.config.PublicIp6 == nil {
|
||||
if bt.config.PublicIp6 == nil && settings.BTsets.EnableIPv6 {
|
||||
bt.config.PublicIp6, err = publicip.Get6(ctx)
|
||||
if err != nil {
|
||||
log.Printf("error getting public ipv6 address: %v", err)
|
||||
@@ -180,7 +183,6 @@ func (bt *BTServer) configure(ctx context.Context) (err error) {
|
||||
if bt.config.PublicIp6 != nil {
|
||||
log.Println("PublicIp6:", bt.config.PublicIp6)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (bt *BTServer) GetTorrent(hash torrent.InfoHash) *Torrent {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
package version
|
||||
|
||||
const Version = "MatriX.114.OE"
|
||||
const Version = "MatriX.115.OE"
|
||||
|
||||
@@ -58,11 +58,11 @@ var Staticjs28841163dchunkjsLICENSEtxt []byte
|
||||
//go:embed pages/static/js/2.8841163d.chunk.js.map
|
||||
var Staticjs28841163dchunkjsmap []byte
|
||||
|
||||
//go:embed pages/static/js/main.50e71e43.chunk.js
|
||||
var Staticjsmain50e71e43chunkjs []byte
|
||||
//go:embed pages/static/js/main.b8051ff5.chunk.js
|
||||
var Staticjsmainb8051ff5chunkjs []byte
|
||||
|
||||
//go:embed pages/static/js/main.50e71e43.chunk.js.map
|
||||
var Staticjsmain50e71e43chunkjsmap []byte
|
||||
//go:embed pages/static/js/main.b8051ff5.chunk.js.map
|
||||
var Staticjsmainb8051ff5chunkjsmap []byte
|
||||
|
||||
//go:embed pages/static/js/runtime-main.33603a80.js
|
||||
var Staticjsruntimemain33603a80js []byte
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"files": {
|
||||
"main.js": "/static/js/main.50e71e43.chunk.js",
|
||||
"main.js.map": "/static/js/main.50e71e43.chunk.js.map",
|
||||
"main.js": "/static/js/main.b8051ff5.chunk.js",
|
||||
"main.js.map": "/static/js/main.b8051ff5.chunk.js.map",
|
||||
"runtime-main.js": "/static/js/runtime-main.33603a80.js",
|
||||
"runtime-main.js.map": "/static/js/runtime-main.33603a80.js.map",
|
||||
"static/js/2.8841163d.chunk.js": "/static/js/2.8841163d.chunk.js",
|
||||
@@ -12,6 +12,6 @@
|
||||
"entrypoints": [
|
||||
"static/js/runtime-main.33603a80.js",
|
||||
"static/js/2.8841163d.chunk.js",
|
||||
"static/js/main.50e71e43.chunk.js"
|
||||
"static/js/main.b8051ff5.chunk.js"
|
||||
]
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="manifest" href="/site.webmanifest"><meta name="msapplication-TileColor" content="#00a572"><meta name="theme-color" content="#ffffff"><link rel="preconnect" href="https://fonts.gstatic.com"><link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600&display=swap" rel="stylesheet"><meta name="viewport" content="width=device-width,shrink-to-fit=no"><meta name="description" content="TorrServer - torrent to http stream"/><title>TorrServer MatriX</title></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="https://cdn.lordicon.com/libs/frhvbuzj/lord-icon-2.0.2.js"></script><script src="https://www.gstatic.com/firebasejs/8.1.2/firebase-app.js"></script><script src="https://www.gstatic.com/firebasejs/8.1.2/firebase-analytics.js"></script><script>const firebaseConfig={apiKey:"AIzaSyDivIsadtzAmp3SIY4yArNcFugUmr63rvo",authDomain:"torrserve.firebaseapp.com",databaseURL:"https://torrserve.firebaseio.com",projectId:"torrserve",storageBucket:"torrserve.appspot.com",messagingSenderId:"400168070412",appId:"1:400168070412:web:82c8e43dd7fc8f807aed29",measurementId:"G-T4RC2BFRSF"};firebase.initializeApp(firebaseConfig),firebase.analytics()</script><script>!function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c<f.length;c++)l=f[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,f=1;f<t.length;f++){var i=t[f];0!==o[i]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var f=this.webpackJsonptorrserver_web=this.webpackJsonptorrserver_web||[],i=f.push.bind(f);f.push=r,f=f.slice();for(var a=0;a<f.length;a++)r(f[a]);var p=i;t()}([])</script><script src="/static/js/2.8841163d.chunk.js"></script><script src="/static/js/main.50e71e43.chunk.js"></script></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="manifest" href="/site.webmanifest"><meta name="msapplication-TileColor" content="#00a572"><meta name="theme-color" content="#ffffff"><link rel="preconnect" href="https://fonts.gstatic.com"><link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600&display=swap" rel="stylesheet"><meta name="viewport" content="width=device-width,shrink-to-fit=no"><meta name="description" content="TorrServer - torrent to http stream"/><title>TorrServer MatriX</title></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="https://cdn.lordicon.com/libs/frhvbuzj/lord-icon-2.0.2.js"></script><script src="https://www.gstatic.com/firebasejs/8.1.2/firebase-app.js"></script><script src="https://www.gstatic.com/firebasejs/8.1.2/firebase-analytics.js"></script><script>const firebaseConfig={apiKey:"AIzaSyDivIsadtzAmp3SIY4yArNcFugUmr63rvo",authDomain:"torrserve.firebaseapp.com",databaseURL:"https://torrserve.firebaseio.com",projectId:"torrserve",storageBucket:"torrserve.appspot.com",messagingSenderId:"400168070412",appId:"1:400168070412:web:82c8e43dd7fc8f807aed29",measurementId:"G-T4RC2BFRSF"};firebase.initializeApp(firebaseConfig),firebase.analytics()</script><script>!function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c<f.length;c++)l=f[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,f=1;f<t.length;f++){var i=t[f];0!==o[i]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var f=this.webpackJsonptorrserver_web=this.webpackJsonptorrserver_web||[],i=f.push.bind(f);f.push=r,f=f.slice();for(var a=0;a<f.length;a++)r(f[a]);var p=i;t()}([])</script><script src="/static/js/2.8841163d.chunk.js"></script><script src="/static/js/main.b8051ff5.chunk.js"></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -81,12 +81,12 @@ func RouteWebPages(route *gin.RouterGroup) {
|
||||
c.Data(200, "application/json", Staticjs28841163dchunkjsmap)
|
||||
})
|
||||
|
||||
route.GET("/static/js/main.50e71e43.chunk.js", func(c *gin.Context) {
|
||||
c.Data(200, "application/javascript; charset=utf-8", Staticjsmain50e71e43chunkjs)
|
||||
route.GET("/static/js/main.b8051ff5.chunk.js", func(c *gin.Context) {
|
||||
c.Data(200, "application/javascript; charset=utf-8", Staticjsmainb8051ff5chunkjs)
|
||||
})
|
||||
|
||||
route.GET("/static/js/main.50e71e43.chunk.js.map", func(c *gin.Context) {
|
||||
c.Data(200, "application/json", Staticjsmain50e71e43chunkjsmap)
|
||||
route.GET("/static/js/main.b8051ff5.chunk.js.map", func(c *gin.Context) {
|
||||
c.Data(200, "application/json", Staticjsmainb8051ff5chunkjsmap)
|
||||
})
|
||||
|
||||
route.GET("/static/js/runtime-main.33603a80.js", func(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user