<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>guide &amp;mdash; progressiv.dev blog</title>
    <link>https://blog.progressiv.dev/suguru/tag:guide</link>
    <description></description>
    <pubDate>Tue, 28 Apr 2026 17:59:48 +0000</pubDate>
    <item>
      <title>Write.as and WriteFreely, documentation and links</title>
      <link>https://blog.progressiv.dev/suguru/links-to-documentation-of-write-as-and-writefreely</link>
      <description>&lt;![CDATA[This article discusses Write.as and WriteFreely. It also shows you links to their guide pages.&#xA;&#xA;!--more--&#xA;&#xA;Write.as&#xA;&#xA;Write.as is a company founded in 2015. It provides platforms to publish contents in Internet, including its flagship product, Write.as, the same name application as the company. You can host your site with either Free or Pro account. The service is powered by its core applications and WriteFreely.&#xA;&#xA;Write.as Guide: https://guides.write.as/&#xA;  Writing Posts&#xA;  Publishing a blog&#xA;  Customizing Write.as&#xA;  Publicizing Posts&#xA;How to use Write.as: https://howto.write.as/&#xA;  Organization&#xA;  Adding Photos&#xA;  Show an Excerpt&#xA;  Creating a Static Page&#xA;  Creating a draft&#xA;  Enable Federation&#xA;&#xA;WriteFreely&#xA;&#xA;WriteFreely is an open source static site generator, developed at GitHub by Write.as company. It is one of the core applications used on Write.as product. It is possible to run WriteFreely on your server. This case you are expected to manage everything by yourself. You can also create your site on public instances listed here.&#xA;&#xA;https://writefreely.org/&#xA;https://writefreely.org/docs/&#xA;https://blog.writefreely.org/ (hosted on Write.as)&#xA;&#xA;Though almost all of the functions are common between Write.as and WriteFreely, one of the main differences between Write.as Pro and WriteFreely is that you have to find places where you upload images by yourself, as WriteFreely does not include an image uploader or an image management application.&#xA;&#xA;https://guides.write.as/writing/#uploading-photos&#xA;&#xA;  Write.as Pro users can upload photos to Snap.as. Unlike free services such as imgur, Snap.as is developed by us and funded by you — which means your photos will have a lasting, ad-free home on the web&#xA;&#xA;This should not be a big problem if you host your WriteFreely on a server as you just can upload images to it. You would have to use a FTP client or scp / rsync via SSH to upload them. Uploading to Amazon S3 or Tardigrade should work too. &#xA;&#xA;There are other differences such as Email subscription, publishing via Email, cross-posting with Twitter, etc. Please check this page to see what you can get on Write.as Pro account and what you cannot on either Write.as Free account or your WriteFreely instance.&#xA;&#xA;Installation guides:&#xA;https://writefreely.org/start&#xA;https://discuss.write.as/t/slightly-less-simple-install-how-to/303&#xA;&#xA;If you are willing to host a WriteFreely instance with SSL support, I would recommend you to have a look at the latter instruction. Some of the commands seem outdated, so please check the latest information.&#xA;&#xA;#fediverse #writeas #writefreely #guide&#xA;&#xA;Copyright (C) 2021 Suguru Hirahara. This work is available under GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation. See https://blog.progressiv.dev/yq31akw3jj for copying conditions.]]&gt;</description>
      <content:encoded><![CDATA[<p>This article discusses <a href="https://write.as/" rel="nofollow">Write.as</a> and <a href="https://writefreely.org/" rel="nofollow">WriteFreely</a>. It also shows you links to their guide pages.</p>



<h2 id="write-as">Write.as</h2>

<p><a href="https://write.as/about" rel="nofollow">Write.as</a> is a company founded in 2015. It provides platforms to publish contents in Internet, including its flagship product, Write.as, the same name application as the company. You can <a href="https://write.as/start" rel="nofollow">host</a> your site with either Free or Pro account. The service is powered by its core applications and WriteFreely.</p>
<ul><li>Write.as Guide: <a href="https://guides.write.as/" rel="nofollow">https://guides.write.as/</a>
<ul><li><a href="https://guides.write.as/writing/" rel="nofollow">Writing Posts</a></li>
<li><a href="https://guides.write.as/blogging/" rel="nofollow">Publishing a blog</a></li>
<li><a href="https://guides.write.as/customizing/" rel="nofollow">Customizing Write.as</a></li>
<li><a href="https://guides.write.as/publicizing/" rel="nofollow">Publicizing Posts</a></li></ul></li>
<li>How to use Write.as: <a href="https://howto.write.as/" rel="nofollow">https://howto.write.as/</a>
<ul><li><a href="https://howto.write.as/organization" rel="nofollow">Organization</a></li>
<li><a href="https://howto.write.as/adding-photos" rel="nofollow">Adding Photos</a></li>
<li><a href="https://howto.write.as/show-an-excerpt" rel="nofollow">Show an Excerpt</a></li>
<li><a href="https://howto.write.as/creating-a-static-page" rel="nofollow">Creating a Static Page</a></li>
<li><a href="https://howto.write.as/creating-a-draft" rel="nofollow">Creating a draft</a></li>
<li><a href="https://howto.write.as/enabling-federation" rel="nofollow">Enable Federation</a></li></ul></li></ul>

<h2 id="writefreely">WriteFreely</h2>

<p><a href="https://writefreely.org/" rel="nofollow">WriteFreely</a> is an open source static site generator, developed at <a href="https://github.com/writeas/writefreely" rel="nofollow">GitHub</a> by Write.as company. It is one of the core <a href="https://write.as/apps" rel="nofollow">applications</a> used on Write.as product. It is possible to run WriteFreely on your server. This case you are expected to manage everything by yourself. You can also create your site on public instances listed <a href="https://writefreely.org/instances" rel="nofollow">here</a>.</p>
<ul><li><a href="https://writefreely.org/" rel="nofollow">https://writefreely.org/</a></li>
<li><a href="https://writefreely.org/docs/" rel="nofollow">https://writefreely.org/docs/</a></li>
<li><a href="https://blog.writefreely.org/" rel="nofollow">https://blog.writefreely.org/</a> (hosted on Write.as)</li></ul>

<p>Though almost all of the functions are common between Write.as and WriteFreely, one of the main differences between <strong>Write.as Pro</strong> and WriteFreely is that you have to find places where you upload images by yourself, as WriteFreely does not include an image uploader or an image management application.</p>

<p><a href="https://guides.write.as/writing/#uploading-photos" rel="nofollow">https://guides.write.as/writing/#uploading-photos</a></p>

<blockquote><p>Write.as Pro users can upload photos to Snap.as. Unlike free services such as imgur, Snap.as is developed by us and funded by you — which means your photos will have a lasting, ad-free home on the web</p></blockquote>

<p>This should not be a big problem if you host your WriteFreely on a server as you just can upload images to it. You would have to use a FTP client or <a href="https://linuxize.com/post/how-to-use-scp-command-to-securely-transfer-files/" rel="nofollow">scp</a> / <a href="https://linuxize.com/post/how-to-transfer-files-with-rsync-over-ssh/" rel="nofollow">rsync</a> via SSH to upload them. Uploading to Amazon S3 or <a href="https://tardigrade.io/" rel="nofollow">Tardigrade</a> should work too.</p>

<p>There are other differences such as <a href="https://howto.write.as/email-subscription" rel="nofollow">Email subscription</a>, <a href="https://howto.write.as/publish-via-email" rel="nofollow">publishing via Email</a>, <a href="https://howto.write.as/cross-posting-with-twitter" rel="nofollow">cross-posting with Twitter</a>, etc. Please check this <a href="https://write.as/start" rel="nofollow">page</a> to see what you can get on Write.as Pro account and what you cannot on either Write.as Free account or your WriteFreely instance.</p>

<h3 id="installation-guides">Installation guides:</h3>
<ul><li><a href="https://writefreely.org/start" rel="nofollow">https://writefreely.org/start</a></li>
<li><a href="https://discuss.write.as/t/slightly-less-simple-install-how-to/303" rel="nofollow">https://discuss.write.as/t/slightly-less-simple-install-how-to/303</a></li></ul>

<p>If you are willing to host a WriteFreely instance with SSL support, I would recommend you to have a look at the latter instruction. Some of the commands seem outdated, so please check the latest information.</p>

<p><a href="/suguru/tag:fediverse" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">fediverse</span></a> <a href="/suguru/tag:writeas" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">writeas</span></a> <a href="/suguru/tag:writefreely" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">writefreely</span></a> <a href="/suguru/tag:guide" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">guide</span></a></p>

<p>Copyright © 2021 Suguru Hirahara. This work is available under GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation. See <a href="https://blog.progressiv.dev/yq31akw3jj" rel="nofollow">https://blog.progressiv.dev/yq31akw3jj</a> for copying conditions.</p>
]]></content:encoded>
      <guid>https://blog.progressiv.dev/suguru/links-to-documentation-of-write-as-and-writefreely</guid>
      <pubDate>Thu, 28 Jan 2021 06:24:29 +0000</pubDate>
    </item>
    <item>
      <title>How to install diaspora*, decentralized social network, on Debian 10 -- installation guide for beginners</title>
      <link>https://blog.progressiv.dev/suguru/how-to-install-diaspora-decentralized-social-network-on-debian-10</link>
      <description>&lt;![CDATA[This article shows you how to install diaspora 0.7.14.0 on Debian 10.&#xA;&#xA;!--more--&#xA;&#xA;0. Introduction&#xA;&#xA;What is &#34;diaspora&#34; ?&#xA;&#xA;https://www.howtoforge.com/how-to-install-diaspora-decentralized-social-media-on-debian-10/&#xA;&#xA;  Diaspora is an open-source, privacy-aware, and distributed social network. It consists of a group of independently deployed and owned nodes which interoperate to create the network. Diaspora is a social network that focused on three philosophy, decentralization, freedom, and privacy.&#xA;&#xA;Manual installation is preferred&#xA;&#xA;I assume that maybe you were looking for a way of installing diaspora with a tool such as Docker or Ansible.&#xA;&#xA;I understand you would prefer an isolated environment so that you could remove packages whenever you would like to.&#xA;&#xA;However, unfortunately, neither Docker nor Ansible playbook is supported officially as of now. Technically, Docker support has been implemented here, but it lacks documentation and is mainly for development. See: https://github.com/diaspora/diaspora/pull/7870#issuecomment-429594392&#xA;&#xA;Bitnami installer is officially discouraged&#xA;&#xA;There is also an installer by Bitnami provided here.&#xA;&#xA;However, keep in mind that it is not officially supported. It is also discouraged by the develpment team.&#xA;&#xA;https://discourse.diasporafoundation.org/t/noob-using-bitnami-ports-and-security-help/3202/2&#xA;&#xA;  The general advice is “don’t use Bitnami or anything else that claims to be able to set up diaspora”, because they can’t. Our official installation docs are found in the wiki, and they explain everything, including the config files.&#xA;&#xA;Though it is not clear if it means that they cannot create an installer properly because of technical limitation of some sort or that they are just poor at programming, there is a lot of reports at the official forum about the bitnami installer&#39;s issue.&#xA;&#xA;Basically, the only recommended way of installing diaspora is to install packages and configure them manually, including a web server, a SSL certificate, etc.&#xA;&#xA;Official instructions are for advanced users&#xA;&#xA;There are instructions for installation on the official wiki page, but probably it is safe to say that they are for advanced users. There you are expected to have set up a web server and a database software and configured them already, which is a tough task for beginners.&#xA;&#xA;Acknowledgement&#xA;&#xA;The article is based on: https://www.howtoforge.com/how-to-install-diaspora-decentralized-social-media-on-debian-10/. I tried these commands by myself and verified it worked on Debian 10. Below I tweaked only tiny parts to improve the instruction. Huge thanks to the author of the original article!&#xA;&#xA;Disclaimer&#xA;&#xA;This guide is written for Debian 10. It is not tested for neither previous nor future versions. The name or version of the packages may change, so please make sure that you are installing proper packages.&#xA;&#xA;For the latest information, please consult the documentations on the official wiki and the project page at GitHub. The FAQ page for server administrators is worth checking when you experience an issue.&#xA;&#xA;As of now, the latest version of diaspora is 0.7.14.0.&#xA;&#xA;1. Initial server setup&#xA;&#xA;Before proceeding, you should not forget to configure the basic security setting of your machine. Initial Server Setup with Debian 10 on DigitalOcean is a nice guide for beginners.&#xA;&#xA;Now the basic security setting has been configured, let&#39;s start installation.&#xA;&#xA;First, log in as root if you are not.&#xA;&#xA;$ su - root&#xA;&#xA;(If you are familiar with sudo already, you can safely run these commands below with # with sudo, after adding the current user to sudo group with root user.)&#xA;&#xA;Next, update system packages.&#xA;&#xA;apt update &amp;&amp; apt upgrade -y&#xA;&#xA;Since this instruction uses vim as a text editor, install vim.  You&#39;ll need sudo too.&#xA;&#xA;apt install vim sudo&#xA;&#xA;Of course, you could choose your favorite text editor such as emacs and nano.&#xA;&#xA;2. Install dependencies&#xA;&#xA;First, install the basic packages to install diaspora with this command:&#xA;&#xA;apt install build-essential cmake gnupg2 libssl-dev libcurl4-openssl-dev libxml2-dev libxslt-dev imagemagick ghostscript curl libmagickwand-dev git libpq-dev redis-server nodejs postgresql&#xA;&#xA;Start redis-server&#xA;&#xA;Let&#39;s start redis-server.&#xA;&#xA;systemctl start redis-server&#xA;&#xA;systemctl enable redis-server&#xA;&#xA;Start postgresql&#xA;&#xA;Start postgresql too.&#xA;&#xA;systemctl start postgresql&#xA;&#xA;systemctl enable postgresql&#xA;&#xA;3. Create a new user on postgresql&#xA;&#xA;Here we are going to add a user on postgresql, a database software.&#xA;&#xA;Since we have installed and started it already, log in to the postgresql shell with:&#xA;&#xA;sudo -i -u postgres psql&#xA;&#xA;First, change the password for the default user by running this command.&#xA;&#xA;postgres=# \password postgres&#xA;&#xA;Then, run the command below to create a database user diaspora. Please do not forget to replace yourpassword with a new one.&#xA;&#xA;postgres=# CREATE USER diaspora WITH CREATEDB PASSWORD &#39;yourpassword&#39;;&#xA;&#xA;Those information will be required later when we configure diaspora (step 6), so please take a note of them.&#xA;&#xA;Now the database user has been added, run exit to log out from postgres shell.&#xA;&#xA;postgres=# exit&#xA;&#xA;4. Create a new user on Debian to install diaspora&#xA;&#xA;Now let&#39;s add a new user diaspora to Debian, with which you&#39;ll install diaspora.&#xA;&#xA;First, make sure you are on root. If you are not, run this command to log in to root user: $ su - root.&#xA;&#xA;Please run this command to add diaspora.&#xA;&#xA;adduser --disabled-login diaspora&#xA;&#xA;Do not forget to set a password of the user.&#xA;&#xA;passwd diaspora&#xA;&#xA;Let&#39;s add the user to sudo group.&#xA;&#xA;usermod -aG sudo diaspora&#xA;&#xA;5. Install ruby with rvm&#xA;&#xA;Before installing diaspora, we need to install ruby for the user.&#xA;&#xA;In this instruction we are going to use RVM (Ruby Bersion Manager) to install ruby 2.6, the supported version for diaspora as of now.&#xA;&#xA;Install GPG keys&#xA;&#xA;First, before installing RVM, log in to diaspora with this command:&#xA;&#xA;su - diaspora&#xA;&#xA;Then, add GPG keys to proceed with RVM installation.&#xA;&#xA;In order to add them, run the command on this official page here: https://rvm.io/rvm/install#install-gpg-keys.&#xA;&#xA;Since the GPG keys can be revoked and replaced with new ones any time, please do not forget to check the latest information. Also, please remember not to copy and paste GPG key values from a third party website.&#xA;&#xA;Install and load RVM&#xA;&#xA;After installing the keys, let&#39;s install the stable RVM.&#xA;&#xA;$ curl -sSL https://get.rvm.io | bash -s stable&#xA;&#xA;Then, load the RVM&#39;s script with:&#xA;&#xA;$ source /home/diaspora/.rvm/scripts/rvm&#xA;&#xA;Install ruby 2.6&#xA;&#xA;Note: the required version of ruby may change in the future. Before installing ruby, please consult the installation guide on the official wiki for the supported version.&#xA;&#xA;As of now, ruby 2.6 is recommended, so let&#39;s install it with RVM:&#xA;&#xA;$ rvm install 2.6&#xA;&#xA;6. Install and configure diaspora&#xA;&#xA;In this step we are finally going to install diaspora.&#xA;&#xA;At first, confirm you are logged in as diaspora. If not, run this command: $ su - diaspora.&#xA;&#xA;Download source code&#xA;&#xA;Run this command to download the latest stable source code of diaspora.&#xA;&#xA;$ git clone -b master https://github.com/diaspora/diaspora.git&#xA;&#xA;If you are willing to test/develop diaspora, switch to develop branch.&#xA;&#xA;Note: if master branch cannot be found, it is likely that it has been renamed to main branch. In this case, run instead: $ git clone -b main https://github.com/diaspora/diaspora.git.&#xA;&#xA;Copy configuration files&#xA;&#xA;Next, move to the source code directory, where you are going to install diaspora.&#xA;&#xA;$ cd diaspora&#xA;&#xA;Here you are required to configure two configuration files, one for the database connection (database.yml) and the other for diaspora itself (diaspora.yml).&#xA;&#xA;First, let&#39;s copy example configuration files by running these two commands.&#xA;&#xA;$ cp config/database.yml.example config/database.yml&#xA;&#xA;$ cp config/diaspora.yml.example config/diaspora.yml&#xA;&#xA;Note: in a future version, diaspora.yml.example will be replaced with dispora.toml.example. In case you cannot find diaspora.yml.example, try this command instead: $ cp config/diaspora.toml.example config/diaspora.toml.&#xA;&#xA;Edit database configuration file&#xA;&#xA;At first, we are going to configure database.yml. Open the file on vim with:&#xA;&#xA;$ vim config/database.yml&#xA;&#xA;Inside the file, there should be a postgresql section.&#xA;&#xA;postgresql: &amp;postgresql&#xA;  adapter: postgresql&#xA;  host: &#34;localhost&#34;&#xA;  port: 5432&#xA;  username: &#34;diaspora&#34;&#xA;  password: &#34;yourpassword&#34;&#xA;  encoding: unicode&#xA;&#xA;Please replace yourpassword with your own password which you have set on the step 3 above.&#xA;&#xA;After editing, save the change and close the file.&#xA;&#xA;Edit diaspora configuration file&#xA;&#xA;Next, open diaspora.yml inside config folder.&#xA;&#xA;$ vim config/diaspora.yml&#xA;&#xA;Note: If you cannot find diaspora.yml, try this command: $ vim config/diaspora.toml.&#xA;&#xA;There are many options you would like to change later (enabling/disabling of account creation, captcha on creating account, etc.), but for now let&#39;s just edit something important.&#xA;&#xA;The critical configurations are url, certificateauthorities, and railsenvironment.&#xA;&#xA;url&#xA;&#xA;First, look for url under environment, and replace it with the domain where you are going to host a diaspora instance.&#xA;&#xA;Since we are going to serve a diaspora instance on HTTPS, do not forget add the domain with https://.&#xA;&#xA;As said explicitly in the configuration file, you cannot change the value later. So please be careful to pick a right domain!&#xA;&#xA;certificateauthorities&#xA;&#xA;Next, we need to set certificate authorities.&#xA;&#xA;Just under the url setting, there should be the line which starts from #certificateauthorities.&#xA;&#xA;Since we are on Debian, remove # of the first one. It should be like certificateauthorities = &#34;/etc/ssl/certs/ca-certificates.crt&#34;.&#xA;&#xA;railsenvironment&#xA;&#xA;Then, let&#39;s set the rails environment value to production.&#xA;&#xA;Under server section, there should be the line which starts with #railsenvironment. Please remove the hash and set it to railsenvironment = &#34;production&#34;.&#xA;&#xA;Disable captcha on registration&#xA;&#xA;Since captcha does not work well, you have to disable it as of now. See: https://github.com/diaspora/diaspora/issues/6828&#xA;&#xA;Under settings and captcha section, there should be option enable.  Please set it to enable: false.&#xA;&#xA;After those changes, the configuration file should be set as below.&#xA;&#xA;configuration: ## Section&#xA;...&#xA;  environment: ## Section&#xA;...&#xA;    url: &#34;https://example.com&#34;&#xA;    certificateauthorities: &#39;/etc/ssl/certs/ca-certificates.crt&#39;&#xA;...&#xA;  server: ## Section&#xA;    railsenvironment: &#39;production&#39;&#xA;...&#xA;  settings: ## Section&#xA;...&#xA;    captcha: ## Section&#xA;      enable: false&#xA;...&#xA;&#xA;where https://example.com should be your own domain with https://.&#xA;&#xA;Install gem and ruby libraries&#xA;&#xA;Here we are going to install applications required for diaspora. On diaspora user, run these commands to install them.&#xA;&#xA;$ gem install bundler&#xA;&#xA;$ script/configurebundler&#xA;&#xA;$ bin/bundle install --full-index&#xA;&#xA;Migrate database&#xA;&#xA;Run this command to migrate the database.&#xA;&#xA;$ RAILSENV=production bundle exec rake db:create db:migrate&#xA;&#xA;Compile assets&#xA;&#xA;Run this command to compile assets.&#xA;&#xA;$ RAILSENV=production bin/rake assets:precompile&#xA;&#xA;Here diaspora has been installed on your system. Below we are going to prepare the system for running and serving it properly.&#xA;&#xA;7. Set up diaspora as a service&#xA;&#xA;Now, we are going to set up diaspora to run as a service.&#xA;&#xA;First, log in as root.&#xA;&#xA;$ su - root&#xA;&#xA;Next, move to the directory below:&#xA;&#xA;cd /etc/systemd/system/&#xA;&#xA;Inside the directory, we are going to create three files, diaspora.target, diaspora-web.service, and diaspora-sidekiq.service.&#xA;&#xA;diaspora.target&#xA;&#xA;Create a new file with vim.&#xA;&#xA;vim diaspora.target&#xA;&#xA;Copy and paste the configuration below to the file.&#xA;&#xA;[Unit]&#xA;Description=Diaspora social network&#xA;Wants=postgresql.service&#xA;Wants=redis-server.service&#xA;After=redis-server.service&#xA;After=postgresql.service&#xA;&#xA;[Install]&#xA;WantedBy=multi-user.target&#xA;&#xA;Save and close it.&#xA;&#xA;diaspora-web.service&#xA;&#xA;Next, create a new service for diaspora web interface:&#xA;&#xA;vim diaspora-web.service&#xA;&#xA;Copy and paste the configuration:&#xA;&#xA;[Unit]&#xA;Description=Diaspora social network (unicorn)&#xA;PartOf=diaspora.target&#xA;StopWhenUnneeded=true&#xA;&#xA;[Service]&#xA;User=diaspora&#xA;Environment=RAILSENV=production&#xA;WorkingDirectory=/home/diaspora/diaspora&#xA;ExecStart=/bin/bash -lc &#34;bin/bundle exec unicorn -c config/unicorn.rb -E production&#34;&#xA;Restart=always&#xA;&#xA;[Install]&#xA;WantedBy=diaspora.target&#xA;&#xA;Save and close it.&#xA;&#xA;diaspora-sidekiq.service&#xA;&#xA;Finally, create a new service for the monitoring service:&#xA;&#xA;vim diaspora-sidekiq.service&#xA;&#xA;Copy and paste the configuration:&#xA;&#xA;[Unit]&#xA;Description=Diaspora social network (sidekiq)&#xA;PartOf=diaspora.target&#xA;StopWhenUnneeded=true&#xA;&#xA;[Service]&#xA;User=diaspora&#xA;Environment=RAILSENV=production&#xA;WorkingDirectory=/home/diaspora/diaspora&#xA;ExecStart=/bin/bash -lc &#34;bin/bundle exec sidekiq&#34;&#xA;Restart=always&#xA;&#xA;[Install]&#xA;WantedBy=diaspora.target&#xA;&#xA;Save and close it.&#xA;&#xA;Register services&#xA;&#xA;Here we are going to set those services to run automatically on reboot.&#xA;&#xA;First, reload the systemctl daemon.&#xA;&#xA;systemctl daemon-reload&#xA;&#xA;Next, enable those services with this command.&#xA;&#xA;systemctl enable diaspora.target diaspora-sidekiq.service diaspora-web.service&#xA;&#xA;Run diaspora.target to start the two services.&#xA;&#xA;systemctl start diaspora.target&#xA;&#xA;In order to check if they are up and running, run these commands.&#xA;&#xA;systemctl status diaspora-web&#xA;&#xA;systemctl status diaspora-sidekiq&#xA;&#xA;8. Install SSL certificate with certbot&#xA;&#xA;Install certbot&#xA;&#xA;In this instruction we are going to use certbot by EFF to obtain Let&#39;s Encrypt certificates automatically.&#xA;&#xA;First, install certbot.&#xA;&#xA;apt install certbot&#xA;&#xA;Obtain Let&#39;s Encrypt certificate&#xA;&#xA;Then, run this command to make certbot obtain the SSL certificate.&#xA;&#xA;certbot certonly --rsa-key-size 2048 --standalone --agree-tos --no-eff-email --email example@example.com -d example.com&#xA;&#xA;Please do not forget to replace the email address (example@example.com) and domain (example.com). Since you may receive important information later, such as a SSL expiration warning, you should use a reachable email address.&#xA;&#xA;Also, please note that there are rate limits on Let&#39;s Encrypt. You should be careful not to exceed the limit, otherwise you would need to wait one week until it becomes possible again to obtain the certificate for the same domain.&#xA;&#xA;  Renewals are treated specially: they don’t count against your Certificates per Registered Domain limit, but they are subject to a Duplicate Certificate limit of 5 per week.&#xA;    Exceeding the Duplicate Certificate limit is reported with the error message too many certificates already issued for exact set of domains.&#xA;&#xA;9. Install and configure the web server&#xA;&#xA;Here, we are going to install and configure nginx to serve diaspora with HTTPS.&#xA;&#xA;First, let&#39;s install nginx.&#xA;&#xA;apt install nginx&#xA;&#xA;Create a configuration file&#xA;&#xA;Then, create a configuration file with vim.&#xA;&#xA;vim /etc/nginx/sites-available/diaspora&#xA;&#xA;Copy and paste the configuration below. Please don&#39;t forget to replace example.com with your own domain.&#xA;&#xA;upstream diasporaserver {&#xA; server unix:/home/diaspora/diaspora/tmp/diaspora.sock;&#xA;}&#xA;&#xA;server {&#xA;  listen 80;&#xA;  listen [::]:80;&#xA;  servername example.com;&#xA;  return 301 https://example.com$requesturi;&#xA;&#xA;  accesslog /dev/null;&#xA;  errorlog /dev/null;&#xA;}&#xA;&#xA;server {&#xA;  listen 443 ssl http2;&#xA;  listen [::]:443 ssl http2;&#xA;  servername example.com;&#xA;&#xA;  accesslog /var/log/nginx/dspr-access.log;&#xA;  errorlog /var/log/nginx/dspr-error.log;&#xA;&#xA;  sslcertificate /etc/letsencrypt/live/example.com/fullchain.pem;&#xA;  sslcertificatekey /etc/letsencrypt/live/example.com/privkey.pem;&#xA;&#xA;  sslprotocols TLSv1.2;&#xA;  sslciphers EECDH+CHACHA20:EECDH+AESGCM:EECDH+AES;&#xA;  sslecdhcurve X25519:P-521:P-384:P-256;&#xA;  sslpreferserverciphers on;&#xA;  sslsessioncache shared:SSL:10m;&#xA;&#xA;  root /home/diaspora/diaspora/public;&#xA;&#xA;  clientmaxbodysize 5M;&#xA;  clientbodybuffersize 256K;&#xA;&#xA;  tryfiles $uri @diaspora;&#xA;&#xA;  location /assets/ {&#xA;    expires max;&#xA;    addheader Cache-Control public;&#xA;  }&#xA;&#xA;  location @diaspora {&#xA;    proxysetheader X-Real-IP $remoteaddr;&#xA;    proxysetheader X-Forwarded-For $proxyaddxforwardedfor;&#xA;    proxysetheader X-Forwarded-Proto https;&#xA;    proxysetheader Host $httphost;&#xA;    proxyredirect off;&#xA;    proxypass http://diasporaserver;&#xA;  }&#xA;}&#xA;&#xA;Activate and run nginx&#xA;&#xA;Next, activate the server configuration with the command below.&#xA;&#xA;ln -s /etc/nginx/sites-available/diaspora /etc/nginx/sites-enabled/&#xA;&#xA;Before enabling nginx, let&#39;s check if configuration is correct.&#xA;&#xA;nginx -t&#xA;&#xA;Please correct an error if any.&#xA;&#xA;After checking the configuration, restart the server and set it to run on reboot automatically.&#xA;&#xA;systemctl restart nginx&#xA;&#xA;systemctl enable nginx&#xA;&#xA;Install certbot plug-in for nginx&#xA;&#xA;Next, install python-certbot-nginx. This is required for certbot to renew a SSL certificate for you.&#xA;&#xA;apt install certbot python-certbot-nginx&#xA;&#xA;Let&#39;s test if certbot should work properly. With --dry-run you can simulate the renewal and test if there would be something wrong.&#xA;&#xA;certbot renew --dry-run&#xA;&#xA;If you get the message Congratulations, all renewals succeeded. it should be fine. From now on, certbot will take care of certificate renewal for you.&#xA;&#xA;Now, your diaspora instance should be up and ready!&#xA;&#xA;Please go to your domain for diaspora on a web browser, and you should be able to visit your diaspora instance.&#xA;&#xA;10. Maintenance&#xA;&#xA;Update diaspora&#xA;&#xA;Courtesy of: https://stanislas.blog/2018/02/setup-diaspora-pod-debian-ubuntu/&#xA;&#xA;If you are doing a major version update, please follow the instruction on the official wiki page.&#xA;&#xA;In order to update diaspora, log in to diaspora user with this command.&#xA;&#xA;su - diaspora&#xA;&#xA;Before updating, stop the diaspora services with this command (with sudo).&#xA;&#xA;$ sudo systemctl stop diaspora.target&#xA;&#xA;To update diaspora source code, go to the diaspora directory and get the latest source code with this command.&#xA;&#xA;$ cd diaspora &amp;&amp; git pull&#xA;&#xA;In order to update dependencies, run these commands.&#xA;&#xA;$ gem install bundler&#xA;&#xA;$ bin/bundle --full-index&#xA;&#xA;To update the database, run this command.&#xA;&#xA;$ RAILSENV=production bin/rake db:migrate&#xA;&#xA;To compile assets again, run:&#xA;&#xA;$ RAILSENV=production bin/rake assets:precompile&#xA;&#xA;To reflect those changes, start diaspora services.&#xA;&#xA;$ sudo systemctl start diaspora.target&#xA;&#xA;Backup&#xA;&#xA;To backup the database, run this command to make a dump of it.&#xA;&#xA;$ sudo -u postgres pgdump diasporaproduction   diaspora.sql&#xA;&#xA;To backup the whole folder of the diaspora installation, this command creates a zipped archive for you.&#xA;&#xA;$ tar -czvf diaspora.tar.gz /home/diaspora/diaspora&#xA;&#xA;Please do not forget to download them on a safe and isolated environment.&#xA;&#xA;Too difficult?&#xA;&#xA;If those steps are too complex and difficult for you, you can open your account on any public instances as advised on the official wiki page.&#xA;&#xA;However, before doing so, you are expected to conduct due diligence. For there could be server administrators who were going to spy on you on their diaspora* instance.&#xA;&#xA;https://mastodon.technology/@ctonysem/105621677595253667&#xA;&#xA;  Unless #E2EE is implemented you would still have to trust someone, and there could be malicious actors too. &#xA;    If you are going to use public instances, please be careful. You should conduct due diligence by yourself; who manages the server, how they are financed etc...&#xA;&#xA;#fediverse #diaspora #guide&#xA;&#xA;Copyright (C) 2021 Suguru Hirahara. This work is available under GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation. See https://blog.progressiv.dev/yq31akw3jj for copying conditions.]]&gt;</description>
      <content:encoded><![CDATA[<p>This article shows you how to install <a href="https://diasporafoundation.org/" rel="nofollow">diaspora*</a> <a href="https://github.com/diaspora/diaspora/releases/tag/v0.7.14.0" rel="nofollow">0.7.14.0</a> on Debian 10.</p>



<h1 id="0-introduction">0. Introduction</h1>

<h2 id="what-is-diaspora">What is “diaspora*” ?</h2>

<p><a href="https://www.howtoforge.com/how-to-install-diaspora-decentralized-social-media-on-debian-10/" rel="nofollow">https://www.howtoforge.com/how-to-install-diaspora-decentralized-social-media-on-debian-10/</a></p>

<blockquote><p>Diaspora is an open-source, privacy-aware, and distributed social network. It consists of a group of independently deployed and owned nodes which interoperate to create the network. Diaspora is a social network that focused on three philosophy, decentralization, freedom, and privacy.</p></blockquote>

<h2 id="manual-installation-is-preferred">Manual installation is preferred</h2>

<p>I assume that maybe you were looking for a way of installing diaspora* with a tool such as Docker or Ansible.</p>

<p>I understand you would prefer an isolated environment so that you could remove packages whenever you would like to.</p>

<p>However, unfortunately, neither Docker nor Ansible playbook is supported officially as of now. Technically, Docker support has been implemented <a href="https://github.com/diaspora/diaspora/pull/7870#event-1930968934" rel="nofollow">here</a>, but it lacks documentation and is mainly for development. See: <a href="https://github.com/diaspora/diaspora/pull/7870#issuecomment-429594392" rel="nofollow">https://github.com/diaspora/diaspora/pull/7870#issuecomment-429594392</a></p>

<h2 id="bitnami-installer-is-officially-discouraged">Bitnami installer is officially discouraged</h2>

<p>There is also an installer by Bitnami provided <a href="https://bitnami.com/stack/diaspora/installer" rel="nofollow">here</a>.</p>

<p>However, keep in mind that it is not officially supported. It is also <strong>discouraged by the develpment team</strong>.</p>

<p><a href="https://discourse.diasporafoundation.org/t/noob-using-bitnami-ports-and-security-help/3202/2" rel="nofollow">https://discourse.diasporafoundation.org/t/noob-using-bitnami-ports-and-security-help/3202/2</a></p>

<blockquote><p>The general advice is “don’t use Bitnami or anything else that claims to be able to set up diaspora*”, because they can’t. Our official installation docs are found in the wiki, and they explain everything, including the config files.</p></blockquote>

<p>Though it is not clear if it means that they cannot create an installer properly because of technical limitation of some sort or that they are just poor at programming, there is a lot of reports at the <a href="https://discourse.diasporafoundation.org/search?q=bitnami%20order%3Alatest" rel="nofollow">official forum</a> about the bitnami installer&#39;s issue.</p>

<p>Basically, the only recommended way of installing diaspora* is to install packages and configure them manually, including a web server, a SSL certificate, etc.</p>

<h2 id="official-instructions-are-for-advanced-users">Official instructions are for advanced users</h2>

<p>There are instructions for installation on the <a href="https://wiki.diasporafoundation.org/Installation" rel="nofollow">official wiki page</a>, but probably it is safe to say that they are for advanced users. There you are expected to have set up a web server and a database software and configured them already, which is a tough task for beginners.</p>

<h2 id="acknowledgement">Acknowledgement</h2>

<p><strong>The article is based on: <a href="https://www.howtoforge.com/how-to-install-diaspora-decentralized-social-media-on-debian-10/" rel="nofollow">https://www.howtoforge.com/how-to-install-diaspora-decentralized-social-media-on-debian-10/</a></strong>. I tried these commands by myself and verified it worked on Debian 10. Below I tweaked only tiny parts to improve the instruction. Huge thanks to the author of the original article!</p>

<h2 id="disclaimer">Disclaimer</h2>

<p>This guide is written for Debian 10. It is not tested for neither previous nor future versions. The name or version of the packages may change, so please make sure that you are installing proper packages.</p>

<p>For the latest information, please consult the <a href="https://wiki.diasporafoundation.org" rel="nofollow">documentations</a> on the official wiki and the <a href="https://github.com/diaspora/diaspora" rel="nofollow">project page</a> at GitHub. The <a href="https://wiki.diasporafoundation.org/FAQ_for_pod_maintainers" rel="nofollow">FAQ page for server administrators</a> is worth checking when you experience an issue.</p>

<p>As of now, the latest version of diaspora* is <a href="https://github.com/diaspora/diaspora/releases/tag/v0.7.14.0" rel="nofollow">0.7.14.0</a>.</p>

<h1 id="1-initial-server-setup">1. Initial server setup</h1>

<p>Before proceeding, you should not forget to configure the basic security setting of your machine. <a href="https://www.digitalocean.com/community/tutorials/initial-server-setup-with-debian-10" rel="nofollow">Initial Server Setup with Debian 10</a> on DigitalOcean is a nice guide for beginners.</p>

<p>Now the basic security setting has been configured, let&#39;s start installation.</p>

<p>First, log in as root if you are not.</p>

<pre><code>$ su - root
</code></pre>

<p>(If you are familiar with <code>sudo</code> already, you can safely run these commands below with <code>#</code> with sudo, after adding the current user to <code>sudo</code> group with root user.)</p>

<p>Next, update system packages.</p>

<pre><code># apt update &amp;&amp; apt upgrade -y
</code></pre>

<p>Since this instruction uses <code>vim</code> as a text editor, install <code>vim</code>.  You&#39;ll need <code>sudo</code> too.</p>

<pre><code># apt install vim sudo
</code></pre>

<p>Of course, you could choose your favorite text editor such as <code>emacs</code> and <code>nano</code>.</p>

<h1 id="2-install-dependencies">2. Install dependencies</h1>

<p>First, install the basic packages to install diaspora* with this command:</p>

<pre><code># apt install build-essential cmake gnupg2 libssl-dev libcurl4-openssl-dev libxml2-dev libxslt-dev imagemagick ghostscript curl libmagickwand-dev git libpq-dev redis-server nodejs postgresql
</code></pre>

<h2 id="start-redis-server">Start redis-server</h2>

<p>Let&#39;s start <code>redis-server</code>.</p>

<pre><code># systemctl start redis-server
</code></pre>

<pre><code># systemctl enable redis-server
</code></pre>

<h2 id="start-postgresql">Start postgresql</h2>

<p>Start <code>postgresql</code> too.</p>

<pre><code># systemctl start postgresql
</code></pre>

<pre><code># systemctl enable postgresql
</code></pre>

<h1 id="3-create-a-new-user-on-postgresql">3. Create a new user on postgresql</h1>

<p>Here we are going to add a user on postgresql, a database software.</p>

<p>Since we have installed and started it already, log in to the postgresql shell with:</p>

<pre><code># sudo -i -u postgres psql
</code></pre>

<p>First, change the password for the default user by running this command.</p>

<pre><code>postgres=# \password postgres
</code></pre>

<p>Then, run the command below to create a database user <code>diaspora</code>. Please do not forget to replace <code>yourpassword</code> with a new one.</p>

<pre><code>postgres=# CREATE USER diaspora WITH CREATEDB PASSWORD &#39;yourpassword&#39;;
</code></pre>

<p>Those information will be required later when we configure diaspora* (step 6), so please take a note of them.</p>

<p>Now the database user has been added, run <code>exit</code> to log out from postgres shell.</p>

<pre><code>postgres=# exit
</code></pre>

<h1 id="4-create-a-new-user-on-debian-to-install-diaspora">4. Create a new user on Debian to install diaspora*</h1>

<p>Now let&#39;s add a new user <code>diaspora</code> to Debian, with which you&#39;ll install diaspora*.</p>

<p>First, make sure you are on root. If you are not, run this command to log in to root user: <code>$ su - root</code>.</p>

<p>Please run this command to add <code>diaspora</code>.</p>

<pre><code># adduser --disabled-login diaspora
</code></pre>

<p>Do not forget to set a password of the user.</p>

<pre><code># passwd diaspora
</code></pre>

<p>Let&#39;s add the user to sudo group.</p>

<pre><code># usermod -aG sudo diaspora
</code></pre>

<h1 id="5-install-ruby-with-rvm">5. Install ruby with rvm</h1>

<p>Before installing diaspora*, we need to install <code>ruby</code> for the user.</p>

<p>In this instruction we are going to use RVM (Ruby Bersion Manager) to install ruby 2.6, the supported version for diaspora* as of now.</p>

<h2 id="install-gpg-keys">Install GPG keys</h2>

<p>First, before installing RVM, log in to <code>diaspora</code> with this command:</p>

<pre><code># su - diaspora
</code></pre>

<p>Then, add GPG keys to proceed with RVM installation.</p>

<p>In order to add them, run the command on this official page here: <a href="https://rvm.io/rvm/install#install-gpg-keys" rel="nofollow">https://rvm.io/rvm/install#install-gpg-keys</a>.</p>

<p>Since the GPG keys can be revoked and replaced with new ones any time, please do not forget to check the latest information. Also, <strong>please remember not to copy and paste GPG key values from a third party website.</strong></p>

<h2 id="install-and-load-rvm">Install and load RVM</h2>

<p>After installing the keys, let&#39;s install the stable RVM.</p>

<pre><code>$ curl -sSL https://get.rvm.io | bash -s stable
</code></pre>

<p>Then, load the RVM&#39;s script with:</p>

<pre><code>$ source /home/diaspora/.rvm/scripts/rvm
</code></pre>

<h2 id="install-ruby-2-6">Install ruby 2.6</h2>

<p><strong>Note:</strong> the required version of ruby may change in the future. Before installing ruby, please consult the <a href="https://wiki.diasporafoundation.org/Installation/Debian/Buster#RVM" rel="nofollow">installation guide</a> on the official wiki for the supported version.</p>

<p>As of now, ruby 2.6 is recommended, so let&#39;s install it with RVM:</p>

<pre><code>$ rvm install 2.6
</code></pre>

<h1 id="6-install-and-configure-diaspora">6. Install and configure diaspora*</h1>

<p>In this step we are finally going to install diaspora*.</p>

<p>At first, confirm you are logged in as <code>diaspora</code>. If not, run this command: <code>$ su - diaspora</code>.</p>

<h2 id="download-source-code">Download source code</h2>

<p>Run this command to download the latest stable source code of diaspora*.</p>

<pre><code>$ git clone -b master https://github.com/diaspora/diaspora.git
</code></pre>

<p>If you are willing to test/develop diaspora*, switch to <code>develop</code> branch.</p>

<p><strong>Note:</strong> if <code>master</code> branch cannot be found, it is likely that it has been renamed to <code>main</code> branch. In this case, run instead: <code>$ git clone -b main https://github.com/diaspora/diaspora.git</code>.</p>

<h2 id="copy-configuration-files">Copy configuration files</h2>

<p>Next, move to the source code directory, where you are going to install diaspora*.</p>

<pre><code>$ cd diaspora
</code></pre>

<p>Here you are required to configure two configuration files, one for the database connection (<code>database.yml</code>) and the other for diaspora* itself (<code>diaspora.yml</code>).</p>

<p>First, let&#39;s copy example configuration files by running these two commands.</p>

<pre><code>$ cp config/database.yml.example config/database.yml
</code></pre>

<pre><code>$ cp config/diaspora.yml.example config/diaspora.yml
</code></pre>

<p><strong>Note</strong>: in a future version, <code>diaspora.yml.example</code> will be replaced with <a href="https://github.com/diaspora/diaspora/commit/08395cc8773978f2dff3aaebe89b66102512bdf1#diff-61e72a4f7d55d155d68a9aa9448bbf3081fccba5280271dca15367b14f748e43" rel="nofollow"><code>dispora.toml.example</code></a>. In case you cannot find <code>diaspora.yml.example</code>, try this command instead: <code>$ cp config/diaspora.toml.example config/diaspora.toml</code>.</p>

<h2 id="edit-database-configuration-file">Edit database configuration file</h2>

<p>At first, we are going to configure <code>database.yml</code>. Open the file on <code>vim</code> with:</p>

<pre><code>$ vim config/database.yml
</code></pre>

<p>Inside the file, there should be a <code>postgresql</code> section.</p>

<pre><code>postgresql: &amp;postgresql
  adapter: postgresql
  host: &#34;localhost&#34;
  port: 5432
  username: &#34;diaspora&#34;
  password: &#34;yourpassword&#34;
  encoding: unicode
</code></pre>

<p>Please replace <code>yourpassword</code> with your own password which you have set on the step 3 above.</p>

<p>After editing, save the change and close the file.</p>

<h2 id="edit-diaspora-configuration-file">Edit diaspora* configuration file</h2>

<p>Next, open <code>diaspora.yml</code> inside <code>config</code> folder.</p>

<pre><code>$ vim config/diaspora.yml
</code></pre>

<p><strong>Note:</strong> If you cannot find <code>diaspora.yml</code>, try this command: <code>$ vim config/diaspora.toml</code>.</p>

<p>There are many options you would like to change later (enabling/disabling of account creation, captcha on creating account, etc.), but for now let&#39;s just edit something important.</p>

<p>The critical configurations are <code>url</code>, <code>certificate_authorities</code>, and <code>rails_environment</code>.</p>

<h3 id="url">url</h3>

<p>First, look for <a href="https://github.com/diaspora/diaspora/blob/4ea2a77a864ca69c218063cd7cfddd1f5f0765f9/config/diaspora.toml.example#L33" rel="nofollow"><code>url</code></a> under <code>environment</code>, and replace it with the domain where you are going to host a diaspora* instance.</p>

<p>Since we are going to serve a diaspora* instance on HTTPS, do not forget add the domain with <code>https://</code>.</p>

<p>As said explicitly in the configuration file, <strong>you cannot change the value later</strong>. So please be careful to pick a right domain!</p>

<h3 id="certificate-authorities">certificate_authorities</h3>

<p>Next, we need to set certificate authorities.</p>

<p>Just under the <code>url</code> setting, there should be the line which starts from <a href="https://github.com/diaspora/diaspora/blob/4ea2a77a864ca69c218063cd7cfddd1f5f0765f9/config/diaspora.toml.example#L39" rel="nofollow"><code>#certificate_authorities</code></a>.</p>

<p>Since we are on Debian, remove <code>#</code> of the first one. It should be like <code>certificate_authorities = &#34;/etc/ssl/certs/ca-certificates.crt&#34;</code>.</p>

<h3 id="rails-environment">rails_environment</h3>

<p>Then, let&#39;s set the rails environment value to <code>production</code>.</p>

<p>Under <code>server</code> section, there should be the line which starts with <a href="https://github.com/diaspora/diaspora/blob/4ea2a77a864ca69c218063cd7cfddd1f5f0765f9/config/diaspora.toml.example#L176" rel="nofollow"><code>#rails_environment</code></a>. Please remove the hash and set it to <code>rails_environment = &#34;production&#34;</code>.</p>

<h3 id="disable-captcha-on-registration">Disable captcha on registration</h3>

<p>Since captcha does not work well, you have to disable it as of now. See: <a href="https://github.com/diaspora/diaspora/issues/6828" rel="nofollow">https://github.com/diaspora/diaspora/issues/6828</a></p>

<p>Under <code>settings</code> and <code>captcha</code> section, there should be option <code>enable</code>.  Please set it to <code>enable: false</code>.</p>

<p>After those changes, the configuration file should be set as below.</p>

<pre><code>configuration: ## Section
...
  environment: ## Section
...
    url: &#34;https://example.com&#34;
    certificate_authorities: &#39;/etc/ssl/certs/ca-certificates.crt&#39;
...
  server: ## Section
    rails_environment: &#39;production&#39;
...
  settings: ## Section
...
    captcha: ## Section
      enable: false
...
</code></pre>

<p>where <code>https://example.com</code> should be your own domain with <code>https://</code>.</p>

<h2 id="install-gem-and-ruby-libraries">Install gem and ruby libraries</h2>

<p>Here we are going to install applications required for diaspora*. On <code>diaspora</code> user, run these commands to install them.</p>

<pre><code>$ gem install bundler
</code></pre>

<pre><code>$ script/configure_bundler
</code></pre>

<pre><code>$ bin/bundle install --full-index
</code></pre>

<h2 id="migrate-database">Migrate database</h2>

<p>Run this command to migrate the database.</p>

<pre><code>$ RAILS_ENV=production bundle exec rake db:create db:migrate
</code></pre>

<h2 id="compile-assets">Compile assets</h2>

<p>Run this command to compile assets.</p>

<pre><code>$ RAILS_ENV=production bin/rake assets:precompile
</code></pre>

<p>Here diaspora* has been installed on your system. Below we are going to prepare the system for running and serving it properly.</p>

<h1 id="7-set-up-diaspora-as-a-service">7. Set up diaspora* as a service</h1>

<p>Now, we are going to set up diaspora* to run as a service.</p>

<p>First, log in as root.</p>

<pre><code>$ su - root
</code></pre>

<p>Next, move to the directory below:</p>

<pre><code># cd /etc/systemd/system/
</code></pre>

<p>Inside the directory, we are going to create three files, <code>diaspora.target</code>, <code>diaspora-web.service</code>, and <code>diaspora-sidekiq.service</code>.</p>

<h2 id="diaspora-target">diaspora.target</h2>

<p>Create a new file with <code>vim</code>.</p>

<pre><code># vim diaspora.target
</code></pre>

<p>Copy and paste the configuration below to the file.</p>

<pre><code>[Unit]
Description=Diaspora social network
Wants=postgresql.service
Wants=redis-server.service
After=redis-server.service
After=postgresql.service

[Install]
WantedBy=multi-user.target
</code></pre>

<p>Save and close it.</p>

<h2 id="diaspora-web-service">diaspora-web.service</h2>

<p>Next, create a new service for diaspora web interface:</p>

<pre><code># vim diaspora-web.service
</code></pre>

<p>Copy and paste the configuration:</p>

<pre><code>[Unit]
Description=Diaspora social network (unicorn)
PartOf=diaspora.target
StopWhenUnneeded=true

[Service]
User=diaspora
Environment=RAILS_ENV=production
WorkingDirectory=/home/diaspora/diaspora
ExecStart=/bin/bash -lc &#34;bin/bundle exec unicorn -c config/unicorn.rb -E production&#34;
Restart=always

[Install]
WantedBy=diaspora.target
</code></pre>

<p>Save and close it.</p>

<h2 id="diaspora-sidekiq-service">diaspora-sidekiq.service</h2>

<p>Finally, create a new service for the monitoring service:</p>

<pre><code># vim diaspora-sidekiq.service
</code></pre>

<p>Copy and paste the configuration:</p>

<pre><code>[Unit]
Description=Diaspora social network (sidekiq)
PartOf=diaspora.target
StopWhenUnneeded=true

[Service]
User=diaspora
Environment=RAILS_ENV=production
WorkingDirectory=/home/diaspora/diaspora
ExecStart=/bin/bash -lc &#34;bin/bundle exec sidekiq&#34;
Restart=always

[Install]
WantedBy=diaspora.target
</code></pre>

<p>Save and close it.</p>

<h2 id="register-services">Register services</h2>

<p>Here we are going to set those services to run automatically on reboot.</p>

<p>First, reload the systemctl daemon.</p>

<pre><code># systemctl daemon-reload
</code></pre>

<p>Next, enable those services with this command.</p>

<pre><code># systemctl enable diaspora.target diaspora-sidekiq.service diaspora-web.service
</code></pre>

<p>Run <code>diaspora.target</code> to start the two services.</p>

<pre><code># systemctl start diaspora.target
</code></pre>

<p>In order to check if they are up and running, run these commands.</p>

<pre><code># systemctl status diaspora-web
</code></pre>

<pre><code># systemctl status diaspora-sidekiq
</code></pre>

<h1 id="8-install-ssl-certificate-with-certbot">8. Install SSL certificate with certbot</h1>

<h2 id="install-certbot">Install certbot</h2>

<p>In this instruction we are going to use <code>certbot</code> by EFF to obtain Let&#39;s Encrypt certificates automatically.</p>

<p>First, install <code>certbot</code>.</p>

<pre><code># apt install certbot
</code></pre>

<h2 id="obtain-let-s-encrypt-certificate">Obtain Let&#39;s Encrypt certificate</h2>

<p>Then, run this command to make certbot obtain the SSL certificate.</p>

<pre><code># certbot certonly --rsa-key-size 2048 --standalone --agree-tos --no-eff-email --email example@example.com -d example.com
</code></pre>

<p>Please do not forget to replace the email address (<code>example@example.com</code>) and domain (<code>example.com</code>). Since you may receive important information later, such as a SSL expiration warning, you should use a reachable email address.</p>

<p>Also, please note that there are <a href="https://letsencrypt.org/docs/rate-limits/" rel="nofollow">rate limits</a> on Let&#39;s Encrypt. You should be careful not to exceed the limit, otherwise you would need to wait one week until it becomes possible again to obtain the certificate for the same domain.</p>

<blockquote><p>Renewals are treated specially: they don’t count against your Certificates per Registered Domain limit, but they are subject to a Duplicate Certificate limit of 5 per week.</p>

<p>Exceeding the Duplicate Certificate limit is reported with the error message <code>too many certificates already issued for exact set of domains</code>.</p></blockquote>

<h1 id="9-install-and-configure-the-web-server">9. Install and configure the web server</h1>

<p>Here, we are going to install and configure <code>nginx</code> to serve diaspora* with HTTPS.</p>

<p>First, let&#39;s install nginx.</p>

<pre><code># apt install nginx
</code></pre>

<h2 id="create-a-configuration-file">Create a configuration file</h2>

<p>Then, create a configuration file with vim.</p>

<pre><code># vim /etc/nginx/sites-available/diaspora
</code></pre>

<p>Copy and paste the configuration below. Please don&#39;t forget to replace <code>example.com</code> with your own domain.</p>

<pre><code>upstream diaspora_server {
 server unix:/home/diaspora/diaspora/tmp/diaspora.sock;
}

server {
  listen 80;
  listen [::]:80;
  server_name example.com;
  return 301 https://example.com$request_uri;

  access_log /dev/null;
  error_log /dev/null;
}

server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  server_name example.com;

  access_log /var/log/nginx/dspr-access.log;
  error_log /var/log/nginx/dspr-error.log;

  ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;

  ssl_protocols TLSv1.2;
  ssl_ciphers EECDH+CHACHA20:EECDH+AESGCM:EECDH+AES;
  ssl_ecdh_curve X25519:P-521:P-384:P-256;
  ssl_prefer_server_ciphers on;
  ssl_session_cache shared:SSL:10m;

  root /home/diaspora/diaspora/public;

  client_max_body_size 5M;
  client_body_buffer_size 256K;

  try_files $uri @diaspora;

  location /assets/ {
    expires max;
    add_header Cache-Control public;
  }

  location @diaspora {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://diaspora_server;
  }
}
</code></pre>

<h2 id="activate-and-run-nginx">Activate and run nginx</h2>

<p>Next, activate the server configuration with the command below.</p>

<pre><code># ln -s /etc/nginx/sites-available/diaspora /etc/nginx/sites-enabled/
</code></pre>

<p>Before enabling nginx, let&#39;s check if configuration is correct.</p>

<pre><code># nginx -t
</code></pre>

<p>Please correct an error if any.</p>

<p>After checking the configuration, restart the server and set it to run on reboot automatically.</p>

<pre><code># systemctl restart nginx
</code></pre>

<pre><code># systemctl enable nginx
</code></pre>

<h2 id="install-certbot-plug-in-for-nginx">Install certbot plug-in for nginx</h2>

<p>Next, install <code>python-certbot-nginx</code>. This is required for <code>certbot</code> to renew a SSL certificate for you.</p>

<pre><code># apt install certbot python-certbot-nginx
</code></pre>

<p>Let&#39;s test if <code>certbot</code> should work properly. With <code>--dry-run</code> you can simulate the renewal and test if there would be something wrong.</p>

<pre><code># certbot renew --dry-run
</code></pre>

<p>If you get the message <code>Congratulations, all renewals succeeded.</code> it should be fine. From now on, <code>certbot</code> will take care of certificate renewal for you.</p>

<p>Now, your diaspora* instance should be up and ready!</p>

<p>Please go to your domain for diaspora* on a web browser, and you should be able to visit your diaspora* instance.</p>

<h1 id="10-maintenance">10. Maintenance</h1>

<h2 id="update-diaspora">Update diaspora*</h2>

<p>Courtesy of: <a href="https://stanislas.blog/2018/02/setup-diaspora-pod-debian-ubuntu/" rel="nofollow">https://stanislas.blog/2018/02/setup-diaspora-pod-debian-ubuntu/</a></p>

<p><em>If you are doing a major version update, please follow the <a href="https://wiki.diasporafoundation.org/Updating#Major_version_update_guides" rel="nofollow">instruction</a> on the official wiki page.</em></p>

<p>In order to update diaspora*, log in to <code>diaspora</code> user with this command.</p>

<pre><code># su - diaspora
</code></pre>

<p>Before updating, stop the diaspora* services with this command (with sudo).</p>

<pre><code>$ sudo systemctl stop diaspora.target
</code></pre>

<p>To update diaspora* source code, go to the diaspora* directory and get the latest source code with this command.</p>

<pre><code>$ cd diaspora &amp;&amp; git pull
</code></pre>

<p>In order to update dependencies, run these commands.</p>

<pre><code>$ gem install bundler
</code></pre>

<pre><code>$ bin/bundle --full-index
</code></pre>

<p>To update the database, run this command.</p>

<pre><code>$ RAILS_ENV=production bin/rake db:migrate
</code></pre>

<p>To compile assets again, run:</p>

<pre><code>$ RAILS_ENV=production bin/rake assets:precompile
</code></pre>

<p>To reflect those changes, start diaspora* services.</p>

<pre><code>$ sudo systemctl start diaspora.target
</code></pre>

<h2 id="backup">Backup</h2>

<p>To backup the database, run this command to make a dump of it.</p>

<pre><code>$ sudo -u postgres pg_dump diaspora_production &gt; diaspora.sql
</code></pre>

<p>To backup the whole folder of the diaspora* installation, this command creates a zipped archive for you.</p>

<pre><code>$ tar -czvf diaspora.tar.gz /home/diaspora/diaspora
</code></pre>

<p>Please do not forget to download them on a safe and isolated environment.</p>

<h1 id="too-difficult">Too difficult?</h1>

<p>If those steps are too complex and difficult for you, you can open your account on any <a href="https://diaspora.podupti.me/" rel="nofollow">public instances</a> as advised on the official wiki page.</p>

<p>However, before doing so, <strong>you are expected to conduct due diligence</strong>. For there could be server administrators who were going to spy on you on their diaspora* instance.</p>

<p><a href="https://mastodon.technology/@ctonysem/105621677595253667" rel="nofollow">https://mastodon.technology/@ctonysem/105621677595253667</a></p>

<blockquote><p>Unless <a href="/suguru/tag:E2EE" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">E2EE</span></a> is implemented you would still have to trust someone, and there could be malicious actors too.</p>

<p>If you are going to use public instances, please be careful. You should conduct due diligence by yourself; who manages the server, how they are financed etc...</p></blockquote>

<p><a href="/suguru/tag:fediverse" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">fediverse</span></a> <a href="/suguru/tag:diaspora" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">diaspora</span></a> <a href="/suguru/tag:guide" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">guide</span></a></p>

<p>Copyright © 2021 Suguru Hirahara. This work is available under GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation. See <a href="https://blog.progressiv.dev/yq31akw3jj" rel="nofollow">https://blog.progressiv.dev/yq31akw3jj</a> for copying conditions.</p>
]]></content:encoded>
      <guid>https://blog.progressiv.dev/suguru/how-to-install-diaspora-decentralized-social-network-on-debian-10</guid>
      <pubDate>Wed, 27 Jan 2021 17:19:19 +0000</pubDate>
    </item>
  </channel>
</rss>