hect1c / skitty_v2

2 stars 0 forks source link

Refactor so environment specific data (database credentials, auth tokens, etc) aren't tracked by Git #6

Closed hect1c closed 10 years ago

hect1c commented 10 years ago

I'd suggest we create a new node module, something like config.js in the root dir that the other modules can require and extract information. We can have an example config.example.js that still gets tracked for instruction purposes but this way we could keep the project public.


hect1c commented 10 years ago

I haven't actually done this before but StackOverflow suggests BFG Repo-Cleaner is pretty straightforward for the task. You can essentially do find-and-replace on the history of a repo in its entirety.


Original Comment By:

hect1c commented 10 years ago

I think so however we first need to make sure that the DB credentials and user key are purged from the repo's commit history before making it all public.


Original Comment By:

hect1c commented 10 years ago

So with this should we change back to github? I only used bitbucket since it allows free private repos.


Original Comment By: Hartley Jean-Aimee

hect1c commented 10 years ago

Cool. I'm working on a feature to allow the external config now. I'll open a branch up for you to check it out.

My openshift email is me@eran.sh

Glad to be on the project! :)


Original Comment By:

hect1c commented 10 years ago

I like that idea. Let's do it.


Original Comment By: Hartley Jean-Aimee

hect1c commented 10 years ago

Cool! My pub key is below.

Here's another idea. We do the major development in a public repo with the external config file approach as described above. We develop in the master branch but you keep a local, alternate, branch with openshift specific config within. This way you could still handle deployments while keeping all of the ENV specific stuff out of the public repo...

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJanp+5oNTmFYSk3IliAiLT3pImQ29JUASbaJVBVUSHrkU09LZF+4ZivMYUJREaledts01oUA+VqTcBJS2qcClblEgBfqH5XN4W9W2AEOFf1UGBvcakr8abPOxR8a27xYsv3BurhGczNUvfUV3+mvM6iHxXlWluEpqWizOHSvfcs/5r3w9phl2qDi2CQk+hDxhc/qnkQ72UuRyGpzWdq2B39bo01uuOEY/FhvVWyXg0oLk33gqnIQOssOe/J4atz2si/5t4vphY/96fbw67yVfqYjIWhp8AUpqebKbOEFCCfPr2vuzbL/rhf4WHgKXTHT+Sy5h8jIGHU+8KJ4oQGLV eran@macbook

Original Comment By:

hect1c commented 10 years ago

I can also add you as a collaborator on openshift, you just need to sign up with them:

https://www.openshift.com/app/account/new

And then just provide me the email address used.


Original Comment By: Hartley Jean-Aimee

hect1c commented 10 years ago

Yes I do.

Provide me your SSH public key so I can add it to the system and then use the following to ssh:

ssh 53ceaa805973ca83ba0002bf@plugdjbot-skitty.rhcloud.com


Original Comment By: Hartley Jean-Aimee

hect1c commented 10 years ago

Hmm... I'll have to investigate a little more into how Openshift works. The advantage to splitting the config stuff out into a separate file is that we're free to include the app.js logic within the repo. This is ideal as the app.js stuff is mostly static, it's only the config-related stuff that changes.

Do you have SSH to OpenShift or is it purely Git push controlled?


Original Comment By:

hect1c commented 10 years ago

Well we can currently do that for app.js and appTemplate.js for example but the problem lies with the openshift integration. So when I do git push openshift or any pushes to the openshift remote repo , it pushes directly to the openshift server, and restarts the application, and any deploy scripts/hooks. So how can we have app.js be available on the openshift remote repo but not the github or bitbucket master repo? Because I would rather have the project public.


Original Comment By: Hartley Jean-Aimee

EranSch commented 10 years ago

Addressed with 954cf3d1fa7cb62b7d1928c49ec86520130c7351