TZAG, I'm currently trying to deploy Sourcehut and I've run into an issue. Any time I to create a new repo, I experience the following error: mkdir /var/lib/git/~slips: permission denied This happens irregardless of the permissions the directory in question is set to, and the message strangely doesn't change even when the repo directory does, always pointing to /var/lib/git. For context, here's my config.ini (sensitive strings redacted): https://null.slipfox.xyz/Ep.ini No logs are written to either git.sr.ht.log or git.sr.ht-api.log when this occurs. Assistance would be appreciated.
On Mon Nov 14, 2022 at 5:45 AM GMT, Slips wrote: > mkdir /var/lib/git/~slips: permission denied The git.sr.ht API will create repos on the filesystem as whatever user you're running it as. Are you perhaps running it using your own user? When running `./api/api`, make sure to run it as the git user. You could, for example, do `doas -u git ./api/api`.
> The git.sr.ht API will create repos on the filesystem as whatever user > you're running it as.It's running as git, as far as I can tell, since that's the default user it runs as in the OpenRC service, and htop shows git as the process owner for both the regular and API processes. > You could, for example, do `doas -u git ./api/api`. These instructions sound like they're for running directly from the repo, which I am not. I am using the Alpine packages. P.S. My apologies for originally sending this email directly to you instead of over the ML, I'm not used to working in Mailing Lists.
On Mon Nov 14, 2022 at 7:40 PM GMT, Slips wrote: > > The git.sr.ht API will create repos on the filesystem as whatever user > > you're running it as.It's running as git, as far as I can tell, since > > that's the default user > it runs as in the OpenRC service, and htop shows git as the process > owner for both the regular and API processes. Ah, I see, I had misunderstood your issue. If you are getting a permissions error, it would be quite surprising if the issue was not a permissions issue. Just to confirm, do you still get the error if you set the following? ``` doas chmod o+x /var /var/lib doas chown -R git:git /var/lib/git doas chmod -R 777 /var/lib/git ``` Can you replicate the permissions issue in any way if you `doas -u git -s` then try to create the directory yourself?
doas chmod o+x /var /var/lib doas chown -R git:git /var/lib/git doas chmod -R 777 /var/lib/git I do still experience this issue after running these commands. I cannot replicate this issue when running mkdir from the git user, it works perfectly fine there. Just to confirm that the service users are running as git, here's a screenshot of my bpytop: https://null.slipfox.xyz/EA.png
I solved the issue, it was PEBKAC. You see, I've been running the Sourcehut services through an Alpine LXC (Linux Container) this whole time, and one of consequences of that is I have to pass the ports sourcehut uses through to the host server so I can proxy via nginx. I just checked and I had a separate instance of the API service running on the host machine which was taking all of the API requests I was making. I turned off that service and that error has been solved. This of course led to another error which I will discuss on either the IRC or a separate thread. Thank you for the help.