コード例 #1
0
        /// <summary>
        /// Sets the IIS machine key. Configures algorithms and keys to use for encryption,
        /// decryption, and validation of forms-authentication data and view-state data, and
        /// for out-of-process session state identification.
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="validationKey">Specifies the key used to validate encrypted data</param>
        /// <param name="decryptionKey">Specifies the key that is used to encrypt and decrypt data or the process by which the key is generated</param>
        /// <param name="validation">Specifies the type of encryption that is used to validate data</param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration IisMachineKey(this IOfferRemoteConfiguration configuration, string validationKey, string decryptionKey, MachineKeyValidation validation)
        {
            var operation = new SetIisMachineKeyOperation(validationKey, decryptionKey, validation);

            Configure.Operation(configuration, operation);
            return(configuration);
        }
コード例 #2
0
        /// <summary>
        /// Disables User Account Control. The operation is idempotent and will trigger a restart, but only if UAC not is already disabled.
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="enabled">Specify if you want UAC enabled or not. E.g. setting this to false will disable UAC.</param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration UserAccountControl(this IOfferRemoteConfiguration configuration, bool enabled)
        {
            var operation = new UserAccountControlOperation(enabled);

            OperationExecutor.Execute((RemoteBuilder)configuration, operation);
            return(configuration);
        }
コード例 #3
0
        /// <summary>
        /// Disables User Account Control. The operation is idempotent and will trigger a restart, but only if UAC not is already disabled.
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="enabled">Specify if you want UAC enabled or not. E.g. setting this to false will disable UAC.</param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration UserAccountControl(this IOfferRemoteConfiguration configuration, bool enabled)
        {
            var operation = new UserAccountControlOperation(enabled);

            Configure.Operation(configuration, operation);
            return(configuration);
        }
コード例 #4
0
        /// <summary>
        /// Sets the IIS machine key. Configures algorithms and keys to use for encryption,
        /// decryption, and validation of forms-authentication data and view-state data, and
        /// for out-of-process session state identification.
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="validationKey">Specifies the key used to validate encrypted data</param>
        /// <param name="decryptionKey">Specifies the key that is used to encrypt and decrypt data or the process by which the key is generated</param>
        /// <param name="validation">Specifies the type of encryption that is used to validate data</param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration IisMachineKey(this IOfferRemoteConfiguration configuration, string validationKey, string decryptionKey, MachineKeyValidation validation)
        {
            var operation = new SetIisMachineKeyOperation(validationKey, decryptionKey, validation);

            OperationExecutor.Execute((RemoteBuilder)configuration, operation);
            return(configuration);
        }
コード例 #5
0
        /// <summary>
        /// Will create a new Application Pool in IIS.
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration IISAppPool(this IOfferRemoteConfiguration infra, string name)
        {
            var op = new IisAppPoolOperation(name);

            OperationExecutor.Execute((RemoteBuilder)infra, op);
            return(infra);
        }
コード例 #6
0
        /// <summary>
        /// Will create a new Application Pool in IIS.
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration IISAppPool(this IOfferRemoteConfiguration infra, string name)
        {
            var op = new IisAppPoolOperation(name);

            Configure.Operation(infra, op);
            return(infra);
        }
コード例 #7
0
        /// <summary>
        /// Sets ACL (Access Control Lists) on files or folders. Like chmod on Linux.
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="user">The user account that will get access</param>
        /// <param name="fileOrFolder">The file or folder to configure ACL for</param>
        /// <param name="accessRights">The access rights to allow</param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration Acl(this IOfferRemoteConfiguration configuration, string user, string fileOrFolder, FileSystemRights accessRights)
        {
            var op = new AclOperation(user, fileOrFolder, accessRights, new AclOptions.AclOptionsValues());

            OperationExecutor.Execute((RemoteBuilder)configuration, op);
            return(configuration);
        }
コード例 #8
0
        /// <summary>
        /// Installs IIS
        /// </summary>
        /// <returns></returns>
        public static IOfferRemoteConfiguration IIS(this IOfferRemoteConfiguration infra)
        {
            var op = new IisInfrastructureOperation();

            Configure.Operation(infra, op);
            return(infra);
        }
コード例 #9
0
        /// <summary>
        /// Creates a new Web Site in IIS if not exist. If exist, will delete and then create new.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration IISWebSite(this IOfferRemoteConfiguration infra, string name, int id)
        {
            var op = new IisWebSiteOperation(name, id);

            Configure.Operation(infra, op);
            return(infra);
        }
コード例 #10
0
        /// <summary>
        /// Installs IIS
        /// </summary>
        /// <returns></returns>
        public static IOfferRemoteConfiguration IIS(this IOfferRemoteConfiguration infra)
        {
            var op = new IisInfrastructureOperation();

            OperationExecutor.Execute((RemoteBuilder)infra, op);
            return(infra);
        }
コード例 #11
0
        /// <summary>
        /// Creates a new Web Site in IIS if not exist. If exist, will delete and then create new.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration IISWebSite(this IOfferRemoteConfiguration infra, string name, int id)
        {
            var op = new IisWebSiteOperation(name, id);

            OperationExecutor.Execute((RemoteBuilder)infra, op);
            return(infra);
        }
コード例 #12
0
        /// <summary>
        /// Will create a new Web Application in IIS under the given Web Site, with the provided options.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="webSite"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration IISWebApp(this IOfferRemoteConfiguration infra, string name, string webSite, Action <IOfferIisWebAppOptions> options)
        {
            var op = new IisWebAppOperation(name, webSite);

            Configure.Operation(infra, op);
            return(infra);
        }
コード例 #13
0
        /// <summary>
        /// Creates environment variable if not exists. Overwrites the variable if exists.
        /// </summary>
        /// <param name="configure"></param>
        /// <param name="name">Variable name </param>
        /// <param name="value">Variable value</param>
        /// <param name="target">Variable target</param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration EnvironmentVariable(this IOfferRemoteConfiguration configure, string name, string value, EnvironmentVariableTarget target)
        {
            var operation = new EnvironmentVariableOperation(name, value, target);

            OperationExecutor.Execute((RemoteBuilder)configure, operation);
            return(configure);
        }
コード例 #14
0
        /// <summary>
        /// Gives access to Windows Registry operations
        /// </summary>
        /// <param name="conf"></param>
        /// <param name="reg">Windows Registry operations</param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration WindowsRegistry(this IOfferRemoteConfiguration conf, Action <IOfferWindowsRegistryOperations> reg)
        {
            var builder = new WindowsRegistryBuilder(conf);

            reg(builder);
            return(conf);
        }
コード例 #15
0
        /// <summary>
        /// Gives access to Windows Registry operations
        /// </summary>
        /// <param name="conf"></param>
        /// <param name="reg">Windows Registry operations</param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration WindowsRegistry(this IOfferRemoteConfiguration conf, Action <IOfferWindowsRegistryOperations> reg)
        {
            var confBuilder = conf as RemoteConfigurationBuilder;
            var builder     = new WindowsRegistryBuilder(conf, confBuilder.Server, confBuilder.Settings, confBuilder.Token);

            reg(builder);
            return(conf);
        }
コード例 #16
0
        /// <summary>
        /// Offer common Windows operations
        /// </summary>
        /// <returns></returns>
        public static IOfferRemoteConfiguration Windows(this IOfferRemoteConfiguration infra, Action <WindowsInfrastructureOptions> options)
        {
            var op = new WindowsFeatureInfrastructureOperation();

            options(new WindowsInfrastructureOptions(op));
            OperationExecutor.Execute((RemoteBuilder)infra, op);
            return(infra);
        }
コード例 #17
0
        /// <summary>
        /// Installs and configures IIS with provided options
        /// </summary>
        /// <param name="options"></param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration IIS(this IOfferRemoteConfiguration infra, Action <IisInfrastructureOptions> options)
        {
            var op = new IisInfrastructureOperation();

            options(new IisInfrastructureOptions(op));

            Configure.Operation(infra, op);
            return(infra);
        }
コード例 #18
0
        /// <summary>
        /// Creates a new Web Site in IIS if not exist. If exist, will delete and then create new with provided options.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="id"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration IISWebSite(this IOfferRemoteConfiguration infra, string name, int id, Action <IOfferIisWebSiteOptions> options)
        {
            var opt = new IisWebSiteOptions();

            options(opt);
            var op = new IisWebSiteOperation(name, id, opt);

            OperationExecutor.Execute((RemoteBuilder)infra, op);
            return(infra);
        }
コード例 #19
0
        /// <summary>
        /// Will create a new Application Pool in IIS with provided options.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration IISAppPool(this IOfferRemoteConfiguration infra, string name, Action <IOfferIisAppPoolOptions> options)
        {
            var opt = new IisAppPoolOptions();

            options(opt);
            var op = new IisAppPoolOperation(name, opt.Values);

            OperationExecutor.Execute((RemoteBuilder)infra, op);
            return(infra);
        }
コード例 #20
0
        /// <summary>
        /// Will create a new Web Application in IIS under the given Web Site, with the provided options.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="webSite"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration IISWebApp(this IOfferRemoteConfiguration infra, string name, string webSite, Action <IOfferIisWebAppOptions> options)
        {
            var builder = new IisWebAppOptions(name);

            options(builder);

            var op = new IisWebAppOperation(name, webSite, builder.Values);

            OperationExecutor.Execute((RemoteBuilder)infra, op);
            return(infra);
        }
コード例 #21
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="user">The user account that will get access</param>
        /// <param name="fileOrFolder">The file or folder to configure ACL for</param>
        /// <param name="accessRights">The access rights to allow or deny</param>
        /// <param name="options">Additional ACL options</param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration Acl(this IOfferRemoteConfiguration configuration, string user, string fileOrFolder, FileSystemRights accessRights, Action <IOfferAclOptions> options)
        {
            var opt = new AclOptions();

            if (options != null)
            {
                options(opt);
            }
            var op = new AclOperation(user, fileOrFolder, accessRights, opt.Values);

            OperationExecutor.Execute((RemoteBuilder)configuration, op);
            return(configuration);
        }
コード例 #22
0
        /// <summary>
        /// Will configure provided Windows Service on remote server with provided options.
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="serviceName">Name of the Windows Service</param>
        /// <param name="serviceDirPath">Path to the directory where the Windows Service is located</param>
        /// <param name="relativeExePath">The relative location (from the Windows Service root directory) of the executable (.exe) for which the Windows Service will execute</param>
        /// <param name="displayName">The display name of the Windows Service as will be displayed in Windows Service Manager</param>
        /// <param name="options">Additional options for the Windows Service</param>
        /// <returns></returns>
        public static IOfferRemoteConfiguration WindowsService(this IOfferRemoteConfiguration configuration, string serviceName, string displayName, string serviceDirPath, string relativeExePath, Action <IOfferWindowsServiceOptions> options)
        {
            var winServiceOptions = new WindowsServiceOptions();

            if (options != null)
            {
                options(winServiceOptions);
            }

            var winServiceOperation = new ConfigureWindowsServiceOperation(serviceName, displayName, serviceDirPath, relativeExePath, winServiceOptions.Values);

            OperationExecutor.Execute((RemoteBuilder)configuration, winServiceOperation);
            return(configuration);
        }
コード例 #23
0
        public static void Operation(IOfferRemoteConfiguration remoteConfiguration, IExecuteRemotely operation)
        {
            var seqContainer = remoteConfiguration as RemoteConfigurationBuilder;

            seqContainer.AddOperation(operation);
        }
コード例 #24
0
 /// <summary>
 /// Provide operations for installing SSL certificates.
 /// </summary>
 public static IOfferSslInfrastructure SslCertificate(this IOfferRemoteConfiguration infra)
 {
     return(new SslInfrastructureBuilder(infra));
 }
コード例 #25
0
        /// <summary>
        /// Provide operations for installing SSL certificates.
        /// </summary>
        public static IOfferSslInfrastructure SslCertificate(this IOfferRemoteConfiguration infra)
        {
            var builder = infra as RemoteConfigurationBuilder;

            return(new SslInfrastructureBuilder(infra, builder.Server, builder.Settings, builder.Token));
        }
コード例 #26
0
 public WindowsRegistryBuilder(IOfferRemoteConfiguration conf)
 {
     _conf = conf;
 }
コード例 #27
0
 public WindowsRegistryBuilder(IOfferRemoteConfiguration remoteConfig, ServerConfig server, ConDepSettings settings, CancellationToken token) : base(server, settings, token)
 {
     RemoteConfigurationBuilder = remoteConfig;
 }
コード例 #28
0
 public SslInfrastructureBuilder(IOfferRemoteConfiguration infraBuilder)
 {
     _infraBuilder = infraBuilder;
 }
コード例 #29
0
ファイル: Configure.cs プロジェクト: peteraglen/condep-dsl
 public static void Operation(IOfferRemoteConfiguration remoteConfiguration, IExecuteRemotely operation)
 {
     var seqContainer = remoteConfiguration as RemoteConfigurationBuilder;
     seqContainer.AddOperation(operation);
 }
コード例 #30
0
        public static void Operation(IOfferRemoteConfiguration remoteConfiguration, RemoteCompositeOperation operation)
        {
            var seqContainer = remoteConfiguration as RemoteConfigurationBuilder;

            seqContainer.AddOperation(operation);
        }
コード例 #31
0
 public WindowsRegistryBuilder(IOfferRemoteConfiguration conf)
 {
     _conf = conf;
 }
コード例 #32
0
 /// <summary>
 /// Will configure provided Windows Service on remote server.
 /// </summary>
 /// <param name="configuration"></param>
 /// <param name="serviceName">Name of the Windows Service</param>
 /// <param name="serviceDirPath">Path to the directory where the Windows Service is located</param>
 /// <param name="relativeExePath">The relative location (to destDir) of the executable (.exe) for which the Windows Service will execute</param>
 /// <param name="displayName">The display name of the Windows Service as will be displayed in Windows Service Manager</param>
 /// <returns></returns>
 public static IOfferRemoteConfiguration WindowsService(this IOfferRemoteConfiguration configuration, string serviceName, string displayName, string serviceDirPath, string relativeExePath)
 {
     return(WindowsService(configuration, serviceName, displayName, serviceDirPath, relativeExePath, null));
 }
コード例 #33
0
ファイル: Configure.cs プロジェクト: peteraglen/condep-dsl
 public static void Operation(IOfferRemoteConfiguration remoteConfiguration, RemoteCompositeOperation operation)
 {
     var seqContainer = remoteConfiguration as RemoteConfigurationBuilder;
     seqContainer.AddOperation(operation);
 }
コード例 #34
0
 public SslInfrastructureBuilder(IOfferRemoteConfiguration infraBuilder)
 {
     _infraBuilder = infraBuilder;
 }