custom/conf/app.ini seems not working #895

Closed
opened 2025-11-02 03:40:39 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @twang2218 on GitHub (Jul 17, 2017).

  • Gitea version (or commit ref): 1.1.2
  • Git version: 2.8.5
  • Operating system: Docker
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I'm going to run the gitea stack inside docker, and I followed the customize guide to config the settings, /data/gitea/custom/conf/app.ini, here is the my custom settings:

APP_NAME = Gitea: 开发团队
RUN_USER = git
RUN_MODE = prod

[ui.meta]
AUTHOR = 开发团队
DESCRIPTION = 危险勿入‼️

[server]
SSH_DOMAIN = dev.example.org
HTTP_PORT  = 80
ROOT_URL   = http://dev.example.org/
DISABLE_SSH = false
SSH_PORT = 2222

[database]
DB_TYPE = postgres
HOST = database:5432
NAME = gitea
USER = gitea
PASSWD = gitea_password
SSL_MODE = disable

[security]
INSTALL_LOCK = true

And then I use the docker-compose.yml to start the stack:

version: '3.3'

volumes:
    gitea: {}
    db: {}

configs:
    init-db-script:
        file: ./init-db.sh
    gitea-custom-ini:
        file: ./gitea.ini

services:
    gitea:
        image: gitea/gitea:1.1.2
        depends_on: [ database ]
        ports:
            - "2222:2222"
            - "3000:80"
        configs:
            - source: gitea-custom-ini
              target: /data/gitea/custom/conf/app.ini
        volumes:
            - gitea:/data

    database:
        image: postgres:9.6
        volumes:
            - db:/var/lib/postgresql/data
        configs:
            - source: init-db-script
              target: /docker-entrypoint-initdb.d/init-user-db.sh
        environment:
            POSTGRES_PASSWORD: my_db_password

However, when I started the stack by docker stack deploy -c stack.yml dev, I found my custom app.ini is not working.

First the gitea service is running at 3000 port, which is the default one. Second, when I changed the port mapping, 3000:3000 and visit localhost:3000, it redirect me to the install page, and totally ignored my custom settings.

After I followed the install page, I found all my setting have been written to /data/gitea/conf/app.ini, it seems the /data/gitea/custom/conf/app.ini is useless for custom settings.

Screenshots

If this issue involves the Web Interface, please include a screenshot

Originally created by @twang2218 on GitHub (Jul 17, 2017). - Gitea version (or commit ref): 1.1.2 - Git version: 2.8.5 - Operating system: Docker - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description I'm going to run the gitea stack inside docker, and I followed the [customize guide](https://docs.gitea.io/en-us/config-cheat-sheet/) to config the settings, `/data/gitea/custom/conf/app.ini`, here is the my custom settings: ```ini APP_NAME = Gitea: 开发团队 RUN_USER = git RUN_MODE = prod [ui.meta] AUTHOR = 开发团队 DESCRIPTION = 危险勿入‼️ [server] SSH_DOMAIN = dev.example.org HTTP_PORT = 80 ROOT_URL = http://dev.example.org/ DISABLE_SSH = false SSH_PORT = 2222 [database] DB_TYPE = postgres HOST = database:5432 NAME = gitea USER = gitea PASSWD = gitea_password SSL_MODE = disable [security] INSTALL_LOCK = true ``` And then I use the `docker-compose.yml` to start the stack: ```yml version: '3.3' volumes: gitea: {} db: {} configs: init-db-script: file: ./init-db.sh gitea-custom-ini: file: ./gitea.ini services: gitea: image: gitea/gitea:1.1.2 depends_on: [ database ] ports: - "2222:2222" - "3000:80" configs: - source: gitea-custom-ini target: /data/gitea/custom/conf/app.ini volumes: - gitea:/data database: image: postgres:9.6 volumes: - db:/var/lib/postgresql/data configs: - source: init-db-script target: /docker-entrypoint-initdb.d/init-user-db.sh environment: POSTGRES_PASSWORD: my_db_password ``` However, when I started the stack by `docker stack deploy -c stack.yml dev`, I found my custom app.ini is not working. First the `gitea` service is running at `3000` port, which is the default one. Second, when I changed the port mapping, `3000:3000` and visit `localhost:3000`, it redirect me to the install page, and totally ignored my custom settings. After I followed the `install` page, I found all my setting have been written to `/data/gitea/conf/app.ini`, it seems the `/data/gitea/custom/conf/app.ini` is useless for custom settings. ## Screenshots **If this issue involves the Web Interface, please include a screenshot**
GiteaMirror added the type/docs label 2025-11-02 03:40:39 -06:00
Author
Owner

@lafriks commented on GitHub (Jul 17, 2017):

That is because in Dockerfile it is defined that custom folder is ENV GITEA_CUSTOM /data/gitea so /data/gitea is treated as custom folder and final location of app.ini is /data/gitea/conf/app.ini

@lafriks commented on GitHub (Jul 17, 2017): That is because in Dockerfile it is defined that custom folder is `ENV GITEA_CUSTOM /data/gitea` so `/data/gitea` is treated as custom folder and final location of app.ini is `/data/gitea/conf/app.ini`
Author
Owner

@twang2218 commented on GitHub (Jul 17, 2017):

Oh, thank you. Now I tried to mount it on /data/gitea/conf/app.ini, the /install page has gone. app.ini works as expected, Great.

I think this info should be put in either https://docs.gitea.io/en-us/install-with-docker/ or https://docs.gitea.io/en-us/config-cheat-sheet/ to avoid future confusion.

@twang2218 commented on GitHub (Jul 17, 2017): Oh, thank you. Now I tried to mount it on `/data/gitea/conf/app.ini`, the `/install` page has gone. `app.ini` works as expected, Great. I think this info should be put in either https://docs.gitea.io/en-us/install-with-docker/ or https://docs.gitea.io/en-us/config-cheat-sheet/ to avoid future confusion.
Author
Owner

@lafriks commented on GitHub (Jul 17, 2017):

It is docker specific so should be put into docker install documentation

@lafriks commented on GitHub (Jul 17, 2017): It is docker specific so should be put into docker install documentation
Author
Owner

@lafriks commented on GitHub (Jul 17, 2017):

@twang2218 this should be ok?

@lafriks commented on GitHub (Jul 17, 2017): @twang2218 this should be ok?
Author
Owner

@twang2218 commented on GitHub (Jul 17, 2017):

Yes, thank you very much. With such information added, my issue will not become others' issue anymore. That's great, thank for your quick response, have a nice day. And I'm closing this issue now.

@twang2218 commented on GitHub (Jul 17, 2017): Yes, thank you very much. With such information added, my issue will not become others' issue anymore. That's great, thank for your quick response, have a nice day. And I'm closing this issue now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#895