From 2a153316ced027b784dab7eb81ca0651aa0e9ed8 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Wed, 13 Oct 2010 01:41:28 +0200 Subject: [PATCH 01/11] Not used --- pkg/ubuntu/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/ubuntu/README.md b/pkg/ubuntu/README.md index ff82a4c29..bbf70362a 100644 --- a/pkg/ubuntu/README.md +++ b/pkg/ubuntu/README.md @@ -11,7 +11,7 @@ Bootstrap the distribution from git: cd diaspora/pkg/ubuntu Install the dependencies (a good time for a coffe break) - ./diaspora-install-deps + sudo ./diaspora-install-deps Create and install the diaspora bundle and application: ./make-dist.sh bundle @@ -60,6 +60,9 @@ the stuff using git in this case. The user diaspora is added during install. +Tools used for building package are installed globally. All of diasporas +dependencies lives in the nothing is insalled by user or on system level. + make-dist.sh accepts arguments to get a specified commit and/or use another repo. From e922a3be5c8f3553a728bb931284c9f1d668e82a Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Wed, 13 Oct 2010 08:29:24 +0200 Subject: [PATCH 02/11] Ubuntu 10.10 desktop fixes --- pkg/ubuntu/diaspora-install-deps | 2 +- pkg/ubuntu/diaspora-setup | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pkg/ubuntu/diaspora-install-deps b/pkg/ubuntu/diaspora-install-deps index f4fd6be8b..e3a307ef7 100755 --- a/pkg/ubuntu/diaspora-install-deps +++ b/pkg/ubuntu/diaspora-install-deps @@ -15,7 +15,7 @@ grep -v '^#' /etc/apt/sources.list | grep -q universe || { sudo apt-get update sudo apt-get install -qy --ignore-missing build-essential libxslt1-dev \ libxml2 ruby-full mongodb rake python-software-properties git-core \ - imagemagick libmagick9-dev + imagemagick libmagick9-dev xulrunner-1.9 sudo add-apt-repository ppa:maco.m/ruby sudo apt-get update sudo apt-get install -qy rubygems diff --git a/pkg/ubuntu/diaspora-setup b/pkg/ubuntu/diaspora-setup index 56940491f..9e7da6fc2 100755 --- a/pkg/ubuntu/diaspora-setup +++ b/pkg/ubuntu/diaspora-setup @@ -14,7 +14,9 @@ test -n "$services" && { echo " $services" } -/usr/sbin/service mongodb start || : +service mongodb stop || : +rm -f /var/lib/mongodb/mongod.lock +service mongodb start || : cd /usr/share/diaspora/master @@ -26,11 +28,13 @@ if rake db:seed:dev; then else cat <<- EOF - Database config failed. You might want to remove all db files with - 'rm -rf /var/lib/mongodb/*' and/or resetting the config file by - 'cp config/app_config.yml.example config/app_config.yml' before - making a new try. Also, make sure the mongodb server is running - e. g., using '/sbin/service mongod status'. + Database config failed. You might want to + - Just remove the db lock file: rm /var/lib/mongodb/mongod.lock + - Remove all db files: rm -rf /var/lib/mongodb/* + - Reset the config file by + cp config/app_config.yml.example config/app_config.yml + Also, make sure the mongodb server is running e. g., using + 'service mongod status'. EOF exit 1 fi From ea185ccf6a147a95d0753fa89ffbfee69b0fed5d Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Wed, 13 Oct 2010 10:23:06 +0200 Subject: [PATCH 03/11] Resolving merge conflict... My bad, apologies --- pkg/fedora/diaspora.spec | 44 +++++----------------------------------- 1 file changed, 5 insertions(+), 39 deletions(-) diff --git a/pkg/fedora/diaspora.spec b/pkg/fedora/diaspora.spec index ba2456a43..b4bd62b5d 100644 --- a/pkg/fedora/diaspora.spec +++ b/pkg/fedora/diaspora.spec @@ -1,9 +1,9 @@ %global debug_package %{nil} -%define git_release HEAD +%define git_release 1010092232_b313272 Summary: A social network server Name: diaspora -Version: 0.0.1 +Version: 0.0 Release: 1.%{git_release}%{?dist} License: AGPLv3 Group: Applications/Communications @@ -19,7 +19,7 @@ BuildRoot: %{_rmpdir}/not-used-in-fedora/ Requires: mongodb-server Requires: ruby(abi) = 1.8 -Requires: diaspora-bundle = %{version} +Requires: diaspora-bundle = 0.0-1.1010081636_d1a4ee0.fc13 %description @@ -34,10 +34,6 @@ find . -perm /u+x -type f -exec \ %build rm -rf master/vendor/bundle -<<<<<<< HEAD -mkdir master/tmp || : -======= ->>>>>>> upstream/master %install rm -fr $RPM_BUILD_ROOT @@ -59,14 +55,7 @@ cp %SOURCE3 $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/diaspora mkdir -p $RPM_BUILD_ROOT/%{_datadir}/diaspora cp -ar master $RPM_BUILD_ROOT/%{_datadir}/diaspora -<<<<<<< HEAD -cp -ar master/.bundle $RPM_BUILD_ROOT/%{_datadir}/diaspora/master -cp diaspora-setup $RPM_BUILD_ROOT/%{_datadir}/diaspora -mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/diaspora/uploads -mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/diaspora/tmp -======= cp %SOURCE2 $RPM_BUILD_ROOT/%{_datadir}/diaspora ->>>>>>> upstream/master mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/log/diaspora mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/diaspora/uploads @@ -91,25 +80,8 @@ sed -i -e '\|.*/master/config.ru"$|d' \ %post -<<<<<<< HEAD -rm -f %{_datadir}/diaspora/master/vendor/bundle -rm -f %{_datadir}/diaspora/master/log -rm -f %{_datadir}/diaspora/master/public/uploads -rm -rf %{_datadir}/diaspora/master/tmp - -ln -s %{_localstatedir}/log/diaspora \ - %{_datadir}/diaspora/master/log || : -ln -s %{_libdir}/diaspora-bundle/master/vendor/bundle \ - %{_datadir}/diaspora/master/vendor || : -ln -s %{_localstatedir}/lib/diaspora/uploads \ - %{_datadir}/diaspora/master/public/uploads || : -ln -s %{_localstatedir}/lib/diaspora/tmp \ - %{_datadir}/diaspora/master/tmp || : -/sbin/chkconfig --add diaspora-ws || : -======= /sbin/chkconfig --add diaspora-wsd ->>>>>>> upstream/master %preun if [ $1 -eq 0 ] ; then @@ -124,27 +96,21 @@ rm -fr $RPM_BUILD_ROOT %files -f files %defattr(-, root, root, 0755) -<<<<<<< HEAD -%doc README.md GNU-AGPL-3.0 -======= %doc AUTHORS README.md GNU-AGPL-3.0 COPYRIGHT README-Fedora.md ->>>>>>> upstream/master %attr(-, diaspora, diaspora) %{_datadir}/diaspora/master/config.ru %attr(-, diaspora, diaspora) %{_datadir}/diaspora/master/config/environment.rb %attr(-, diaspora, diaspora) %{_localstatedir}/log/diaspora %attr(-, diaspora, diaspora) %{_localstatedir}/lib/diaspora/uploads %attr(-, diaspora, diaspora) %{_localstatedir}/lib/diaspora/tmp -<<<<<<< HEAD -======= %{_datadir}/diaspora/master/tmp %{_datadir}/diaspora/master/public/uploads %{_datadir}/diaspora/master/log ->>>>>>> upstream/master %config(noreplace) %{_sysconfdir}/logrotate.d/diaspora %{_sysconfdir}/init.d/diaspora-wsd %changelog -* Fri Sep 24 2010 Alec Leamas 0.0-1.1009280542_859ec2d +* Fri Sep 24 2010 Alec Leamas 0.0-1.1010092232_b313272.fc13 + - Initial attempt to create a spec fi+le # rubygem-term-ansicolor in repo (1.0.5) From 8c2ccfc5a8fb2acf86a36e79984b7f6eae79d384 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Wed, 13 Oct 2010 10:34:32 +0200 Subject: [PATCH 04/11] Updating to reflect new tests on 10.04 desktop. --- pkg/ubuntu/README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/ubuntu/README.md b/pkg/ubuntu/README.md index ff82a4c29..b8f3f7987 100644 --- a/pkg/ubuntu/README.md +++ b/pkg/ubuntu/README.md @@ -63,8 +63,13 @@ The user diaspora is added during install. make-dist.sh accepts arguments to get a specified commit and/or use another repo. -This has been tested on a Ubuntu 32-bit 10.10 , clean server. Since this -is a very small dist, the dependencies should possibly be complete. +This has been tested on a Ubuntu 32-bit 10.10 , clean server and on 10.04 +Lucid desktop, also clean installation. + +mongodb is having problems occasionally. Sometimes the dependencies are not +installed, and mongod refuses to start. invoke /usr/bin/mongod -f /etc/mongodb.conf +fo test. The lockfile /var/lib/mongodb/mongod.conf is also a potential +problem. Remove to make it start again. The diaspora-wsd is just placeholder FTM, it does **not** work. From 49975d7010001be9ac6e3f5b12a52018ccb2cd32 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Wed, 13 Oct 2010 12:26:52 +0200 Subject: [PATCH 05/11] Providing better message if port 3000 is in use, closing ticket 287. --- script/server | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/script/server b/script/server index c5357a32e..adfced9aa 100755 --- a/script/server +++ b/script/server @@ -1,4 +1,16 @@ #!/bin/bash +# +# Start diaspora websocket and main services +# +# See issue 287 + +# Is someone listening on 3000 already? (ipv4 only test ?) +services=$( netstat -nl | grep '[^:]:3000[ \t]') +test -n "$services" && { + echo "Warning: something is already using port 3000" + echo " $services" +} + # Check if Mongo is running From ccdc259838c3dbbc047d4b23bff2f9ce8a780ca9 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Wed, 13 Oct 2010 12:50:29 +0200 Subject: [PATCH 07/11] Comment update --- script/server | 1 - 1 file changed, 1 deletion(-) diff --git a/script/server b/script/server index adfced9aa..130b61220 100755 --- a/script/server +++ b/script/server @@ -2,7 +2,6 @@ # # Start diaspora websocket and main services # -# See issue 287 # Is someone listening on 3000 already? (ipv4 only test ?) services=$( netstat -nl | grep '[^:]:3000[ \t]') From 3f9a51fa3fb783ea0fe71aa8cc2dc4da542fd067 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 13 Oct 2010 10:27:29 -0700 Subject: [PATCH 08/11] First attempt at detecting called port with getopts --- script/server | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/script/server b/script/server index 130b61220..5edce844a 100755 --- a/script/server +++ b/script/server @@ -3,10 +3,19 @@ # Start diaspora websocket and main services # -# Is someone listening on 3000 already? (ipv4 only test ?) -services=$( netstat -nl | grep '[^:]:3000[ \t]') +# Is someone listening on the port already? (ipv4 only test ?) +PORT=3000 +while getopts ":p:" OPTION +do + if OPTION='p' + then + PORT=$OPTARG + fi +done + +services=$( netstat -nl | grep '[^:]:'+ $PORT +'[ \t]') test -n "$services" && { - echo "Warning: something is already using port 3000" + echo "Warning: something is already using port " + $PORT echo " $services" } From 9e27c802c3ea50274f7017139445974dd88fed78 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 13 Oct 2010 10:47:21 -0700 Subject: [PATCH 09/11] Got port check in bash script working --- script/server | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/server b/script/server index 5edce844a..b03370533 100755 --- a/script/server +++ b/script/server @@ -13,10 +13,11 @@ do fi done -services=$( netstat -nl | grep '[^:]:'+ $PORT +'[ \t]') +services=$( netstat -nl | grep '[^:]:'$PORT'[ \t]') test -n "$services" && { echo "Warning: something is already using port " + $PORT echo " $services" + exit } From 9898c8b15850603fe40789d9b8c8865ecbb974e8 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 13 Oct 2010 11:07:26 -0700 Subject: [PATCH 10/11] Typo in script/server --- script/server | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/server b/script/server index b03370533..42238e052 100755 --- a/script/server +++ b/script/server @@ -15,7 +15,7 @@ done services=$( netstat -nl | grep '[^:]:'$PORT'[ \t]') test -n "$services" && { - echo "Warning: something is already using port " + $PORT + echo "Warning: something is already using port "$PORT echo " $services" exit } From 9a1590fa0233fe0131b9a5f755a00dfc5f62068b Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 13 Oct 2010 11:18:06 -0700 Subject: [PATCH 11/11] Move user module requires out to the user modules definition file --- app/models/user.rb | 8 ++------ lib/diaspora/user.rb | 11 +++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 lib/diaspora/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index 12322dca6..92f4f92a4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. -require File.join(Rails.root, 'lib/diaspora/user/friending') -require File.join(Rails.root, 'lib/diaspora/user/querying') -require File.join(Rails.root, 'lib/diaspora/user/receiving') +require File.join(Rails.root, 'lib/diaspora/user') require File.join(Rails.root, 'lib/salmon/salmon') class InvitedUserValidator < ActiveModel::Validator @@ -20,9 +18,7 @@ end class User include MongoMapper::Document plugin MongoMapper::Devise - include Diaspora::UserModules::Friending - include Diaspora::UserModules::Querying - include Diaspora::UserModules::Receiving + include Diaspora::UserModules include Encryptor::Private QUEUE = MessageHandler.new diff --git a/lib/diaspora/user.rb b/lib/diaspora/user.rb new file mode 100644 index 000000000..94da947f8 --- /dev/null +++ b/lib/diaspora/user.rb @@ -0,0 +1,11 @@ +require File.join(Rails.root, 'lib/diaspora/user/friending') +require File.join(Rails.root, 'lib/diaspora/user/querying') +require File.join(Rails.root, 'lib/diaspora/user/receiving') + +module Diaspora + module UserModules + include Friending + include Querying + include Receiving + end +end