go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.11k stars 5.49k forks source link

welcome/install page sqlite path textbox default should be absolute #3459

Closed siochs closed 2 years ago

siochs commented 6 years ago

Description

On Server:

$GiteaHome=/local/gitea
useradd -r -s /bin/bash -d $GiteaHome -m git
wget https://dl.gitea.io/gitea/master/gitea-master-linux-amd64 -O $GiteaHome/bin/gitea
chmod +x $GiteaHome/bin/gitea
chown -R git:git $GiteaHome
$GiteaHome/bin/gitea web

Browse welcome page, select SQLite and leave all the defaults. Create a rummy repo called testrepo. Add a public key for ssh authentication in Administration page. Then try this on the client:

git clone git@myserver:myuser/testrepo.git .
Cloning into '.'...
Gitea: Internal error
Failed to get repository: no such table: repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

This error can be fixed by editing /local/gitea/bin/custom/conf/app.ini

[database]
DB_TYPE  = sqlite3
HOST     = 127.0.0.1:3306
NAME     = gitea
USER     = gitea
PASSWD   =
SSL_MODE = disable
PATH     = /local/gitea/data/gitea.db (<- was data/gitea.db)

Well, this is not really a bug. But I think it would be nice to have the absolute path as default in the textbox for the database path on the welcome/install page: image

Note

This does not happen when running from docker:

docker run -p 3000:3000 gitea/gitea:latest

image

thehowl commented 6 years ago

I disagree. Having a relative path is actually useful if moving gitea (its entire directory) to a new folder, or migrating the server. The docker image already handles the case and uses an absolute path from the configuration specified in the dockerfile.

techknowlogick commented 2 years ago

This is now the case