Publish post 'Test nginx Configuration Directives' #3

Merged
ccm merged 19 commits from ccm-test-nginx into trunk 2025-06-30 22:49:28 +00:00
Showing only changes of commit c26453415d - Show all commits

View File

@ -372,19 +372,19 @@ Add a spec:
```moonscript ```moonscript
describe "https://git.domain.abc", -> describe "https://git.domain.abc", ->
it "reverse-proxies request to a gitea unix socket", -> it "reverse-proxy's request to a gitea unix socket", ->
Path = require "sitegen.path" socket = fname: "unixstreamsrvr.moon", dir: "/run/gitea", owner: "nobody"
socket_fname = "unixstreamsrvr.moon" basepath = debug.getinfo(1).short_src\match"^(.*)/[^/]*$" or "."
socket_dir = "/run/gitea" seconds = 0.1
socket_owner = "nobody"
basepath = Path.basepath debug.getinfo(1).short_src
Path.exec "install", "-o", socket_owner, "-d", socket_dir os.execute "install -o #{socket.owner} -d #{socket.dir}"
cmd = "su -s /bin/bash -c 'moon %s' %s" cmd = "su -s /bin/bash -c 'moon %s' %s"
server = io.popen cmd\format Path.join(basepath, socket_fname), socket_owner server = io.popen cmd\format "#{basepath}/#{socket.fname}", socket.owner
Path.exec "sleep", "0.1" os.execute "sleep #{seconds}"
result = Path.read_exec "find", socket_dir, "-type", "s", "-ls" f = io.popen "find #{socket.dir} -type s -ls", "r"
assert.truthy result\match "nobody%s+nogroup.+" .. Path.join(socket_dir, "gitea.socket") result = with f\read "*a"
f\close!
assert.truthy result\match "nobody%s+nogroup.+#{socket.dir}/gitea.socket"
req "https://git.domain.abc" req "https://git.domain.abc"