Browse Source

Move pump.io to the social networking section

Bob Mottram 11 years ago
parent
commit
d082a46914
1 changed files with 213 additions and 215 deletions
  1. 213
    215
      beaglebone.txt

+ 213
- 215
beaglebone.txt View File

3738
 
3738
 
3739
 More information about the Friendica app can be found on http://friendica-for-android.wiki-lab.net/
3739
 More information about the Friendica app can be found on http://friendica-for-android.wiki-lab.net/
3740
 
3740
 
3741
+*** pump.io
3742
+pump.io is the successor to StatusNet (which later became [[GNU Social]]) and is a communications system which can do things other than just microblogging.  It takes fewer system resources to run and so is better suited to low power servers such as the BBB, but is more complicated to install.  Currently when using self-signed certificates it seems very hard to federate with other pump.io servers so it may be that although GNU Social is an older system it may still be more practical.  For the instructions which follow it will be possible to run your own pump.io site for your family and friends, as a kind of /data silo/, but federating with anyone else could turn out to be difficult or impossible.
3743
+
3744
+A list of pump.io sites can be found at http://pumpstatus.jpope.org
3745
+
3746
+For a pump.io site you will need a separate domain/subdomain, so see [[Setting up a web site]] for details of how to create an Apache configuration for your site.  If you're using freedns then you will need to create a new subdomain.
3747
+
3748
+#+BEGIN_SRC: bash
3749
+apt-get update && apt-get install redis-server nodejs-legacy imagemagick graphicsmagick git-core screen
3750
+cd /opt
3751
+git clone https://github.com/e14n/pump.io.git
3752
+cd /opt/pump.io
3753
+npm install
3754
+npm install databank-redis
3755
+#+END_SRC
3756
+
3757
+Edit the configuration file.
3758
+
3759
+#+BEGIN_SRC: bash
3760
+emacs /etc/pump.io.json
3761
+#+END_SRC
3762
+
3763
+Add the following, replacing /mypumpiodomainname.com/ with your domain name.
3764
+
3765
+#+BEGIN_SRC: bash
3766
+{
3767
+    "driver": "redis",
3768
+    "params": {"host":"localhost","port":6379},
3769
+    "secret":  "A long random string",
3770
+    "noweb":  false,
3771
+    "site":  "Name of my pump.io site",
3772
+    "owner":  "My name or organisation",
3773
+    "ownerURL":  "https://mypumpiodomainname.com/",
3774
+    "port":  7270,
3775
+    "urlPort": 443,
3776
+    "hostname":  "mypumpiodomainname.com",
3777
+    "address":  "localhost",
3778
+    "nologger":  false,
3779
+    "serverUser":  "pumpio",
3780
+	"rejectUnauthorized": false,
3781
+    "key":  "/var/local/pump.io/keys/mypumpiodomainname.com.key",
3782
+    "cert":  "/var/local/pump.io/keys/mypumpiodomainname.com.crt",
3783
+    "uploaddir": "/var/local/pump.io/uploads",
3784
+    "debugClient": false,
3785
+    "firehose": "ofirehose.example",
3786
+	"logfile": "/var/local/pump.io/pump.io.log",
3787
+    "disableRegistration": false
3788
+}
3789
+#+END_SRC
3790
+
3791
+Save and exit.
3792
+
3793
+#+BEGIN_SRC: bash
3794
+export HOSTNAME=mypumpiodomainname.com
3795
+mkdir /var/local/pump.io
3796
+mkdir /var/local/pump.io/uploads
3797
+mkdir /var/local/pump.io/keys
3798
+cp /etc/ssl/private/$HOSTNAME.key /var/local/pump.io/keys
3799
+cp /etc/ssl/certs/$HOSTNAME.crt /var/local/pump.io/keys
3800
+useradd -s /bin/bash -d /var/local/pump.io pumpio
3801
+chown -R pumpio:pumpio /var/local/pump.io
3802
+chmod 400 /var/local/pump.io/keys/*
3803
+mkdir /tmp/apache2
3804
+cd /tmp/apache2
3805
+apt-get build-dep apache2
3806
+apt-get install autoconf
3807
+apt-get source apache2
3808
+cd apache2-*
3809
+wget http://freedombone.uk.to/apache-2.2-wstunnel.patch
3810
+sha256sum apache-2.2-wstunnel.patch
3811
+cfc4866da2688a8eb76e0300cf16b52539ef4e525053a3851d4b6bba9a77e439
3812
+
3813
+patch -p1 -i apache-2.2-wstunnel.patch
3814
+autoconf
3815
+./configure --enable-so --enable-proxy=shared --enable-proxy-wstunnel=shared
3816
+make
3817
+cp modules/proxy/.libs/mod_proxy_wstunnel.so  /usr/lib/apache2/modules/
3818
+cd /etc/apache2/mods-enabled
3819
+ln -s /usr/lib/apache2/modules/mod_proxy_wstunnel.so ../mods-available/proxy_wstunnel.load
3820
+#+END_SRC
3821
+
3822
+Within the section of your Apache site configuration:
3823
+
3824
+#+BEGIN_SRC: bash
3825
+emacs /etc/apache2/sites-available/mypumpiodomainname.com
3826
+#+END_SRC
3827
+
3828
+The initial section which begins with *<VirtualHost *:80>* should be replaced by the following, replacing /mypumpiodomainname.com/ with your pump.io domain name and /myusername@mydomainname.com/ with your email address.
3829
+
3830
+#+BEGIN_SRC: bash
3831
+<VirtualHost *:80>
3832
+	ServerAdmin myusername@mydomainname.com
3833
+	ServerName mypumpiodomainname.com
3834
+
3835
+    RewriteEngine On
3836
+    RewriteCond %{HTTPS} off
3837
+    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
3838
+</VirtualHost>
3839
+#+END_SRC
3840
+
3841
+Add the following in the section which begins with *<VirtualHost *:443>*.
3842
+
3843
+#+BEGIN_SRC: bash
3844
+    LoadModule proxy_wstunnel_module /usr/lib/apache2/modules/mod_proxy_wstunnel.so
3845
+
3846
+    <Location /main/realtime/sockjs>
3847
+        ProxyPass wss://localhost/main/realtime/sockjs
3848
+        ProxyPassReverse wss://localhost/main/realtime/sockjs
3849
+    </Location>
3850
+
3851
+#    <LocationMatch ".*\.(jpg|png|gif)$">
3852
+#        CacheEnable disk
3853
+#    </LocationMatch>
3854
+
3855
+    ProxyVia On
3856
+    ProxyPreserveHost On
3857
+    SSLProxyEngine On
3858
+
3859
+    ProxyPass / https://localhost:7270/
3860
+    ProxyPassReverse / https://localhost:7270/
3861
+#+END_SRC
3862
+
3863
+Save and exit.
3864
+
3865
+#+BEGIN_SRC: bash
3866
+a2enmod cache
3867
+a2enmod disk_cache
3868
+apachectl configtest
3869
+service apache2 restart
3870
+npm install forever -g
3871
+#+END_SRC
3872
+
3873
+Now create the daemon.
3874
+
3875
+#+BEGIN_SRC: bash
3876
+emacs /etc/init.d/pumpio
3877
+#+END_SRC
3878
+
3879
+Add the following text:
3880
+
3881
+#+BEGIN_SRC: bash
3882
+#!/bin/bash
3883
+# /etc/init.d/pumpio
3884
+
3885
+### BEGIN INIT INFO
3886
+# Provides:          pump.io
3887
+# Required-Start:    $remote_fs $syslog
3888
+# Required-Stop:     $remote_fs $syslog
3889
+# Default-Start:     2 3 4 5
3890
+# Default-Stop:      0 1 6
3891
+# Short-Description: starts pump.io as a background daemon
3892
+# Description:       Starts pump.io on boot
3893
+### END INIT INFO
3894
+
3895
+# Author: Bob Mottram <bob@robotics.uk.to>
3896
+
3897
+#Settings
3898
+SERVICE='pumpio'
3899
+COMMAND="forever /opt/pump.io/bin/pump > /var/local/pump.io/daemon.log"
3900
+USERNAME='pumpio'
3901
+NICELEVEL=19 # from 0-19 the bigger the number, the less the impact on system resources
3902
+HISTORY=1024
3903
+INVOCATION="nice -n ${NICELEVEL} ${COMMAND}"
3904
+PATH='/usr/local/sbin:/usr/local/bin:/usr/bin:/sbin:/usr/sbin:/bin:/var/local/pump.io'
3905
+
3906
+pumpio_start() {
3907
+echo "Starting $SERVICE..."
3908
+su --command "screen -h ${HISTORY} -dmS ${SERVICE} ${INVOCATION}" $USERNAME
3909
+}
3910
+
3911
+pumpio_stop() {
3912
+echo "Stopping $SERVICE"
3913
+su --command "screen -p 0 -S ${SERVICE} -X stuff "'^C'"" $USERNAME
3914
+}
3915
+
3916
+#Start-Stop here
3917
+case "$1" in
3918
+  start)
3919
+    pumpio_start
3920
+    ;;
3921
+  stop)
3922
+    pumpio_stop
3923
+    ;;
3924
+  restart)
3925
+    pumpio_stop
3926
+    sleep 10s
3927
+    pumpio_start
3928
+    ;;
3929
+    *)
3930
+  echo "Usage: $0 {start|stop|restart}"
3931
+  exit 1
3932
+  ;;
3933
+esac
3934
+
3935
+exit 0
3936
+#+END_SRC
3937
+
3938
+Save and exit. Then enable the daemon and run it.
3939
+
3940
+#+BEGIN_SRC: bash
3941
+chmod +x /etc/init.d/pumpio
3942
+update-rc.d pumpio defaults
3943
+service pumpio start
3944
+#+END_SRC
3945
+
3946
+Now visit your pump.io site by navigating to:
3947
+
3948
+https://mypumpiodomainname.com
3949
+
3950
+and add a new user.  If you wish this to be a single user node not open to the general public (including spammers and sockpuppets) then edit */etc/pump.io.json* and set *disableRegistration* to *true*.  After making that change restart with the command *service pumpio restart*.
3951
+
3741
 ** Install Gopher
3952
 ** Install Gopher
3742
 *** Server setup
3953
 *** Server setup
3743
 
3954
 
5262
 -- Jason Self
5473
 -- Jason Self
5263
 #+END_VERSE
5474
 #+END_VERSE
5264
 
5475
 
5265
-*** GNU Social
5266
-
5267
 For a microblog you will need a separate domain/subdomain, so see [[Setting up a web site]] for details of how to create an Apache configuration for your microblog.  If you're using freedns then you will need to create a new subdomain.
5476
 For a microblog you will need a separate domain/subdomain, so see [[Setting up a web site]] for details of how to create an Apache configuration for your microblog.  If you're using freedns then you will need to create a new subdomain.
5268
 
5477
 
5269
 Install some dependencies:
5478
 Install some dependencies:
5411
 
5620
 
5412
 When following other GNU Social users enter the URL of your profile.  For example, https://mygnusocialdomain/myusername
5621
 When following other GNU Social users enter the URL of your profile.  For example, https://mygnusocialdomain/myusername
5413
 
5622
 
5414
-*** pump.io
5415
-pump.io is the successor to StatusNet (which later became [[GNU Social]]).  It takes fewer system resources to run and so is better suited to low power servers such as the BBB, but is more complicated to install.  Currently when using self-signed certificates it seems very hard to federate with other pump.io servers so it may be that although GNU Social is an older system it may still be more practical.  For the instructions which follow it will be possible to run your own pump.io site for your family and friends, as a kind of /data silo/, but federating with anyone else could turn out to be difficult or impossible.
5416
-
5417
-A list of pump.io sites can be found at http://pumpstatus.jpope.org
5418
-
5419
-For a pump.io site you will need a separate domain/subdomain, so see [[Setting up a web site]] for details of how to create an Apache configuration for your site.  If you're using freedns then you will need to create a new subdomain.
5420
-
5421
-#+BEGIN_SRC: bash
5422
-apt-get update && apt-get install redis-server nodejs-legacy imagemagick graphicsmagick git-core screen
5423
-cd /opt
5424
-git clone https://github.com/e14n/pump.io.git
5425
-cd /opt/pump.io
5426
-npm install
5427
-npm install databank-redis
5428
-#+END_SRC
5429
-
5430
-Edit the configuration file.
5431
-
5432
-#+BEGIN_SRC: bash
5433
-emacs /etc/pump.io.json
5434
-#+END_SRC
5435
-
5436
-Add the following, replacing /mypumpiodomainname.com/ with your domain name.
5437
-
5438
-#+BEGIN_SRC: bash
5439
-{
5440
-    "driver": "redis",
5441
-    "params": {"host":"localhost","port":6379},
5442
-    "secret":  "A long random string",
5443
-    "noweb":  false,
5444
-    "site":  "Name of my pump.io site",
5445
-    "owner":  "My name or organisation",
5446
-    "ownerURL":  "https://mypumpiodomainname.com/",
5447
-    "port":  7270,
5448
-    "urlPort": 443,
5449
-    "hostname":  "mypumpiodomainname.com",
5450
-    "address":  "localhost",
5451
-    "nologger":  false,
5452
-    "serverUser":  "pumpio",
5453
-	"rejectUnauthorized": false,
5454
-    "key":  "/var/local/pump.io/keys/mypumpiodomainname.com.key",
5455
-    "cert":  "/var/local/pump.io/keys/mypumpiodomainname.com.crt",
5456
-    "uploaddir": "/var/local/pump.io/uploads",
5457
-    "debugClient": false,
5458
-    "firehose": "ofirehose.example",
5459
-	"logfile": "/var/local/pump.io/pump.io.log",
5460
-    "disableRegistration": false
5461
-}
5462
-#+END_SRC
5463
-
5464
-Save and exit.
5465
-
5466
-#+BEGIN_SRC: bash
5467
-export HOSTNAME=mypumpiodomainname.com
5468
-mkdir /var/local/pump.io
5469
-mkdir /var/local/pump.io/uploads
5470
-mkdir /var/local/pump.io/keys
5471
-cp /etc/ssl/private/$HOSTNAME.key /var/local/pump.io/keys
5472
-cp /etc/ssl/certs/$HOSTNAME.crt /var/local/pump.io/keys
5473
-useradd -s /bin/bash -d /var/local/pump.io pumpio
5474
-chown -R pumpio:pumpio /var/local/pump.io
5475
-chmod 400 /var/local/pump.io/keys/*
5476
-mkdir /tmp/apache2
5477
-cd /tmp/apache2
5478
-apt-get build-dep apache2
5479
-apt-get install autoconf
5480
-apt-get source apache2
5481
-cd apache2-*
5482
-wget http://freedombone.uk.to/apache-2.2-wstunnel.patch
5483
-sha256sum apache-2.2-wstunnel.patch
5484
-cfc4866da2688a8eb76e0300cf16b52539ef4e525053a3851d4b6bba9a77e439
5485
-
5486
-patch -p1 -i apache-2.2-wstunnel.patch
5487
-autoconf
5488
-./configure --enable-so --enable-proxy=shared --enable-proxy-wstunnel=shared
5489
-make
5490
-cp modules/proxy/.libs/mod_proxy_wstunnel.so  /usr/lib/apache2/modules/
5491
-cd /etc/apache2/mods-enabled
5492
-ln -s /usr/lib/apache2/modules/mod_proxy_wstunnel.so ../mods-available/proxy_wstunnel.load
5493
-#+END_SRC
5494
-
5495
-Within the section of your Apache site configuration:
5496
-
5497
-#+BEGIN_SRC: bash
5498
-emacs /etc/apache2/sites-available/mypumpiodomainname.com
5499
-#+END_SRC
5500
-
5501
-The initial section which begins with *<VirtualHost *:80>* should be replaced by the following, replacing /mypumpiodomainname.com/ with your pump.io domain name and /myusername@mydomainname.com/ with your email address.
5502
-
5503
-#+BEGIN_SRC: bash
5504
-<VirtualHost *:80>
5505
-	ServerAdmin myusername@mydomainname.com
5506
-	ServerName mypumpiodomainname.com
5507
-
5508
-    RewriteEngine On
5509
-    RewriteCond %{HTTPS} off
5510
-    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
5511
-</VirtualHost>
5512
-#+END_SRC
5513
-
5514
-Add the following in the section which begins with *<VirtualHost *:443>*.
5515
-
5516
-#+BEGIN_SRC: bash
5517
-    LoadModule proxy_wstunnel_module /usr/lib/apache2/modules/mod_proxy_wstunnel.so
5518
-
5519
-    <Location /main/realtime/sockjs>
5520
-        ProxyPass wss://localhost/main/realtime/sockjs
5521
-        ProxyPassReverse wss://localhost/main/realtime/sockjs
5522
-    </Location>
5523
-
5524
-#    <LocationMatch ".*\.(jpg|png|gif)$">
5525
-#        CacheEnable disk
5526
-#    </LocationMatch>
5527
-
5528
-    ProxyVia On
5529
-    ProxyPreserveHost On
5530
-    SSLProxyEngine On
5531
-
5532
-    ProxyPass / https://localhost:7270/
5533
-    ProxyPassReverse / https://localhost:7270/
5534
-#+END_SRC
5535
-
5536
-Save and exit.
5537
-
5538
-#+BEGIN_SRC: bash
5539
-a2enmod cache
5540
-a2enmod disk_cache
5541
-apachectl configtest
5542
-service apache2 restart
5543
-npm install forever -g
5544
-#+END_SRC
5545
-
5546
-Now create the daemon.
5547
-
5548
-#+BEGIN_SRC: bash
5549
-emacs /etc/init.d/pumpio
5550
-#+END_SRC
5551
-
5552
-Add the following text:
5553
-
5554
-#+BEGIN_SRC: bash
5555
-#!/bin/bash
5556
-# /etc/init.d/pumpio
5557
-
5558
-### BEGIN INIT INFO
5559
-# Provides:          pump.io
5560
-# Required-Start:    $remote_fs $syslog
5561
-# Required-Stop:     $remote_fs $syslog
5562
-# Default-Start:     2 3 4 5
5563
-# Default-Stop:      0 1 6
5564
-# Short-Description: starts pump.io as a background daemon
5565
-# Description:       Starts pump.io on boot
5566
-### END INIT INFO
5567
-
5568
-# Author: Bob Mottram <bob@robotics.uk.to>
5569
-
5570
-#Settings
5571
-SERVICE='pumpio'
5572
-COMMAND="forever /opt/pump.io/bin/pump > /var/local/pump.io/daemon.log"
5573
-USERNAME='pumpio'
5574
-NICELEVEL=19 # from 0-19 the bigger the number, the less the impact on system resources
5575
-HISTORY=1024
5576
-INVOCATION="nice -n ${NICELEVEL} ${COMMAND}"
5577
-PATH='/usr/local/sbin:/usr/local/bin:/usr/bin:/sbin:/usr/sbin:/bin:/var/local/pump.io'
5578
-
5579
-pumpio_start() {
5580
-echo "Starting $SERVICE..."
5581
-su --command "screen -h ${HISTORY} -dmS ${SERVICE} ${INVOCATION}" $USERNAME
5582
-}
5583
-
5584
-pumpio_stop() {
5585
-echo "Stopping $SERVICE"
5586
-su --command "screen -p 0 -S ${SERVICE} -X stuff "'^C'"" $USERNAME
5587
-}
5588
-
5589
-#Start-Stop here
5590
-case "$1" in
5591
-  start)
5592
-    pumpio_start
5593
-    ;;
5594
-  stop)
5595
-    pumpio_stop
5596
-    ;;
5597
-  restart)
5598
-    pumpio_stop
5599
-    sleep 10s
5600
-    pumpio_start
5601
-    ;;
5602
-    *)
5603
-  echo "Usage: $0 {start|stop|restart}"
5604
-  exit 1
5605
-  ;;
5606
-esac
5607
-
5608
-exit 0
5609
-#+END_SRC
5610
-
5611
-Save and exit. Then enable the daemon and run it.
5612
-
5613
-#+BEGIN_SRC: bash
5614
-chmod +x /etc/init.d/pumpio
5615
-update-rc.d pumpio defaults
5616
-service pumpio start
5617
-#+END_SRC
5618
-
5619
-Now visit your pump.io site by navigating to:
5620
-
5621
-https://mypumpiodomainname.com
5622
-
5623
-and add a new user.  If you wish this to be a single user node not open to the general public (including spammers and sockpuppets) then edit */etc/pump.io.json* and set *disableRegistration* to *true*.  After making that change restart with the command *service pumpio restart*.
5624
-
5625
 ** Install Tripwire
5623
 ** Install Tripwire
5626
 
5624
 
5627
 #+BEGIN_VERSE
5625
 #+BEGIN_VERSE
6161
 Install some dependencies.
6159
 Install some dependencies.
6162
 
6160
 
6163
 #+BEGIN_SRC: bash
6161
 #+BEGIN_SRC: bash
6164
-apt-get install git-core python python-dev python-lxml python-imaging python-virtualenv python-gst0.10 libjpeg8-dev
6162
+apt-get install git-core python python-dev python-lxml python-imaging python-virtualenv python-gst0.10 libjpeg8-dev sqlite3
6165
 #+END_SRC
6163
 #+END_SRC
6166
 
6164
 
6167
-Create a user and an installation directory, replacing /mymediagoblinsite/ with the domain name for your mediagoblin site.
6165
+Create a user, replacing /mymediagoblinsite/ with the domain name for your mediagoblin site.
6168
 
6166
 
6169
 #+BEGIN_SRC: bash
6167
 #+BEGIN_SRC: bash
6170
 export HOSTNAME=mymediagoblinsite
6168
 export HOSTNAME=mymediagoblinsite