Skip to content
Browse files

API updates - uncovered problems with kensa prerelease

  • Loading branch information...
1 parent 67590d3 commit 05b07bf3db91a37853b6e4a6b03121ce3540ae80 @csquared committed
View
2 .env.sample
@@ -0,0 +1,2 @@
+HEROKU_USERNAME=mysqlomatic
+HEROKU_PASSWORD=46c0e8c38cdf72f4
View
2 .gitignore
@@ -2,4 +2,4 @@
config/database.yml
log/*
tmp/*
-
+.env
View
1 Procfile
@@ -0,0 +1 @@
+web: script/server -p $PORT
View
13 README.md
@@ -6,8 +6,11 @@ MySQL-o-matic is a multitenant MySQL cloud service similar to Amazon RDS or Fath
# Installation
- $ gem install -v=2.3.5 rails
- $ gem install mysql
- $ cp config/database.yml.example config/database.yml
- $ rake gems:install
- $ rake db:setup
+ $ gem install -v=2.3.5 rails
+ $ gem install mysql
+ $ gem install foreman
+ $ cp config/database.yml.example config/database.yml
+ $ rake gems:install
+ $ rake db:setup
+ $ cp .env.sample .env
+ $ foreman start -p 3000
View
1 addon-manifest.json
@@ -3,7 +3,6 @@
"api": {
"config_vars": ["DATABASE_URL"],
"password": "46c0e8c38cdf72f4",
- "username": "heroku",
"production": "https://yourapp.com/",
"test": "http://localhost:3000/"
}
View
2 app/controllers/application_controller.rb
@@ -3,7 +3,7 @@
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
- protect_from_forgery # See ActionController::RequestForgeryProtection for details
+ # protect_from_forgery # See ActionController::RequestForgeryProtection for details
# Scrub sensitive parameters from your log
# filter_parameter_logging :password
View
3 app/controllers/databases_controller.rb
@@ -6,7 +6,8 @@ def create
@database = Database.create
respond_to do |format|
format.json do
- render :json => @database.attributes.merge(:config => { 'DATABASE_URL' => @database.url }).to_json
+ render :json => @database.attributes.merge(:config => { 'DATABASE_URL' => @database.url }).to_json,
+ :status => 201
end
format.html do
flash.now[:notice] = "Database created"
View
2 app/controllers/heroku_controller.rb
@@ -4,7 +4,7 @@ class HerokuController < DatabasesController
protected
def authenticate_heroku
authenticate_or_request_with_http_basic do |user, password|
- user == 'heroku' && password == '46c0e8c38cdf72f4'
+ user == ENV['HEROKU_USERNAME'] && password == ENV['HEROKU_PASSWORD']
end
end
end

0 comments on commit 05b07bf

Please sign in to comment.
Something went wrong with that request. Please try again.