mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +00:00
make hostname configurable
This commit is contained in:
parent
c905f5c414
commit
ff0b565cc5
1 changed files with 3 additions and 2 deletions
|
|
@ -12,6 +12,7 @@ CONFIG_DEFAULTS = {
|
||||||
dry_run: false,
|
dry_run: false,
|
||||||
path: File.expand_path('../test-blog', __FILE__),
|
path: File.expand_path('../test-blog', __FILE__),
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
|
hostname: nil,
|
||||||
port: 6706,
|
port: 6706,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -54,8 +55,8 @@ def authenticated?(auth)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
real_host = $config[:host] == '0.0.0.0' ? 'h.samhuri.net' : $config[:host]
|
host = $config[:hostname] || $config[:host]
|
||||||
$url_root = "http://#{real_host}:#{$config[:port]}/"
|
$url_root = "http://#{host}:#{$config[:port]}/"
|
||||||
def url_for(*components)
|
def url_for(*components)
|
||||||
File.join($url_root, *components)
|
File.join($url_root, *components)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue