Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpiva committed Oct 5, 2017
2 parents ea3b277 + 33bd52a commit 0bc9e01
Show file tree
Hide file tree
Showing 124 changed files with 5,996 additions and 4,998 deletions.
Binary file added Dependencies/x64/librhash.dll
Binary file not shown.
Binary file added Dependencies/x86/librhash.dll
Binary file not shown.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM mono:5.2

#MAINTAINER Cayde Dixon <[email protected]>

RUN curl https://bintray.com/user/downloadSubjectPublicKey?username=bintray | apt-key add -
RUN echo "deb http://dl.bintray.com/cazzar/shoko-deps jesse main" | tee -a /etc/apt/sources.list

RUN apt-get update && apt-get install -y --force-yes libmediainfo0 librhash0 sqlite.interop

RUN mkdir -p /usr/src/app/source /usr/src/app/build
COPY . /usr/src/app/source
WORKDIR /usr/src/app/source

ADD https://github.com/NuGet/Home/releases/download/3.3/NuGet.exe .
RUN mono NuGet.exe restore
RUN xbuild /property:Configuration=CLI /property:OutDir=/usr/src/app/build/
RUN rm -rf /usr/src/app/source
RUN rm /usr/src/app/build/System.Net.Http.dll
WORKDIR /usr/src/app/build

VOLUME /root/.shoko/
VOLUME /usr/src/app/build/webui

EXPOSE 8111
ENTRYPOINT mono Shoko.CLI.exe
File renamed without changes.
12 changes: 7 additions & 5 deletions Installers/ShokoServer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{0BA2D22B-A0B7-48F8-8AA1-BAAEFC2034CB}
AppName=Shoko Server
AppVersion=3.8.0.0
AppVersion=3.8.1.0
AppVerName=Shoko Server
AppPublisher=Shoko Team
AppPublisherURL=https://shokoanime.com/
Expand All @@ -35,6 +35,9 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
Source: "..\Shoko.Server\bin\Release\System.Security.Cryptography.Algorithms.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Shoko.Server\bin\Release\System.Security.Cryptography.Encoding.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Shoko.Server\bin\Release\System.Security.Cryptography.Primitives.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Shoko.Server\bin\Release\System.Security.Cryptography.X509Certificates.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Shoko.Server\bin\Release\System.ValueTuple.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Shoko.Server\bin\Release\System.ValueTuple.xml"; DestDir: "{app}"; Flags: ignoreversion
Expand Down Expand Up @@ -134,9 +137,6 @@ Source: "..\Shoko.Server\bin\Release\System.Data.SQLite.xml"; DestDir: "{app}";
Source: "..\Shoko.Server\bin\Release\System.Net.Http.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Shoko.Server\bin\Release\System.Net.Http.Formatting.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Shoko.Server\bin\Release\System.Net.Http.Formatting.xml"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Shoko.Server\bin\Release\System.Security.Cryptography.Algorithms.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Shoko.Server\bin\Release\System.Security.Cryptography.Encoding.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Shoko.Server\bin\Release\System.Security.Cryptography.Primitives.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Shoko.Server\bin\Release\de\*"; DestDir: "{app}\de"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\Shoko.Server\bin\Release\en-gb\*"; DestDir: "{app}\en-gb"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\Shoko.Server\bin\Release\es\*"; DestDir: "{app}\es"; Flags: ignoreversion recursesubdirs createallsubdirs
Expand All @@ -149,6 +149,7 @@ Source: "..\Shoko.Server\bin\Release\ru\*"; DestDir: "{app}\ru"; Flags: ignoreve
Source: "..\Shoko.Server\bin\Release\webui\*"; DestDir: "{app}\webui"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\Shoko.Server\bin\Release\x86\*"; DestDir: "{app}\x86"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\Shoko.Server\bin\Release\x64\*"; DestDir: "{app}\x64"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "FixPermissions.bat"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Expand All @@ -164,8 +165,9 @@ Filename: "{sys}\netsh.exe"; Parameters: "http add urlacl url=http://+:8111/JMMS
Filename: "{sys}\netsh.exe"; Parameters: "http add urlacl url=http://+:8111/JMMServerStreaming sddl=D:(A;;GA;;;S-1-1-0)"; Flags: runhidden;
Filename: "{sys}\netsh.exe"; Parameters: "http add urlacl url=http://+:8111/JMMServerImage sddl=D:(A;;GA;;;S-1-1-0)"; Flags: runhidden;
Filename: "{sys}\netsh.exe"; Parameters: "http add urlacl url=http://+:8111/ sddl=D:(A;;GA;;;S-1-1-0)"; Flags: runhidden;
Filename: "{app}\FixPermissions.bat";
Filename: "{app}\ShokoServer.exe"; Flags: nowait postinstall skipifsilent shellexec; Description: "{cm:LaunchProgram,Shoko Server}"
Filename: "https://shokoanime.com/shoko-version-3-8-released/"; Flags: shellexec runasoriginaluser postinstall; Description: "View 3.8 Release Notes"
Filename: "https://shokoanime.com/shoko-version-3-8-1-released/"; Flags: shellexec runasoriginaluser postinstall; Description: "View 3.8.1 Release Notes"

[UninstallRun]
Filename: "{sys}\netsh.exe"; Parameters: "advfirewall firewall delete rule name=""Shoko Server - Client Port"" protocol=TCP localport=8111"; Flags: runhidden; StatusMsg: "Closing exception on firewall..."; Tasks: Firewall
Expand Down
6 changes: 3 additions & 3 deletions SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using System.Runtime.InteropServices;
using System.Windows;

[assembly: AssemblyVersion("3.8.0.0")]
[assembly: AssemblyTitle("Shoko Server")]
[assembly: AssemblyVersion("3.8.1.*")]
[assembly: AssemblyProduct("Shoko Server")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyInformationalVersion("release")]
128 changes: 128 additions & 0 deletions Shoko.CLI/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
</configSections>

<appSettings>
<add key="FirstRun" value="true" />
<add key="DatabaseType" value="SQLite" />
<add key="SQLServer_DatabaseServer" value="localhost" />
<add key="SQLServer_DatabaseName" value="" />
<add key="SQLServer_Username" value="" />
<add key="SQLServer_Password" value="" />
<add key="MySQL_Hostname" value="localhost" />
<add key="MySQL_SchemaName" value="" />
<add key="MySQL_Username" value="" />
<add key="MySQL_Password" value="" />
<add key="SQLite_DatabaseFile" value="" />
<add key="AniDB_Username" value="" />
<add key="AniDB_Password" value="" />
<add key="AniDB_ServerAddress" value="api.anidb.info" />
<add key="AniDB_ServerPort" value="9000" />
<add key="AniDB_ClientPort" value="4556" />
<add key="AniDB_AVDumpClientPort" value="4557" />
<add key="AniDB_AVDumpKey" value="" />
<add key="WebCache_Address" value="omm.hobbydb.net.leaf.arvixe.com" />
<add key="WebCache_Anonymous" value="false" />
<add key="WebCache_FileHashes_Get" value="true" />
<add key="WebCache_FileHashes_Send" value="true" />
<add key="WebCache_XRefFileEpisode_Get" value="true" />
<add key="WebCache_XRefFileEpisode_Send" value="true" />
<add key="WebCache_TvDB_Get" value="true" />
<add key="WebCache_TvDB_Send" value="false" />
<add key="TvDB_AutoFanart" value="true" />
<add key="TvDB_AutoFanartAmount" value="10" />
<add key="TvDB_AutoWideBanners" value="true" />
<add key="TvDB_AutoPosters" value="true" />
<add key="MovieDB_AutoFanart" value="true" />
<add key="MovieDB_AutoFanartAmount" value="10" />
<add key="MovieDB_AutoPosters" value="true" />
<add key="DefaultSeriesLanguage" value="1" />
<add key="AniDB_DownloadSimilarAnime" value="false" />
<add key="AniDB_DownloadCharactersCreators" value="false" />
<add key="AniDB_DownloadReviews" value="false" />
<add key="AniDB_DownloadReleaseGroups" value="false" />
<add key="AniDB_DownloadRelatedAnime" value="true" />
<add key="AniDB_MyList_AddFiles" value="true" />
<add key="AniDB_MyList_StorageState" value="2" />
<add key="AniDB_MyList_ReadWatched" value="true" />
<add key="AniDB_MyList_ReadUnwatched" value="true" />
<add key="AniDB_MyList_SetWatched" value="true" />
<add key="AniDB_MyList_SetUnwatched" value="true" />
<add key="DefaultEpisodeLanguage" value="1" />
<add key="VideoExtensions" value="MKV,AVI,MP4,MOV,OGM,WMV,MPG,MPEG,MK3D,M4V" />
<add key="WatchForNewFiles" value="true" />
<add key="RunImportOnStart" value="false" />
<add key="Hash_CRC32" value="false" />
<add key="Hash_MD5" value="false" />
<add key="Hash_SHA1" value="false" />
<add key="LanguagePreference" value="x-jat,en" />
<add key="LanguageUseSynonyms" value="true" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="Import_UseExistingFileWatchedStatus" value="true" />
<add key="Trakt_Username" value="" />
<add key="Trakt_Password" value="" />
<add key="Culture" value="" />
</appSettings>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<extensions>
<add assembly="Shoko.Server" />
</extensions>
<targets>
<target name="file" xsi:type="File" fileName="${basedir}/logs/${shortdate}.txt" layout="[${shortdate} ${date:format=HH\:mm\:ss\:fff}] ${level}|${stacktrace} ${message}" />
<target name="console" xsi:type="ColoredConsole" layout="${date:format=HH\:mm\:ss}| --- ${message}" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="file" />
<logger name="*" minlevel="Trace" writeTo="console" />
</rules>
</nlog>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.4000" newVersion="4.1.0.4000" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Iesi.Collections" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.4000" newVersion="4.0.0.4000" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Extensions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.Tracing" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.1" newVersion="4.1.1.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
50 changes: 50 additions & 0 deletions Shoko.CLI/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using Shoko.Server;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Shoko.Server.Commands;

namespace Shoko.CLI
{
class Program
{
static void Main(string[] args)
{
for (int x = 0; x < args.Length; x++)
{
if (args[x].Equals("instance", StringComparison.InvariantCultureIgnoreCase))
{
if (x + 1 < args.Length)
{
ServerSettings.DefaultInstance = args[x + 1];
}
}
}

ServerSettings.LoadSettings();
ServerState.Instance.LoadSettings();

ShokoServer.Instance.StartUpServer();

ShokoServer.RunWorkSetupDB();

bool running = true;

ShokoServer.Instance.ServerShutdown += (sender, eventArgs) => running = false;
Utils.YesNoRequired += (sender, e) =>
{
e.Cancel = true;
};

ShokoService.CmdProcessorGeneral.OnQueueStateChangedEvent +=
ev => Console.WriteLine($"Queue state change: {ev.QueueState.formatMessage()}");

while (running)
{
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(60));
}
}
}
}
27 changes: 27 additions & 0 deletions Shoko.CLI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Reflection;
using System.Runtime.CompilerServices;
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("Shoko.CLI")]

// 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("3a8e0177-9701-4a59-a6cd-16c6908839ea")]

// 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.*")]
75 changes: 75 additions & 0 deletions Shoko.CLI/Shoko.CLI.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3A8E0177-9701-4A59-A6CD-16C6908839EA}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Shoko.CLI</RootNamespace>
<AssemblyName>Shoko.CLI</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Shoko.Server\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Shoko.Server\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shoko.Commons\Shoko.Commons.csproj">
<Project>{e0399140-9902-4f38-909d-85e42717ec30}</Project>
<Name>Shoko.Commons</Name>
</ProjectReference>
<ProjectReference Include="..\Shoko.Commons\Shoko.Models\Shoko.Models.csproj">
<Project>{f73f9df6-580a-4341-b516-8717626f9d42}</Project>
<Name>Shoko.Models</Name>
</ProjectReference>
<ProjectReference Include="..\Shoko.Server\Shoko.Server.csproj">
<Project>{da8f0783-0f82-4106-9860-6f09ba2ea522}</Project>
<Name>Shoko.Server</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
2 changes: 1 addition & 1 deletion Shoko.Commons
Submodule Shoko.Commons updated 1 files
+1 −2 Utils/Misc.cs
Loading

0 comments on commit 0bc9e01

Please sign in to comment.