Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Secure "env" configuration #45

Closed
wants to merge 4 commits into from
Closed

Secure "env" configuration #45

wants to merge 4 commits into from

Conversation

laserlemon
Copy link
Contributor

Hi guys,

I added the ability to public-key-encrypt the env configurations included in the build matrix. Here's why:

Let's say I have an open source Rails app that depends on connecting to an external service such as GitHub or RubyGems. I configure my app to keep those credentials in ENV (a la Heroku). In order to fully test on Travis, I need to include those credentials in the build env without exposing them publicly in .travis.yml.

I borrowed a page from the Campfire notification configuration, where you can encrypt your credentials.

I also cleaned up a bit of the code surrounding SecureConfig and its relation to SslKey.

I think this will open Travis up to many more public apps that rely on private configuration. Thanks and I hope it helps!

@joshk
Copy link
Contributor

joshk commented Apr 15, 2012

This is pretty AWESOME

Thank you sooooo much! I have been meaning to do this for ages!

What do you think @svenfuchs @rkh @mattmatt ?

@laserlemon
Copy link
Contributor Author

Thanks. I have a blog post in the works and it's going to be a call to action for people to open source their Rails apps. Being able to test them all on Travis would be a big win.

@joshk
Copy link
Contributor

joshk commented Apr 16, 2012

Travis Pro support is around the corner, so why not just test in private?

On 16/04/2012, at 2:36 AM, Steve Richert wrote:

Thanks. I have a blog post in the works and it's going to be a call to action for people to open source their Rails apps. Being able to test them all on Travis would be a big win.


Reply to this email directly or view it on GitHub:
#45 (comment)

@laserlemon
Copy link
Contributor Author

I notice that people closed-source their Rails apps because they don't know what to do about private configurations like these. For apps that have to be private, Travis Pro is absolutely the right move. Otherwise, I think that apps that can be open sourced should be open sourced.

@svenfuchs
Copy link
Contributor

looks good to me!

@laserlemon
Copy link
Contributor Author

:shipit:

@laserlemon
Copy link
Contributor Author

Rebased against master and green. 💚

@joshk
Copy link
Contributor

joshk commented Apr 19, 2012

Hey Steve,

I am sorry about my lack of reply to this PR, been super busy with getting donation packs ready, and now I am in Krakow for Railsberry.

I will reply soon, promise.

Josh

<3<3<3

On 19/04/2012, at 3:40 AM, Steve Richert wrote:

Rebased against master and green. 💚


Reply to this email directly or view it on GitHub:
#45 (comment)

@laserlemon
Copy link
Contributor Author

Understood, and no problem. Enjoy Railsberry!

@laserlemon
Copy link
Contributor Author

By the way, I added Travis secure env support to Figaro for when this is shipped. Enjoy RailsConf!

@travisbot
Copy link

This pull request fails (merged 1cdc574d into 52fb894).

@laserlemon
Copy link
Contributor Author

Hogwash!

@joshk
Copy link
Contributor

joshk commented Apr 26, 2012

hahaha, i fixed the issue and pushed to master.

On 26/04/2012, at 1:56 PM, Steve Richert wrote:

Hogwash!


Reply to this email directly or view it on GitHub:
#45 (comment)

@laserlemon
Copy link
Contributor Author

Awesome, thank you!

@laserlemon
Copy link
Contributor Author

Rebased. 💚

@travisbot
Copy link

This pull request passes (merged d6fe181e into d1945fc).

@joshk
Copy link
Contributor

joshk commented Apr 30, 2012

Can you ping me on IM or irc when you see me next.


Sent from my Sega Master System

On 30/04/2012, at 5:39 PM, Steve Richertreply@reply.github.com wrote:

Rebased. 💚


Reply to this email directly or view it on GitHub:
#45 (comment)

@travisbot
Copy link

This pull request passes (merged 7e588dee into 046bde6).

@svenfuchs
Copy link
Contributor

what's up with this? can we merge?

@joshk
Copy link
Contributor

joshk commented May 7, 2012

I have explained the issues to Steve (changes required in Travis Build) and he is going to take care of it.

Do not merge yet.

On 8/05/2012, at 1:02 AM, Sven Fuchs wrote:

what's up with this? can we merge?


Reply to this email directly or view it on GitHub:
#45 (comment)

@travisbot
Copy link

This pull request passes (merged 3f013c8 into 181a8e2).

@laserlemon
Copy link
Contributor Author

Secure env configurations can now be detected (and obfuscated) by travis-worker.

@joshk
Copy link
Contributor

joshk commented May 8, 2012

Steve, regarding [:env, 'SECURE USE_GIT_REPOS=true'], how about instead [:env, { :secure => 'USE_GIT_REPOS=true' }] ?

@laserlemon
Copy link
Contributor Author

Woof. Okay, I'll have to get back to it another time.

@joshk
Copy link
Contributor

joshk commented May 8, 2012

Sorry :(

I just thought it is cleaner and simpler to detect a hash with a secure key instead of a string with SECURE at the front, since there is a possibility of env var exports having SECURE in them

On 8/05/2012, at 3:33 PM, Steve Richert wrote:

Woof. Okay, I'll have to get back to it another time.


Reply to this email directly or view it on GitHub:
#45 (comment)

@laserlemon
Copy link
Contributor Author

Understood, although this only detects those that begin with "SECURE " so it wouldn't match:

SECURE=asdf FOO=bar HELLO=world

@luxflux
Copy link

luxflux commented May 10, 2012

Just a short question: How will you generate such a key? I saw your code in Figaro, it looks quite easy. Would it be possible to add a form on the website to generate such values? Or a Gem for the cli? (I don't want to use figaro in a non-rails app)...

@ericanderson
Copy link

+1, would love this.

@pangratz
Copy link

😍 looking forward to this one ...

@joshk
Copy link
Contributor

joshk commented Jul 17, 2012

I am closing this as commits from this PR were included with the PR by @drogus which has since been merged.

@joshk joshk closed this Jul 17, 2012
@pangratz
Copy link

Is this already usable or is this not yet available on travis-ci.org?

@eigenein
Copy link

eigenein commented Sep 9, 2012

+1 Is this usable now?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants