https://wiki.diasporafoundation.org/api.php?action=feedcontributions&user=Koehn&feedformat=atomdiaspora* project wiki - User contributions [en]2024-03-29T13:10:36ZUser contributionsMediaWiki 1.39.3https://wiki.diasporafoundation.org/wiki/index.php?title=Alternative_startup_methods&diff=4400Alternative startup methods2015-12-16T15:59:41Z<p>Koehn: /* Init Scripts & Upstart */</p>
<hr />
<div>This page is for listing alternative methods for starting up the Diaspora service automatical or in some manner other than calling the ./script/start<br />
<br />
== Init Scripts & Upstart ==<br />
* [http://anonscm.debian.org/cgit/pkg-ruby-extras/diaspora-installer.git/tree/debian/diaspora-installer.init Init script of debian-installer package]<br />
<br />
Sample /etc/diaspora.conf required by the init script is given below<br />
<br />
<code><pre><br />
export SERVERNAME=localhost<br />
export ENVIRONMENT_URL=https://localhost<br />
export RAILS_ENV=production<br />
export DB=postgres</pre></code><br />
<br />
* <del>[https://github.com/netom/diaspora-init diaspora-init on Github by netom]</del> [https://github.com/ur5/diaspora-init fork of dead repo]<br />
* [https://github.com/jhass/old_diaspora_wiki/blob/master/Init-script-for-diaspora.md Init Script on OLD github page for diaspora]<br />
* [http://stackoverflow.com/questions/9122488/how-to-allow-diaspora-to-start-when-server-boot-up Stack Overflow Ubuntu init script]<br />
* [https://gist.github.com/koehn/fde0832318a6328f20c8 Init script that works as of Diaspora 0.5] (also requires a script in [https://gist.github.com/koehn/c8c8e33388677e09352a <code>/home/diaspora/diaspora/diaspora-init</code>])<br />
<br />
== systemd ==<br />
* [https://github.com/jhass/diaspora/blob/old_systemd/diaspora.service Old systemd unit starting script/server]<br />
* [https://github.com/jhass/diaspora/tree/systemd/systemd modular systemd units] (running puma instead of unicorn and chruby instead of RVM)<br />
<br />
== daemontools ==<br />
* [https://github.com/jhass/diaspora/tree/daemontools/daemontools Unmaintained scripts to start foreman directly]<br />
<br />
== god ==<br />
* [https://github.com/despora/diaspora/blob/despora/script/diaspora.god Despora god config]<br />
* [https://github.com/diasporg/diaspora/blob/master/script/diaspora.god diasp.org god config]<br />
<br />
== Passenger ==<br />
<br />
All you need is the following snippet of Apache configuration in e.g. a <code><VirtualHost></code> block:<br />
<br />
<code><pre><br />
DocumentRoot $diasporapath/public<br />
PassengerAppRoot $diasporapath<br />
PassengerAppEnv production<br />
PassengerRuby $rubypath<br />
</pre></code><br />
<br />
Replace <code>$diasporapath</code> with the path where you installed diaspora*, and replace <code>$rubypath</code> with the Ruby binary Passenger should use (probably what RVM installed, if you use RVM).<br />
<br />
Note, however, that this does not automatically start Sidekiq. You need to do that yourself.</div>Koehnhttps://wiki.diasporafoundation.org/wiki/index.php?title=Template:Installation/Common&diff=4398Template:Installation/Common2015-12-16T15:17:59Z<p>Koehn: /* Start Diaspora */</p>
<hr />
<div>== Get the source ==<br />
<br />
It's time to download Diaspora! As your diaspora user run:<br />
<br />
{{#tag:syntaxhighlight|<br />
cd ~<br />
git clone {{#ifeq: {{#var:mode}}|production|-b master|}} git://github.com/diaspora/diaspora.git<br />
cd diaspora<br />
|lang=bash}}<br />
<br />
Don't miss the <tt>cd diaspora</tt>, all coming commands expect to be run from that directory!<br />
<br />
== Configuration ==<br />
<br />
=== Copy files ===<br />
<br />
{{#tag:syntaxhighlight|<br />
cp config/database.yml.example config/database.yml<br />
cp config/diaspora.yml.example config/diaspora.yml<br />
|lang=bash}}<br />
<br />
{{#ifeq: {{#var:mode}}|production|{{Installation/Configuration}}|}}<br />
{{#ifeq: {{#var:mode}}|production|{{Installation/Reverse_proxy}}|}}<br />
<br />
== Bundle ==<br />
<br />
It's time to install the Ruby libraries required by Diaspora:<br />
<br />
{{#tag:syntaxhighlight|<br />
gem install bundler<br />
{{#ifeq:{{#var:gcc5}}|true|bundle config --local build.sigar '--with-cppflags="-fgnu89-inline"'|}}<br />
{{#var:env_string}} bin/bundle install {{#ifeq: {{#var:mode}}|production|--without test development|}} {{#ifeq: {{#var:mode}}|development|--with {{#switch: {{#var:DB}}|mysql=mysql|postgres=postgresql|mariadb=mysql}}|}}<br />
|lang=bash}}<br />
<br />
This takes quite a while. You should get a green success message when it's finished, if that's not the case you should seek for help on the mailing list or the IRC channel. You can speed it up a bit adding <tt> -jn</tt> to the command, where <tt>n</tt> is the number of CPU cores you have available.<br />
<br />
Running the manual <tt>gem install</tt> command shown in the error message can sometimes show a clearer error message if the <tt>bundle</tt> command fails.<br />
<br />
== Database setup ==<br />
<br />
Double check your <tt>config/database.yml</tt> looks right and run:<br />
<br />
{{#tag:syntaxhighlight|<br />
{{#var:env_string}} bin/rake db:create db:schema:load<br />
|lang=bash}}<br />
<br />
{{#ifeq: {{#var:mode}}|production|{{Installation/Assets}}|}}<br />
<br />
== Start Diaspora ==<br />
<br />
It's time to start Diaspora:<br />
<br />
{{#tag:syntaxhighlight|<br />
{{#ifeq: {{#var:mode}}|development||{{#var:db_prefix}}}}./script/server<br />
|lang="bash"}}<br />
<br />
{{#ifeq: {{#var:mode}}|production|In the most simple case you want to do this inside a [http://www.gnu.org/software/screen/ screen] or [http://tmux.sourceforge.net/ tmux] session from which you can safely detach.|}}<br />
<br />
Alternatively, you can put the following file into <code>/etc/init.d/diaspora</code>:<br />
<br />
#! /bin/sh<br />
<br />
### BEGIN INIT INFO<br />
# Provides: diaspora<br />
# Required-Start: apache2<br />
# Required-Stop: <br />
# Should-Start: <br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: <br />
# Short-Description: Diaspora social networking pod server<br />
# Description: Diaspora is a social networking pod server.<br />
### END INIT INFO<br />
<br />
# Load the VERBOSE setting and other rcS variables<br />
. /lib/init/vars.sh<br />
<br />
# Define LSB log_* functions.<br />
. /lib/lsb/init-functions<br />
<br />
PROC_NAME=Diaspora<br />
HOME_DIR=/home/diaspora<br />
DAEMON=$HOME_DIR/diaspora/diaspora-init<br />
PID_FILE=/var/run/diaspora.pid<br />
RUN_AS_USER=diaspora<br />
WAITFORDAEMON=60<br />
<br />
wait_for_deaddaemon () {<br />
pid=$1<br />
sleep 1<br />
if test -n "$pid"<br />
then<br />
if kill -0 $pid 2>/dev/null<br />
then<br />
cnt=0<br />
while kill -0 $pid 2>/dev/null<br />
do<br />
cnt=`expr $cnt + 1`<br />
if [ $cnt -gt $WAITFORDAEMON ]<br />
then<br />
log_action_end_msg 1 "still running"<br />
exit 1<br />
fi<br />
sleep 1<br />
[ "`expr $cnt % 3`" != 2 ] || log_action_cont_msg ""<br />
done<br />
fi<br />
fi<br />
log_action_end_msg 0<br />
}<br />
<br />
case "$1" in<br />
start)<br />
log_action_begin_msg "Starting $PROC_NAME service: "<br />
if start-stop-daemon --start --user $RUN_AS_USER --pidfile $PID_FILE --startas $DAEMON --chuid $RUN_AS_USER --background --make-pidfile<br />
then<br />
log_action_end_msg 0<br />
else<br />
log_action_end_msg 1<br />
exit 1<br />
fi<br />
;;<br />
<br />
stop)<br />
log_action_begin_msg "Stopping $PROC_NAME service: "<br />
pid=`cat $PID_FILE 2>/dev/null` || true<br />
<br />
if test ! -f $PID_FILE -o -z "$pid"; then<br />
log_action_end_msg 0 "not running - there is no $PID_FILE"<br />
exit 0<br />
fi<br />
<br />
if start-stop-daemon --stop --user $RUN_AS_USER --pidfile $PID_FILE<br />
then<br />
wait_for_deaddaemon $pid<br />
elif<br />
kill -0 $pid 2>/dev/null; then<br />
log_action_end_msg 1 "Is $pid not $PROC_NAME? Is $DAEMON a different binary now?"<br />
exit 1<br />
else<br />
log_action_end_msg 1 "$DAEMON died: process $pid not running; or permission denied"<br />
exit 1<br />
fi<br />
;;<br />
<br />
esac<br />
<br />
And put this file into <code>/home/diaspora/diaspora/diaspora-init</code>:<br />
<br />
#!/bin/bash --login<br />
shopt -s expand_aliases<br />
<br />
export RAILS_ENV=production <br />
export DB=postgres <br />
<br />
cd /home/diaspora/diaspora<br />
<br />
./script/server <br />
<br />
Then run the following command:<br />
<br />
update-rc.d diaspora defaults<br />
<br />
Then Ubuntu will start/stop Diaspora automatically on startup/shutdown. You can manually start Diaspora with <code>service diaspora start</code> and stop it with <code>service diaspora stop</code>.<br />
<br />
== Further reading ==<br />
<br />
* [[Diasporas components explained]]<br />
* Is there anybody out there? [[FAQ_for_pod_maintainers#Am_I_alone_here.3F_.28Establish_connections_with_other_pods.29|Establish connections with other pods]]<br />
* [[FAQ_for_pod_maintainers#What_are_roles_and_how_do_I_use_them.3F_.2F_Make_yourself_an_admin|Make yourself an admin]]<br />
* [[Updating#{{#switch: {{#var:mode}}|production=Updating_a_production_install|development=Updating_a_development_install}}|Updating Diaspora]]<br />
{{#ifeq: {{#var:mode}}|production|* [[Integrating other social networks]]<br />
* [[Alternative startup methods]] (Passenger, Init script, Daemontools, ...)<br />
* [[Asset hosting on S3]]|* [[Getting Started With Contributing]]|}}<br />
<br />
<includeonly><br />
[[Category:Installation]]<br />
[[Category:Podmin]]<br />
</includeonly></div>Koehnhttps://wiki.diasporafoundation.org/wiki/index.php?title=Talk:Updating&diff=2502Talk:Updating2014-01-20T21:56:31Z<p>Koehn: /* Ruby update */</p>
<hr />
<div>== Ruby update ==<br />
<br />
[[User:Koehn]] I don't think we should clutter a general updating guide with information about releases, we got the changelog for that. Is the middle step with <tt>cd .. && cd -</tt> that'll update ruby when necessary not clear enough? Any idea how to improve it? --[[User:MrZYX|MrZYX]] ([[User talk:MrZYX|talk]]) 08:38, 20 January 2014 (UTC)<br />
<br />
It didn't upgrade ruby for me, and there are no instructions on the page to see the changelog.</div>Koehnhttps://wiki.diasporafoundation.org/wiki/index.php?title=Updating&diff=2496Updating2014-01-20T02:59:37Z<p>Koehn: Added note to upgrade ruby to version 2.0.0 if upgrading to diaspora 0.3 or later.</p>
<hr />
<div>Updating Diaspora is fairly straight forward. But sometimes there are special procedures or updates, so always read the [https://github.com/diaspora/diaspora/blob/master/Changelog.md changelog] first.<br />
<br />
= RVM =<br />
<br />
In case you followed the recommended setup and are on RVM, update RVM first:<br />
<br />
<syntaxhighlight lang="bash"><br />
rvm get stable<br />
</syntaxhighlight><br />
<br />
If you are upgrading to diaspora version 0.3 or later, you should install ruby 2.0.0:<br />
<br />
<syntaxhighlight lang="bash"><br />
rvm install ruby 2.0.0 <br />
rvm use 2.0.0<br />
</syntaxhighlight><br />
<br />
= Updating a production install =<br />
<br />
We need to update the code first:<br />
<br />
<syntaxhighlight lang="bash"><br />
git pull<br />
</syntaxhighlight><br />
<br />
Read the output! If you made local modifications to files tracked in git, it might refuse the update or place conflict markers into the files which need to be resolved. If you run on PostgreSQL and get a message about <tt>Gemfile.lock</tt> try <tt>git checkout Gemfile.lock</tt> first.<br />
<br />
In case the recommended Ruby version changed you need to install it. Check with<br />
<syntaxhighlight lang="bash"><br />
cd .. && cd -<br />
</syntaxhighlight><br />
<br />
If that outputs a red warning run the command it gives you and do <tt>cd .. && cd -</tt> again.<br />
<br />
Now we need to update the Ruby libraries:<br />
<br />
<syntaxhighlight lang="bash"><br />
bundle # Or DB=postgres bundle for PostgreSQL users<br />
</syntaxhighlight><br />
<br />
Then lets apply updates to the database schema, attention this might take a bit if you got a big database already.<br />
<br />
<syntaxhighlight lang="bash"><br />
RAILS_ENV=production bundle exec rake db:migrate # As always add DB=postgres to the command if you're a PostgreSQL user<br />
</syntaxhighlight><br />
<br />
Update the static content:<br />
<br />
<syntaxhighlight lang="bash"><br />
bundle exec rake assets:precompile<br />
</syntaxhighlight><br />
<br />
Now you need to restart Diaspora. To do this with the standard startup method you need to get to the place where you run <tt>./script/server</tt>, hit <tt>Ctrl+C</tt> and run it again.<br />
<br />
= Updating a development install =<br />
<br />
Just checkout the develop branch, pull (from upstream), rebundle and migrate the database:<br />
<br />
<syntaxhighlight lang="bash"><br />
cd diaspora<br />
git checkout develop<br />
git pull # Or git pull upstream develop if you cloned from your fork<br />
cd .. && cd -<br />
bundle # Or DB=postgres bundle if you use PostgreSQL<br />
rake db:migrate<br />
</syntaxhighlight><br />
<br />
[[Category:Podmin]]<br />
[[Category:Installation]]</div>Koehnhttps://wiki.diasporafoundation.org/wiki/index.php?title=Tools_to_use_with_Diaspora&diff=2365Tools to use with Diaspora2013-12-06T16:28:44Z<p>Koehn: /* More cool stuff (add ons to make your diaspora experience smarter) */</p>
<hr />
<div>{{Languages}}<br />
<br />
If you're looking for information about how to add diaspora related functionality to your web site, you might want to look at the [[FAQ For Web Developers|FAQ for web developers]].<br />
<br />
== Browser Add-ons ==<br />
<br />
=== Sharing extensions (instantly share on diaspora the page you're visiting) ===<br />
<br />
* [http://sourceforge.net/projects/diasporatools/ Diaspora Tools] - (Firefox) share webpages and images to Diaspora, translate text on Diaspora<br />
* [https://chrome.google.com/webstore/detail/pgblolfhnddeobmfgjhckddncbbfnlim Diaspora* Publisher] - (Chrome) allows you to share your favorite pages with your friends; you can also select and share a specific part of the page.<br />
* [http://soycodigo.wordpress.com/diaspost/ Diaspost] - (Chrome) quickly share webpages to Diaspora<br />
* [http://my.opera.com/coreymwamba/blog/2011/09/07/diaspora-opera-sharing-extension Diaspora* Opera sharing extension] (Opera) quickly share webpages to Diaspora<br />
* [https://addons.mozilla.org/en-US/firefox/addon/diaspora-easyshare/?src=search Diaspora* Easyshare] (Firefox) Firefox addon to share a page in a nice graphical way: image+text+tags. More infos [http://arlogn.github.io/easyshare/ here]<br />
* [http://diasporapictureshare.blogspot.com/ Diaspora* Picture Share] - a modified sharing bookmarklet to quickly share pictures on Diaspora*<br />
* [https://addons.mozilla.org/en-US/firefox/addon/diaspora-advanced-sharer/ Diaspora* Advanced Sharer] (Firefox) Addon to share the current page to any Diaspora pod. Grabs title, URL and selected part of page which is converted from HTML to Markdown (images, lists, urls, etc work).<br />
<br />
=== More cool stuff (add ons to make your diaspora experience smarter) ===<br />
<br />
* [https://addons.mozilla.org/en-US/firefox/addon/lowenzahn/?src=api Löwenzahn] - (Firefox) This addon shows a notification when you get a new Diaspora message or notification. (Note: not compatible with recent versions of Firefox)<br />
* [https://github.com/Faldrian/diasporaAutoUpdate Diaspora AutoUpdate] - Greasemonkey script to automatically update the stream (like Twitter does in it's Webinterface). <small>By Faldrian</small><br />
* [http://userscripts.org/scripts/show/91276 Diaspora Translate] - (Firefox with [https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/ Greasemonkey], Chrome) GreaseMonkey script to translate posts in your stream, also offers hiding non-ssl images.<br />
* [https://chrome.google.com/webstore/detail/diaspora-gif-toggler/dnlohoiofpckikpfjepegcadpgbcailf Diaspora* GIF Toggler] - (Chrome) Stop animated gif in your stream and toggle by clicking.<br />
* [http://dia.so dia.so] - A profile shortener so people on other pods get you on their pod and A url shortener all pod admins can use.<br />
* [https://userscripts.org/scripts/show/165053 Do It Later] - (Firefox with [https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/ Greasemonkey]), a Greasemonkey script which enables you to schedule things to be posted whenever you like. By Deus Figendi.<br />
* [https://userscripts.org/scripts/show/164822 Notification Titler] - (Firefox with [https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/ Greasemonkey]), a Greasemonkey script which adds post titles to items in the notifications drop-down, so you can identify them. By Deus Figendi.<br />
* [http://jenseitsderfenster.de/diasporavisual/ Diaspora Reshare Visualiser] - A Javascript tool to display a flow chart of reshares of a particular post. <br />
* [http://markdownpad.com Markdown Pad] - A popular Markdown editor for Windows Systems. <br />
* [http://sourceforge.net/projects/retext/ ReText] - A simple but efficient Markdown and HTML editor for Linux Systems, including live preview.<br />
* [http://enki-editor.org/ Enki] - A text editor with markdown support (incl. preview) for Linux, MacOSX and Windows. (Ubuntu- & Debian-Packages available)<br />
* [http://unicode-table.com/en/ Unicode Character Table] - Not specific to Diaspora but a very hand for including Unicode like ★ ☂ ☯ ♫ ❤ in your diaspora posts. <br />
* [http://rsv.diapod.net Diaspora Reshare Graph] - A data driven document implementation of the Diaspora Reshare Visualizer<br />
* [http://userscripts.org/scripts/show/171283 Quote Post] - Quotes a post instead of resharing, allows to add own text to the original post. <small>By DeusFigendi</small><br />
* [http://userscripts.org/scripts/show/117102 Tag Filter] - allows to filter postings in the stream by tags, can replace all inline-images and iFrames (Videos) by a textlink or icon (or hides it total), helps to add tags you often use. <small>By DeusFigendi</small><br />
<br />
== WordPress Plugins ==<br />
<br />
* [http://wordpress.org/extend/plugins/webfinger-profile/ Webfinger Profile Plugin for 'Join me' widget] - display a widget on your WordPress blog with your profile information from Diaspora, [http://blog.duthied.com/2011/08/30/webfinger-profile-plugin/ more info]<br />
* [https://github.com/diaspora/wp-post-to-diaspora Wordpress plugin: wp-post-to-diaspora] when you make a new blog post, this plugin will post a link to it to your diaspora account<br />
* [http://gattonero.me/1041CdI Sociable] - a WordPress plugin customized for share content also on Diaspora*<br />
<br />
== Programmer Tools ==<br />
<br />
* [https://aur.archlinux.org/packages/cliaspora/ Cliaspora] - A command-line client for Diaspora* <br />
* [https://github.com/marekjm/diaspy Diaspy] - Unofficial Python API for Diaspora<br />
* [https://github.com/jaywink/diaspora-tools Diaspora Tools] - Python pod2pod contacts and aspects migration script. Alpha quality.<br />
<br />
== Gnu/Linux Command Line Voodoo ==<br />
If you whant to change your Pod you may need a list of your contacts. This shell command may be usefull for you. Export your Data via "Settings - Account - Export Data - download my xml" and rename this file to d-exported-in.xml<br />
Then run this shell script:<br />
<br />
<pre>grep 'diaspora_handle' d-exported-in.xml | cut -d '>' -f 2 | cut -d '<' -f 1 | sort | uniq | tee d-contacts-out.txt<br />
</pre><br />
<br />
you'll get the file "d-contacts-out.txt" wich is a list of all your contacts.<br />
<br />
<br />
[[Category:Community]]<br />
[[Category:Github transfer done]]</div>Koehn