From 63ed6a3a9505850affef46544fd5cf3fbae5bb37 Mon Sep 17 00:00:00 2001 From: maxwell Date: Tue, 21 Sep 2010 21:31:53 -0700 Subject: [PATCH 1/7] MS DG made async webfingering controller. need to call it from javascript to prevent seeds from blocking. remember to update your gems --- Gemfile | 4 ++++ Gemfile.lock | 6 ++++++ app/controllers/requests_controller.rb | 3 +++ config/routes.rb | 1 + 4 files changed, 14 insertions(+) diff --git a/Gemfile b/Gemfile index cc92bec3d..adc4431aa 100644 --- a/Gemfile +++ b/Gemfile @@ -38,6 +38,10 @@ gem 'magent', :git => 'http://github.com/dcu/magent.git' gem 'carrierwave', :git => 'git://github.com/rsofaer/carrierwave.git' , :branch => 'master' #Untested mongomapper branch gem 'mini_magick' +#sinatra +gem 'sinatra', '1.0' +gem 'async_sinatra' + group :test, :development do gem 'factory_girl_rails' end diff --git a/Gemfile.lock b/Gemfile.lock index dd181b320..abad54828 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -104,6 +104,8 @@ GEM addressable (2.2.1) arel (1.0.1) activesupport (~> 3.0.0) + async_sinatra (0.2.3) + sinatra (>= 1.0) autotest (4.3.2) bcrypt-ruby (2.1.2) bson (1.0.7) @@ -212,6 +214,8 @@ GEM selenium-client (1.2.18) selenium-rc (2.2.4) selenium-client (>= 1.2.18) + sinatra (1.0) + rack (>= 1.0) subexec (0.0.4) thin (1.2.7) daemons (>= 1.0.9) @@ -238,6 +242,7 @@ PLATFORMS DEPENDENCIES addressable + async_sinatra autotest bson (= 1.0.7) bson_ext (= 1.0.7) @@ -266,6 +271,7 @@ DEPENDENCIES ruby-debug saucelabs-adapter (= 0.8.12) selenium-rc + sinatra (= 1.0) sprinkle! thin webmock diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 6087ebe85..fd6e10e7b 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -42,6 +42,9 @@ class RequestsController < ApplicationController return end + + + # rel_hash = {:friend => params[:friend_handle]} Rails.logger.debug("Sending request: #{rel_hash}") begin diff --git a/config/routes.rb b/config/routes.rb index ae757499c..5b7ddba4f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -33,6 +33,7 @@ Diaspora::Application.routes.draw do match 'signup', :to => 'registrations#new', :as => "new_user_registration" match 'get_to_the_choppa', :to => redirect("/signup") + match "/finger", :to => AsyncController #public routes # match 'webfinger', :to => 'publics#webfinger' From c000b31ffb365241d3128800aacece7d8475f357 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 23 Sep 2010 10:17:13 -0700 Subject: [PATCH 2/7] query for post through user --- app/controllers/comments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 4caeb1414..fe11cb8ae 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -10,7 +10,7 @@ class CommentsController < ApplicationController respond_to :json, :only => :show def create - target = Post.find_by_id params[:comment][:post_id] + target = current_user.find_visible_post_by_id params[:comment][:post_id] text = params[:comment][:text] @comment = current_user.comment text, :on => target From e6d1b8b8089f1387e91605f6037bc2e6f27f72e5 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 23 Sep 2010 10:29:36 -0700 Subject: [PATCH 3/7] fixed syntax in welsch translation --- config/locales/devise.cy.yml | 44 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/config/locales/devise.cy.yml b/config/locales/devise.cy.yml index 4f89f9b34..5d6d6049a 100644 --- a/config/locales/devise.cy.yml +++ b/config/locales/devise.cy.yml @@ -12,31 +12,31 @@ cy: devise: failure: - unauthenticated: 'Mae angen i chi arwyddo i mewn neu ymuno cyn parhau.' - unconfirmed: 'Rhaid i chi gadarnhau eich cyfrif cyn parhau.' - locked: 'Mae eich cyfrif wedi'i gloi.' - invalid: 'E-bost neu gyfrinair annilys.' - invalid_token: 'Tocyn dilysu annilys.' - timeout: 'Mae eich sesiwn wedi dod i ben, arwyddwch i mewn eto i barhau.' - inactive: 'Nid yw eich cyfrif wedi'i actifadu.' + unauthenticated: "Mae angen i chi arwyddo i mewn neu ymuno cyn parhau." + unconfirmed: "Rhaid i chi gadarnhau eich cyfrif cyn parhau." + locked: "Mae eich cyfrif wedi'i gloi." + invalid: "E-bost neu gyfrinair annilys." + invalid_token: "Tocyn dilysu annilys." + timeout: "Mae eich sesiwn wedi dod i ben, arwyddwch i mewn eto i barhau." + inactive: "Nid yw eich cyfrif wedi'i actifadu." sessions: - signed_in: 'Arwyddwyd i fewn yn llwyddiannus.' - signed_out: 'Arwyddwyd allan yn llwyddiannus.' + signed_in: "Arwyddwyd i fewn yn llwyddiannus." + signed_out: "Arwyddwyd allan yn llwyddiannus." passwords: - send_instructions: 'Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau.' - updated: 'Newidiwyd eich cyfrinair yn llwyddiannus. Rydych chi wedi arwyddo i fewn.' + send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." + updated: "Newidiwyd eich cyfrinair yn llwyddiannus. Rydych chi wedi arwyddo i fewn." confirmations: - send_instructions: 'Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau.' - confirmed: 'Cadarnhawyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn.' + send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." + confirmed: "Cadarnhawyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." registrations: - signed_up: 'Rydych chi wedi arwyddo i fyny yn llwyddiannus. Anfonwyd cadarnhad at eich e-bost os yw wedi'i alluogi.' - updated: 'Diweddarwyd eich cyfrif yn llwyddiannus.' - destroyed: 'Hwyl fawr! Canslwyd eich cyfrif yn llwyddiannus. Rydym yn gobeithio gweld chi eto yn fuan.' + signed_up: "Rydych chi wedi arwyddo i fyny yn llwyddiannus. Anfonwyd cadarnhad at eich e-bost os yw wedi'i alluogi." + updated: "Diweddarwyd eich cyfrif yn llwyddiannus." + destroyed: "Hwyl fawr! Canslwyd eich cyfrif yn llwyddiannus. Rydym yn gobeithio gweld chi eto yn fuan." unlocks: - send_instructions: 'Byddwch yn derbyn e-bost gyda cyfarwyddiadau ar sut i agor eich cyfrif mewn ychydig funudau.' - unlocked: 'Datglowyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn.' + send_instructions: "Byddwch yn derbyn e-bost gyda cyfarwyddiadau ar sut i agor eich cyfrif mewn ychydig funudau." + unlocked: "Datglowyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." mailer: - confirmation_instructions: 'Cyfarwyddiadau cadarnhad.' - reset_password_instructions: 'Ailosod cyfarwyddiadau cyfrinair' - unlock_instructions: 'Cyfarwyddiadau Datgloi' - \ No newline at end of file + confirmation_instructions: "Cyfarwyddiadau cadarnhad." + reset_password_instructions: "Ailosod cyfarwyddiadau cyfrinair" + unlock_instructions: "Cyfarwyddiadau Datgloi" + From 40d736d233098d6a1d2962a4f4ca20675fefa2be Mon Sep 17 00:00:00 2001 From: maxwell Date: Thu, 23 Sep 2010 10:39:47 -0700 Subject: [PATCH 4/7] MS changed the session page to show APP_CONFIG[:terse_pod_url] --- app/views/devise/sessions/new.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 15880df0b..a2de719b5 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -10,7 +10,7 @@ = f.label :username = f.text_field :username %p.user_network - ="@#{APP_CONFIG[:pod_url]}" + ="@#{APP_CONFIG[:terse_pod_url]}" %p = f.label :password From 8c0bc4b9e60e0e94fd515ba7f595e6d08fba34af Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 23 Sep 2010 10:49:35 -0700 Subject: [PATCH 5/7] fix in person partial --- app/helpers/application_helper.rb | 6 +++++- app/views/people/_person.html.haml | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 89df26155..b6e4c4389 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -57,7 +57,11 @@ module ApplicationHelper end def person_image_link(person) - link_to person_image_tag(person), object_path(person) + if current_user.friends.include?(person) || current_user.person == person + link_to person_image_tag(person), object_path(person) + else + person_image_tag person + end end def new_request(request_count) diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml index 7e22a5570..185695db1 100644 --- a/app/views/people/_person.html.haml +++ b/app/views/people/_person.html.haml @@ -8,7 +8,10 @@ .content %span.from - = link_to person.real_name, person_path(person) + - if current_user.friends.include?(person) || person.id == current_user.person.id + = link_to person.real_name, person_path(person) + - else + = person.real_name .info = person.diaspora_handle From cfe019d7a9b4069c1f472b89fc2b291d7c26074f Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 12:19:28 -0700 Subject: [PATCH 6/7] Take out async controller until we actually put it in the app --- config/routes.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index f4f49b01d..0ac115b76 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -33,7 +33,6 @@ Diaspora::Application.routes.draw do match 'signup', :to => 'registrations#new', :as => "new_user_registration" match 'get_to_the_choppa', :to => redirect("/signup") - match "/finger", :to => AsyncController #public routes # match 'webfinger', :to => 'publics#webfinger' From 3381c46050c228ca90b90f9a129a8a8d9239158e Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 12:21:05 -0700 Subject: [PATCH 7/7] Revert "mongodb now in Fedora repos." This reverts commit d55c0ae5511d5839fe1abb27dc470370f87c4d4c. --- README.md | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d215f5e98..0d5cee400 100644 --- a/README.md +++ b/README.md @@ -115,14 +115,6 @@ If you're on **Mac OS X**, you already have Ruby on your system. Yay! ### MongoDB -To install MongoDB on **Fedora**, use the official repositories - - sudo yum install mongodb-server - -Ensure that the server is started at system reboot: - - sudo chkconfig mongod on - To install MongoDB on **Ubuntu**, add the official MongoDB repository [here](http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages). @@ -155,6 +147,32 @@ Then run: sudo chmod -Rv 777 /data/ +To install MongoDB on a x86_64 **Fedora** system, add the official MongoDB +repository from MongoDB +(http://www.mongodb.org/display/DOCS/CentOS+and+Fedora+Packages) into +/etc/yum.repos.d/10gen.repo: + + [10gen] + name=10gen Repository + baseurl=http://downloads.mongodb.org/distros/fedora/13/os/x86_64/ + gpgcheck=0 + enabled=1 + +Then use yum to install the packages: + + sudo yum install mongo-stable mongo-stable-server + +If you're running a 32-bit system, run `wget +http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz`. If you're +running a 64-bit system, run `wget +http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz`. + + # extract + tar xzf mongodb-linux-i686-1.4.0.tgz + # create the required data directory + sudo mkdir -p /data/db + sudo chmod -Rv 777 /data/ + To install MongoDB on **Mac OS X**, run the following: brew install mongo @@ -248,7 +266,7 @@ run `service mongodb start`). If you installed the binary manually, run `sudo mongod` from where mongo is installed to start mongo. If you installed the Fedora package, MongoDB will need to be started via -`service mongod start`. If you installed the binary manually, run `sudo +`service mongodb start`. If you installed the binary manually, run `sudo mongod` from where Mongo is installed to start Mongo. If you installed the OsX package through "brew", MongoDB will need to be