diff --git a/config.toml b/config.toml index ddbf1736..b0ed24dc 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,6 @@ [serverConfig] - ServerPort = ":8000" #leave format as is it expects a string with colon + ServerPort = "8000" #leave format as is it expects a string with colon ServerAddr = "192.168.1.8" #Put in the IP address you want to bind to LogLevel = "Debug" # Options = Debug, Info, Warn, Error, Fatal, Panic LogOutput = "file" #Options = file, stdout #file will print it to logs/server.log diff --git a/main.go b/main.go index 947a3dd8..f8da71cc 100644 --- a/main.go +++ b/main.go @@ -214,7 +214,7 @@ func main() { } Engine.CheckTorrentWatchFolder(cronEngine, db, tclient, torrentLocalStorage, Config, torrentQueues) //Every 5 minutes the engine will check the specified folder for new .torrent files Engine.RefreshRSSCron(cronEngine, db, tclient, torrentLocalStorage, Config, torrentQueues) // Refresing the RSS feeds on an hourly basis to add torrents that show up in the RSS feed - Engine.CheckTorrentsCron(cronEngine, db, tclient, Config) + Engine.CheckTorrentsCron(cronEngine, db, tclient, Config) //Every 30 seconds all torrents are checked to see if queue changes need to be made or they need to be stopped due to ratio router := mux.NewRouter() //setting up the handler for the web backend router.HandleFunc("/", serveHome) //Serving the main page for our SPA diff --git a/settings/settings.go b/settings/settings.go index f5a030dc..02944dc1 100644 --- a/settings/settings.go +++ b/settings/settings.go @@ -18,6 +18,7 @@ import ( //Logger is the injected variable for global logger var Logger *logrus.Logger +//ClientConnectSettings contains all the settings for connecting and authenticating to the server type ClientConnectSettings struct { HTTPAddr string HTTPAddrIP string @@ -146,7 +147,8 @@ func FullClientSettingsNew() FullClientSettings { } //HTTP, proxy httpAddrIP := viper.GetString("serverConfig.ServerAddr") - httpAddrPort := viper.GetString("serverConfig.ServerPort") + httpAddrPortRaw := viper.GetString("serverConfig.ServerPort") + httpAddrPort := ":" + httpAddrPortRaw //adding the separator required for running the webui httpAddr = httpAddrIP + httpAddrPort proxySet := viper.GetBool("reverseProxy.ProxyEnabled") websocketClientPort = strings.TrimLeft(viper.GetString("serverConfig.ServerPort"), ":") //Trimming off the colon in front of the port @@ -215,7 +217,8 @@ func FullClientSettingsNew() FullClientSettings { // fmt.Println("Reading in custom DHT config") // dhtServerConfig = dhtServerSettings(dhtServerConfig) //} - httpAddrPortInt64, err := strconv.ParseInt(httpAddrPort, 10, 0) + strippedHTTPPort := strings.TrimPrefix(httpAddrPort, ":") + httpAddrPortInt64, err := strconv.ParseInt(strippedHTTPPort, 10, 0) if err != nil { fmt.Println("Failed creating 64-bit integer for goTorrent Port!", err) }