From ArchWiki
Latest comment: 19 March 2022 by Andreymal

During installation, the server refuses to overwrite /etc/gogs/app.ini : it says "read-only filesystem" in spite of the chown command. And if I try to modify the file manually, it still keeps redirecting to myhost.local:3000/install each time: it won't complete the installation until the file can be written from the web interface. So the instructions do not work as written here on the wiki. But if you go read it says

"So how do you create a custom configuration if you are not allowed to edit conf/app.ini? Well, create custom/conf/app.ini then! Corresponding keys in corresponding sections in custom/conf/app.ini will overwrite the values set in conf/app.ini."

But they don't give the full path! But I found that it works OK if I use /var/lib/gogs/custom/app.ini. I had to modify /usr/lib/systemd/system/gogs.service to tell it to use that one instead, and restart, and chown -R on that directory too: then and only then is myhost.local:3000/install actually able to modify its own config file.

Of course /etc is the right place for config files actually, but there must be something in the code that insists that it will be stored in a directory called "custom", or maybe even that the "custom" directory must be under the top-level storage directory?

—This unsigned comment is by Ecloud (talk) 20:15, 19 March 2022 (UTC). Please sign your posts with ~~~~!Reply[reply]

This is because gogs.service uses ProtectSystem=full since 2018 (git commit). It can be worked around by using ReadWritePaths=/etc/gogs which I just described in Gogs#First start (not sure if this is a correct solution, but it works). -- andreymal (talk) 21:07, 19 March 2022 (UTC)Reply[reply]