From 02d17d1b115dc0db8e957b221399575d445c2056 Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Sat, 14 Jun 2025 11:04:33 -0700 Subject: [PATCH] Run socket server as user nobody in reverse-proxy spec --- spec/nginx_spec.moon | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/nginx_spec.moon b/spec/nginx_spec.moon index 8dc754c..2d79503 100644 --- a/spec/nginx_spec.moon +++ b/spec/nginx_spec.moon @@ -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"