コード例 #1
0
ファイル: IISFtpInstaller.cs プロジェクト: zaanton/win-acme
        public override void Default(ScheduledRenewal renewal, IOptionsService optionsService)
        {
            var siteId = optionsService.TryGetLong(nameof(optionsService.Options.FtpSiteId), optionsService.Options.FtpSiteId) ??
                         optionsService.TryGetLong(nameof(optionsService.Options.InstallationSiteId), optionsService.Options.InstallationSiteId) ??
                         optionsService.TryGetLong(nameof(optionsService.Options.SiteId), optionsService.Options.SiteId) ??
                         throw new Exception($"Missing parameter --{nameof(optionsService.Options.FtpSiteId).ToLower()}");
            var site = _iisClient.GetFtpSite(siteId);

            renewal.Binding.FtpSiteId = site.Id;
        }
コード例 #2
0
ファイル: IISFtpInstaller.cs プロジェクト: pthorin/win-acme
        public override void Default(ScheduledRenewal renewal, IOptionsService optionsService)
        {
            var siteId = optionsService.TryGetLong(nameof(optionsService.Options.FtpSiteId), optionsService.Options.FtpSiteId);

            if (siteId == null)
            {
                siteId = optionsService.TryGetLong(nameof(optionsService.Options.InstallationSiteId), optionsService.Options.InstallationSiteId);
            }
            if (siteId == null)
            {
                siteId = optionsService.TryGetLong(nameof(optionsService.Options.SiteId), optionsService.Options.SiteId);
            }
            if (siteId != null)
            {
                var site = _iisClient.GetFtpSite(siteId.Value); // Throws exception when not found
                renewal.Binding.InstallationSiteId = site.Id;
            }
            else
            {
                throw new Exception($"Missing parameter --{nameof(optionsService.Options.FtpSiteId).ToLower()}");
            }
        }
コード例 #3
0
ファイル: FileSystem.cs プロジェクト: numbqr123/win-acme
 public override void Default(Target target, IOptionsService optionsService)
 {
     if (target.IIS == true && _iisClient.Version.Major > 0)
     {
         var validationSiteId = optionsService.TryGetLong(nameof(optionsService.Options.ValidationSiteId), optionsService.Options.ValidationSiteId);
         if (validationSiteId != null)
         {
             var site = _iisClient.GetWebSite(validationSiteId.Value); // Throws exception when not found
             target.ValidationSiteId = validationSiteId;
             target.WebRootPath      = site.WebRoot();
         }
     }
     base.Default(target, optionsService);
 }