[x]
):If I create users via CLI, I can login with them but I'm not able to create repo or organizations (500 error). These are the following logs. The GETs for images and css are removed for readability.
scm_1 | [Macaron] 2018-08-30 12:08:22: Started POST /user/login for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:08:22: Completed POST /user/login 302 Found in 37.081795ms
scm_1 | [Macaron] 2018-08-30 12:08:22: Started GET / for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:08:22: Completed GET / 200 OK in 7.359742ms
scm_1 | [Macaron] 2018-08-30 12:08:23: Started GET /api/v1/repos/search?uid=3&q=&limit=15&mode= for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:08:23: Completed GET /api/v1/repos/search?uid=3&q=&limit=15&mode= 200 OK in 1.277463ms
scm_1 | [Macaron] 2018-08-30 12:08:28: Started GET /repo/create for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:08:28: Completed GET /repo/create 200 OK in 10.016899ms
scm_1 | [Macaron] 2018-08-30 12:08:44: Started POST /repo/create for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:08:44: Completed POST /repo/create 404 Not Found in 6.4625ms
Users registered via UI are able to do these actions. Following logs:
scm_1 | [Macaron] 2018-08-30 12:06:35: Started GET /user/login?redirect_to=%2fgitea for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:06:35: Completed GET /user/login?redirect_to=%2fgitea 200 OK in 6.500791ms
scm_1 | [Macaron] 2018-08-30 12:06:39: Started POST /user/login for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:06:39: Completed POST /user/login 302 Found in 30.6528ms
scm_1 | [Macaron] 2018-08-30 12:06:39: Started GET / for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:06:39: Completed GET / 200 OK in 8.813589ms
scm_1 | [Macaron] 2018-08-30 12:06:39: Started GET /api/v1/repos/search?uid=1&q=&limit=15&mode= for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:06:39: Completed GET /api/v1/repos/search?uid=1&q=&limit=15&mode= 200 OK in 2.21234ms
scm_1 | [Macaron] 2018-08-30 12:06:50: Started GET /repo/create for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:06:50: Completed GET /repo/create 200 OK in 14.413634ms
scm_1 | [Macaron] 2018-08-30 12:07:00: Started POST /repo/create for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:07:00: Completed POST /repo/create 302 Found in 151.862962ms
scm_1 | [Macaron] 2018-08-30 12:07:00: Started GET /bla/iamgrooot for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:07:00: Completed GET /bla/iamgrooot 200 OK in 30.998872ms
scm_1 | [Macaron] 2018-08-30 12:07:05: Started GET /user/logout for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:07:05: Completed GET /user/logout 302 Found in 2.907559ms
scm_1 | [Macaron] 2018-08-30 12:07:05: Started GET / for 172.18.0.1
scm_1 | [Macaron] 2018-08-30 12:07:05: Completed GET / 200 OK in 3.796085ms
The users were created with these commands:
gitea admin create-user --name celine --password test --email [email protected]
gitea admin change-password --username celine --password test123
This is the gitea.log:
2018/08/31 11:22:24 [...routers/repo/repo.go:146 handleCreateError()] [E] CreatePost: initRepository: InitRepository: chdir /data/git/repositories/giteauser/123456789.git: no such file or directory
This is the repo directory:
bash-4.4# ls -la /data/git/repositories/
total 24
drwxr-xr-x 6 git git 4096 Aug 31 11:22 .
drwxr-xr-x 5 git git 4096 Aug 31 11:14 ..
drwxr-xr-x 2 root root 4096 Aug 31 11:21 celine
drwxr-xr-x 3 git git 4096 Aug 31 11:23 groot
drwxr-xr-x 2 git git 4096 Aug 31 11:11 root
So it seems like using Gitea CLI it doesn't create the repo folder like it should for the git user. My app.ini has the env RUN_USER = git
.. But it doesn't seem to work right. Manually chown
of the folder seems to resolve the problem..
I think CreateUser shouldn't pre-create user directory in repositories directory, instead this directory should be autocreated when first user's repo is created/cloned.
All operations that involves user's directory should check it's existence and auto-create this directory if it's really needed or skip working with it if it's not.
This will solve problem if user is created externally by not same user as gitea is run under.
Great idea, thank you :) :+1:
Most helpful comment
I think CreateUser shouldn't pre-create user directory in repositories directory, instead this directory should be autocreated when first user's repo is created/cloned.
All operations that involves user's directory should check it's existence and auto-create this directory if it's really needed or skip working with it if it's not.
This will solve problem if user is created externally by not same user as gitea is run under.