procsd 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/procsd/cli.rb +27 -7
- data/lib/procsd/generator.rb +1 -1
- data/lib/procsd/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdf2c20fbe8f6aada5790a37464fa13eceb7db3ec671a821c32a8ea6471e579d
|
4
|
+
data.tar.gz: 4bdca0fd4c9b095a678988cde054031363ed80d5f48332ecc445803e16f402b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef4ac450a0847a268685a5c15f22772896d41de580b359d4a212432c31daed795b47d5e5d774e3307a20a3686f10372293ccc8047954b9b905321555de92ba79
|
7
|
+
data.tar.gz: 1392ebe266e97c45a77fd72a0f55d0aa261720bdb0950369838403c4412e005eb16b3fefa33ff20211bc46e8435baf4a27ecf048407d89db1b0c9f0b9f549a7d
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
# CHANGELOG
|
2
|
+
## 0.5.3
|
3
|
+
* Fix: procsd config sudoers command
|
4
|
+
* Add: procsd config services command
|
5
|
+
|
6
|
+
## 0.5.2
|
7
|
+
* Fix: use uniq app name in Nginx config files
|
8
|
+
* Add: custom option public_folder_path (Nginx)
|
9
|
+
* Add: --dev option for exec command (to require dev_environment in development mode)
|
10
|
+
|
2
11
|
## 0.5.1
|
3
12
|
* Fix bug `uninitialized constant Procsd::Generator::Pathname`, thanks to @koppen
|
4
13
|
|
data/README.md
CHANGED
@@ -249,7 +249,7 @@ environment:
|
|
249
249
|
RAILS_LOG_TO_STDOUT: true
|
250
250
|
nginx:
|
251
251
|
server_name: my-domain.com
|
252
|
-
public_folder_path: public # path is relative to the main project directory,
|
252
|
+
public_folder_path: public # path is relative to the main project directory, default value is `public`.
|
253
253
|
```
|
254
254
|
|
255
255
|
Configuration is done! Run [procsd create](#create-an-application-export-to-systemd) to create app services with Nginx reverse proxy config:
|
data/lib/procsd/cli.rb
CHANGED
@@ -21,7 +21,7 @@ module Procsd
|
|
21
21
|
|
22
22
|
public_folder_path = @config[:nginx]["public_folder_path"] || "public"
|
23
23
|
unless Dir.exist?(File.join options["dir"], public_folder_path)
|
24
|
-
raise ConfigurationError, "Missing public
|
24
|
+
raise ConfigurationError, "Missing public folder path to use with Nginx"
|
25
25
|
end
|
26
26
|
|
27
27
|
unless @config.dig(:environment, "PORT")
|
@@ -192,15 +192,28 @@ module Procsd
|
|
192
192
|
execute command, type: :exec
|
193
193
|
end
|
194
194
|
|
195
|
-
desc "config", "Print config files based on current settings. Available types: sudoers"
|
195
|
+
desc "config", "Print config files based on current settings. Available types: sudoers, services"
|
196
196
|
def config(name)
|
197
197
|
preload!
|
198
198
|
|
199
|
+
options = { "user" => ENV["USER"], "dir" => ENV["PWD"], "path" => `/bin/bash -ilc 'echo $PATH'`.strip }
|
200
|
+
generator = Generator.new(@config, options)
|
201
|
+
|
199
202
|
case name
|
200
203
|
when "sudoers"
|
201
|
-
say
|
204
|
+
say generator.generate_sudoers(options["user"], has_reload: has_reload?)
|
205
|
+
when "services"
|
206
|
+
return unless valid_create_options?(options)
|
207
|
+
|
208
|
+
services = generator.generate_units
|
209
|
+
services.each do |service_name, service_data|
|
210
|
+
puts "Service: #{service_name} (size: #{service_data[:size]}):"
|
211
|
+
puts "---\n\n"
|
212
|
+
puts service_data[:content]
|
213
|
+
puts "---\n\n"
|
214
|
+
end
|
202
215
|
else
|
203
|
-
raise ArgumentError, "
|
216
|
+
raise ArgumentError, "Wrong type of argument: #{name}"
|
204
217
|
end
|
205
218
|
end
|
206
219
|
|
@@ -230,16 +243,23 @@ module Procsd
|
|
230
243
|
|
231
244
|
private
|
232
245
|
|
233
|
-
def
|
234
|
-
|
246
|
+
def valid_create_options?(opts)
|
247
|
+
opts.each do |key, value|
|
235
248
|
next unless %w(user dir path).include? key
|
236
249
|
if value.nil? || value.empty?
|
237
|
-
say("Can't fetch value for --#{key}, please provide it's as an argument", :red)
|
250
|
+
say("Can't fetch value for --#{key}, please provide it's as an argument", :red)
|
251
|
+
return false
|
238
252
|
else
|
239
253
|
say("Value of the --#{key} option: #{value}", :yellow)
|
240
254
|
end
|
241
255
|
end
|
242
256
|
|
257
|
+
true
|
258
|
+
end
|
259
|
+
|
260
|
+
def perform_create
|
261
|
+
return unless valid_create_options?(options)
|
262
|
+
|
243
263
|
generator = Generator.new(@config, options)
|
244
264
|
generator.generate_units(save: true)
|
245
265
|
|
data/lib/procsd/generator.rb
CHANGED
data/lib/procsd/version.rb
CHANGED