iisconfig 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MWZiOWYzMTVmYTg4Y2Q0ZGE2OWJmZTAwZjAxNjJlNTBmMmFjNjk1NA==
5
- data.tar.gz: !binary |-
6
- M2YyZDEyZDE1ODcxZjNmMWM5ODA3ZDJmMjZmZmFjZWI0MmMzMDIyZA==
2
+ SHA1:
3
+ metadata.gz: 4f8eca836dedb5d94aff136c11582888163a4534
4
+ data.tar.gz: 9e6697802dc44c2879c3cfd0411bceafd45a1464
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NWY0ZGY4MDExZWFkNjYyOTMzMDhlZDE1OTNiNjE5NGYzOWViYTg5MmNjYTI4
10
- NmM3N2I5ZWJkMmYyZTQxZTUwMTkwZGQwNTkyNjBiZTlkMzg2M2Y1NWU3YTNi
11
- MDczMzcxNGEwZGUxZDUzMjliNTBmNzc3MzFhMzhhMzc2MTZmODA=
12
- data.tar.gz: !binary |-
13
- ZWIzN2NhYjc5N2I0NTg2YWQ3NzdkMmU2MzA2MGM2ZTIyMDk4YTE3NmY5YWJi
14
- ZGU3YzFmYjUxZTcwZjVkYjYyZmJhNjM5OTJmYjNhOGM4ODg2YjdhMzc2MGNm
15
- MTFjZGMwMGJhMTAzYjdkNDQ1MGMyNTEwOWQ3YmE2ZGQ2NDU0ZDU=
6
+ metadata.gz: 83d240d5a1b899e7576261b85c76c61645a722981f7a17126ae9269f21b1beb58421c7740da93a9ed39f0a67dde1735b908d4f3d1f932af227cdfde5ca9a17f2
7
+ data.tar.gz: 83e4402c3e85c602c56452b2dc8ec5b7d95cdf741532852fef33db476984f2e1aef9be67bf3d02ba3a7d36e1be1ccf4f24023ea5fee2ce4ad51d0c8135a6a6fa
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.6.0
@@ -2,6 +2,7 @@ require 'site'
2
2
  require 'ftp_site'
3
3
  require 'iis_object'
4
4
  require 'process_model'
5
+ require 'command'
5
6
 
6
7
  module IISConfig
7
8
 
@@ -97,7 +98,14 @@ module IISConfig
97
98
  commands << delete if exist? :apppool, @name
98
99
  commands << add
99
100
  @process_model.settings.each_pair do |key, value|
100
- commands << %W{SET CONFIG /section:applicationPools /[name='#{@name}'].processModel.#{key}:#{value}}
101
+ safe_command = %W{SET CONFIG /section:applicationPools /[name='#{@name}'].processModel.#{key}:#{value}}
102
+
103
+ if value.is_a?(IISConfig::SensitiveValue)
104
+ c = %W{SET CONFIG /section:applicationPools /[name='#{@name}'].processModel.#{key}:#{value.value}}
105
+ commands << IISConfig::Command.new(c, safe_command)
106
+ else
107
+ commands << safe_command
108
+ end
101
109
  end
102
110
  commands << %W{SET APPPOOL /apppool.name:#{@name} /enable32BitAppOnWin64:#{@enable_32bit_app_on_win64}}
103
111
 
@@ -0,0 +1,15 @@
1
+ module IISConfig
2
+
3
+ class Command
4
+
5
+ attr_reader :command
6
+ attr_reader :safe_command
7
+
8
+ def initialize(command, safe_command)
9
+ @command = command
10
+ @safe_command = safe_command
11
+ end
12
+
13
+ end
14
+
15
+ end
@@ -1,6 +1,7 @@
1
1
  $:.push File.expand_path(File.dirname(__FILE__))
2
2
 
3
3
  require 'rexml/document'
4
+ require 'sensitive_value'
4
5
  require 'app_pool'
5
6
  require 'ftp_site'
6
7
  require 'site'
@@ -3,13 +3,16 @@ module IISConfig
3
3
  class Runner
4
4
 
5
5
  def self.execute_command(args)
6
- args.flatten!
6
+ args = [args].flatten
7
7
  tool = :appcmd
8
8
 
9
- puts " #{tool.to_s} #{args.join(' ')}"
9
+ safe_command = args.map { |v| v.is_a?(IISConfig::Command) ? v.safe_command : v }
10
+ command = args.map { |v| v.is_a?(IISConfig::Command) ? v.command : v }
11
+
12
+ puts " #{tool.to_s} #{safe_command.join(' ')}"
10
13
 
11
14
  unless IISConfiguration.dry_run?
12
- result = `c:/windows/system32/inetsrv/appcmd #{args.join(' ')}"`
15
+ result = `c:/windows/system32/inetsrv/appcmd #{command.join(' ')}"`
13
16
  puts result if IISConfiguration.verbose?
14
17
  raise Exception.new($?.exitstatus) unless $?.success?
15
18
  result
@@ -0,0 +1,21 @@
1
+ module IISConfig
2
+
3
+ class SensitiveValue
4
+
5
+ attr_reader :value
6
+
7
+ def initialize(value)
8
+ @value = value
9
+ end
10
+
11
+ def to_s
12
+ "[SENSITIVE]"
13
+ end
14
+
15
+ def to_sym
16
+ @value.to_sym
17
+ end
18
+
19
+ end
20
+
21
+ end
data/test/example.rb CHANGED
@@ -7,8 +7,10 @@ app_pool do |p|
7
7
  p.runtime_version :'v2.0'
8
8
  p.start_mode 'AlwaysRunning'
9
9
  p.process_model do |m|
10
- m.identity_type :NetworkService
10
+ m.identity_type :SpecificUser
11
11
  m.idle_timeout '0.00:30:00'
12
+ m.username ENV['APP_POOL_USERNAME']
13
+ m.password SensitiveValue.new(ENV['APP_POOL_PASSWORD'])
12
14
  end
13
15
 
14
16
  p.site do |s|
metadata CHANGED
@@ -1,63 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iisconfig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-06 00:00:00.000000000 Z
11
+ date: 2018-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: !binary |-
20
- MS42LjA=
21
- - - ! '>='
19
+ version: 1.6.0
20
+ - - ">="
22
21
  - !ruby/object:Gem::Version
23
- version: !binary |-
24
- MS42LjA=
22
+ version: 1.6.0
25
23
  type: :runtime
26
24
  prerelease: false
27
25
  version_requirements: !ruby/object:Gem::Requirement
28
26
  requirements:
29
- - - ~>
27
+ - - "~>"
30
28
  - !ruby/object:Gem::Version
31
- version: !binary |-
32
- MS42LjA=
33
- - - ! '>='
29
+ version: 1.6.0
30
+ - - ">="
34
31
  - !ruby/object:Gem::Version
35
- version: !binary |-
36
- MS42LjA=
32
+ version: 1.6.0
37
33
  - !ruby/object:Gem::Dependency
38
34
  name: rainbow
39
35
  requirement: !ruby/object:Gem::Requirement
40
36
  requirements:
41
- - - ~>
37
+ - - "~>"
42
38
  - !ruby/object:Gem::Version
43
- version: !binary |-
44
- Mi4wLjA=
45
- - - ! '>='
39
+ version: 2.0.0
40
+ - - ">="
46
41
  - !ruby/object:Gem::Version
47
- version: !binary |-
48
- Mi4wLjA=
42
+ version: 2.0.0
49
43
  type: :runtime
50
44
  prerelease: false
51
45
  version_requirements: !ruby/object:Gem::Requirement
52
46
  requirements:
53
- - - ~>
47
+ - - "~>"
54
48
  - !ruby/object:Gem::Version
55
- version: !binary |-
56
- Mi4wLjA=
57
- - - ! '>='
49
+ version: 2.0.0
50
+ - - ">="
58
51
  - !ruby/object:Gem::Version
59
- version: !binary |-
60
- Mi4wLjA=
52
+ version: 2.0.0
61
53
  description: IIS Configuration
62
54
  email:
63
55
  - stuff@lukesmith.net
@@ -71,12 +63,14 @@ files:
71
63
  - lib/iisconfig.rb
72
64
  - lib/iisconfig/app_pool.rb
73
65
  - lib/iisconfig/application.rb
66
+ - lib/iisconfig/command.rb
74
67
  - lib/iisconfig/configuration.rb
75
68
  - lib/iisconfig/ftp_site.rb
76
69
  - lib/iisconfig/iis_object.rb
77
70
  - lib/iisconfig/iisconfig.rb
78
71
  - lib/iisconfig/process_model.rb
79
72
  - lib/iisconfig/runner.rb
73
+ - lib/iisconfig/sensitive_value.rb
80
74
  - lib/iisconfig/site.rb
81
75
  - lib/iisconfig/version.rb
82
76
  - lib/iisconfig/virtual_directory.rb
@@ -90,17 +84,17 @@ require_paths:
90
84
  - lib
91
85
  required_ruby_version: !ruby/object:Gem::Requirement
92
86
  requirements:
93
- - - ! '>='
87
+ - - ">="
94
88
  - !ruby/object:Gem::Version
95
89
  version: '0'
96
90
  required_rubygems_version: !ruby/object:Gem::Requirement
97
91
  requirements:
98
- - - ! '>='
92
+ - - ">="
99
93
  - !ruby/object:Gem::Version
100
94
  version: '0'
101
95
  requirements: []
102
96
  rubyforge_project: iisconfig
103
- rubygems_version: 2.4.8
97
+ rubygems_version: 2.4.5.1
104
98
  signing_key:
105
99
  specification_version: 4
106
100
  summary: IIS Config