ossn / fixme_backend

6 stars 17 forks source link

README needs to be updated #13

Open himankpathak opened 5 years ago

himankpathak commented 5 years ago

Readme is very unclear, and it took me a while to get things rolling.

Things needed to be fixed in README:

@alexdor please advise regarding this.

alexdor commented 5 years ago

You are right that it needs to be updated, regarding your points:

  1. The requirements are on top of the local installation because they aren’t required if you run the app with docker. Docker compose includes the database and then Buffalo will migrate the database, so I’m not sure what do you mean that the docker-compose has no use before the Postgres is up and running.

  2. Yes you are right, it’s just a random string

  3. I think that this is for Buffalo 0.14.x, am I wrong?

  4. In theory the envOr call should override the above username and password but the password and the username should be the fallback, isn’t it working this way?

himankpathak commented 5 years ago

Regarding the issues:

  1. I am not that familiar with docker-compose. I tried using docker-compose previously but I was not successful in running the app. I tried it today on a fresh install and it worked! Though installing the Dev Environment with docker-compose is still not working and I am getting following errors:

    web_1  | buffalo: 2019/03/13 10:31:37 === Running: go build -v -i -tags development -o tmp/fixme-backend-build  (PID: 196) ===
    web_1  | actions/app.go:12:2: cannot find package "github.com/rs/cors" in any of:
    web_1  |    /usr/local/go/src/github.com/rs/cors (from $GOROOT)
    web_1  |    /go/src/github.com/rs/cors (from $GOPATH)
    web_1  | worker/helpers.go:10:2: cannot find package "github.com/shurcooL/githubv4" in any of:
    web_1  |    /usr/local/go/src/github.com/shurcooL/githubv4 (from $GOROOT)
    web_1  |    /go/src/github.com/shurcooL/githubv4 (from $GOPATH)
    web_1  | worker/worker.go:16:2: cannot find package "golang.org/x/oauth2" in any of:
    web_1  |    /usr/local/go/src/golang.org/x/oauth2 (from $GOROOT)
    web_1  |    /go/src/golang.org/x/oauth2 (from $GOPATH)
    web_1  | buffalo: 2019/03/13 10:31:37 === Error! ===
    web_1  | buffalo: 2019/03/13 10:31:37 === exit status 1
    web_1  | actions/app.go:12:2: cannot find package "github.com/rs/cors" in any of:
    web_1  |    /usr/local/go/src/github.com/rs/cors (from $GOROOT)
    web_1  |    /go/src/github.com/rs/cors (from $GOPATH)
    web_1  | worker/helpers.go:10:2: cannot find package "github.com/shurcooL/githubv4" in any of:
    web_1  |    /usr/local/go/src/github.com/shurcooL/githubv4 (from $GOROOT)
    web_1  |    /go/src/github.com/shurcooL/githubv4 (from $GOPATH)
    web_1  | worker/worker.go:16:2: cannot find package "golang.org/x/oauth2" in any of:
    web_1  |    /usr/local/go/src/golang.org/x/oauth2 (from $GOROOT)
    web_1  |    /go/src/golang.org/x/oauth2 (from $GOPATH)
  2. We can just add info about this so people can fast forward.

  3. Yea, you're absolutely right. I am working on the issue to upgrade to buffalo 0.14.1 and currently hit a wall. I will post update about it on the particular issue. We would be also require to update readme with new instructions for 0.14.x

  4. In theory yes, but it is not working, the only way I was able to connect it my postgres server was changing the password of my user 'postgres' to 'postgres'. I read in the buffalo db config docs that the url param for a connection will override any other connection param.

himankpathak commented 5 years ago

I am also getting this error couldn't get key: could not find ENV var with JWT_SECRET

while running buffalo task db:seed

I have random JWT string set in dev.docker-compose.yml and docker-compose.yml

alexdor commented 5 years ago

Do you want to open a pr with the proposed changes so we can comment on the pr?

The error that you posted here https://github.com/ossn/fixme_backend/issues/13#issuecomment-472372701 looks like it can't find a package, so maybe smth when wrong during the package installation

In order for the docker-compose environment variables to be read you need to run the command inside the docker container. When you run buffalo task db:seed the command is executed on your local machine not inside the docker container that's why you get the error about not founding the JWT_SECRET.

himankpathak commented 5 years ago

Yea sure @alexdor that would be nice.

yea I fixed this issue, It was due to some go dep package problem.

we should also include steps to create the docker container as well.

himankpathak commented 5 years ago

Hi @alexdor, sorry for the delay with #12 I was busy because of my university end semester exams. I created a docker image but while running the docker image with docker run -p 8080:8080 go-docker I am getting the same error as before 2019/04/20 16:51:00 couldn't get key: could not find ENV var with JWT_SECRET 2019/04/20 16:51:00 couldn't get key: could not find ENV var with JWT_SECRET

alexdor commented 5 years ago

Hello @himankpathak, sorry for the delay. You need to set this environment variables in order for the application to boot https://github.com/ossn/fixme_backend/blob/master/dev.docker-compose.yml#L18