top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What should be the best way to securely connect to remote Postgres server from Rails.

+1 vote
320 views

I'm wonder how most people securely connect to a Postgres database on a server separate from the app server.

The ActiveRecord docs for a MySQL connection have explicit SSL options, whereas with Postgres it seems one would pass SSL options as documented for libpq.

However a quick Googling returns SO threads with suggestions to use SSH tunnels. Which I guess could be managed with something like AutoSSH.

I'd love to hear from others. Is one method faster than the other, or easier to maintain?

posted Feb 15, 2014 by Ahmed Patel

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+1 vote

I have added force_ssl in ApplicationController. Then thin start --ssl. It took me to https, but with red cross. i.e. Not trusted site.

I tried with creating the certificate with - http://www.napcsweb.com/blog/2013/07/21/rails_ssl_simple_wa/
Still the same. Can anyone suggest?

+2 votes

I am working on building an api client for the Rakuten Market-place. I have got some test requests for add delete update etc working and thought I should aim to structure it as a Gem and publish it so that others can use it/enhance it.

I haven't built a Gem before (worked mostly within the rails environment to date).

Have been reading and looking at other api client gems and am making progress on building something (still got a way to go to handle errors etc.)

To make the gem general purpose though, I am trying to figure out the best way to provide the mapping between models in a rails app and the api client objects (such as product, category, order etc).

I am aiming to make each client api object a class be (or should i call them models?)
Then I suspect I will use new to build an api instance from a rails instance, and find to return an api instance to a rails instance.

I can build in mapping for my own models to the api objects with no problem, but I can't see how I could generalize this so that other apps with similar models could use the gem.

I suspect there are approaches for doing this, but so far I haven't managed to come up with how to do it. If anyone has any wisdom on the matter I would be grateful.

0 votes

What is the best method to manage image uploads in Rails? Is there a tool that allows auto-resizing upon image upload based on predefined dimensions? Moreover, is there any tool available that makes it possible to render / regenerate the same originally uploaded image using alternative view based styles, e.g. thumbs, 320x200 or 640x480 etc..?

...