diff --git a/src/Jackett.Console/App.config b/src/Jackett.Console/App.config deleted file mode 100644 index 2532b3ad8..000000000 --- a/src/Jackett.Console/App.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/src/Jackett.Console/Jackett.Console.csproj b/src/Jackett.Console/Jackett.Console.csproj deleted file mode 100644 index a538372ba..000000000 --- a/src/Jackett.Console/Jackett.Console.csproj +++ /dev/null @@ -1,94 +0,0 @@ - - - - - Debug - AnyCPU - {4E2A81DA-E235-4A88-AD20-38AABBFBF33C} - Exe - Properties - Jackett.Console - JackettConsole - v4.5.2 - 512 - true - PackageReference - win - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - jackett.ico - - - Jackett.Console.Program - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - - - {74420a79-cc16-442c-8b1e-7c1b913844f0} - CurlSharp - - - {6B854A1B-9A90-49C0-BC37-9A35C75BCA73} - Jackett.Common - - - {e636d5f8-68b4-4903-b4ed-ccfd9c9e899f} - Jackett - - - - - - - - \ No newline at end of file diff --git a/src/Jackett.Console/Program.cs b/src/Jackett.Console/Program.cs deleted file mode 100644 index 2f618f393..000000000 --- a/src/Jackett.Console/Program.cs +++ /dev/null @@ -1,209 +0,0 @@ -using System; -using CommandLine; -using CommandLine.Text; -using Jackett.Common; -using Jackett.Common.Models.Config; -using Jackett.Common.Utils; -using Jackett.Utils; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading; -using System.Threading.Tasks; - -namespace Jackett.Console -{ - public class Program - { - - static void Main(string[] args) - { - - var optionsResult = Parser.Default.ParseArguments(args); - optionsResult.WithNotParsed(errors => - { - var text = HelpText.AutoBuild(optionsResult); - text.Copyright = " "; - text.Heading = "Jackett v" + EnvironmentUtil.JackettVersion + " options:"; - System.Console.WriteLine(text); - Environment.ExitCode = 1; - return; - }); - - optionsResult.WithParsed(options => - { - try - { - var runtimeSettings = options.ToRunTimeSettings(); - - // Initialize autofac, logger, etc. We cannot use any calls to Engine before the container is set up. - Engine.BuildContainer(runtimeSettings, new WebApi2Module()); - - if (runtimeSettings.LogRequests) - Engine.Logger.Info("Logging enabled."); - - if (runtimeSettings.TracingEnabled) - Engine.Logger.Info("Tracing enabled."); - - if (runtimeSettings.IgnoreSslErrors == true) - { - Engine.Logger.Info("Jackett will ignore SSL certificate errors."); - } - - if (runtimeSettings.DoSSLFix == true) - Engine.Logger.Info("SSL ECC workaround enabled."); - else if (runtimeSettings.DoSSLFix == false) - Engine.Logger.Info("SSL ECC workaround has been disabled."); - // Choose Data Folder - if (!string.IsNullOrWhiteSpace(runtimeSettings.CustomDataFolder)) - { - Engine.Logger.Info("Jackett Data will be stored in: " + runtimeSettings.CustomDataFolder); - } - - if(!string.IsNullOrEmpty(runtimeSettings.ClientOverride)) - { - if (runtimeSettings.ClientOverride != "httpclient" && runtimeSettings.ClientOverride != "httpclient2" && runtimeSettings.ClientOverride != "httpclientnetcore") - { - Engine.Logger.Error($"Client override ({runtimeSettings.ClientOverride}) has been deprecated, please remove it from your start arguments"); - Environment.Exit(1); - } - } - - // Use Proxy - if (options.ProxyConnection != null) - { - Engine.Logger.Info("Proxy enabled. " + runtimeSettings.ProxyConnection); - } - - /* ====== Actions ===== */ - - // Install service - if (options.Install) - { - Engine.ServiceConfig.Install(); - return; - } - - // Uninstall service - if (options.Uninstall) - { - Engine.Server.ReserveUrls(doInstall: false); - Engine.ServiceConfig.Uninstall(); - return; - } - - // Reserve urls - if (options.ReserveUrls) - { - Engine.Server.ReserveUrls(doInstall: true); - return; - } - - // Start Service - if (options.StartService) - { - if (!Engine.ServiceConfig.ServiceRunning()) - { - Engine.ServiceConfig.Start(); - } - return; - } - - // Stop Service - if (options.StopService) - { - if (Engine.ServiceConfig.ServiceRunning()) - { - Engine.ServiceConfig.Stop(); - } - return; - } - - // Migrate settings - if (options.MigrateSettings) - { - Engine.ConfigService.PerformMigration(); - return; - } - - - // Show Version - if (options.ShowVersion) - { - System.Console.WriteLine("Jackett v" + EnvironmentUtil.JackettVersion); - return; - } - - /* ====== Overrides ===== */ - - // Override listen public - if (options.ListenPublic || options.ListenPrivate) - { - if (Engine.ServerConfig.AllowExternal != options.ListenPublic) - { - Engine.Logger.Info("Overriding external access to " + options.ListenPublic); - Engine.ServerConfig.AllowExternal = options.ListenPublic; - if (System.Environment.OSVersion.Platform != PlatformID.Unix) - { - if (ServerUtil.IsUserAdministrator()) - { - Engine.Server.ReserveUrls(doInstall: true); - } - else - { - Engine.Logger.Error("Unable to switch to public listening without admin rights."); - Engine.Exit(1); - } - } - - Engine.SaveServerConfig(); - } - } - - // Override port - if (options.Port != 0) - { - if (Engine.ServerConfig.Port != options.Port) - { - Engine.Logger.Info("Overriding port to " + options.Port); - Engine.ServerConfig.Port = options.Port; - if (System.Environment.OSVersion.Platform != PlatformID.Unix) - { - if (ServerUtil.IsUserAdministrator()) - { - Engine.Server.ReserveUrls(doInstall: true); - } - else - { - Engine.Logger.Error("Unable to switch ports when not running as administrator"); - Engine.Exit(1); - } - } - - Engine.SaveServerConfig(); - } - } - - Engine.Server.Initalize(); - Engine.Server.Start(); - Engine.RunTime.Spin(); - Engine.Logger.Info("Server thread exit"); - } - catch (Exception e) - { - Engine.Logger.Error(e, "Top level exception"); - } - }); - } - - - - - } -} - diff --git a/src/Jackett.Console/Properties/AssemblyInfo.cs b/src/Jackett.Console/Properties/AssemblyInfo.cs deleted file mode 100644 index 8ad58d305..000000000 --- a/src/Jackett.Console/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Jackett.Console")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Jackett.Console")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4e2a81da-e235-4a88-ad20-38aabbfbf33c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.0.0.0")] diff --git a/src/Jackett.Console/install_service_macos b/src/Jackett.Console/install_service_macos deleted file mode 100755 index cf565d3e1..000000000 --- a/src/Jackett.Console/install_service_macos +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash - -#Setting up colors -BOLDRED="$(printf '\033[1;31m')" -BOLDGREEN="$(printf '\033[1;32m')" -NC="$(printf '\033[0m')" # No Color - -# Stop and unload the service if it's running -launchctl remove org.user.Jackett - -# Move working directory to Jackett's -cd "$(dirname "$0")" - -# Check if we're running from Jackett's directory -if [ ! -f ./JackettConsole.exe ]; then -echo "${BOLDRED}ERROR${NC}: Couldn't locate JackettConsole.exe. Is the script in the right directory?" - exit 1 -fi -jackettdir="$(pwd)" - -# Check if mono is installed -command -v mono >/dev/null 2>&1 || { echo >&2 "${BOLDRED}ERROR${NC}: Jackett requires Mono but it's not installed. Aborting."; exit 1; } -monodir="$(dirname $(command -v mono))" - -# Check that no other service called Jackett is already running -if [[ $(launchctl list | grep org.user.Jackett) ]]; then - echo "${BOLDRED}ERROR${NC}: Jackett already seems to be running as a service. Please stop it before running this script again." - exit 1 -fi - -# Write the plist to LaunchAgents -mkdir -p ~/Library/LaunchAgents/ -cat >~/Library/LaunchAgents/org.user.Jackett.plist < - - - - EnvironmentVariables - - PATH - /usr/bin:/bin:/usr/sbin:/sbin:${monodir} - - KeepAlive - - Label - org.user.Jackett - ProgramArguments - - ${monodir}/mono - --debug - JackettConsole.exe - --NoRestart - - RunAtLoad - - WorkingDirectory - ${jackettdir} - - - -EOL - -# Run the agent -launchctl load ~/Library/LaunchAgents/org.user.Jackett.plist - -# Check that it's running -if [[ $(launchctl list | grep org.user.Jackett) ]]; then -echo "${BOLDGREEN}Agent successfully installed and launched!${NC}" -else - cat << EOL -${BOLDRED}ERROR${NC}: Could not launch agent. The installation might have failed. -Please open an issue on https://github.com/Jackett/Jackett/issues and paste following information: -Mono directory: \`${monodir}\` -Jackett directory: \`${jackettdir}\` - -EOL -fi diff --git a/src/Jackett.Console/jackett.ico b/src/Jackett.Console/jackett.ico deleted file mode 100644 index fb7b8efe5..000000000 Binary files a/src/Jackett.Console/jackett.ico and /dev/null differ diff --git a/src/Jackett.sln b/src/Jackett.sln index a3c7a1a0e..5aaed639a 100644 --- a/src/Jackett.sln +++ b/src/Jackett.sln @@ -15,8 +15,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ..\README.md = ..\README.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Console", "Jackett.Console\Jackett.Console.csproj", "{4E2A81DA-E235-4A88-AD20-38AABBFBF33C}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Service", "Jackett.Service\Jackett.Service.csproj", "{BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Tray", "Jackett.Tray\Jackett.Tray.csproj", "{FF9025B1-EC14-4AA9-8081-9F69C5E35B63}" @@ -55,10 +53,6 @@ Global {74420A79-CC16-442C-8B1E-7C1B913844F0}.Debug|Any CPU.Build.0 = Debug|Any CPU {74420A79-CC16-442C-8B1E-7C1B913844F0}.Release|Any CPU.ActiveCfg = Release|Any CPU {74420A79-CC16-442C-8B1E-7C1B913844F0}.Release|Any CPU.Build.0 = Release|Any CPU - {4E2A81DA-E235-4A88-AD20-38AABBFBF33C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4E2A81DA-E235-4A88-AD20-38AABBFBF33C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4E2A81DA-E235-4A88-AD20-38AABBFBF33C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4E2A81DA-E235-4A88-AD20-38AABBFBF33C}.Release|Any CPU.Build.0 = Release|Any CPU {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}.Debug|Any CPU.Build.0 = Debug|Any CPU {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -94,7 +88,6 @@ Global GlobalSection(NestedProjects) = preSolution {E636D5F8-68B4-4903-B4ED-CCFD9C9E899F} = {FF8B9A1B-AE7E-4F14-9C37-DA861D034738} {74420A79-CC16-442C-8B1E-7C1B913844F0} = {7D7FA63C-3C2C-4B56-BD93-8CD28CF44E5D} - {4E2A81DA-E235-4A88-AD20-38AABBFBF33C} = {FF8B9A1B-AE7E-4F14-9C37-DA861D034738} {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA} = {FF8B9A1B-AE7E-4F14-9C37-DA861D034738} {FF9025B1-EC14-4AA9-8081-9F69C5E35B63} = {FF8B9A1B-AE7E-4F14-9C37-DA861D034738} {A61E311A-6F8B-4497-B5E4-2EA8994C7BD8} = {FF8B9A1B-AE7E-4F14-9C37-DA861D034738}