Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__mailer__HOST and __mailer__FROM not considered #15894

Closed
1 of 5 tasks
floli opened this issue May 16, 2021 · 5 comments · Fixed by #15943
Closed
1 of 5 tasks

__mailer__HOST and __mailer__FROM not considered #15894

floli opened this issue May 16, 2021 · 5 comments · Fixed by #15943
Labels
topic/distribution This PR changes something about the packaging of Gitea

Comments

@floli
Copy link

floli commented May 16, 2021

  • Gitea version (or commit ref): latest stable: gitea/gitea:1
  • Git version: Docker
  • Operating system: Docker @ Debian Stable
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • [x ] No: It's an installation issue
  • Log gist:

Description

I use a docker-compose.yaml file with an environment section:

    environment:
      - GITEA__DEFAULT__APP_NAME=domain.de git
      - GITEA__server__DOMAIN=git.domain.de
      - GITEA__server__ROOT_URL=https://git.domain.de
      - GITEA__server__SSH_PORT=222
      - GITEA__mailer__ENABLED=true
      - GITEA__mailer__HOST=mail.domain.de:587
      - GITEA__mailer__FROM=git@domain.de

All of the settings are being considered in setup just fine (up to including mailer.ENABLED) but mailer.HOST and mailer.FROM are being ignored, i.e. on the setup page the fields are blank and in the configuration page of the admin interface only Enabled is shown with regard to the mailer

Logs

Show setup of a new container with gitea directory deleted and call of config page in browser:

# docker-compose up -d && docker-compose logs -f
Creating network "gitea_default" with the default driver
Creating gitea_server_1 ... done
Attaching to gitea_server_1
server_1  | Generating /data/ssh/ssh_host_ed25519_key...
server_1  | Generating /data/ssh/ssh_host_rsa_key...
server_1  | Generating /data/ssh/ssh_host_dsa_key...
server_1  | Generating /data/ssh/ssh_host_ecdsa_key...
server_1  | Could not load host certificate "/data/ssh/ssh_host_ed25519_cert": No such file or directory
server_1  | Could not load host certificate "/data/ssh/ssh_host_rsa_cert": No such file or directory
server_1  | Could not load host certificate "/data/ssh/ssh_host_ecdsa_cert": No such file or directory
server_1  | Could not load host certificate "/data/ssh/ssh_host_dsa_cert": No such file or directory
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | 2021/05/16 11:38:30 cmd/web.go:82:runWeb() [I] Starting Gitea on PID: 17
server_1  | 2021/05/16 11:38:30 ...dules/setting/git.go:101:newGit() [I] Git Version: 2.30.2, Wire Protocol Version 2 Enabled
server_1  | 2021/05/16 11:38:30 routers/init.go:93:PreInstallInit() [T] AppPath: /app/gitea/gitea
server_1  | 2021/05/16 11:38:30 routers/init.go:94:PreInstallInit() [T] AppWorkPath: /app/gitea
server_1  | 2021/05/16 11:38:30 routers/init.go:95:PreInstallInit() [T] Custom path: /data/gitea
server_1  | 2021/05/16 11:38:30 routers/init.go:96:PreInstallInit() [T] Log path: /data/gitea/log
server_1  | 2021/05/16 11:38:30 routers/init.go:97:PreInstallInit() [T] Preparing to run install page
server_1  | 2021/05/16 11:38:31 routers/init.go:100:PreInstallInit() [I] SQLite3 Supported
server_1  | 2021/05/16 11:38:31 cmd/web.go:189:listen() [I] Listen: http://0.0.0.0:3000
server_1  | 2021/05/16 11:38:31 ...s/graceful/server.go:55:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3000 on PID: 17
server_1  | 2021/05/16 11:38:31 ...s/graceful/server.go:66:func1() [D] Starting server on tcp:0.0.0.0:3000 (PID: 17)
server_1  | 2021/05/16 11:38:45 ...uters/routes/base.go:36:1() [I] Started GET / for 46.114.26.149:0
server_1  | 2021/05/16 11:38:45 ...s/context/context.go:184:HTML() [D] Template: install
server_1  | 2021/05/16 11:38:45 ...uters/routes/base.go:45:1() [I] Completed GET / 200 OK in 8.104212ms
server_1  | 2021/05/16 11:38:45 [Static] Serving /serviceworker.js
server_1  | 2021/05/16 11:38:45 ...uters/routes/base.go:36:1() [I] Started GET /serviceworker.js for 46.114.26.149:0
server_1  | 2021/05/16 11:38:45 ...uters/routes/base.go:45:1() [I] Completed GET /serviceworker.js 304 Not Modified in 185.237µs

Best Thanks!

@techknowlogick
Copy link
Member

What's the output of your app.ini look like?

@gnat
Copy link
Contributor

gnat commented May 17, 2021

The issue here maaay be the Initial Configuration GUI doesn't load some settings into the GUI itself as new defaults, so the settings passed in by environment-to-ini get overridden by the GUI itself.

Here's a few other affected settings for me in version 1.14.2:

  • GITEA__SERVICE__REQUIRE_SIGNIN_VIEW
  • GITEA__SERVICE__DISABLE_REGISTRATION
  • GITEA__MAILER__ENABLED

@floli
Copy link
Author

floli commented May 17, 2021

My app.ini reflects the settings from the environment variables:

[mailer]
ENABLED = false
FROM    = git@domain.de
HOST    = mail.domain.de:587

I was a bit confused, because the configuration admin web page only shows the enabled settings, not FROM or HOST.

I am also not able to set the APP_NAME. Using the setting above results in

[default]
APP_NAME = domain.de git

which has no effect. Using the environment variable GITEA__APP_NAME=domain.de git has no effect either.

@gnat
Copy link
Contributor

gnat commented May 17, 2021

Yup APP_NAME... this all smells like the Initial Configuration GUI is not pre-populating with environment-to-ini (or app.ini in general).

For reference my environment is Gitea 1.14.2 with MySQL 8.0 and have the same issue.

@d3m1gd
Copy link

d3m1gd commented May 19, 2021

can confirm that GITEA__service__DISABLE_REGISTRATION=true not having any effect, both gui setup and ini file have false in this field.

as for APP_NAME, this works for me: GITEA____APP_NAME=Gitea, notice the 4 underscores

zeripath added a commit to zeripath/gitea that referenced this issue May 21, 2021
NewContext does not set the mailer or service settings so add
a new function that will run this.

Fix go-gitea#15894

Signed-off-by: Andrew Thornton <art27@cantab.net>
techknowlogick pushed a commit that referenced this issue Jun 16, 2021
…15943)

* Ensure settings for Service and Mailer are read on the install page

NewContext does not set the mailer or service settings so add
a new function that will run this.

Fix #15894

Signed-off-by: Andrew Thornton <art27@cantab.net>

* placate lint

Signed-off-by: Andrew Thornton <art27@cantab.net>
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 10, 2021
…o-gitea#15943)

* Ensure settings for Service and Mailer are read on the install page

NewContext does not set the mailer or service settings so add
a new function that will run this.

Fix go-gitea#15894

Signed-off-by: Andrew Thornton <art27@cantab.net>

* placate lint

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
@delvh delvh added topic/distribution This PR changes something about the packaging of Gitea and removed theme/docker labels Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/distribution This PR changes something about the packaging of Gitea
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants