go-gitea / lgtm

A simple pull request approval system
Apache License 2.0
104 stars 31 forks source link

Please add some docs on how to run lgtm #29

Open calind opened 7 years ago

calind commented 7 years ago

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
tboerger commented 7 years ago

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.

strawd commented 7 years ago

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

tboerger commented 7 years ago

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

Lerentis commented 7 years ago

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?

tboerger commented 7 years ago

A GitHub 404? What do you mean?

Lerentis commented 7 years ago

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 commented 7 years ago

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 ).

tboerger commented 7 years ago

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

Lerentis commented 7 years ago

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

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