Strider-CD / strider

Open Source Continuous Integration & Deployment Server
http://strider-cd.github.io/
4.59k stars 432 forks source link

Hostname in the github callback url. #201

Closed sebv closed 9 years ago

sebv commented 10 years ago

When 'linking with github account' from a remote host. The callback url is 'localhost'. I had to manually change it to register. I havn't check the other hooks yet, will do it once I have some scripts to run.

My environments variables are configured in the supervisor conf file.

peterbraden commented 10 years ago

I've seen this too - are you using the strider docker container?

sebv commented 10 years ago

yes

peterbraden commented 10 years ago

Yeah, think it's this issue: https://github.com/Strider-CD/strider-dockerfile/issues/9

(this is another reason we should move the dockerfile into this repo, to avoid duping issues)

niallo commented 10 years ago

You need to make a new docker container which has the env variables defined in supervisord.conf. You can either build a new one (docker build etc) or edit the file in the stock one and commit.

See also https://github.com/Strider-CD/strider-dockerfile/blob/master/supervisord.conf#L17

We do need to document this more clearly though.

sebv commented 10 years ago

I did, it doesn't work.

niallo commented 10 years ago

This works for me. SSH into the docker container and edit the file /etc/supervisor/conf.d/supervisord.conf. Then commit the resulting container (along with the startup commands) and re-run it. It works fine.

For example, we use the following for https://public-ci.stridercd.com:

[program:node]
command = env PORT=3000 SERVER_NAME=https://public-ci.stridercd.com GITHUB_APP_ID=<id> GITHUB_APP_SECRET=<secret> SMTP_HOST=smtp.mailgun.org SMTP_USER=<user> SMTP_PASS=<password> DB_URI=mongodb://<foo>
sebv commented 10 years ago

Am trying with master. (doing git pull + npm update on container)

peterbraden commented 10 years ago

Let's reopen this until we have better docs - this is non-obvious.

sebv commented 10 years ago

Ok I got it working. That was a me misusing supervisorctl, I forgot the reread/update stage.

This would need a quick doc, even better configuration method, it's not fun to squeeze so many characters in one line with vi.

niallo commented 10 years ago

@sebv thoughts on #202 ? would be an easy contribution if you are interested in helping :-)

sebv commented 10 years ago

I'll have a look a bit later, I want to use it first. Maybe I can use it for wd test, am getting tired of travis.

mattjay commented 10 years ago

Seeing similar behavior inside of a docker container. Having trouble starting a docker container with env variable for server name to be an IP address instead of a url. This causes the github callback url to be used as localhost:3000 and even if manually changed in the redirect param still doesn't link properly. Will update if I can figure out a workaround.

mattjay commented 10 years ago

@sebv

Ok I got it working. That was a me misusing supervisorctl, I forgot the reread/update stage.

Can you elaborate on what you mean here? I'm having some trouble getting this working.

sebv commented 10 years ago

Just modifying the config file is not enough, see here.

niallo commented 10 years ago

FYI with the new Dockerfile in strider repo (or docker pull strider/strider image) you can set environment variables via docker run

E.g.

docker run -e DB_URI=foo -e SERVER_NAME=https://example.com strider/strider should work. You shouldn't have to modify the image.

knownasilya commented 9 years ago

Stale