Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/kandanapp/kandan
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerCooley committed Feb 16, 2013
2 parents 623ff1b + 8a0c6f6 commit 97baf5a
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 1 deletion.
39 changes: 39 additions & 0 deletions DEPLOY.md
Expand Up @@ -62,6 +62,45 @@ Your app should be up and running now. The default admin user is `Admin` with pa
## dotCloud
Looking for community help here.

## AppFog
You'll need an [AppFog account](https://www.appfog.com/) and the [af command line tool](https://docs.appfog.com/getting-started/af-cli) installed. Once that's all set up, login from the command line: `af login`. You'll be prompted for the username/password you set on AppFog. You're returned to your operating system's command prompt. It's not a terminal emulator.

If you want to use PostgreSQL rather than MySQL, provision the service on the Services page of the [console](https://console.appfog.com). Note the name of your database and app name on the console and substitute as appropriate.

git clone https://github.com/kandanapp/kandan.git
cd kandan
bundle install
bundle exec rake assets:precompile
af push your_app_name --path . --instances 1 --mem 256M --runtime ruby19

You'll answer a few questions; you'll probably get an error at the end about an invalid app description. That's okay, we'll fix that next:

Detected a Rails Application, is this correct? [Yn]: y
1: AWS US East - Virginia
2: AWS EU West - Ireland
3: AWS Asia SE - Singapore
4: Rackspace AZ 1 - Dallas
5: HP AZ 2 - Las Vegas
Select Infrastructure: 1
Application Deployed URL [<your_app_name>.aws.af.cm]: <your_app_name>
Memory reservation (128M, 256M, 512M, 1G, 2G) [256M]:
How many instances? [1]:
Bind existing services to '<your_app_name>'? [yN]: y
1: kandan_production
2: <your_app_name>-mysql-12781
Which one?: 1
Bind another? [yN]: n
Create services to bind to '<your_app_name>'? [yN]:
Would you like to save this configuration? [yN]: y
Manifest written to manifest.yml.
Creating Application: Error 300: Invalid application description

If you get the invalid app description, open manifest.yml in a text editor and remove the space from the description. (It defaults to Rails Application, which causes the error.) Then, at the terminal:

af update <your_app_name>

And you should also restart the app on AppFog (in the console). Then, Kandan should be available on your AppFox backend now! With your browser, visit the domain name assigned to you by AppFog (or create a CNAME record at your DNS provider to use an alternate).

## Heroic server install
If you're looking to install Kandan on a private server, or to develop locally for lemonodor fame, then here is the path you must follow, young hero:

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/channels_controller.rb
Expand Up @@ -12,7 +12,7 @@ def index
more_activities = (channel.activities.count > Kandan::Config.options[:per_page])
channel.activities.order('id DESC').includes(:user).page.each do |activity|
activities.push activity.attributes.merge({
:user => activity.user.as_json(:only => [:id, :ido_id, :email, :first_name, :last_name, :gravatar_hash, :active, :locale])
:user => activity.user_or_deleted_user.as_json(:only => [:id, :ido_id, :email, :first_name, :last_name, :gravatar_hash, :active, :locale, :username])
})
end

Expand Down
4 changes: 4 additions & 0 deletions app/models/activity.rb
Expand Up @@ -3,4 +3,8 @@ class Activity < ActiveRecord::Base
belongs_to :channel

paginates_per Kandan::Config.options[:per_page]

def user_or_deleted_user
self.user || User.deleted_user
end
end
7 changes: 7 additions & 0 deletions app/models/user.rb
Expand Up @@ -26,4 +26,11 @@ def active_for_authentication?
super && active?
end

def self.deleted_user
dummy_user = new(:username => "Deleted User", :gravatar_hash => "", :email => "")
dummy_user.active = false

return dummy_user
end

end
6 changes: 6 additions & 0 deletions config/environments/development.rb
Expand Up @@ -34,4 +34,10 @@

# Expands the lines which load the assets
config.assets.debug = true

config.logger = Logger.new(STDOUT)
config.logger.level = Logger.const_get(
ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].upcase : 'DEBUG'
)

end

0 comments on commit 97baf5a

Please sign in to comment.