lgtm icon indicating copy to clipboard operation
lgtm copied to clipboard

Please add some docs on how to run lgtm

Open calind opened this issue 8 years ago • 9 comments

I've tired using docker image with docker run -d -p 8000:8000 -e DEBUG=true gitea/lgtm but it doesn't look to start up and docker logs say:

DEBU[0000] Driver sqlite3
DEBU[0000] Data Source /var/lib/lgtm/lgtm.sqlite
INFO[0000] database ping failed. retry in 1s
INFO[0001] database ping failed. retry in 1s
INFO[0002] database ping failed. retry in 1s
INFO[0003] database ping failed. retry in 1s
INFO[0004] database ping failed. retry in 1s
INFO[0005] database ping failed. retry in 1s
INFO[0006] database ping failed. retry in 1s
INFO[0007] database ping failed. retry in 1s
INFO[0008] database ping failed. retry in 1s
INFO[0009] database ping failed. retry in 1s
INFO[0010] database ping failed. retry in 1s
INFO[0011] database ping failed. retry in 1s
INFO[0012] database ping failed. retry in 1s
INFO[0013] database ping failed. retry in 1s
INFO[0014] database ping failed. retry in 1s
INFO[0015] database ping failed. retry in 1s
INFO[0016] database ping failed. retry in 1s
INFO[0017] database ping failed. retry in 1s
INFO[0018] database ping failed. retry in 1s
INFO[0019] database ping failed. retry in 1s
INFO[0020] database ping failed. retry in 1s
INFO[0021] database ping failed. retry in 1s
INFO[0022] database ping failed. retry in 1s
INFO[0023] database ping failed. retry in 1s
INFO[0024] database ping failed. retry in 1s
INFO[0025] database ping failed. retry in 1s
INFO[0026] database ping failed. retry in 1s
INFO[0027] database ping failed. retry in 1s
INFO[0028] database ping failed. retry in 1s
INFO[0029] database ping failed. retry in 1s
ERRO[0030] unable to open database file
FATA[0030] database ping attempts failed

calind avatar Feb 18 '17 17:02 calind

Looks like you are on some redhat system? Add a :z to the volume.

Please note that this project is not maintained on the long term by us, we will launch our own gitea instance soon and than we will drop this tool.

tboerger avatar Feb 18 '17 17:02 tboerger

FYI I got the same errors on CentOS and it turned out to be SELinux for me

strawd avatar Mar 03 '17 23:03 strawd

Just add something like --volume /my/host/path:/var/lib/lgtm:z and it should work fine on CentOS and other RedHat derivates.

tboerger avatar Mar 03 '17 23:03 tboerger

adding the volume fixes the database ping error for me, but i cant login after that. everything just ends in a github 404. am i missing something else?

Lerentis avatar Jun 08 '17 19:06 Lerentis

A GitHub 404? What do you mean?

tboerger avatar Jun 09 '17 18:06 tboerger

after i start the docker container as mentioned before, i get this web ui sign-in

If i click on sign in, i get redirected to this link, which results in a 404 404

like i said, i think i am missing something here, but i can't find any documentation :/

Offtopic: tboerger you are really working on a lot of projects. i feel like i have seen your name constantly over the last months :D

Lerentis avatar Jun 09 '17 19:06 Lerentis

okay i see now what i have missed. you are working with the github oauth api and don't provide a way of how to set the oauth client id and secret (at least i could not find any), as well as there is no clear way to figure out the callback url to register a new oauth application in general (it is crafted in this function ).

Lerentis avatar Jun 17 '17 13:06 Lerentis

You can see at https://github.com/go-gitea/infrastructure/blob/master/ansible/roles/lgtm/templates/service.j2#L17-L25 how we are launching this container, just provide the required environment variables and the redirect URL should be something like https://lgtm.gitea.io/login.

Offtopic: tboerger you are really working on a lot of projects. i feel like i have seen your name constantly over the last months :D

Yeah I'm pretty active in the Go world, maybe it's too much from time to time :P

tboerger avatar Jun 18 '17 20:06 tboerger

that works perfectly thanks (: for future reference: create new OAuth Application here and fill environment variables for a minimal functionality.

  • Homepage URL = protocol://Host:Port (f.e. http://localhost:8000)
  • Authorization callback URL = protocol://Host:Port/login (f.e. http://localhost:8000/login)
docker run --name lgtm -v /my/host/path:/var/lib/lgtm:z -e GITHUB_CLIENT= -e GITHUB_SECRET= -p 8000:8000 gitea/lgtm

should be mentioned in the readme. i can write something down and create a pull request if you'd like

Lerentis avatar Jun 20 '17 18:06 Lerentis