Run socket server as user nobody in reverse-proxy spec

This commit is contained in:
Catalin Constantin Mititiuc 2025-06-14 11:04:33 -07:00
parent a14be2cbde
commit 02d17d1b11

View File

@ -117,12 +117,12 @@ describe "https://git.miti.sh", ->
socket_owner = "nobody"
basepath = Path.basepath debug.getinfo(1).short_src
Path.mkdir socket_dir
server = io.popen "moon %s"\format Path.join(basepath, socket_fname)
Path.exec "install", "-o", socket_owner, "-d", socket_dir
cmd = "su -s /bin/bash -c 'moon %s' %s"
server = io.popen cmd\format Path.join(basepath, socket_fname), socket_owner
Path.exec "sleep", "0.1"
Path.exec "chown", "-R", socket_owner, socket_dir
result = Path.read_exec "find", socket_dir, "-type", "s", "-ls"
assert.truthy result\match "nobody%s+root.+" .. Path.join(socket_dir, "gitea.socket")
assert.truthy result\match "nobody%s+nogroup.+" .. Path.join(socket_dir, "gitea.socket")
req "https://git.miti.sh"