puppet-forge-server 1.5.3 → 1.6.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 +4 -4
- data/README.md +40 -0
- data/lib/puppet_forge_server/server.rb +5 -1
- data/lib/puppet_forge_server/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a171b2b28c33323c957641164b1a785700ea6372
|
4
|
+
data.tar.gz: 35cfa215febc8ccf95dbbfa0165ddfdc40a051cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f94bc68aa70ab4cc0c294768bb8d94e4b1f7a9047b29499049b937f5c0d57e0be7b5972527a7afbb1edd69d81b59207640274a7264faab123dfc96dd270786e7
|
7
|
+
data.tar.gz: 2e329e028ae4385997e450ef9349e18a8431c9d673c8ecf59564de45e56599fe056ad158c73a6573f897fbb1e57d1a229a28b902fb59cd9e270a343ab5826b2f
|
data/README.md
CHANGED
@@ -138,6 +138,46 @@ sudo -u forge puppet-forge-server -D -m /opt/forge/modules -x https://forgeapi.p
|
|
138
138
|
|
139
139
|
You are done. Now go install some puppet modules.
|
140
140
|
|
141
|
+
### Behind Apache (Passenger Support)
|
142
|
+
|
143
|
+
Apache virtualhost config:
|
144
|
+
```
|
145
|
+
<VirtualHost *:80>
|
146
|
+
ServerName localhost
|
147
|
+
DocumentRoot /opt/forge/public
|
148
|
+
<Directory /opt/forge/public>
|
149
|
+
Allow from all
|
150
|
+
Options -MultiViews
|
151
|
+
Require all granted
|
152
|
+
</Directory>
|
153
|
+
</VirtualHost>
|
154
|
+
```
|
155
|
+
|
156
|
+
Create a `config.ru` one folder down from the Apache DocumentRoot, eg: /opt/forge/config.ru:
|
157
|
+
```
|
158
|
+
require 'rubygems'
|
159
|
+
require 'puppet_forge_server'
|
160
|
+
|
161
|
+
# Set base cache directory for proxy backends
|
162
|
+
cache_dir = '/opt/forge/cache' # default: File.join(Dir.tmpdir.to_s, 'puppet-forge-server', 'cache')
|
163
|
+
|
164
|
+
# Create backends
|
165
|
+
backends = [
|
166
|
+
PuppetForgeServer::Backends::Directory.new('/opt/forge/modules'),
|
167
|
+
# Add directory backend for serving cached modules in case proxy flips over
|
168
|
+
PuppetForgeServer::Backends::Directory.new(cache_dir),
|
169
|
+
PuppetForgeServer::Backends::ProxyV3.new('https://forgeapi.puppetlabs.com', cache_dir)
|
170
|
+
]
|
171
|
+
|
172
|
+
# Disable access logging, log errors to STDERR
|
173
|
+
PuppetForgeServer::Logger.set({:server => STDERR, :access => File.open(File::NULL, "w")})
|
174
|
+
|
175
|
+
# Run
|
176
|
+
run PuppetForgeServer::Server.new.build(backends, PuppetForgeServer::Utils::OptionParser.class_eval('@@DEFAULT_WEBUI_ROOT'))
|
177
|
+
```
|
178
|
+
|
179
|
+
You can now connect to http://localhost and see the web interface, start using and adding modules in the same way as you would running as a Daemon.
|
180
|
+
|
141
181
|
## Web UI
|
142
182
|
|
143
183
|
Puppet forge server comes with built-in web UI looking very similar to the official puppet forge web page and providing a simple module search feature. Each view haml file corresponds to the request endpoint; for example **/** or index is formed by the index.haml located in the *views* directory and obviously combined with layout.haml that is being refered to during any request.
|
@@ -97,7 +97,11 @@ module PuppetForgeServer
|
|
97
97
|
case type
|
98
98
|
when 'Proxy'
|
99
99
|
@log.info "Detecting API version for #{url}..."
|
100
|
-
|
100
|
+
[
|
101
|
+
PuppetForgeServer::Backends.const_get("#{type}V#{get_api_version(url)}").new(url.chomp('/'), options[:cache_basedir]),
|
102
|
+
# Add directory backend for serving cached modules in case proxy flips over
|
103
|
+
PuppetForgeServer::Backends.const_get('Directory').new(options[:cache_basedir])
|
104
|
+
]
|
101
105
|
else
|
102
106
|
PuppetForgeServer::Backends.const_get(type).new(url)
|
103
107
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-forge-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilja Bobkevic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|