Howto install Diaspora pod on NethServer

education
v7

(Markus Neuberger) #21

I think it was a copy/paste action of an already working postgres db creation.
I’ll have a look and change it if needed.


(Rob Bosch) #22

I’ve been looking into this a bit because I was quite confused. Then I found this: http://www.polylab.dk/utf8-vs-unicode.html
Turns out UTF8 is using unicode 8bit: https://www.postgresql.org/docs/9.1/static/multibyte.html (find UTF8 in the table)
I have too little knowledge on this subject but what I understand is that having the database as UTF8 should be ok since it is using unicode…
anyone can comment on this? @davidep @giacomo


(Markus Neuberger) #23

I updated the howto to use unicode now instead of utf-8 and create the database with bin/rake db:create.

I don’t remember exactly why I used UTF8 but I think I got this error:

ERROR:  new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT:  Use the same encoding as in the template database, or use template0 as template.

and solved it with using utf8 and manual db creation but it would have been enough to just use template: template0.

I am sorry for that, I am afraid the database needs to be converted.

Docs about postgres templates:

https://www.postgresql.org/docs/9/static/manage-ag-templatedbs.html


(Rob Bosch) #24

Shouldn’t this part be deleted then?

nm… you got that error by using the rake command?


(Markus Neuberger) #25

Done. Thanks.

Yes.


(Rob Bosch) #26

When I look at the howto on d* wiki on setting up the db I see another part in the setup of the db:

RAILS_ENV=production bundle exec rake db:create db:migrate

I don’t know what the bundle exec part does and how essential this is for setting up the db. Maybe it must be added?

/edit: info on bundle exec command: https://bundler.io/man/bundle-exec.1.html
/edit2: this is quite specific ruby stuff…


(Markus Neuberger) #27

Thanks, I edited it to

RAILS_ENV=production bundle exec rake db:create db:migrate

It may have been a copy/paste error.


(Samuel Cooper) #28

Just chiming in here to help you out on your guide.

bin/rake and bundle exec rake are interchangeable here.

Please be careful with this. You’re editing YAML files using a tool that’s not aware of the YAML structure [0]. If we move password from line 6 for whatever reason, your script fails. If we change our example domain, your script fails. Similar goes for the other sed lines. Also, sed is not exactly known for its usability. My suggestion, if I may, is to find a different, less obfuscating tool to do this job.

If you run into errors like the one with the database creation you mentioned earlier, please do not invent custom solutions but drop by at diaspora*'s Discourse as it might be an error affecting other users as well. In addition, you avoid adding errors to your guide that way.

I took the liberty to investigate the impact of the error of specifying utf8 instead of unicode as character set setting, and we got lucky. As per current PostgreSQL documentation, in this case they have been aliases for each other at least since PostgreSQL 9.6 [1]. This means installations are not broken, contrary to what I was afraid of earlier.

On a long-term note: Please make sure to support users of your guide properly. We’ve had situations in the past where projects would create guides for their platforms, but turned their users to the diaspora* support channels if problems arised, on the grounds that they “did not know how diaspora* works”. We do not know your platform and often cannot help properly in such a case. As you provide this guide, I encourage you to know diaspora* well enough to be able to support users of your guide, or they may end up without any support, and we’d like to avoid that :slight_smile:

[0] It is not possible to correctly parse context sensitive grammer with regular expressions.
[1] Note that them being aliases is not the case for all database systems; for example MySQL has a quite unique character set utf8 which is not compliant to standards and has given us a fair share of trouble.


(Markus Neuberger) #29

Thanks for clarifying, I really appreciate it.

This howto was intended to provide a quick setup of diaspora on Nethserver to test it.
I already added a link to diaspora documentation.


(Samuel Cooper) #30

I am sorry, didn’t see that update.

When skipping through the revisions, I noticed changing # Create DB to # Create DB User might avoid confusion for other readers :slight_smile:


(Markus Neuberger) #31

That’s really confusing. Thanks. I changed it.


(Samuel Cooper) #32

By the way, I really appreciate that.


(Markus Neuberger) #33

Diaspora is really a nice software and we like to test it for the education part of Nethserver. We also like to explore the addons like chat and see if we can integrate Diaspora to Nethserver, maybe as a module.
But first we have to get into it and learn how to correctly setup and use it, as you mentioned.


(Rob Bosch) #34

Today I did a (minor) update on the diaspora software on my server. Installed version was 0.7.6.0, new version is 0.7.7.1
The instructions on diaspora wiki are almost complete.
https://wiki.diasporafoundation.org/Updating
The extra info that you need to perform the update:

  • stop diaspora: systemctl stop diaspora.target
  • change to diaspora user: su diaspora
  • change to the directory where diaspora is installed: cd /home/diaspora/diaspora

Then follow the directions of the wikipage
Afterwards restart diaspora: systemctl enable diaspora.target diaspora-sidekiq.service diaspora-web.service --now