Compare commits

..

No commits in common. "63d3bf5f66a6de52163adb4a7a0562f05f233e68" and "5ef0ee912f3a5f977e7422fa8c208399538b40fa" have entirely different histories.

6 changed files with 11 additions and 27 deletions

View file

@ -7,7 +7,6 @@ require 'fileutils'
require 'open3'
# make for: the user, system, package
# user/usr, system/sys, package/pkg
# as regular user, if dependencies provided
# user: $HOME/.local

View file

@ -1,5 +0,0 @@
module User
end

View file

@ -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

View file

@ -3,12 +3,7 @@ require 'erb'
class NGINXProxy
class << self
attr_accessor :domain, :port, :service, :user, :willcard
def willcard(value = nil)
@willcard = value unless value.nil?
@willcard
end
attr_accessor :domain, :port, :service, :user
def domain(value = nil)
@domain = value unless value.nil?
@ -32,11 +27,8 @@ class NGINXProxy
@service
end
## bundle exec rackup -s puma -b unix:///run/user/1000/http.sock
def generate
template_path = File.join(__dir__, 'data', 'templates', 'nginx', 'proxy.erb')
template = File.read(template_path)
template = File.read("proxy.erb")
template = ERB.new(template)
template.result(binding)
end
@ -56,3 +48,12 @@ class NGINXProxy
end
end
class ExampleProxy < NGINXProxy
domain "gurgul.org"
service "forgejo"
user "git"
port 3000
end
puts ExampleProxy.generate
puts ExampleProxy.path