[Bug 278855] www/forgejo 1.21.10.0_1 does not start

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 09 May 2024 14:23:24 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278855

--- Comment #1 from Stefan Bethke <stb@lassitu.de> ---
You are correct. With forgejo-1.21.10.0_1, a service forgejo start does not
report anything, and no process is running.

If I create /usr/local/etc/syslog.d/forgejo.conf with this contents:
!forgejo
*.*     /var/log/forgejo.log

and create the file and kick syslogd, I get this at the next attempt to start
forgejo:
May  9 16:14:02 fbsd14 forgejo[1382]: 2024/05/09 16:14:02
cmd/web.go:242:runWeb() [I] Starting Forgejo on PID: 1383
May  9 16:14:02 fbsd14 forgejo[1382]: 2024/05/09 16:14:02
...es/setting/oauth2.go:147:loadOAuth2From() [F] save oauth2.JWT_SECRET failed:
failed to save "/usr/local/etc/forgejo/conf/app.ini": open
/usr/local/etc/forgejo/conf/app.ini: permission denied

So the issue is that the config file is missing some information that forgejo
is trying to add itself, but since the config file is not writeable by the git
user by default, this fails.

This is due to changes that were made to the default app.ini that now contain
"CHANGE_ME" instead of valid secrets, leading to exactly this startup problem.

Additionally, gitea/forgejo have historically lacked a method to check the
config file for verifying the config. I will try and add forgejo doctor to the
start script to make it easier to diagnose when the config is invalid.

-- 
You are receiving this mail because:
You are the assignee for the bug.