Docker template overriding not working


#1

I have been at this for hours and now i give up.
I have followed the documentation to the letter but i CAN NOT get template overriding to work.

Here is a tree of the files:

under gitea (which is next to git & ssh)

custom/
├── public
│   └── img
│       └── unialt-logo-large.png
└── templates
    ├── custom
    │   └── home.tmpl
    └── home.tmpl

Custom is located under /data/gitea as explained in the documentation, as you can see from som leftovers I have tried multiple solutions to see if I am missing something.

home.tmpl:

{{template "base/head" .}}

<img style="text-align:center;" src="{{AppSubUrl}}/img/unialt-icon-large.png" alt="Unialt Logo">

{{template "base/footer" .}}

It should be a very simple override but I cant even see my static file.


#2

Search in the Git repo for help. You’re probably in the wrong directory. Take a break and use fresh eyes.


#3

I dont think there’s much more I can do. The first thing i did was go through the issues, and there are plenty related to the templates and docker that has to do with file structure. But this is not the case with me (I hope):

bash-4.4# ls
Makefile  bin       dev       home      media     proc      run       srv       tmp       var
app       data      etc       lib       mnt       root      sbin      sys       usr
bash-4.4# ls data
custom  git     gitea   ssh
bash-4.4# ls data/gitea/
avatars   conf      custom    indexers  log       sessions
bash-4.4# ls data/gitea/custom/
home.tmpl  public     templates
bash-4.4# ls data/gitea/custom/templates/
custom     home.tmpl
bash-4.4# ls data/gitea/custom/templates/custom/
home.tmpl
bash-4.4# printenv
DB_HOST=db:3306
HOSTNAME=c5dbfe80e3df
DB_USER=gitea
USER=git
PWD=/
HOME=/root
GITEA_CUSTOM=/data/gitea
USER_UID=1000
USER_GID=1000
TERM=xterm
DB_PASSWD=gitea
SHLVL=1
DB_NAME=gitea
DB_TYPE=mysql
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/bin/printenv

This is from inside the container with “GITEA_CUSTOM” variable set. I’ve also tried /data/gitea/custom and not setting it at all. I am definitely out of options…


#4

Are you able to put the file as /data/gitea/public/img/unialt-logo-large.png? and for templates /data/gitea/templates/home.tmpl?


#5

Yep, that works…
I get it now, but someone should really concrete the documentation on this. Can I (I will look later).

Thanks! I owe you a beer!