A place where the Joyent community can gather, help each other out, and stay informed.
You are not logged in.
I want to make my source for my site open for everyone to check out but I don't want them downloading my database password and other private information. I don't want to setup two repos, one for deploying and one for the public. It seems like to much work. I want everyone to be able to access everything but a couple of files.
Any ideas?
Offline
if you're accessing via http(s) you can set permissions per directory.
you should probably keep your database.yml off the repository. (keep a safe sample there, but customize it on deployment)
Offline
cch wrote:
if you're accessing via http(s) you can set permissions per directory.
you should probably keep your database.yml off the repository. (keep a safe sample there, but customize it on deployment)
I am... I was just worried about the database.yml and my switchtower recipe. Does this even NEED to be in the repo or even in the production app at all?
Offline
Do you think this would work?
task :write_database_config, :roles => :app do
buffer = render(:template => <<DATABASE_CONFIG)
production:
adapter: sqlite3
database: /path/to/my/database.db
DATABASE_CONFIG
put buffer, "#{release_path}/config/database.yml"
end
Works, I'm half way there
Last edited by joshpeek (2006-02-08 04:49:01)
Offline
For some reason I think it just takes leaving it blank, like we do
[dev:/railsapphosting/scripts/TextSamurai.rb]
@readonly = r
to make something readable in a private repository
And for some reason I'm thinking that
[repos:/path/to/file.rb]
Make the file.rb unreadable in an open repos
...
Offline
I've just set an ignore on database.yml and deploy.rb. That works for me. Now I need to recreate the repo (because of versions w/ my passwords are up there) and move to https.
Offline
I can't get switchtower to deploy over https.
It stalls here.
out :: joshpeek.com (R)eject, accept (t)emporarily or accept (p)ermanently?
Plus lighttpd doesn't wana start from switchtower. I have to manually start it up from shell access.
Bad Gateway
The proxy server received an invalid response from an upstream server.
Last edited by joshpeek (2006-02-08 22:08:30)
Offline
Its done.
http://www.joshpeek.com/blog/2006/02/08/steal-my-blog
I'm stilling have those problems with https and switchtower restarting lighttpd.
Last edited by joshpeek (2006-02-08 22:25:22)
Offline
FWIW, here's what I do to have my database.yml installed after Switchtower does its thing:
desc "After symlinking current version, install database.yml"
task :after_symlink do run "cp /home/#{user}/etc/#{application}-database.yml #{deploy_to}/current/config/database.yml"
end
Though your way would work too, of course...
Offline
mcornick wrote:
FWIW, here's what I do to have my database.yml installed after Switchtower does its thing:
Code:
desc "After symlinking current version, install database.yml"
task :after_symlink do run "cp /home/#{user}/etc/#{application}-database.yml #{deploy_to}/current/config/database.yml"
end
Though your way would work too, of course...
I actually like that way better. But why not just symlink to it instead of copying.
Here is my modification.
desc "After symlinking current version, install database.yml"
task :after_symlink do run "ln -nfs #{shared_dir}/config/database.yml #{release_path}/config/database.yml"
end
Last edited by joshpeek (2006-02-09 00:41:44)
Offline
joshpeek wrote:
I actually like that way better. But why not just symlink to it instead of copying.
Why not, indeed. Changed my code accordingly.
I'm also having issues w/ restarting lighttpd from switchtower, though. Much like explained here: http://wrath.rubyonrails.org/pipermail/ … 12244.html Every time I think I've fixed it, it fails again within a few deployments, so I've just avoided the frustration and manually restart lighttpd after every deployment (which unfortunately ruins the real reason for using switchtower, as far as I'm concerned, but whatever...)
Offline