Where is the "custom" folder inside a docker installation?


#1

Hi

I installed gitea with docker; however, the custom folder is missing. I tried to find it by using the ‘find’ command, but it is not there. First, I created a for my gitea installation. It is called gitea and its home directory is located in: /home/gitea

Then I put the following inside: /home/gitea/docker-compose.yml

version: "2"

networks:
  gitea:
    external: false

services:
  server:
    image: gitea/gitea:latest
    environment:
      - USER_UID=117
      - USER_GID=124
    restart: always
    networks:
      - gitea
    volumes:
      - ./gitea:/data
    ports:
      - "3000:3000"
      - "222:22"

Then I started it:
cd /home/gitea
docker-compose up -d

it created this ugly folder structure :thinking:

/home/gitea/
└── gitea
    ├── git
    │   ├── lfs
    │   └── repositories
    │       └── adminjm
    │           └── jmeile.git
    │               ├── branches
    │               ├── hooks
    │               │   ├── post-receive.d
    │               │   ├── pre-receive.d
    │               │   └── update.d
    │               ├── info
    │               ├── objects
    │               │   ├── 00
    │               │   ├── 80
    │               │   ├── 9e
    │               │   ├── bf
    │               │   ├── info
    │               │   └── pack
    │               └── refs
    │                   ├── heads
    │                   └── tags
    ├── gitea
    │   ├── avatars
    │   ├── conf
    │   ├── indexers
    │   │   └── issues.bleve
    │   ├── log
    │   └── sessions
    │       ├── 2
    │       │   └── 0
    │       └── f
    │           └── 6
    └── ssh

I said ugly because if you want to access app.ini, you have to go to: /home/gitea/gitea/gitea
Anyway, I guess this is something I will try to fix.

After that, I setup an apache reverse proxy:

<VirtualHost *:443>
    ServerName myhost-mydomain-com
    .... Some other things like SSL & Rewrite config go here ....
    <Proxy *>
            Require all granted
    </Proxy>
    SSLProxyEngine on
    # Note: no trailing slash after either /gitea or port
    ProxyPass /gitea myhost-mydomain-com : 3000
    ProxyPassReverse /gitea myhost-mydomain-com : 3000
</VirtualHost>

Then I restarted apache and stoped gitea:

service apache2 restart
cd /home/gitea
docker-compose down

Next I added this to app.ini:

[server]
ROOT_URL = myhost-mydomain-com / gitea

Then I started gitea again:

docker-compose up -d

and I went to the web link

myhost-mydomain-com /gitea

I could setup it by clicking on sign-in and using this options:

Database Type: SQLite3
Path: /data/git/repositories
Site Title: Gitea server
Repository Root Path: /data/git/repositories
Git LFS Root Path: /data/git/lfs
Run As Username: git -> yes, I don't use "gitea". This one is inside the docker-image
SSH Server Domain: mydomain-com
SSH Server Port: 22
Gitea HTTP Listen Port: 3000
Gitea Base URL: myhost-mydomain-com /gitea
Log Path: /data/gitea/log

Under “Optional Settings” I setup another not relevant things to this problem, ie: “Email Settings”. I disabled most of the “Server and Third-Party Service Settings”. Finally I setup my admin user and password under: “Administrator Account Settings” and hit: “Install Gitea”

Then I just thought about customizing some pages, but first I just needed to find the custom folder. A search inside /home/gitea didn’t find anything. I tried to create the folder on several places:

/home/gitea/gitea/gitea/custom
/home/gitea/gitea/custom
/home/gitea/custom

Then I put a file called “my_file.txt” with some random contents inside those folders. then I set the right permissions:

chown -R gitea:gitea /home/gitea

And restarted gitea:

cd /home/gitea
docker-compose down
docker-compose up -d

I tried to access that file:

myhost-mydomain-com /gitea/my_file.txt

But the only thing I get is a 404 error. What am I missing?

Note: since I can’t enter more than two links, they are separated with spaces and dashes

Thanks in advanced

Best regards
Josef


#2

The custom folder may not be called custom. Try reading the docs again and look for issues where people customized with Docker for your answer.


#3

I tried looking the forum for such problems with Docker, but I didn’t find much information. Regarding:

“The custom folder may not be called custom”

Yes, there is a variable, when I go insider the docker container:

GITEA_CUSTOM=/data/gitea

Outside the docker container, the “/data/gitea” folder is located under: /home/gitea/gitea/gitea. I already put a file there, but the webserver still says 404 not found.

So, I guess, I will try insalling the binary instead of docker. For me docker seems to be easier, but it is not.

Best regards
Josef