Compare commits
No commits in common. "63d3bf5f66a6de52163adb4a7a0562f05f233e68" and "5ef0ee912f3a5f977e7422fa8c208399538b40fa" have entirely different histories.
63d3bf5f66
...
5ef0ee912f
6 changed files with 11 additions and 27 deletions
|
@ -7,7 +7,6 @@ require 'fileutils'
|
||||||
require 'open3'
|
require 'open3'
|
||||||
|
|
||||||
# make for: the user, system, package
|
# make for: the user, system, package
|
||||||
# user/usr, system/sys, package/pkg
|
|
||||||
|
|
||||||
# as regular user, if dependencies provided
|
# as regular user, if dependencies provided
|
||||||
# user: $HOME/.local
|
# user: $HOME/.local
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
|
|
||||||
module User
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
|
@ -1,11 +0,0 @@
|
||||||
require 'nginx'
|
|
||||||
|
|
||||||
class ExampleProxy < NGINXProxy
|
|
||||||
domain "gurgul.org"
|
|
||||||
service "forgejo"
|
|
||||||
user "git"
|
|
||||||
port 3000
|
|
||||||
end
|
|
||||||
|
|
||||||
puts ExampleProxy.generate
|
|
||||||
puts ExampleProxy.available_path
|
|
|
@ -3,12 +3,7 @@ require 'erb'
|
||||||
|
|
||||||
class NGINXProxy
|
class NGINXProxy
|
||||||
class << self
|
class << self
|
||||||
attr_accessor :domain, :port, :service, :user, :willcard
|
attr_accessor :domain, :port, :service, :user
|
||||||
|
|
||||||
def willcard(value = nil)
|
|
||||||
@willcard = value unless value.nil?
|
|
||||||
@willcard
|
|
||||||
end
|
|
||||||
|
|
||||||
def domain(value = nil)
|
def domain(value = nil)
|
||||||
@domain = value unless value.nil?
|
@domain = value unless value.nil?
|
||||||
|
@ -32,11 +27,8 @@ class NGINXProxy
|
||||||
@service
|
@service
|
||||||
end
|
end
|
||||||
|
|
||||||
## bundle exec rackup -s puma -b unix:///run/user/1000/http.sock
|
|
||||||
|
|
||||||
def generate
|
def generate
|
||||||
template_path = File.join(__dir__, 'data', 'templates', 'nginx', 'proxy.erb')
|
template = File.read("proxy.erb")
|
||||||
template = File.read(template_path)
|
|
||||||
template = ERB.new(template)
|
template = ERB.new(template)
|
||||||
template.result(binding)
|
template.result(binding)
|
||||||
end
|
end
|
||||||
|
@ -56,3 +48,12 @@ class NGINXProxy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class ExampleProxy < NGINXProxy
|
||||||
|
domain "gurgul.org"
|
||||||
|
service "forgejo"
|
||||||
|
user "git"
|
||||||
|
port 3000
|
||||||
|
end
|
||||||
|
|
||||||
|
puts ExampleProxy.generate
|
||||||
|
puts ExampleProxy.path
|
Loading…
Add table
Add a link
Reference in a new issue