Can't find / change CustomPath

I’ve deployed Gitea on a Debian server.

Now I wanted to customize some elements. I know how to do that, it is written very clearly in the docs.

However, I can’t find or change the “custom” directory (CustomPath).

I know I should be able to find it with gitea --help. But that shows me:

DEFAULT CONFIGURATION:
     CustomPath:  /usr/local/bin/custom 
     CustomConf:  /usr/local/bin/custom/conf/app.ini
     AppPath:     /usr/local/bin/gitea
     AppWorkPath: /usr/local/bin

And this looks very weird to me.

  1. /usr/local/bin is where you want to store software such as the Gitea binary. Why on eath would you want to store some HTML templates there? So I assume this can’t be right. I created some templates there but Gitea didn’t pick up these changes. Then I deleted this whole config folder… but there was an app.ini… Was this bad? I guess not because I have all my configuration put in /etc/gitea/app.ini?

  2. CustomConf seems to be wrong to. I have my app.ini stored in /etc/gitea/app.ini

I run Gitea through a systemd service with --config /etc/gitea/app.ini enabled. I tried to also put --custom-path /etc/gitea/custom or Environment=GITEA_CUSTOM=/etc/gitea/custom here but this doesn’t work either. I will receive the following error if I start/stop the service:

sh: 0: getcwd() failed: No such file or directory

However the service is running after that. But gitea --help still does show the old paths. Or will this always show the default paths? Maybe I misunderstood this?

Edit:
In the Webinterface Admin settings it says /var/lib/gitea/custom… completely different than gitea --help. I guess I’ll try that tomorrow.

When running the Gitea binary you always need to provide it with the path to your app.ini and any pertinent environment variables (such as those set in the systemd unit), otherwise Gitea falls back to defaults.

But isn’t that exactly what I did?
I’ve put --config /etc/gitea/app.ini in the systemd file.
And that works. It reads the correct config file.

However if I either put the additional parameter --custom-path /etc/gitea/custom or the environment variable GITEA_CUSTOM=/etc/gitea/custom this doesn’t work. Gitea doesn’t pick up templates from /etc/gitea/custom/template/… (Yes I did systemctl daemon-reload)

btw. from what I’ve read it should be enough to only pass --custom-path /etc/gitea and don’t set the --config parameter? This should expect the config in /etc/gitea/conf/app.ini according to the docs? I’ve also tried that also but Gitea won’t recognize the config file and wants to start a new setup.

If you mean I should run gitea help --config xxx --custom-path xxx instead of gitea help to show the correct paths… this doesn’t work either. It is still /usr/bin/custom. And it throws an error that --custom-path isn’t an option or so. (Can tell exactly the error tonight if needed)