Add tests for nginx.conf directives #1
@ -104,14 +104,20 @@ describe "http://miti.sh/posts", ->
|
|||||||
assert.same request\body!\match("<title>(.*)</title>"), "miti.sh · Posts"
|
assert.same request\body!\match("<title>(.*)</title>"), "miti.sh · Posts"
|
||||||
|
|
||||||
describe "http://git.miti.sh", ->
|
describe "http://git.miti.sh", ->
|
||||||
it "reverse proxies request to unix socket", ->
|
it "reverse proxies request to gitea through a unix socket", ->
|
||||||
os.execute "mkdir /run/gitea"
|
Path = require "sitegen.path"
|
||||||
p = io.popen "luajit unixstreamsrvr.lua"
|
filename = "unixstreamsrvr.lua"
|
||||||
os.execute("sleep 1")
|
socket_dir = "/run/gitea"
|
||||||
os.execute("chown -R nobody /run/gitea")
|
info = debug.getinfo 1
|
||||||
|
basepath = Path.basepath info.short_src
|
||||||
|
|
||||||
|
os.execute "mkdir " .. socket_dir
|
||||||
|
p = io.popen "luajit %s"\format Path.join basepath, filename
|
||||||
|
os.execute "sleep 0"
|
||||||
|
os.execute "chown -R nobody " .. socket_dir
|
||||||
|
|
||||||
request = req "http://git.miti.sh"
|
request = req "http://git.miti.sh"
|
||||||
assert.is_not_nil p\read"*a"\match "Host: git.miti.sh"
|
assert.truthy p\read"*a"\match "Host: git.miti.sh"
|
||||||
|
|
||||||
describe "http://apps.miti.sh", ->
|
describe "http://apps.miti.sh", ->
|
||||||
it "doesn't find it", ->
|
it "doesn't find it", ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user