Is it possible to load configuration from a Server in Rails? - ruby-on-rails

A quick question: In Java/Spring/Spring Boot world I know it is possible to have your server load their configuration from a "config server" instead of files in the instance or environment variables.
I am talking of spring-cloud-config-server.
Would it be possible to do the same thing in Rails?
Is there an extension or gem that would allow me to pull config from a KV storage or maybe from a remote storage (S3 for example) on instances starting?
Thanks in advance.

Related

how to manage secrets of rails app while deploying application with chef habitat?

I am looking for how can I manage my passwords/credentials while deploying my rails application with habitat. so that I don't have to commit my credentials into the version control.
after researching a lot I found a work around for the credentials.
so habitat credentials are stored in .toml file and you can use these credentials directly. now we need to send this toml file to server directly if we do not want to commit file.
or we can create databags.

How to integrate configuration files from a config service in rails?

I am currently running a rails application and a SpringBoot configuration service in the same local network. Is it possible to configure rails to use the config files provided by the service in Springboot?
More specifically I am looking to fetch the database connection and user data via the service and let rails connect to a remote database.
The service provides theses files via http as json or yml.
Thank you.
Edit: Solved it by using a bash script with wget to pull and assemble config files manually via container scripts that are executed before each deploy.

Are all my Ruby files in my Rails project stored on the server I specify? (eg. Puma, Webrick)

When I enter a URL into my browser, and it sends a request to the server (in this case, the host is salty-headland-18854.herokuapp.com), are all my Rails files stored at this host?
How does Puma come into play? I understand Puma to be a web server and I've included its gem. What is the distinction here between the host and Puma?
Does Heroku have a bunch of physical computers somewhere, that house my literal .rb files?
Visual of my question
It depends on the files, but pretty much the answer is yes. Heroku pulls down your app from the git repository specified (or you push it to Heroku's git repository) and Heroku has all the files from that. Without a security exploit, no one is able to access their source.
You can think of a Heroku Dyno as a Linux server with the complete Rails application. When it is launched for the first time, a linux server is built and the Rails application copied to it and the app server launched.
You code actually lives in the Github repository you have linked to Heroku. Persistant data is stored either in the database or an external file service such as S3.
It is possible to run commands on the Dynos using heroku run
Reference

delayed_paperclip and load balancer

It seems paperclip and/or delayed_paperclip saves a temporary file on local web server fs before upload it to S3 or Rackspace Cloud File (i'm using fog.io).
If you have a worker for delayed_job on a separated server, this worker won't be able to see this tmp file on the web sever.
Or you could have one worker in each web server, but then worker1 on webserver1 can't see files on webserver2. You would need a queue/server affinity, right?
So the question is: how should I use delayed_paperclip with load balancer?
Thank you!

Setting up Amazon Webservices for Rails

I've been trying to set up a web server using EC2 on Amazon web services.
Using the appstack-nginx-passenger-ree AMI, I tried to set up the server.
I put my ruby files in /opt/sites and I installed passenger and apache2-dev & apace2-mpm-fork.
I had to set up the apache config file.
Afterwards what should I do?
How do I set the path file of the ruby files and deploy them?
How can I start up the server and be able to look at it?
You should make sure you start up apache (which should show you a default welcome page on your the IP of you box (if you have opened up the firewall)), then setup the path to your ruby project in your httpd.conf file.
Here's a guide that might help you out
Paul, your link is broken, the corrected link for the guide is this Setting up Rails 3 on Amazon EC2 instance

Resources