[x]
):The command gitea admin change-password
fails with only this message: models.SetEngine: Failed to connect to database: Unknown database type:
which leads me to believe that it isn't reading any database information from the config file. There doesn't appear to be an option to set the config file path when using the cli for this command (option looks to be available for other cli commands). I also tried copying my app.ini file into custom/conf/app.ini in a current working directory of /var/lib/gitea but got hte same error.
Maybe the --config
flag should be global instead. Since everything have to use it 馃
Running into this same issue on a FreeBSD install using Sqlite. Config file is located in /usr/local/etc/gitea/conf/app.ini
This issue is actually solved when environment variable GITEA_CUSTOM is set properly. After setting GITEA_CUSTOM=/usr/local/etc/gitea, my above example works as expected.
I've run into this too; on Arch Linux, app.ini is installed as /etc/gitea/app.ini, so even when I set GITEA_CUSTOM=/etc/gitea, the admin CLI won't work because it tries to find /etc/gitea/conf/app.ini.
Making the --config global will fix this for me.
Hello, since I couldn't find any documentation about such option (--config global
) and I couldn't manage to make it work with gitea admin change-password
, I used this to fix the issue:
sudo mkdir /etc/gitea/conf; sudo ln -s /etc/gitea/app.ini /etc/gitea/conf/app.ini
GITEA_CUSTOM=/etc/gitea git admin change-password -u user -p mynewsecurepasswd
The documentation seems somewhat inconsistent, and --custom-path
isn't a valid option. It will just error out complaining about missing value. You can export GITEA_CUSTOM
as your config path, eg /etc/gitea
, and then use --config app.ini
(as a global option).
I struggle to see the benefit of using relative paths for --config
, this should really take an absolute path. I also don't understand the changes made and referenced earlier in this issue where --config
was added (but not mentioned in official documentation, perhaps reverted?) as an argument (but referred to as an option) with overlapping naming for global options.
https://github.com/go-gitea/gitea/pull/4184/files#diff-e7eae7f3890550dab75286171f96fa07R65
Every time you use gitea
you need to use it with the config file added, like so:
gitea --config /etc/gitea/app.ini admin create-user --username ...
Most helpful comment
Maybe the
--config
flag should be global instead. Since everything have to use it 馃