myapacheconf 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: '058d8dda443a9096927d7fe6cfad4368365ff25ce69a252a460e007853150013'
4
+ data.tar.gz: 66f216b35ace67c88a66f7e5de4a43da60ec0ac426dd6be4ea42d789031e1c64
5
+ SHA512:
6
+ metadata.gz: '0355479d7c3727ef4c655a3b88698db5fe24ccf9baf600d374208438d4252d0afcac87e03e2bb9b6b187598447258c783aa5becfd8c9f2573ca05e352de4cdd1'
7
+ data.tar.gz: bf6e2314b089468e9bf58bca40605f2edb93aeca6212189ec96ff13a5e75990b1b5b17ba377f3b8a277a2d1ace4e4a3c7258d04f988d6db2ebeab199991a3a5e
checksums.yaml.gz.sig ADDED
Binary file
data.tar.gz.sig ADDED
Binary file
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: myapacheconf.rb
4
+
5
+ require 'polyrex-headings'
6
+
7
+
8
+ class MyApacheConf
9
+ using ColouredText
10
+
11
+ attr_reader :to_h, :conf
12
+
13
+ def initialize(raw_s, debug: false)
14
+
15
+ @debug = debug
16
+
17
+ contents = RXFHelper.read(raw_s).first
18
+ puts 'content: ' + contents.inspect if @debug
19
+
20
+ s = if contents =~ /^<\?ph / then
21
+ contents
22
+ else
23
+ '<?ph schema="sections[title,tags]/section[x]"?>
24
+ title: Apache Config
25
+ tags: apache
26
+
27
+ ' + contents
28
+
29
+ end
30
+
31
+ puts ('s: ' + s.inspect).debug if @debug
32
+ ph = PolyrexHeadings.new(s, debug: debug)
33
+
34
+ @to_h = @h = ph.to_h.first.last
35
+ puts @to_h.inspect
36
+
37
+ @sip = []
38
+ @extensions = []
39
+ build()
40
+
41
+ end
42
+
43
+
44
+ private
45
+
46
+ def build()
47
+
48
+ @conf = @h[:proxypassthru][:'port 80'].map do |line|
49
+
50
+ host, addr = line.split(/ +/,2)
51
+
52
+ s = "<VirtualHost *:80>
53
+ ProxyPreserveHost On
54
+ ProxyPass / http://#{addr}/
55
+ ProxyPassReverse / http://#{addr}/
56
+ ServerName #{host}
57
+ </VirtualHost>"
58
+
59
+ [host, s]
60
+
61
+ end.to_h
62
+
63
+ end
64
+
65
+
66
+ end
67
+
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: myapacheconf
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
14
+ YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjEwNjE3MDkyODMwWhcN
15
+ MjIwNjE3MDkyODMwWjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
+ cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQD2Ymsq
17
+ zSfu2+Mpfr2qO4qtGTX4bx1+6aTVl6+Aa9RV+a+Cp0GscHq6ocO05ZrdRnm0NYNX
18
+ hHbD566TvygQxSmxLwG53GAObel4atW8YzhVp2G152tAWA76oVaBO9SjaudVmCdW
19
+ jPeSH/8uajP2O0OBp9AlqdIBc8QAAGpui2r6e4DYLgGvWJv04aCHT3BWD/kWe02N
20
+ J+9FQH9qrBzFIUIOaitxf0jVQdrosNOSIB+XV1/0EsUVxEDBvs2mKZJA5pq9O4Qq
21
+ XN2dLp5bewAkjvNm34t2Jy6Zfche3w0wheyzGPlYfEDllTr0DLov16KebdEwPA0J
22
+ iUC+kMwT7RTEUVGW3srkDTZnIPwd7GRdt8ZqbG+yE2h1t+96S2QtCD7F+1zrMHDc
23
+ DU6Ws14wBUjVitev/sVLUsKn029UqfkjdC5a3auTir5CghxEe5wBoKYPLUsQ3RNo
24
+ Q4fqaRvHDARDhdi4N6dP9kOSNdyju0N1ITgMx2h8MokK6EzNyfP2r0PcvqMCAwEA
25
+ AaOBijCBhzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUAhP886NV
26
+ RFniuJNeNANnDlQ8MIwwJgYDVR0RBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
27
+ c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1hc3RlckBqYW1lc3JvYmVydHNvbi5ldTAN
28
+ BgkqhkiG9w0BAQsFAAOCAYEArOTdQD7PiCBSoj9hgPuRRHNsXnh/nDF83PfM/lQr
29
+ e985NCKAdxnjIxG3qKiQl+D2qP2whd9UuZChXckjBAZgQVnUD2GSses/mOiSRG4G
30
+ ZSLFJlgJ+IBtfy76q9kb4hXg4vhMJ9fCjVRodT2SW1/o8b6jgGS8YNAsHcLYIK2d
31
+ /fG2l6Lc0FwjZQ6Jr4zp+yS3x7Mgtd0EtESR8VU+noxj/BNo4WxeDc8Z0IjP3fZP
32
+ cyTwAqK+Gmy4Hu5EJ2hjs6DDBI80+A92TpOF5YbsOIaf2rRaSThPS8kl3BE9FkA6
33
+ 0ZqR9xdVy2+nQIJOTIVcdQ2uaVYvN+wUKaAojekp2sHqE5EJnz54ppM/4KXIViTn
34
+ U1oeS5oL/7hNboFFSoHajMhjOrNpcgypwViFLSX7nr788ZlWwQSiNYdnFazPHCNq
35
+ osgNPcLkc9OPm2ZC/FUmEP2xbH0iqaODrzkt0abENVN7bsOVs6eGXO0uHl6LK+N8
36
+ vjhInZ6KRUK0qO82ril1tM/Z
37
+ -----END CERTIFICATE-----
38
+ date: 2021-06-17 00:00:00.000000000 Z
39
+ dependencies:
40
+ - !ruby/object:Gem::Dependency
41
+ name: polyrex-headings
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '0.2'
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 0.2.0
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '0.2'
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 0.2.0
60
+ description:
61
+ email: digital.robertson@gmail.com
62
+ executables: []
63
+ extensions: []
64
+ extra_rdoc_files: []
65
+ files:
66
+ - lib/myapacheconf.rb
67
+ homepage: https://github.com/jrobertson/myapacheconf
68
+ licenses:
69
+ - MIT
70
+ metadata: {}
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubygems_version: 3.1.2
87
+ signing_key:
88
+ specification_version: 4
89
+ summary: Helps build apache2 virtual host configuration files from a simpler config
90
+ file.
91
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1,4 @@
1
+ zN�4����&[Z~�Ѱ���0����UM=� �`�A\
2
+ �%�C�Y�x� i�wI ��<����&��n��;���*!�U �c�:ZC�t(]���!�M[^UdCU�ehEsf Z��s10V,�r�,��po=�. `�ɿ�M{�Ԁ��;�R� =v'�`�x jA��ި��||ޣ�Ŷ5n��r�7m�1��:a��f�?�f�>;��"�=��Cu7����f ������ƙ\1d����z�OĹ:- 4w��x��R�f@�V��+ �n6�xd�1���0�
3
+
4
+ 6i�