commit
ce1fa42f9d
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.2 KiB |
@ -1,355 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Emby.Server.Implementations.IO
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for streaming data with throttling support.
|
||||
/// </summary>
|
||||
public class ThrottledStream : Stream
|
||||
{
|
||||
/// <summary>
|
||||
/// A constant used to specify an infinite number of bytes that can be transferred per second.
|
||||
/// </summary>
|
||||
public const long Infinite = 0;
|
||||
|
||||
#region Private members
|
||||
/// <summary>
|
||||
/// The base stream.
|
||||
/// </summary>
|
||||
private readonly Stream _baseStream;
|
||||
|
||||
/// <summary>
|
||||
/// The maximum bytes per second that can be transferred through the base stream.
|
||||
/// </summary>
|
||||
private long _maximumBytesPerSecond;
|
||||
|
||||
/// <summary>
|
||||
/// The number of bytes that has been transferred since the last throttle.
|
||||
/// </summary>
|
||||
private long _byteCount;
|
||||
|
||||
/// <summary>
|
||||
/// The start time in milliseconds of the last throttle.
|
||||
/// </summary>
|
||||
private long _start;
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets the current milliseconds.
|
||||
/// </summary>
|
||||
/// <value>The current milliseconds.</value>
|
||||
protected long CurrentMilliseconds => Environment.TickCount;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum bytes per second that can be transferred through the base stream.
|
||||
/// </summary>
|
||||
/// <value>The maximum bytes per second.</value>
|
||||
public long MaximumBytesPerSecond
|
||||
{
|
||||
get => _maximumBytesPerSecond;
|
||||
set
|
||||
{
|
||||
if (MaximumBytesPerSecond != value)
|
||||
{
|
||||
_maximumBytesPerSecond = value;
|
||||
Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the current stream supports reading.
|
||||
/// </summary>
|
||||
/// <returns>true if the stream supports reading; otherwise, false.</returns>
|
||||
public override bool CanRead => _baseStream.CanRead;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the current stream supports seeking.
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
/// <returns>true if the stream supports seeking; otherwise, false.</returns>
|
||||
public override bool CanSeek => _baseStream.CanSeek;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the current stream supports writing.
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
/// <returns>true if the stream supports writing; otherwise, false.</returns>
|
||||
public override bool CanWrite => _baseStream.CanWrite;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the length in bytes of the stream.
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
/// <returns>A long value representing the length of the stream in bytes.</returns>
|
||||
/// <exception cref="T:System.NotSupportedException">The base stream does not support seeking. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
|
||||
public override long Length => _baseStream.Length;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position within the current stream.
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
/// <returns>The current position within the stream.</returns>
|
||||
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The base stream does not support seeking. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
|
||||
public override long Position
|
||||
{
|
||||
get => _baseStream.Position;
|
||||
set => _baseStream.Position = value;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public long MinThrottlePosition;
|
||||
|
||||
#region Ctor
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:ThrottledStream"/> class.
|
||||
/// </summary>
|
||||
/// <param name="baseStream">The base stream.</param>
|
||||
/// <param name="maximumBytesPerSecond">The maximum bytes per second that can be transferred through the base stream.</param>
|
||||
/// <exception cref="ArgumentNullException">Thrown when <see cref="baseStream"/> is a null reference.</exception>
|
||||
/// <exception cref="ArgumentOutOfRangeException">Thrown when <see cref="maximumBytesPerSecond"/> is a negative value.</exception>
|
||||
public ThrottledStream(Stream baseStream, long maximumBytesPerSecond)
|
||||
{
|
||||
if (baseStream == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(baseStream));
|
||||
}
|
||||
|
||||
if (maximumBytesPerSecond < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(maximumBytesPerSecond),
|
||||
maximumBytesPerSecond, "The maximum number of bytes per second can't be negative.");
|
||||
}
|
||||
|
||||
_baseStream = baseStream;
|
||||
_maximumBytesPerSecond = maximumBytesPerSecond;
|
||||
_start = CurrentMilliseconds;
|
||||
_byteCount = 0;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Public methods
|
||||
/// <summary>
|
||||
/// Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
|
||||
/// </summary>
|
||||
/// <exception cref="T:System.IO.IOException">An I/O error occurs.</exception>
|
||||
public override void Flush()
|
||||
{
|
||||
_baseStream.Flush();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
|
||||
/// </summary>
|
||||
/// <param name="buffer">An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.</param>
|
||||
/// <param name="offset">The zero-based byte offset in buffer at which to begin storing the data read from the current stream.</param>
|
||||
/// <param name="count">The maximum number of bytes to be read from the current stream.</param>
|
||||
/// <returns>
|
||||
/// The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.
|
||||
/// </returns>
|
||||
/// <exception cref="T:System.ArgumentException">The sum of offset and count is larger than the buffer length. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The base stream does not support reading. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">buffer is null. </exception>
|
||||
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">offset or count is negative. </exception>
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
Throttle(count);
|
||||
|
||||
return _baseStream.Read(buffer, offset, count);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the position within the current stream.
|
||||
/// </summary>
|
||||
/// <param name="offset">A byte offset relative to the origin parameter.</param>
|
||||
/// <param name="origin">A value of type <see cref="T:System.IO.SeekOrigin"></see> indicating the reference point used to obtain the new position.</param>
|
||||
/// <returns>
|
||||
/// The new position within the current stream.
|
||||
/// </returns>
|
||||
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The base stream does not support seeking, such as if the stream is constructed from a pipe or console output. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
|
||||
public override long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
return _baseStream.Seek(offset, origin);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the length of the current stream.
|
||||
/// </summary>
|
||||
/// <param name="value">The desired length of the current stream in bytes.</param>
|
||||
/// <exception cref="T:System.NotSupportedException">The base stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. </exception>
|
||||
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
|
||||
public override void SetLength(long value)
|
||||
{
|
||||
_baseStream.SetLength(value);
|
||||
}
|
||||
|
||||
private long _bytesWritten;
|
||||
|
||||
/// <summary>
|
||||
/// Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
|
||||
/// </summary>
|
||||
/// <param name="buffer">An array of bytes. This method copies count bytes from buffer to the current stream.</param>
|
||||
/// <param name="offset">The zero-based byte offset in buffer at which to begin copying bytes to the current stream.</param>
|
||||
/// <param name="count">The number of bytes to be written to the current stream.</param>
|
||||
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The base stream does not support writing. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">buffer is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">The sum of offset and count is greater than the buffer length. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">offset or count is negative. </exception>
|
||||
public override void Write(byte[] buffer, int offset, int count)
|
||||
{
|
||||
Throttle(count);
|
||||
|
||||
_baseStream.Write(buffer, offset, count);
|
||||
|
||||
_bytesWritten += count;
|
||||
}
|
||||
|
||||
public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||
{
|
||||
await ThrottleAsync(count, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
await _baseStream.WriteAsync(buffer, offset, count, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
_bytesWritten += count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
|
||||
/// </returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return _baseStream.ToString();
|
||||
}
|
||||
#endregion
|
||||
|
||||
private bool ThrottleCheck(int bufferSizeInBytes)
|
||||
{
|
||||
if (_bytesWritten < MinThrottlePosition)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure the buffer isn't empty.
|
||||
if (_maximumBytesPerSecond <= 0 || bufferSizeInBytes <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#region Protected methods
|
||||
/// <summary>
|
||||
/// Throttles for the specified buffer size in bytes.
|
||||
/// </summary>
|
||||
/// <param name="bufferSizeInBytes">The buffer size in bytes.</param>
|
||||
protected void Throttle(int bufferSizeInBytes)
|
||||
{
|
||||
if (!ThrottleCheck(bufferSizeInBytes))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_byteCount += bufferSizeInBytes;
|
||||
long elapsedMilliseconds = CurrentMilliseconds - _start;
|
||||
|
||||
if (elapsedMilliseconds > 0)
|
||||
{
|
||||
// Calculate the current bps.
|
||||
long bps = _byteCount * 1000L / elapsedMilliseconds;
|
||||
|
||||
// If the bps are more then the maximum bps, try to throttle.
|
||||
if (bps > _maximumBytesPerSecond)
|
||||
{
|
||||
// Calculate the time to sleep.
|
||||
long wakeElapsed = _byteCount * 1000L / _maximumBytesPerSecond;
|
||||
int toSleep = (int)(wakeElapsed - elapsedMilliseconds);
|
||||
|
||||
if (toSleep > 1)
|
||||
{
|
||||
try
|
||||
{
|
||||
// The time to sleep is more then a millisecond, so sleep.
|
||||
var task = Task.Delay(toSleep);
|
||||
Task.WaitAll(task);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Eatup ThreadAbortException.
|
||||
}
|
||||
|
||||
// A sleep has been done, reset.
|
||||
Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task ThrottleAsync(int bufferSizeInBytes, CancellationToken cancellationToken)
|
||||
{
|
||||
if (!ThrottleCheck(bufferSizeInBytes))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_byteCount += bufferSizeInBytes;
|
||||
long elapsedMilliseconds = CurrentMilliseconds - _start;
|
||||
|
||||
if (elapsedMilliseconds > 0)
|
||||
{
|
||||
// Calculate the current bps.
|
||||
long bps = _byteCount * 1000L / elapsedMilliseconds;
|
||||
|
||||
// If the bps are more then the maximum bps, try to throttle.
|
||||
if (bps > _maximumBytesPerSecond)
|
||||
{
|
||||
// Calculate the time to sleep.
|
||||
long wakeElapsed = _byteCount * 1000L / _maximumBytesPerSecond;
|
||||
int toSleep = (int)(wakeElapsed - elapsedMilliseconds);
|
||||
|
||||
if (toSleep > 1)
|
||||
{
|
||||
// The time to sleep is more then a millisecond, so sleep.
|
||||
await Task.Delay(toSleep, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
// A sleep has been done, reset.
|
||||
Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Will reset the bytecount to 0 and reset the start time to the current time.
|
||||
/// </summary>
|
||||
protected void Reset()
|
||||
{
|
||||
long difference = CurrentMilliseconds - _start;
|
||||
|
||||
// Only reset counters when a known history is available of more then 1 second.
|
||||
if (difference > 1000)
|
||||
{
|
||||
_byteCount = 0;
|
||||
_start = CurrentMilliseconds;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Controller.Authentication;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Cryptography;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using MediaBrowser.Model.Users;
|
||||
|
||||
namespace Emby.Server.Implementations.Library
|
||||
{
|
||||
public class DefaultPasswordResetProvider : IPasswordResetProvider
|
||||
{
|
||||
public string Name => "Default Password Reset Provider";
|
||||
|
||||
public bool IsEnabled => true;
|
||||
|
||||
private readonly string _passwordResetFileBase;
|
||||
private readonly string _passwordResetFileBaseDir;
|
||||
private readonly string _passwordResetFileBaseName = "passwordreset";
|
||||
|
||||
private readonly IJsonSerializer _jsonSerializer;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ICryptoProvider _crypto;
|
||||
|
||||
public DefaultPasswordResetProvider(IServerConfigurationManager configurationManager, IJsonSerializer jsonSerializer, IUserManager userManager, ICryptoProvider cryptoProvider)
|
||||
{
|
||||
_passwordResetFileBaseDir = configurationManager.ApplicationPaths.ProgramDataPath;
|
||||
_passwordResetFileBase = Path.Combine(_passwordResetFileBaseDir, _passwordResetFileBaseName);
|
||||
_jsonSerializer = jsonSerializer;
|
||||
_userManager = userManager;
|
||||
_crypto = cryptoProvider;
|
||||
}
|
||||
|
||||
public async Task<PinRedeemResult> RedeemPasswordResetPin(string pin)
|
||||
{
|
||||
SerializablePasswordReset spr;
|
||||
HashSet<string> usersreset = new HashSet<string>();
|
||||
foreach (var resetfile in Directory.EnumerateFiles(_passwordResetFileBaseDir, $"{_passwordResetFileBaseName}*"))
|
||||
{
|
||||
using (var str = File.OpenRead(resetfile))
|
||||
{
|
||||
spr = await _jsonSerializer.DeserializeFromStreamAsync<SerializablePasswordReset>(str).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (spr.ExpirationDate < DateTime.Now)
|
||||
{
|
||||
File.Delete(resetfile);
|
||||
}
|
||||
else if (spr.Pin.Replace("-", "").Equals(pin.Replace("-", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
var resetUser = _userManager.GetUserByName(spr.UserName);
|
||||
if (resetUser == null)
|
||||
{
|
||||
throw new Exception($"User with a username of {spr.UserName} not found");
|
||||
}
|
||||
|
||||
await _userManager.ChangePassword(resetUser, pin).ConfigureAwait(false);
|
||||
usersreset.Add(resetUser.Name);
|
||||
File.Delete(resetfile);
|
||||
}
|
||||
}
|
||||
|
||||
if (usersreset.Count < 1)
|
||||
{
|
||||
throw new ResourceNotFoundException($"No Users found with a password reset request matching pin {pin}");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new PinRedeemResult
|
||||
{
|
||||
Success = true,
|
||||
UsersReset = usersreset.ToArray()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ForgotPasswordResult> StartForgotPasswordProcess(MediaBrowser.Controller.Entities.User user, bool isInNetwork)
|
||||
{
|
||||
string pin = string.Empty;
|
||||
using (var cryptoRandom = System.Security.Cryptography.RandomNumberGenerator.Create())
|
||||
{
|
||||
byte[] bytes = new byte[4];
|
||||
cryptoRandom.GetBytes(bytes);
|
||||
pin = BitConverter.ToString(bytes);
|
||||
}
|
||||
|
||||
DateTime expireTime = DateTime.Now.AddMinutes(30);
|
||||
string filePath = _passwordResetFileBase + user.InternalId + ".json";
|
||||
SerializablePasswordReset spr = new SerializablePasswordReset
|
||||
{
|
||||
ExpirationDate = expireTime,
|
||||
Pin = pin,
|
||||
PinFile = filePath,
|
||||
UserName = user.Name
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
using (FileStream fileStream = File.OpenWrite(filePath))
|
||||
{
|
||||
_jsonSerializer.SerializeToStream(spr, fileStream);
|
||||
await fileStream.FlushAsync().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new Exception($"Error serializing or writing password reset for {user.Name} to location: {filePath}", e);
|
||||
}
|
||||
|
||||
return new ForgotPasswordResult
|
||||
{
|
||||
Action = ForgotPasswordAction.PinCode,
|
||||
PinExpirationDate = expireTime,
|
||||
PinFile = filePath
|
||||
};
|
||||
}
|
||||
|
||||
private class SerializablePasswordReset : PasswordPinCreationResult
|
||||
{
|
||||
public string Pin { get; set; }
|
||||
|
||||
public string UserName { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -1,97 +1,97 @@
|
||||
{
|
||||
"Albums": "Albums",
|
||||
"AppDeviceValues": "App: {0}, Device: {1}",
|
||||
"Application": "Application",
|
||||
"Artists": "Artists",
|
||||
"AuthenticationSucceededWithUserName": "{0} successfully authenticated",
|
||||
"Albums": "Albom",
|
||||
"AppDeviceValues": "App: {0}, Grät: {1}",
|
||||
"Application": "Aawändig",
|
||||
"Artists": "Könstler",
|
||||
"AuthenticationSucceededWithUserName": "{0} het sech aagmäudet",
|
||||
"Books": "Büecher",
|
||||
"CameraImageUploadedFrom": "A new camera image has been uploaded from {0}",
|
||||
"Channels": "Channels",
|
||||
"ChapterNameValue": "Chapter {0}",
|
||||
"Collections": "Collections",
|
||||
"DeviceOfflineWithName": "{0} has disconnected",
|
||||
"DeviceOnlineWithName": "{0} is connected",
|
||||
"FailedLoginAttemptWithUserName": "Failed login attempt from {0}",
|
||||
"Favorites": "Favorites",
|
||||
"Folders": "Folders",
|
||||
"CameraImageUploadedFrom": "Es nöis Foti esch ufeglade worde vo {0}",
|
||||
"Channels": "Kanäu",
|
||||
"ChapterNameValue": "Kapitu {0}",
|
||||
"Collections": "Sammlige",
|
||||
"DeviceOfflineWithName": "{0} esch offline gange",
|
||||
"DeviceOnlineWithName": "{0} esch online cho",
|
||||
"FailedLoginAttemptWithUserName": "Fäugschlagne Aamäudeversuech vo {0}",
|
||||
"Favorites": "Favorite",
|
||||
"Folders": "Ordner",
|
||||
"Genres": "Genres",
|
||||
"HeaderAlbumArtists": "Albuminterprete",
|
||||
"HeaderCameraUploads": "Camera Uploads",
|
||||
"HeaderAlbumArtists": "Albom-Könstler",
|
||||
"HeaderCameraUploads": "Kamera-Uploads",
|
||||
"HeaderContinueWatching": "Wiiterluege",
|
||||
"HeaderFavoriteAlbums": "Favorite Albums",
|
||||
"HeaderFavoriteArtists": "Besti Interpret",
|
||||
"HeaderFavoriteEpisodes": "Favorite Episodes",
|
||||
"HeaderFavoriteShows": "Favorite Shows",
|
||||
"HeaderFavoriteSongs": "Besti Lieder",
|
||||
"HeaderLiveTV": "Live TV",
|
||||
"HeaderNextUp": "Next Up",
|
||||
"HeaderFavoriteAlbums": "Lieblingsalbe",
|
||||
"HeaderFavoriteArtists": "Lieblings-Interprete",
|
||||
"HeaderFavoriteEpisodes": "Lieblingsepisode",
|
||||
"HeaderFavoriteShows": "Lieblingsserie",
|
||||
"HeaderFavoriteSongs": "Lieblingslieder",
|
||||
"HeaderLiveTV": "Live-Färnseh",
|
||||
"HeaderNextUp": "Als nächts",
|
||||
"HeaderRecordingGroups": "Ufnahmegruppe",
|
||||
"HomeVideos": "Heimfilmli",
|
||||
"Inherit": "Hinzuefüege",
|
||||
"ItemAddedWithName": "{0} was added to the library",
|
||||
"ItemRemovedWithName": "{0} was removed from the library",
|
||||
"LabelIpAddressValue": "Ip address: {0}",
|
||||
"LabelRunningTimeValue": "Running time: {0}",
|
||||
"Latest": "Letschte",
|
||||
"MessageApplicationUpdated": "Jellyfin Server has been updated",
|
||||
"MessageApplicationUpdatedTo": "Jellyfin Server has been updated to {0}",
|
||||
"MessageNamedServerConfigurationUpdatedWithValue": "Server configuration section {0} has been updated",
|
||||
"MessageServerConfigurationUpdated": "Server configuration has been updated",
|
||||
"MixedContent": "Gmischte Inhalt",
|
||||
"Movies": "Movies",
|
||||
"ItemAddedWithName": "{0} esch de Bibliothek dezuegfüegt worde",
|
||||
"ItemRemovedWithName": "{0} esch vo de Bibliothek entfärnt worde",
|
||||
"LabelIpAddressValue": "IP-Adrässe: {0}",
|
||||
"LabelRunningTimeValue": "Loufziit: {0}",
|
||||
"Latest": "Nöischti",
|
||||
"MessageApplicationUpdated": "Jellyfin Server esch aktualisiert worde",
|
||||
"MessageApplicationUpdatedTo": "Jellyfin Server esch of Version {0} aktualisiert worde",
|
||||
"MessageNamedServerConfigurationUpdatedWithValue": "De Serveriistöuigsberiich {0} esch aktualisiert worde",
|
||||
"MessageServerConfigurationUpdated": "Serveriistöuige send aktualisiert worde",
|
||||
"MixedContent": "Gmeschti Inhäut",
|
||||
"Movies": "Film",
|
||||
"Music": "Musig",
|
||||
"MusicVideos": "Musigfilm",
|
||||
"NameInstallFailed": "{0} installation failed",
|
||||
"NameSeasonNumber": "Season {0}",
|
||||
"NameSeasonUnknown": "Season Unknown",
|
||||
"NewVersionIsAvailable": "A new version of Jellyfin Server is available for download.",
|
||||
"NotificationOptionApplicationUpdateAvailable": "Application update available",
|
||||
"NotificationOptionApplicationUpdateInstalled": "Application update installed",
|
||||
"NotificationOptionAudioPlayback": "Audio playback started",
|
||||
"NotificationOptionAudioPlaybackStopped": "Audio playback stopped",
|
||||
"NotificationOptionCameraImageUploaded": "Camera image uploaded",
|
||||
"NotificationOptionInstallationFailed": "Installation failure",
|
||||
"NotificationOptionNewLibraryContent": "New content added",
|
||||
"NotificationOptionPluginError": "Plugin failure",
|
||||
"NotificationOptionPluginInstalled": "Plugin installed",
|
||||
"NotificationOptionPluginUninstalled": "Plugin uninstalled",
|
||||
"NotificationOptionPluginUpdateInstalled": "Plugin update installed",
|
||||
"NotificationOptionServerRestartRequired": "Server restart required",
|
||||
"NotificationOptionTaskFailed": "Scheduled task failure",
|
||||
"NotificationOptionUserLockedOut": "User locked out",
|
||||
"NotificationOptionVideoPlayback": "Video playback started",
|
||||
"NotificationOptionVideoPlaybackStopped": "Video playback stopped",
|
||||
"MusicVideos": "Musigvideos",
|
||||
"NameInstallFailed": "Installation vo {0} fäugschlage",
|
||||
"NameSeasonNumber": "Staffle {0}",
|
||||
"NameSeasonUnknown": "Staffle unbekannt",
|
||||
"NewVersionIsAvailable": "E nöi Version vo Jellyfin Server esch zom Download parat.",
|
||||
"NotificationOptionApplicationUpdateAvailable": "Aawändigsupdate verfüegbar",
|
||||
"NotificationOptionApplicationUpdateInstalled": "Aawändigsupdate installiert",
|
||||
"NotificationOptionAudioPlayback": "Audiowedergab gstartet",
|
||||
"NotificationOptionAudioPlaybackStopped": "Audiwedergab gstoppt",
|
||||
"NotificationOptionCameraImageUploaded": "Foti ueglade",
|
||||
"NotificationOptionInstallationFailed": "Installationsfäuer",
|
||||
"NotificationOptionNewLibraryContent": "Nöie Inhaut hinzuegfüegt",
|
||||
"NotificationOptionPluginError": "Plugin-Fäuer",
|
||||
"NotificationOptionPluginInstalled": "Plugin installiert",
|
||||
"NotificationOptionPluginUninstalled": "Plugin deinstalliert",
|
||||
"NotificationOptionPluginUpdateInstalled": "Pluginupdate installiert",
|
||||
"NotificationOptionServerRestartRequired": "Serverneustart notwändig",
|
||||
"NotificationOptionTaskFailed": "Planti Uufgab fäugschlage",
|
||||
"NotificationOptionUserLockedOut": "Benotzer usgschlosse",
|
||||
"NotificationOptionVideoPlayback": "Videowedergab gstartet",
|
||||
"NotificationOptionVideoPlaybackStopped": "Videowedergab gstoppt",
|
||||
"Photos": "Fotis",
|
||||
"Playlists": "Abspielliste",
|
||||
"Playlists": "Wedergabeliste",
|
||||
"Plugin": "Plugin",
|
||||
"PluginInstalledWithName": "{0} was installed",
|
||||
"PluginUninstalledWithName": "{0} was uninstalled",
|
||||
"PluginUpdatedWithName": "{0} was updated",
|
||||
"ProviderValue": "Provider: {0}",
|
||||
"ScheduledTaskFailedWithName": "{0} failed",
|
||||
"ScheduledTaskStartedWithName": "{0} started",
|
||||
"ServerNameNeedsToBeRestarted": "{0} needs to be restarted",
|
||||
"Shows": "Shows",
|
||||
"Songs": "Songs",
|
||||
"StartupEmbyServerIsLoading": "Jellyfin Server is loading. Please try again shortly.",
|
||||
"PluginInstalledWithName": "{0} esch installiert worde",
|
||||
"PluginUninstalledWithName": "{0} esch deinstalliert worde",
|
||||
"PluginUpdatedWithName": "{0} esch updated worde",
|
||||
"ProviderValue": "Aabieter: {0}",
|
||||
"ScheduledTaskFailedWithName": "{0} esch fäugschlage",
|
||||
"ScheduledTaskStartedWithName": "{0} het gstartet",
|
||||
"ServerNameNeedsToBeRestarted": "{0} mues nöi gstartet wärde",
|
||||
"Shows": "Serie",
|
||||
"Songs": "Lieder",
|
||||
"StartupEmbyServerIsLoading": "Jellyfin Server ladt. Bitte grad noeinisch probiere.",
|
||||
"SubtitleDownloadFailureForItem": "Subtitles failed to download for {0}",
|
||||
"SubtitleDownloadFailureFromForItem": "Subtitles failed to download from {0} for {1}",
|
||||
"SubtitlesDownloadedForItem": "Subtitles downloaded for {0}",
|
||||
"Sync": "Sync",
|
||||
"SubtitleDownloadFailureFromForItem": "Ondertetle vo {0} för {1} hend ned chönne abeglade wärde",
|
||||
"SubtitlesDownloadedForItem": "Ondertetle abeglade för {0}",
|
||||
"Sync": "Synchronisation",
|
||||
"System": "System",
|
||||
"TvShows": "TV Shows",
|
||||
"User": "User",
|
||||
"UserCreatedWithName": "User {0} has been created",
|
||||
"UserDeletedWithName": "User {0} has been deleted",
|
||||
"UserDownloadingItemWithValues": "{0} is downloading {1}",
|
||||
"UserLockedOutWithName": "User {0} has been locked out",
|
||||
"UserOfflineFromDevice": "{0} has disconnected from {1}",
|
||||
"UserOnlineFromDevice": "{0} is online from {1}",
|
||||
"UserPasswordChangedWithName": "Password has been changed for user {0}",
|
||||
"UserPolicyUpdatedWithName": "User policy has been updated for {0}",
|
||||
"UserStartedPlayingItemWithValues": "{0} is playing {1} on {2}",
|
||||
"UserStoppedPlayingItemWithValues": "{0} has finished playing {1} on {2}",
|
||||
"ValueHasBeenAddedToLibrary": "{0} has been added to your media library",
|
||||
"ValueSpecialEpisodeName": "Spezial - {0}",
|
||||
"TvShows": "Färnsehserie",
|
||||
"User": "Benotzer",
|
||||
"UserCreatedWithName": "Benotzer {0} esch erstöut worde",
|
||||
"UserDeletedWithName": "Benotzer {0} esch glösche worde",
|
||||
"UserDownloadingItemWithValues": "{0} ladt {1} abe",
|
||||
"UserLockedOutWithName": "Benotzer {0} esch usgschlosse worde",
|
||||
"UserOfflineFromDevice": "{0} esch vo {1} trennt worde",
|
||||
"UserOnlineFromDevice": "{0} esch online vo {1}",
|
||||
"UserPasswordChangedWithName": "S'Passwort för Benotzer {0} esch gänderet worde",
|
||||
"UserPolicyUpdatedWithName": "Benotzerrechtlinie för {0} esch aktualisiert worde",
|
||||
"UserStartedPlayingItemWithValues": "{0} hed d'Wedergab vo {1} of {2} gstartet",
|
||||
"UserStoppedPlayingItemWithValues": "{0} het d'Wedergab vo {1} of {2} gstoppt",
|
||||
"ValueHasBeenAddedToLibrary": "{0} esch dinnere Biblithek hinzuegfüegt worde",
|
||||
"ValueSpecialEpisodeName": "Extra - {0}",
|
||||
"VersionNumber": "Version {0}"
|
||||
}
|
||||
|
@ -0,0 +1 @@
|
||||
{}
|
@ -0,0 +1,11 @@
|
||||
namespace MediaBrowser.Common.Net
|
||||
{
|
||||
public static class CustomHeaderNames
|
||||
{
|
||||
// Other Headers
|
||||
public const string XForwardedFor = "X-Forwarded-For";
|
||||
public const string XForwardedPort = "X-Forwarded-Port";
|
||||
public const string XForwardedProto = "X-Forwarded-Proto";
|
||||
public const string XRealIP = "X-Real-IP";
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Users;
|
||||
|
||||
namespace MediaBrowser.Controller.Authentication
|
||||
{
|
||||
public interface IPasswordResetProvider
|
||||
{
|
||||
string Name { get; }
|
||||
bool IsEnabled { get; }
|
||||
Task<ForgotPasswordResult> StartForgotPasswordProcess(User user, bool isInNetwork);
|
||||
Task<PinRedeemResult> RedeemPasswordResetPin(string pin);
|
||||
}
|
||||
public class PasswordPinCreationResult
|
||||
{
|
||||
public string PinFile { get; set; }
|
||||
public DateTime ExpirationDate { get; set; }
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
Subproject commit ec5a3b6e5efb6041153b92818aee562f20ee994d
|
||||
Subproject commit b0f7a9b67cc72de98dc357425e9d5c3894c7f377
|
@ -1,4 +1,4 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("10.2.2")]
|
||||
[assembly: AssemblyFileVersion("10.2.2")]
|
||||
[assembly: AssemblyVersion("10.3.3")]
|
||||
[assembly: AssemblyFileVersion("10.3.3")]
|
||||
|
@ -0,0 +1,43 @@
|
||||
FROM debian:9
|
||||
# Docker build arguments
|
||||
ARG SOURCE_DIR=/jellyfin
|
||||
ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-arm64
|
||||
ARG ARTIFACT_DIR=/dist
|
||||
ARG SDK_VERSION=2.2
|
||||
# Docker run environment
|
||||
ENV SOURCE_DIR=/jellyfin
|
||||
ENV ARTIFACT_DIR=/dist
|
||||
ENV DEB_BUILD_OPTIONS=noddebs
|
||||
ENV ARCH=amd64
|
||||
|
||||
# Prepare Debian build environment
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv
|
||||
|
||||
# Install dotnet repository
|
||||
# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current
|
||||
RUN wget https://download.visualstudio.microsoft.com/download/pr/69937b49-a877-4ced-81e6-286620b390ab/8ab938cf6f5e83b2221630354160ef21/dotnet-sdk-2.2.104-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
|
||||
&& mkdir -p dotnet-sdk \
|
||||
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
|
||||
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
|
||||
|
||||
# Prepare the cross-toolchain
|
||||
RUN dpkg --add-architecture arm64 \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y cross-gcc-dev \
|
||||
&& TARGET_LIST="arm64" cross-gcc-gensource 6 \
|
||||
&& cd cross-gcc-packages-amd64/cross-gcc-6-arm64 \
|
||||
&& apt-get install -y gcc-6-source libstdc++6-arm64-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libcloog-isl-dev libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:arm64 linux-libc-dev:arm64 libgcc1:arm64 libcurl4-openssl-dev:arm64 libfontconfig1-dev:arm64 libfreetype6-dev:arm64 liblttng-ust0:arm64 libstdc++6:arm64
|
||||
|
||||
# Link to docker-build script
|
||||
RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh
|
||||
|
||||
# Link to Debian source dir; mkdir needed or it fails, can't force dest
|
||||
RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian
|
||||
|
||||
VOLUME ${ARTIFACT_DIR}/
|
||||
|
||||
COPY . ${SOURCE_DIR}/
|
||||
|
||||
ENTRYPOINT ["/docker-build.sh"]
|
||||
#ENTRYPOINT ["/bin/bash"]
|
@ -0,0 +1,34 @@
|
||||
FROM debian:9
|
||||
# Docker build arguments
|
||||
ARG SOURCE_DIR=/jellyfin
|
||||
ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-arm64
|
||||
ARG ARTIFACT_DIR=/dist
|
||||
ARG SDK_VERSION=2.2
|
||||
# Docker run environment
|
||||
ENV SOURCE_DIR=/jellyfin
|
||||
ENV ARTIFACT_DIR=/dist
|
||||
ENV DEB_BUILD_OPTIONS=noddebs
|
||||
ENV ARCH=arm64
|
||||
|
||||
# Prepare Debian build environment
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev liblttng-ust0
|
||||
|
||||
# Install dotnet repository
|
||||
# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current
|
||||
RUN wget https://download.visualstudio.microsoft.com/download/pr/d9f37b73-df8d-4dfa-a905-b7648d3401d0/6312573ac13d7a8ddc16e4058f7d7dc5/dotnet-sdk-2.2.104-linux-arm.tar.gz -O dotnet-sdk.tar.gz \
|
||||
&& mkdir -p dotnet-sdk \
|
||||
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
|
||||
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
|
||||
|
||||
# Link to docker-build script
|
||||
RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh
|
||||
|
||||
# Link to Debian source dir; mkdir needed or it fails, can't force dest
|
||||
RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian
|
||||
|
||||
VOLUME ${ARTIFACT_DIR}/
|
||||
|
||||
COPY . ${SOURCE_DIR}/
|
||||
|
||||
ENTRYPOINT ["/docker-build.sh"]
|
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source ../common.build.sh
|
||||
|
||||
keep_artifacts="${1}"
|
||||
|
||||
WORKDIR="$( pwd )"
|
||||
|
||||
package_temporary_dir="${WORKDIR}/pkg-dist-tmp"
|
||||
output_dir="${WORKDIR}/pkg-dist"
|
||||
current_user="$( whoami )"
|
||||
image_name="jellyfin-debian_arm64-build"
|
||||
|
||||
rm -rf "${package_temporary_dir}" &>/dev/null \
|
||||
|| sudo rm -rf "${package_temporary_dir}" &>/dev/null
|
||||
|
||||
rm -rf "${output_dir}" &>/dev/null \
|
||||
|| sudo rm -rf "${output_dir}" &>/dev/null
|
||||
|
||||
if [[ ${keep_artifacts} == 'n' ]]; then
|
||||
docker_sudo=""
|
||||
if [[ ! -z $(id -Gn | grep -q 'docker') ]] \
|
||||
&& [[ ! ${EUID:-1000} -eq 0 ]] \
|
||||
&& [[ ! ${USER} == "root" ]] \
|
||||
&& [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then
|
||||
docker_sudo=sudo
|
||||
fi
|
||||
${docker_sudo} docker image rm ${image_name} --force
|
||||
fi
|
@ -0,0 +1 @@
|
||||
docker
|
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Builds the DEB inside the Docker container
|
||||
|
||||
set -o errexit
|
||||
set -o xtrace
|
||||
|
||||
# Move to source directory
|
||||
pushd ${SOURCE_DIR}
|
||||
|
||||
# Remove build-dep for dotnet-sdk-2.2, since it's not a package in this image
|
||||
sed -i '/dotnet-sdk-2.2,/d' debian/control
|
||||
|
||||
# Build DEB
|
||||
export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH}
|
||||
dpkg-buildpackage -us -uc -aarm64
|
||||
|
||||
# Move the artifacts out
|
||||
mkdir -p ${ARTIFACT_DIR}/deb
|
||||
mv /jellyfin_* ${ARTIFACT_DIR}/deb/
|
||||
chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}
|
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source ../common.build.sh
|
||||
|
||||
ARCH="$( arch )"
|
||||
WORKDIR="$( pwd )"
|
||||
|
||||
package_temporary_dir="${WORKDIR}/pkg-dist-tmp"
|
||||
output_dir="${WORKDIR}/pkg-dist"
|
||||
current_user="$( whoami )"
|
||||
image_name="jellyfin-debian_arm64-build"
|
||||
|
||||
# Determine if sudo should be used for Docker
|
||||
if [[ ! -z $(id -Gn | grep -q 'docker') ]] \
|
||||
&& [[ ! ${EUID:-1000} -eq 0 ]] \
|
||||
&& [[ ! ${USER} == "root" ]] \
|
||||
&& [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then
|
||||
docker_sudo="sudo"
|
||||
else
|
||||
docker_sudo=""
|
||||
fi
|
||||
|
||||
# Determine which Dockerfile to use
|
||||
case $ARCH in
|
||||
'x86_64')
|
||||
DOCKERFILE="Dockerfile.amd64"
|
||||
;;
|
||||
'armv7l')
|
||||
DOCKERFILE="Dockerfile.arm64"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Prepare temporary package dir
|
||||
mkdir -p "${package_temporary_dir}"
|
||||
# Set up the build environment Docker image
|
||||
${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE}
|
||||
# Build the DEBs and copy out to ${package_temporary_dir}
|
||||
${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}"
|
||||
# Move the DEBs to the output directory
|
||||
mkdir -p "${output_dir}"
|
||||
mv "${package_temporary_dir}"/deb/* "${output_dir}"
|
@ -0,0 +1 @@
|
||||
../debian-package-x64/pkg-src
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue