Show warning when using the docker update mechanism

This commit is contained in:
Bogdan 2023-08-14 00:03:18 +03:00 committed by GitHub
parent 6a0dc72808
commit cc538c4b2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 6 deletions

View File

@ -9,7 +9,7 @@ import titleCase from 'Utilities/String/titleCase';
import translate from 'Utilities/String/translate'; import translate from 'Utilities/String/translate';
const branchValues = [ const branchValues = [
'master', 'main',
'develop' 'develop'
]; ];
@ -83,6 +83,7 @@ function UpdateSettings(props) {
type={inputTypes.CHECK} type={inputTypes.CHECK}
name="updateAutomatically" name="updateAutomatically"
helpText={translate('UpdateAutomaticallyHelpText')} helpText={translate('UpdateAutomaticallyHelpText')}
helpTextWarning={updateMechanism.value === 'docker' ? translate('AutomaticUpdatesDisabledDocker', { appName: 'Sonarr' }) : undefined}
onChange={onInputChange} onChange={onInputChange}
{...updateAutomatically} {...updateAutomatically}
/> />

View File

@ -111,7 +111,6 @@ class Updates extends Component {
name={icons.CHECK_CIRCLE} name={icons.CHECK_CIRCLE}
size={30} size={30}
/> />
<div className={styles.message}> <div className={styles.message}>
{translate('OnLatestVersion')} {translate('OnLatestVersion')}
</div> </div>
@ -149,8 +148,8 @@ class Updates extends Component {
</div> </div>
{ {
update.branch === 'master' ? update.branch === 'main' ?
null: null :
<Label <Label
className={styles.label} className={styles.label}
> >

View File

@ -149,7 +149,7 @@ namespace NzbDrone.Common.Extensions
public static bool IsPathValid(this string path, PathValidationType validationType) public static bool IsPathValid(this string path, PathValidationType validationType)
{ {
if (path.ContainsInvalidPathChars() || string.IsNullOrWhiteSpace(path)) if (string.IsNullOrWhiteSpace(path) || path.ContainsInvalidPathChars())
{ {
return false; return false;
} }

View File

@ -97,6 +97,7 @@
"Automatic": "Automatic", "Automatic": "Automatic",
"AutomaticAdd": "Automatic Add", "AutomaticAdd": "Automatic Add",
"AutomaticSearch": "Automatic Search", "AutomaticSearch": "Automatic Search",
"AutomaticUpdatesDisabledDocker": "Automatic updates are not directly supported when using the Docker update mechanism. You will need to update the container image outside of {appName} or use a script",
"Backup": "Backup", "Backup": "Backup",
"BackupFolderHelpText": "Relative paths will be under Sonarr's AppData directory", "BackupFolderHelpText": "Relative paths will be under Sonarr's AppData directory",
"BackupIntervalHelpText": "Interval between automatic backups", "BackupIntervalHelpText": "Interval between automatic backups",

View File

@ -58,7 +58,7 @@ namespace Sonarr.Api.V3.Config
.Must((resource, path) => IsValidSslCertificate(resource)).WithMessage("Invalid SSL certificate file or password") .Must((resource, path) => IsValidSslCertificate(resource)).WithMessage("Invalid SSL certificate file or password")
.When(c => c.EnableSsl); .When(c => c.EnableSsl);
SharedValidator.RuleFor(c => c.Branch).NotEmpty().WithMessage("Branch name is required, 'master' is the default"); SharedValidator.RuleFor(c => c.Branch).NotEmpty().WithMessage("Branch name is required, 'main' is the default");
SharedValidator.RuleFor(c => c.UpdateScriptPath).IsValidPath().When(c => c.UpdateMechanism == UpdateMechanism.Script); SharedValidator.RuleFor(c => c.UpdateScriptPath).IsValidPath().When(c => c.UpdateMechanism == UpdateMechanism.Script);
SharedValidator.RuleFor(c => c.BackupFolder).IsValidPath().When(c => Path.IsPathRooted(c.BackupFolder)); SharedValidator.RuleFor(c => c.BackupFolder).IsValidPath().When(c => Path.IsPathRooted(c.BackupFolder));