Administration

These are the pages for all my system administration woes. I rarely post happy things in this section. You have been warned.

2020-08-29 Restarting Phoebe

I have trouble restarting Phoebe and other services I run. I guess I don’t understand how these forking processes work. These processes fork for every request they get, and that works. When they get a lot of requests, however, they enter some sort of failed state. And by “a lot” I mean more than a hundred or so. I know that it’s not a lot but I want these services to work for the small net and so I don’t want to spend any effort in trying to make them handle more. I don’t want to start caching HTTP requests, for example. What irks me most of all is that this doesn’t happen because hundreds of visitors want to know about my stuff. No, I share a link on Mastodon, and my post gets federated, and then every single server on the fediverse tries to get a preview image to display.

I’ve solved this issue for all my services behind Apache by blocking all the fediverse user agents, but Phoebe runs without a web server front-end. I’ve tried to abort as soon as possible, using the same regular expression, but that doesn’t seem to work.

But I have a second layer of defence: Monit watches over my processes. Please forgive the huge start program option. Maybe it’s time to move some of that into a config file. Please just scroll down. I also didn’t want to shorten it, because I think it’s an interesting snapshot of a non-trivial Phoebe setup.

Let’s go through this.

First we have a PID file, where the process ID is going to be. This is how Monit identifies the parent process responsible for the service. The --pid_file option is what tells Phoebe to write the same file. So far so good.

check process phoebe with pidfile /home/alex/farm/phoebe.pid
    start program = "/usr/bin/perl -I/home/alex/phoebe/lib /home/alex/farm/phoebe
 --setsid --user=alex --group=alex
 --log_level=3 --log_file=/home/alex/farm/phoebe.log
 --pid_file=/home/alex/farm/phoebe.pid
 --wiki_dir=/home/alex/phoebe
 --host=transjovian.org --cert_file=/var/lib/dehydrated/certs/transjovian.org/fullchain.pem --key_file=/var/lib/dehydrated/certs/transjovian.org/privkey.pem
 --host=toki.transjovian.org --cert_file=/var/lib/dehydrated/certs/transjovian.org/fullchain.pem --key_file=/var/lib/dehydrated/certs/transjovian.org/privkey.pem
 --host=vault.transjovian.org --cert_file=/var/lib/dehydrated/certs/transjovian.org/fullchain.pem --key_file=/var/lib/dehydrated/certs/transjovian.org/privkey.pem
 --host=communitywiki.org --cert_file=/var/lib/dehydrated/certs/communitywiki.org/fullchain.pem --key_file=/var/lib/dehydrated/certs/communitywiki.org/privkey.pem
 --host=alexschroeder.ch --cert_file=/var/lib/dehydrated/certs/alexschroeder.ch/fullchain.pem --key_file=/var/lib/dehydrated/certs/alexschroeder.ch/privkey.pem
 --host=next.oddmuse.org --cert_file=/var/lib/dehydrated/certs/oddmuse.org/fullchain.pem --key_file=/var/lib/dehydrated/certs/oddmuse.org/privkey.pem
 --wiki_main_page=Welcome --wiki_pages=About
 --wiki_mime_type=image/png --wiki_mime_type=image/jpeg
 --wiki_mime_type=audio/mpeg
 --wiki_space=transjovian.org/test
 --wiki_space=transjovian.org/phoebe
 --wiki_space=transjovian.org/gemini"

OK, with that out of the way, let’s talk about the important stuff: stopping and restarting the process, and determining when to restart the process.

    # leave enough time after a stop for the server to recover before starting
    stop program = "/bin/bash -c 'kill -s SIGKILL `cat /home/alex/farm/phoebe.pid`; sleep 120'"
    if failed
	host transjovian.org
	port 1965
	type tcpssl
        send "gemini://transjovian.org:1965/\r\n"
	expect "20 .*"
	for 5 cycles
	then restart
    if totalmem > 100 MB for 5 cycles then restart
    if 6 restarts within 15 cycles then stop

Monit checks the service using a regular request, once every cycle (5min). If it fails five times in a row (25min), it restarts. It also restarts when total memory is more than 100MB five times in a row. And when it had to restart six times in 15 cycles (75min), then the process gets stopped.

What happens on a restart? First the program is stopped and then it is started. But yesterday for example:

[CEST Aug 29 00:39:05] error    : 'phoebe' total mem amount of 190.0 MB matches resource limit [total mem amount>100 MB]
[CEST Aug 29 00:39:05] info     : 'phoebe' trying to restart
[CEST Aug 29 00:39:05] info     : 'phoebe' stop: '/bin/bash -c kill -s SIGKILL `cat /home/alex/farm/phoebe.pid`; sleep 120'
[CEST Aug 29 00:39:35] info     : 'phoebe' start: '/usr/bin/perl -I/home/alex/phoebe/lib /home/alex/farm/phoebe --setsid --user=alex --group=alex --log_level=3 --log_file=/home/alex/farm/phoebe.log --pid_file=/home/alex/farm/phoebe.pid --wiki_dir=/home/alex/phoebe --host=transjovian.org --cert_file=/va...'
[CEST Aug 29 00:44:42] error    : 'phoebe' process is not running
[CEST Aug 29 00:44:42] info     : 'phoebe' trying to restart
[CEST Aug 29 00:44:42] info     : 'phoebe' start: '/usr/bin/perl -I/home/alex/phoebe/lib /home/alex/farm/phoebe --setsid --user=alex --group=alex --log_level=3 --log_file=/home/alex/farm/phoebe.log --pid_file=/home/alex/farm/phoebe.pid --wiki_dir=/home/alex/phoebe --host=transjovian.org --cert_file=/va...'
[CEST Aug 29 00:49:57] error    : 'phoebe' process is not running
[CEST Aug 29 00:49:57] info     : 'phoebe' trying to restart
[CEST Aug 29 00:49:57] info     : 'phoebe' start: '/usr/bin/perl -I/home/alex/phoebe/lib /home/alex/farm/phoebe --setsid --user=alex --group=alex --log_level=3 --log_file=/home/alex/farm/phoebe.log --pid_file=/home/alex/farm/phoebe.pid --wiki_dir=/home/alex/phoebe --host=transjovian.org --cert_file=/va...'
[CEST Aug 29 00:55:02] error    : 'phoebe' process is not running
[CEST Aug 29 00:55:02] info     : 'phoebe' trying to restart
[CEST Aug 29 00:55:02] info     : 'phoebe' start: '/usr/bin/perl -I/home/alex/phoebe/lib /home/alex/farm/phoebe --setsid --user=alex --group=alex --log_level=3 --log_file=/home/alex/farm/phoebe.log --pid_file=/home/alex/farm/phoebe.pid --wiki_dir=/home/alex/phoebe --host=transjovian.org --cert_file=/va...'
[CEST Aug 29 01:00:12] error    : 'phoebe' process is not running
[CEST Aug 29 01:00:12] info     : 'phoebe' trying to restart
[CEST Aug 29 01:00:12] info     : 'phoebe' start: '/usr/bin/perl -I/home/alex/phoebe/lib /home/alex/farm/phoebe --setsid --user=alex --group=alex --log_level=3 --log_file=/home/alex/farm/phoebe.log --pid_file=/home/alex/farm/phoebe.pid --wiki_dir=/home/alex/phoebe --host=transjovian.org --cert_file=/va...'
[CEST Aug 29 01:05:19] error    : 'phoebe' process is not running
[CEST Aug 29 01:05:19] info     : 'phoebe' trying to restart
[CEST Aug 29 01:05:19] info     : 'phoebe' start: '/usr/bin/perl -I/home/alex/phoebe/lib /home/alex/farm/phoebe --setsid --user=alex --group=alex --log_level=3 --log_file=/home/alex/farm/phoebe.log --pid_file=/home/alex/farm/phoebe.pid --wiki_dir=/home/alex/phoebe --host=transjovian.org --cert_file=/va...'
[CEST Aug 29 01:10:25] error    : 'phoebe' service restarted 6 times within 6 cycles(s) - stop

Why isn’t the process running? Here’s a selection from the other log:

2020/08/29-00:39:38 App::Phoebe (type Net::Server::Fork) starting! pid(19496)
2020/08/29-00:39:38 Cannot connect to SSL port 1965 on 178.209.50.237 [Address already in use]
2020/08/29-00:44:43 App::Phoebe (type Net::Server::Fork) starting! pid(20808)
2020/08/29-00:44:43 Cannot connect to SSL port 1965 on 178.209.50.237 [Address already in use]
2020/08/29-00:49:59 App::Phoebe (type Net::Server::Fork) starting! pid(22125)
2020/08/29-00:49:59 Cannot connect to SSL port 1965 on 178.209.50.237 [Address already in use]
2020/08/29-00:55:05 App::Phoebe (type Net::Server::Fork) starting! pid(23449)
2020/08/29-00:55:05 Cannot connect to SSL port 1965 on 178.209.50.237 [Address already in use]
2020/08/29-01:00:15 App::Phoebe (type Net::Server::Fork) starting! pid(27704)
2020/08/29-01:00:15 Cannot connect to SSL port 1965 on 178.209.50.237 [Address already in use]
2020/08/29-01:05:21 App::Phoebe (type Net::Server::Fork) starting! pid(15897)
2020/08/29-01:05:21 Cannot connect to SSL port 1965 on 178.209.50.237 [Address already in use]

When I returned to the server this morning, that was the state it was in, and when I tried to restart it, same problem. There was a process still running, but the PID file was gone, and so Monit couldn’t stop the process, but the process was also not serving the port it was using.

ps aux | grep phoebe

So what’s the best solution, here? I’m thinking of a variant of “killall”, perhaps? The example below uses “[p]hoebe” to avoid the grep command from listing itself.

ps aux | grep '[p]hoebe' | awk '{print $2}' | xargs kill

What do you think?

Add Comment

2020-08-05 Abusing Soweli Lukin

A long time ago, I wrote Soweli Lukin, a web proxy for Gopher and Gemini. That allowed me to do some munging of the Gopher texts and render it as HTML, which meant reflowing long lines. That’s the main reason Gopher clients don’t work for me on mobile phones.

Now, if somebody wants to crawl all of Gopher space, they can crawl Gopher… or they can use a web proxy. That’d be pretty aggravating, of course, but not inconceivable. There are, after all, lots of people not wearing masks and endangering others, I bet they’re also willing to write such crawlers.

Now look at that, for the logfiles of today and the day before:

root@sibirocobombus:~# grep soweli-lukin /var/log/apache2/access.log /var/log/apache2/access.log.1 | /home/alex/bin/leech-detector
                  ip       hits bandw. hits% interv. status code distrib.
      173.231.59.198      14956     5K  91%   -0.0s  200 (99%), 500 (0%), 502 (0%)
       XX.XX.XXX.XXX        629     2K   3%   -5.3s  200 (97%), 502 (1%), 500 (0%)
      XXX.XXX.XX.XXX        433     4K   2%   -1.4s  200 (99%), 502 (0%)
         XX.XX.X.XXX        221     7K   1%   92.9s  502 (68%), 200 (31%)
…XXXX:XXXX:XXXX:XXXX         16     5K   0%   25.2s  200 (56%), 500 (25%), 304 (18%)
…XX:XXX:XXX:XX:XXX:X         12     4K   0% 1756.0s  200 (100%)

Fifteen thousand hits.

Reminds me of 70.113.100.216 who was slamming Gemini space a few days ago.

Well… I used ipset to drop their packets at the firewall, for now. Let’s see whether they change it, trying to make a comeback.

While I was at it, I also checked the IP numbers with requests in the hundreds. One of them was my monitor that checks whether the site is up, the other two were spiders with such promising names as “spider@seocompany.store” and “SEOkicks”. Ugh. Think of all the CO₂ wasted because of this SEO-💩.

Add Comment

2020-07-28 What to do if I die?

I’m trying to write a document for my wife describing all the IT stuff I run so that she knows what to do or who to contact in case I can’t do it any more. My problem is that I don’t have any friends interested in these things. Nobody knows Perl around here. The two people that do live in Estonia and Canada and they don’t share my hobbies.

What is going to happen to a site like campaignwiki.org? Sure, my wife can keep them up for a while. But she’s not going to turn into a system admin? All these wikis and apps. Somebody should be running this stuff. How does one find people willing to take over? Damn. I should organise better.

How does one archive these things for the future? The problem is that people can export their data but most of them will not, I’m sure. Upload to the Web Archive? Upload to Git Hub? Both? Other stuff? Are there other archives interested in this kind of thing? I mean, in a way I feel it is part of our collective history and how is that going to work, aren’t the national archives interested in keeping copies of all these things? They usually want copies of all the printed books… but websites? Apps? I think this necessarily must change – unless the apocalypse catches up, first.

Makes me think about resilience to capitalism and the apocalypse, both. I recently read the following by @yaaps, in an unrelated thread:

You’re an artisan. Occupying niches too small for economies of scale is how this precapitalist pattern survives and how it spawns new businesses under capitalism. It relies on a certain amount of privilege in that you need free time, skills, and personal/professional connections to succeed. in addition, the artisan is vulnerable to their own success. Replacing artisans with commodity labor is how capitalism grows

To scale up while maintaining autonomy, you need to establish a worker’s collective. That provides a model to distribute income for skilled labor, as needed, without selling equity.

Yeah. I reminded me of the fact that in order to get anything done, we need to organize. I should create an association according to Swiss law to run my sites and find people interested in keeping this stuff up. And then these people can continue after I’m gone? Let me know if you’re interested and we can write some bylaws together! It’s not hard, there are templates.

Tags:

Comments on 2020-07-28 What to do if I die?

An interesting idea: some sort of Sysop Buddy System.

– Alex Schroeder


That’s a tricky one. So far, things I’ve done include making sure my sites are easy to crawl and/or re-host (mainly by making them static for the most part), and making sure trusted friends have admin rights on social media groups I manage. Not sure what to do about my domain names, since I don’t have anyone who’s both trusted enough and technical enough. Your solution is interesting.

Felix 2020-07-29 15:32 UTC


Reply by Cos.

I’ve also been part of an association offering hosting … many of our members have much less interest in helping to keep it going than they once did. A few faithful plug away, but each year things feel a little more grim.

Yes, that’s what I fear. In the past, I used Eggplant Farms. Super nice one-person operation. They used to be more than one but then it all shrank down to just one, sadly. We’d have to prepare for that, too.

I think bank accounts and passwords are ok. Gotta check those instructions again, though. And perhaps find a better way to access my passwords other than using Emacs...

– Alex Schroeder 2020-07-30 05:56 UTC


I can gladly take over your websites and manage them in the way how you wish it. You would need only to pay your domains and hosting for the number of years you wish and need. Since 20 years I am managing servers. bugs@gnu.support

– Anonymous 2020-10-18 16:49 UTC

Add Comment

2020-06-10 Radicale for Calendar and Contacts

So, in an attempt to further degoogle my life, I installed Radicale. It’s a small but powerful CalDAV (calendars, to-do lists) and CardDAV (contacts) server written in Python. It comes with Debian.

Sadly, things aren’t as smooth as I would want them.

The first problem was that authentication via Apache didn’t work. It was weird. When I didn’t have the password file, Apache complained. When I had it, with a user and a password, Apache would let me in but I’d get to the Radicale login box, and there no login worked.

I guess what happened is that somehow Radicale either did not receive the username from Apache, or looked it up and didn’t find it, so I don’t know.

I decided to use Radicale directly, based on the page on the Debian Wiki. That seemed to work.

The second problem is that I could add the CalDAV and CardDAV accounts to my iOS device, but when I used the Contacts or Calendar app, these new accounts still did not show up. All I got is my work account (Exchange) and Gmail. None of that self-hosted stuff.

OK, next morning, checking the debug log, I see some activity from my iOS devices – and Calendar integration seems to work! When I set it up, I used https://example.org/radicale/ and that allowed me to set it up but not to use it. Then I tried https://example.org/radicale/alex and that seems to be working, with alex being my username, or my collection name, or both. Oh dear.

The documentation has the following to say:

Many clients do not support the creation of new calendars and address books. You can use Radicale’s web interface (e.g. http://localhost:5232) to create and manage address books and calendars.

In some clients you can just enter the URL of the Radicale server (e.g. http://localhost:5232) and your user name. In others, you have to enter the URL of the collection directly (e.g. http://localhost:5232/user/calendar10min).

So now I can choose my new calendar in the Calendar app.

It still doesn’t seem to work for Contacts, though. But to be honest, I don’t think I need those as much. I’ve had a text file with ten addresses for a year or two…

I’ll keep looking for the correct setup info.

Tags:

Comments on 2020-06-10 Radicale for Calendar and Contacts

I’ve been using Radicale instead of iCould on my iDevices as well - I can confirm that the collection URL setup worked for both contacts and calendars.

Creating repeating events on Radicale calendar is one of the things that I have varying degrees of success depending on the client I use: it works fine on iOS, but rather finicky in evolution seemingly due to part of CalDav spec being unimplemented.

shimmy1996 2020-06-10 12:24 UTC


Ah! There’s hope! Thank you. 🙂

– Alex Schroeder 2020-06-10 16:24 UTC


After what feels like endless re-configuring, trying to get the right URL, the right account, waiting before trying to save, setting the port again, setting https again, and on and on... it finally worked! 👍

– Alex Schroeder 2020-06-10 16:40 UTC


When I added a second user to radicale, I was unable to log in.

htpasswd /etc/radicale/users somebody
New password: 
Re-type new password: 
Adding password for user somebody

But tail /var/log/radicale/radicale.log says:

2020-07-03 11:48:21,963 - [7fe996f01700] ERROR: An exception occurred during PROPFIND request on '/': Invalid htpasswd file '/etc/radicale/users': not a valid bcrypt hash

Ah! grep encrypt /etc/radicale/config says:

# Htpasswd encryption method
htpasswd_encryption = bcrypt

So now I wonder what htpasswd uses... Here’s what htpasswd --help 2>&1 | grep encrypt says:

 -m  Force MD5 encryption of the password (default).
 -B  Force bcrypt encryption of the password (very secure).
 -d  Force CRYPT encryption of the password (8 chars max, insecure).
 -s  Force SHA encryption of the password (insecure).
 -p  Do not encrypt the password (plaintext, insecure).

I guess I forgot the -B option! Going to retry with htpasswd -B /etc/radicale/users somebody. Now it works! 😀

– Alex Schroeder 2020-07-03 09:55 UTC

Add Comment

2020-06-04 DMARC an Mailing Lists

A while ago I moved my main mail account to my own domain, using migadu.com. They have an excellent setup guide, and a diagnostics page. There’s MX delegation, DKIM public keys, SPF policy, DMARC policy, and so on.

Recently, I subscribed to a mailing list using Mailman. Today I got a friendly email from a mailing list member telling me about a setup problem: the DMARC policy for my domain was causing them problems, as they were getting messages like the following:

Your membership in the mailing list … has been disabled due to excessive bounces

Oops! Apparently my config causes servers to send bounces when my emails get sent via the mailing list, and those bounces are triggering Mailman’s bounce protection for other members. Not good!

But relaxing those rules is also not good. Some searching on the internet found this article: Actually, DMARC works fine with mailing lists. I don’t know what to think about it. The explanation seems to be that mailing lists that are configured to change the subject line of my emails are invalidating the signatures, which causes the conforming mail servers to bounce my mails. Just telling them to no longer reject my emails but to deliver them into Junk folders would have fixed half the problem (the bounces the mailing list members were getting) but it wouldn’t have fixed the problem that my mails look like spoofed emails to many people.

Even the mailing list archive says so:

  • SPOOFED: Re: authorship tag Alex Schroeder

This is not good, and I’m way out of my league. I decided to unsubscribe from the mailing list. Once again, the propensity of every human activity on the Internet to be spammed to death makes every open tool super complicated and the technology required to master harder to understand with every passing year.

I think I’m going to do fine without the mailing list.

Tags:

Comments on 2020-06-04 DMARC an Mailing Lists

Odd, because your previous messages came through to the mailing list without incident, and looking over the headers of all your messages, I don’t see why that last one would get the SPOOFED bit, because it’s no different from the others one (other than the subject line and dates).

Sean Conner 2020-06-05 07:02 UTC


Well, sadly I have no idea – and I don’t think I’ll be investigating. If there is an easy fix out there, I’ll make it. Perhaps I have my mail stuff misconfigured? But I’m afraid I don’t have the know-how to figure out what’s wrong.

– Alex Schroeder 2020-06-05 07:39 UTC

Add Comment

2020-05-26 Certificate problems

Today I was informed by various sources that Emacs Wiki was unreachable. Other sites as well. How strange! I use dehydrated via a cron job to keep my certificates from Let’s Encrypt up to date. I checked. They were up to date! The Apache config files point at the correct certificates. The certificates have expiry dates in July.

I wondered: is it possible that Apache caches these certificates and doesn’t notice when they update? After all, dehydrated sets up symbolic links that I refer to in my Apache config, and these always point to the current certificate files.

I reloaded the Apache config file using apachectl graceful and that seemed to work. Later today I got more reports, however and checked it on another laptop and sure enough, same problem. This time I stopped and restarted Apache completely. Once again, everything seems to be fine. Let’s see whether that was good enough.

If not, let me know. 🙂

Then again, if it doesn’t work, you won’t be able to read this... So here I am, hoping for the best.

Tags:

Add Comment

2020-04-05 Jitsi Considerations

Here are some things to look out for:

  1. Does your Jitsi instance use things that enable tracking, such as Google Analytics, Google Fonts, Google STUN servers?
  2. Does your Jitsi instance have a decent privacy policy, such as minimal logging, no sharing with third parties, and so on?
  3. If you’re self-hosting, have you considered these issues?
  4. Make sure people only use the apps, or Chrome – apparently Safari doesn’t work and Firefox ruins the experience for everybody else in the meeting
  5. Understand that all the apps except for the one on the F-Droid store for Android come with trackers

This is based on the following sources:

  1. Good info by Freifunk München on how to use Jitsi, and a link to their instance
  2. Also, an app for the desktop based on Electron, so at least you don’t have to run Google Chrome
  3. Privacy Tools on Zoom vs. Jitsi, listing some of the issues with Jitsi

Tags:

Comments on 2020-04-05 Jitsi Considerations

I installed the Debian package for the Freifunk Jitsi app and that worked just fine.

alex@melanobombus:~$ sudo dpkg -i Downloads/ffmuc-meet-amd64.deb 
[sudo] password for alex: 
Selecting previously unselected package jitsi-meet-electron.
(Reading database ... 498341 files and directories currently installed.)
Preparing to unpack Downloads/ffmuc-meet-amd64.deb ...
Unpacking jitsi-meet-electron (2.0.4-31) ...
dpkg: dependency problems prevent configuration of jitsi-meet-electron:
 jitsi-meet-electron depends on libappindicator3-1; however:
  Package libappindicator3-1 is not installed.

dpkg: error processing package jitsi-meet-electron (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.31.4-3) ...
Processing triggers for mime-support (3.62) ...
Processing triggers for desktop-file-utils (0.23-4) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Errors were encountered while processing:
 jitsi-meet-electron
alex@melanobombus:~$ apt search libappindicator3-1
Sorting... Done
Full Text Search... Done
gir1.2-appindicator3-0.1/amber 0.4.92-7 amd64
  Typelib files for libappindicator3-1

libappindicator3-1/amber 0.4.92-7 amd64
  allow applications to export a menu into the panel -- GTK3 version

alex@melanobombus:~$ sudo apt install libappindicator3-1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libappindicator3-1 : Depends: libindicator3-7 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
alex@melanobombus:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libappindicator3-1 libindicator3-7
The following NEW packages will be installed:
  libappindicator3-1 libindicator3-7
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 106 kB of archives.
After this operation, 217 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 https://repo.pureos.net/pureos amber/main amd64 libindicator3-7 amd64 0.5.0-4 [52.9 kB]
Get:2 https://repo.pureos.net/pureos amber/main amd64 libappindicator3-1 amd64 0.4.92-7 [53.5 kB]
Fetched 106 kB in 1s (187 kB/s)               
Selecting previously unselected package libindicator3-7:amd64.
(Reading database ... 498429 files and directories currently installed.)
Preparing to unpack .../libindicator3-7_0.5.0-4_amd64.deb ...
Unpacking libindicator3-7:amd64 (0.5.0-4) ...
Selecting previously unselected package libappindicator3-1:amd64.
Preparing to unpack .../libappindicator3-1_0.4.92-7_amd64.deb ...
Unpacking libappindicator3-1:amd64 (0.4.92-7) ...
Setting up libindicator3-7:amd64 (0.5.0-4) ...
Setting up libappindicator3-1:amd64 (0.4.92-7) ...
Setting up jitsi-meet-electron (2.0.4-31) ...
Processing triggers for libc-bin (2.28-10) ...

OK, there was this little problem because I didn’t know how to install a package from a file and satisfy all its dependency from the regular repos.

Also, I’m starting to feel like installing all this stuff from packages I download myself is a security nightmare. These packages are never going to get fixed! 😟

– Alex Schroeder 2020-04-05 12:14 UTC

Add Comment

2020-03-26 Jitsi and the CPU

Yesterday I ran my RPG game on the self-hosted Jitsi installation. All participants need to have the right bandwidth, of course. If you’re close to Zürich, you probably have glass fibre, so no problem. As it turns out, CPU seems to be the limiting factor. The machine I’m renting has two cores and 6GB RAM available. Here are the Munin reports:

Firewall throughput CPU usageLoad average Memory usage

Tags:

Comments on 2020-03-26 Jitsi and the CPU

Other people: Jitsi Meet and the Number of Video Participants – 「… 2 virtual cores and 4GB of memory … both CPUs ran at around 70% with 10 clients and memory use was around 1.4 GBs at the beginning and 800 MB a little while later when everyone had joined and settled in … I was far away from saturating the CPU with 10 simultaneous video streams in the conference.」 – Nice! 🙂

Other software: Big Blue Button: Requirements – 「… we recommend starting with a ‘clean’ Ubuntu 16.04 64-bit server dedicated for BigBlueButton. … 4 GB of memory with swap enabled (8 GB of memory is better) … 4 CPU cores (8 is better)」 – but as noted I only have 2 GB of memory, only 2 CPU cores, it’s not a dedicated server, and it’s Debian Buster, not Ubuntu 16. Oh well!

– Alex Schroeder 2020-03-28 11:54 UTC


Had another session yesterday and when the conference ended it seemed to me that some of the other services on this machine had been killed. Out of memory? I don’t think so. I need to investigate. Perhaps the response times for requests had grown so long that Monit decided the services were down and started restarting them?

– Alex Schroeder 2020-03-29 10:06 UTC


Switching to Twitch TV...

– Alex Schroeder 2020-04-17 12:27 UTC

Add Comment

2020-03-18 Selfhosting Jitsi

I’m trying to self-host Jitsi (”multi-platform open-source video conferencing”).

  1. follow the instructions and use their Ubuntu/Debian repository
  2. I already have the subdomain chat.campaignwiki.org setup with Gandi
  3. add chat.campaignwiki.org to the existing Campaign Wiki domain names in /etc/dehydrated/domains.txt such that Let’s Encrypt will pick it up
  4. edit the Apache config file they generate and comment their settings for SSLProtocol, SSLCipherSuite and SSLHonorCipherOrder, preferring my own
  5. enable the site using a2ensite and restart Apache gracefully using systemctl reload apache2

Testing:

  1. chat.campaignwiki.org seems to work!
  2. got to Firefox preferences and search for Microphone and Camera and make sure to allow requests asking to access them (which I have disabled by default)
  3. on the phone, install the Jitsi Meet app (not sure why the browser isn’t good enough on the phone?)
  4. use the test room to test it...

I get the rooms listed, but I am immediately disconnected when accessing it on the phone. Not good!

I also get disconnected every now and then when using the website on my laptop. Hm.

OK, opening two private browsing windows and connecting to a channel on the official site seems to work. At least I get two copies of my camera showing video and I can chat with myself. It also works with the app on the phone. Thus, this is not an app or browser problem.

Back to my own installation. Let’s check the logs at /var/log/jitsi/jicofo.log. Some things to note after a restart:

  1. “Lonely participants will be “terminated” after 20000 milliseconds” → that would explain my automatic disconnects on the laptop after a bit
  2. the XMPP component says “This server does not serve auth.campaignwiki.org” but I think that’s OK?
  3. I also see references to jitsi-videobridge.campaignwiki.org and focus.campaignwiki.org but surely this cannot work?
  4. there are other Java exceptions, too; these look concerning: “ClassNotFoundException: javax.activation.DataSource”, “ClassNotFoundException: javax.xml.bind.PropertyException”, and “ClassNotFoundException: javax.xml.bind.Unmarshaller”

I think I need to redo my setup. Perhaps the domain name setup was a problem? I remember providing the wrong domain name at some point and then just fixing it in the Apache site config.

  1. apt purge jigasi jitsi-meet jitsi-meet-web-config jitsi-meet-prosody jitsi-meet-web jicofo jitsi-videobridge
  2. apt install -y jitsi-meet
  3. domain to use: chat.campaignwiki.org
  4. use my own certificates: /var/lib/dehydrated/certs/campaignwiki.org/privkey.pem and /var/lib/dehydrated/certs/campaignwiki.org/cert.pem

The differences in the Apache site setup:

--- /etc/apache2/sites-available/chat.campaignwiki.org.conf
+++ /etc/apache2/sites-available/600-chat.campaignwiki.org.conf
@@ -11,13 +11,14 @@
 
   ServerName chat.campaignwiki.org
 
-  SSLProtocol TLSv1 TLSv1.1 TLSv1.2
+  # SSLProtocol TLSv1 TLSv1.1 TLSv1.2
   SSLEngine on
   SSLProxyEngine on
-  SSLCertificateFile /var/lib/dehydrated/certs/campaignwiki.org/cert.pem
-  SSLCertificateKeyFile /var/lib/dehydrated/certs/campaignwiki.org/privkey.pem
-  SSLCipherSuite "EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA256:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EDH+aRSA+AESGCM:EDH+aRSA+SHA256:EDH+aRSA:EECDH:!aNULL:!eNULL:!MEDIUM:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED"
-  SSLHonorCipherOrder on
+  SSLCertificateFile      /var/lib/dehydrated/certs/campaignwiki.org/cert.pem
+  SSLCertificateKeyFile   /var/lib/dehydrated/certs/campaignwiki.org/privkey.pem
+  SSLCertificateChainFile /var/lib/dehydrated/certs/campaignwiki.org/chain.pem
+  # SSLCipherSuite "EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA256:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EDH+aRSA+AESGCM:EDH+aRSA+SHA256:EDH+aRSA:EECDH:!aNULL:!eNULL:!MEDIUM:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED"
+  # SSLHonorCipherOrder on
   Header set Strict-Transport-Security "max-age=31536000"
 
   DocumentRoot "/usr/share/jitsi-meet"

Diff finished.  Wed Mar 18 10:33:44 2020

I still get the same problem:

  1. https://chat.campaignwiki.org/Test loads
  2. I see the UI
  3. I am reconnected after a few seconds

Image 1

Trying to see whether the hostnames make more sense, now:

# grep campaignwiki /etc/prosody/conf.d/chat.campaignwiki.org.cfg.lua 
VirtualHost "chat.campaignwiki.org"
                key = "/etc/prosody/certs/chat.campaignwiki.org.key";
                certificate = "/etc/prosody/certs/chat.campaignwiki.org.crt";
Component "conference.chat.campaignwiki.org" "muc"
admins = { "focus@auth.chat.campaignwiki.org" }
Component "jitsi-videobridge.chat.campaignwiki.org"
VirtualHost "auth.chat.campaignwiki.org"
        key = "/etc/prosody/certs/auth.chat.campaignwiki.org.key";
        certificate = "/etc/prosody/certs/auth.chat.campaignwiki.org.crt";
Component "focus.chat.campaignwiki.org"

These subdomains make my head hurt. How can this work? I have added the four of them to my /etc/hosts file, but no effect. Not surprisingly, it turns out that these need to be “real” domains, reachable from the outside. Continue reading the comments...

Tags:

Comments on 2020-03-18 Selfhosting Jitsi

What domain do you have in /etc/jitsi/meet/*-config.js ? Search the wrong domain with ack --js /etc or something. Frankly, it might be faster to redo the install from scratch on a new machine: it shouldn’t take more than 5-10 min, if you have all the ports open and there’s no other webserver installed on the same machine.

– Federico 2020-03-18 11:02 UTC


I have already redone the config once, so I don’t mind doing it again, but I need to understand what went wrong because the problem seems to be unchanged.

I checked the config file:

# grep campaignwiki /etc/jitsi/meet/chat.campaignwiki.org-config.js 
        domain: 'campaignwiki.org',
        // authdomain: 'campaignwiki.org',
        // jirecon: 'jirecon.campaignwiki.org',
        // call_control: 'callcontrol.campaignwiki.org',
        // focus: 'focus.campaignwiki.org',
        muc: 'conference.campaignwiki.org'
    bosh: '//campaignwiki.org/http-bind',
    // focusUserJid: 'focus@auth.campaignwiki.org',
    //     // 'https://campaignwiki.org/static/oauth.html'
    //          'https://campaignwiki.org/subfolder/static/oauth.html'

This is strange, because the “chat” subdomain seems to be missing. I’ll add that and try again:

--- /etc/jitsi/meet/chat.campaignwiki.org-config.js~
+++ /etc/jitsi/meet/chat.campaignwiki.org-config.js
@@ -6,7 +6,7 @@
 
     hosts: {
         // XMPP domain.
-        domain: 'campaignwiki.org',
+        domain: 'chat.campaignwiki.org',
 
         // When using authentication, domain for guest users.
         // anonymousdomain: 'guest.example.com',
@@ -28,7 +28,7 @@
     },
 
     // BOSH URL. FIXME: use XEP-0156 to discover it.
-    bosh: '//campaignwiki.org/http-bind',
+    bosh: '//chat.campaignwiki.org/http-bind',
 
     // The name of client node advertised in XEP-0115 'c' stanza
     clientNode: 'http://jitsi.org/jitsimeet',

Diff finished.  Wed Mar 18 12:26:23 2020

Sadly, that doesn’t work either. Now I’m getting an “Unfortunately, something went wrong” error.

– Alex Schroeder 2020-03-18 11:20 UTC


OK, next attempt. I found this in the Juno Host docs:

Jitsi requires you create additionals domains in your DNS and in your YunoHost

  • auth.jitsi.domain.tld
  • conference.jitsi.domain.tld
  • jitsi-videobridge.jitsi.domain.tld
  • focus.jitsi.domain.tld

So I created them:

chat 10800 IN A 178.209.50.237
chat 10800 IN AAAA 2a02:418:6a04:178:209:50:237:1
chat.auth 10800 IN A 178.209.50.237
chat.auth 10800 IN AAAA 2a02:418:6a04:178:209:50:237:1
chat.conference 10800 IN A 178.209.50.237
chat.conference 10800 IN AAAA 2a02:418:6a04:178:209:50:237:1
chat.focus 10800 IN A 178.209.50.237
chat.focus 10800 IN AAAA 2a02:418:6a04:178:209:50:237:1
chat.jitsi-videobridge 10800 IN A 178.209.50.237
chat.jitsi-videobridge 10800 IN AAAA 2a02:418:6a04:178:209:50:237:1

And the config file:

--- /etc/jitsi/meet/chat.campaignwiki.org-config.js~
+++ /etc/jitsi/meet/chat.campaignwiki.org-config.js
@@ -6,7 +6,7 @@
 
     hosts: {
         // XMPP domain.
-        domain: 'campaignwiki.org',
+        domain: 'chat.campaignwiki.org',
 
         // When using authentication, domain for guest users.
         // anonymousdomain: 'guest.example.com',
@@ -24,11 +24,11 @@
         // focus: 'focus.campaignwiki.org',
 
         // XMPP MUC domain. FIXME: use XEP-0030 to discover it.
-        muc: 'conference.campaignwiki.org'
+        muc: 'conference.chat.campaignwiki.org'
     },
 
     // BOSH URL. FIXME: use XEP-0156 to discover it.
-    bosh: '//campaignwiki.org/http-bind',
+    bosh: '//chat.campaignwiki.org/http-bind',
 
     // The name of client node advertised in XEP-0115 'c' stanza
     clientNode: 'http://jitsi.org/jitsimeet',

Diff finished.  Wed Mar 18 21:12:06 2020

And now a single user can connect! I can connect to a chatroom and I see my video. No constant reconnects. I also had to restart Prosody with service prosody reload.

The only problem now is that whenever I connect to the same chatroom from a different private window or the phone, both sessions are terminated.

Perhaps this is still related to certificates? I think the one I have is only good for campaignwiki.org, www.campaignwiki.org, and chat.campaignwiki.org – but I need more subdomains, apparently.

– Alex Schroeder 2020-03-18 20:21 UTC


I decided to use the prosody cert calls mentioned in the Configure Prosody section. (Now I remember how I failed to set it up a while ago.)

Anyway:

prosodyctl cert generate chat.campaignwiki.org
prosodyctl cert generate auth.chat.campaignwiki.org
systemctl restart prosody

OK... I can now connect with both browser and phone, and we see each other in the channel, but both believe the other is muted and has no video!

Gaaaah.

– Alex Schroeder 2020-03-18 20:32 UTC


OK, /var/log/jitsi/jicofo.log has a SEVERE message: “... XMPP reconnection failed: ... SSLHandshakeException: PKIX path validation failed: ... CertPathValidatorException: signature check failed”

Let’s try this:

ln -sf /var/lib/prosody/auth.chat.campaignwiki.org.crt /usr/local/share/ca-certificates/
update-ca-certificates -f
systemctl restart prosody
systemctl restart jicofo
systemctl restart jitsi-videobridge

– Alex Schroeder 2020-03-18 20:48 UTC


Oh wow, it works! 😀

– Alex Schroeder 2020-03-18 20:50 UTC


If you’re using the app on your phone, note the trackers!

– Alex Schroeder 2020-03-18 21:21 UTC


Oh, cool:

– Alex Schroeder 2020-03-19 11:51 UTC


Some stuff is still not correct. Jitsi should give me a working XMPP server, too, as far as I understand it. Right now, however, Bitlbee gives me an error: “Login error: Certificate verification problem 0x14: certificate hasn’t got a known issuer”. That isn’t too surprising, considering that I self-generated certificates and added one of them to the local trust db. I guess the answer is to generate a certificate using Let’s Encrypt for all the domains in question.

I edited /etc/dehydrated/domains.txt and now I’m listing these:

campaignwiki.org www.campaignwiki.org chat.campaignwiki.org auth.chat.campaignwiki.org

When I run dehydrated -c I get an error:

 + Responding to challenge for auth.chat.campaignwiki.org authorization...
 + Hook: Nothing to do...
 + Cleaning challenge tokens...
 + Hook: Nothing to do...
 + Challenge validation has failed :(
ERROR: Challenge is invalid! (returned: invalid) (result: {
  "type": "http-01",
  "status": "invalid",
  "error": {
    "type": "urn:ietf:params:acme:error:dns",
    "detail": "DNS problem: NXDOMAIN looking up A for auth.chat.campaignwiki.org - check that a DNS record exists for this domain",
    "status": 400
  },
  "url": "https://acme-v02.api.letsencrypt.org/acme/chall-v3/3446546602/NNlp-g",
  "token": "l7Q3SpNFqQgZT3lnVVEPps0DvN1NkoyfG5rhC_dEMwY"
})

When I run dig on campaignwiki.org, www.campaignwiki.org, chat.campaignwiki.org and auth.chat.campaignwiki.org I do get some output but it doesn’t look correct:

;; QUESTION SECTION:
;auth.chat.campaignwiki.org.	IN	A

;; AUTHORITY SECTION:
campaignwiki.org.	2776	IN	SOA	ns1.gandi.net. hostmaster.gandi.net. 1584556785 10800 3600 604800 10800

Compare with the following:

;; QUESTION SECTION:
;chat.campaignwiki.org.		IN	A

;; ANSWER SECTION:
chat.campaignwiki.org.	3216	IN	A	178.209.50.237

So the answer section doesn’t include the subdomain. How strange.

Actually...

;; QUESTION SECTION:
;chat.auth.campaignwiki.org.	IN	A

;; ANSWER SECTION:
chat.auth.campaignwiki.org. 3600 IN	A	178.209.50.237

I think I got it backwards! 😟

Let’s try the following in my DNS setup:

chat 10800 IN A 178.209.50.237
chat 10800 IN AAAA 2a02:418:6a04:178:209:50:237:1
auth.chat 10800 IN A 178.209.50.237
auth.chat 10800 IN AAAA 2a02:418:6a04:178:209:50:237:1
conference.chat 10800 IN A 178.209.50.237
conference.chat 10800 IN AAAA 2a02:418:6a04:178:209:50:237:1
focus.chat 10800 IN A 178.209.50.237
focus.chat 10800 IN AAAA 2a02:418:6a04:178:209:50:237:1
jitsi-videobridge.chat 10800 IN A 178.209.50.237
jitsi-videobridge.chat 10800 IN AAAA 2a02:418:6a04:178:209:50:237:1

– Alex Schroeder 2020-03-19 12:34 UTC


OK, fixing stuff, now that the subdomains and subsubdoains 🙂 are ready:

rm /usr/local/share/ca-certificates/auth.chat.campaignwiki.org.crt
rm /etc/prosody/certs/*campaign*
for subdomain in chat auth.chat focus.chat jitsi-videobridge.chat conference.chat; do
    cat /var/lib/dehydrated/certs/campaignwiki.org/fullchain.pem > /etc/prosody/certs/$subdomain.campaignwiki.org.crt
    cat /var/lib/dehydrated/certs/campaignwiki.org/privkey.pem > /etc/prosody/certs/$subdomain.campaignwiki.org.key
done
chown prosody.prosody /etc/prosody/certs/*campaign*
update-ca-certificates -f
systemctl restart prosody
systemctl restart jicofo
systemctl restart jitsi-videobridge

So now I’m expecting the following:

# ls -l /etc/prosody/certs
total 40
-rw-r--r-- 1 prosody prosody 4006 Mar 19 22:10 auth.chat.campaignwiki.org.crt
-rw-r--r-- 1 prosody prosody 3243 Mar 19 22:10 auth.chat.campaignwiki.org.key
-rw-r--r-- 1 prosody prosody 4006 Mar 19 22:10 chat.campaignwiki.org.crt
-rw-r--r-- 1 prosody prosody 3243 Mar 19 22:10 chat.campaignwiki.org.key
-rw-r--r-- 1 prosody prosody 4006 Mar 19 22:10 conference.chat.campaignwiki.org.crt
-rw-r--r-- 1 prosody prosody 3243 Mar 19 22:10 conference.chat.campaignwiki.org.key
-rw-r--r-- 1 prosody prosody 4006 Mar 19 22:10 focus.chat.campaignwiki.org.crt
-rw-r--r-- 1 prosody prosody 3243 Mar 19 22:10 focus.chat.campaignwiki.org.key
-rw-r--r-- 1 prosody prosody 4006 Mar 19 22:10 jitsi-videobridge.chat.campaignwiki.org.crt
-rw-r--r-- 1 prosody prosody 3243 Mar 19 22:10 jitsi-videobridge.chat.campaignwiki.org.key
lrwxrwxrwx 1 root    root      37 Jan  9  2019 localhost.crt -> ../../ssl/certs/ssl-cert-snakeoil.pem
lrwxrwxrwx 1 root    root      39 Jan  9  2019 localhost.key -> ../../ssl/private/ssl-cert-snakeoil.key

As you can see, the various certificates are all identical because I’ve setup dehydrated such that the one certificate works for all these names. This differs from the official Let's Encrypt and Prosody documentation!

Once these certificates are in place and have the correct owners, I can edit my hook.sh for dehydrated:

# cat /var/lib/dehydrated/hook.sh
#!/bin/bash
if [ ${1} == "deploy_cert" ]; then
    echo " + Hook: Reloading Apache for ${2}..."
    service apache2 reload
    if [ ${2} == "campaignwiki.org" ]; then
	echo " + Hook: Regenerating prosody's files..."
	# 3 is privkey, 4 is cert, 5 is fullchain, 6 is chain, 7 is timestamp
	# use cat to preserve permissions and ownership
	for subdomain in chat auth.chat focus.chat jitsi-videobridge.chat conference.chat; do
	    cat ${5} > /etc/prosody/certs/$subdomain.campaignwiki.org.crt
	    cat ${3} > /etc/prosody/certs/$subdomain.campaignwiki.org.key
	done
	service prosody reload
    fi
    if [ ${2} == "alexschroeder.ch" ]; then
	echo " + Hook: Regenerating monit's .pem file..."
	# 3 is privkey, 4 is cert, 5 is fullchain, 6 is chain, 7 is timestamp
	# use cat to preserve permissions and ownership
	cat ${5} ${3} > /etc/ssl/localcerts/alexschroeder.ch.all.pem
	service monit reload
    fi
else
    echo " + Hook: Nothing to do..."
fi

Everything still seems to work. 🙂

– Alex Schroeder 2020-03-19 21:19 UTC


When I check the XMPP server with Bitlbee, however: “BitlBee does not support any of the offered SASL authentication schemes: ANONYMOUS” 😟

– Alex Schroeder 2020-03-19 21:21 UTC


Actually, now that I’ve talked to EionRobb on the #bitlbee channel, I think I understand.

  1. I need anonymous access to XMPP for Jitsi to work for anonymous users
  2. Internally, they get assigned random ids, but that doesn’t bother them because they access Jitsi via a URL that gives them a chat room and so whoever is there knew the URL and is your “friend” so you trust them and the alias they give themselves
  3. But from IRC via Bitlbee or via another XMPP client, that doesn’t make sense: you have an id first, like kensanata@pluspora.com, and then you send messages to other people whose id you trust

So, all of this wasn’t actually necessary! 😭

Not sure what to do now. Would a self-signed certificate for auth.chat.campaignwiki.org be enough?

Gah!

– Alex Schroeder 2020-03-19 21:44 UTC


OK, let’s figure out how this works. Prosody has uses this config file for the Jitsi stuff: /etc/prosody/conf.d/chat.campaignwiki.org.cfg.lua. From a copy in the global config file /etc/prosody/prosody.cfg.lua:

-- Certificates
-- Every virtual host and component needs a certificate so that clients and
-- servers can securely verify its identity. Prosody will automatically load
-- certificates/keys from the directory specified here.

OK, so which ones get listed?

  1. virtual server localhost (really?)
  2. virtual server chat.campaignwiki.org (with a SSL section pointing to /etc/prosody/certs)
  3. component conference.chat.campaignwiki.org (no SSL section)
  4. component jitsi-videobridge.chat.campaignwiki.org (no SSL section)
  5. virtual server auth.chat.campaignwiki.org (with a SSL section pointing to /etc/prosody/certs)
  6. component focus.chat.campaignwiki.org (no SSL section)

Hm. So I’m guessing only the virtual servers with SSL section actually need them. Instead of modifying the files too much, I will simply remove the unnecessary copies of the certificates and not add any self-signed certs back.


And for Monit:

check process prosody with pidfile /var/run/prosody/prosody.pid
    start program = "/bin/systemctl start prosody"
    stop program = "/bin/systemctl stop prosody"
    restart program = "/bin/systemctl restart prosody"
    if totalmem > 500 MB for 5 cycles then restart
    if 3 restarts within 15 cycles then stop

check process jicofo with pidfile /var/run/jicofo.pid
    start program = "/bin/systemctl start jicofo"
    stop program = "/bin/systemctl stop jicofo"
    restart program = "/bin/systemctl restart jicofo"
    if totalmem > 500 MB for 5 cycles then restart
    if 3 restarts within 15 cycles then stop

check process jitsi-videobridge with pidfile /var/run/jitsi-videobridge/jitsi-videobridge.pid
    start program = "/bin/systemctl start jitsi-videobridge"
    stop program = "/bin/systemctl stop jitsi-videobridge"
    restart program = "/bin/systemctl restart jitsi-videobridge"
    if totalmem > 500 MB for 5 cycles then restart
    if 3 restarts within 15 cycles then stop

– Alex Schroeder 2020-03-20 08:18 UTC


Had my first virtual tea via Jitsi with my wife in another room and a friend in the neighbourhood. Got to experiment with phone and laptop, camera and external microphone. 🙂

– Alex Schroeder 2020-03-20 15:02 UTC


I am trying to get Jitsi Meet to work. I have all the hostnames configured and a Let’s Encrypt cert for all of them, and I got nginx configured to show the web-interface. jitsi-videobridge is running and saying things in its logfile, but jicofo only prints a couple of warnings and then nothing more, which I think is wrong? (It is a Java-program after all). Everybody who connects can see video of themselves, and that others are present, but no video or audio from other participants. Any hints? What does jicofo log in your working setup?

Adam 2020-03-20 16:30 UTC


Ah, I got it working by adding the prosody user with the correct password and noticing that port 5347 is only listened on locally, so I should use localhost in jicofo/config and jitsi-videobridge/config. Thanks for the inspiration!

Adam 2020-03-20 17:04 UTC


Jicofo logs a ton of info messages and no errors: focus request, joining the room, chat room event, granted ownership, member joined, another focus request, another member joining the room, another chat room event, a conference created, a participant added, nothing out of the ordinary. There is one warning “no jingle session yet” immediately followed by an info log message saying a session-accept was received.

Back when the setup was not working, I had Java exceptions in there: java.lang.ClassNotFoundException, IllegalArgumentException, stuff like that.

Check for errors in your Prosody log files, too. /var/log/prosody/prosody.err had errors (”Error binding encrypted port for https: No certificate present in SSL/TLS configuration for https port 5281”) back when it wasn’t working (this was also visible in /var/log/prosody/prosody.log).

– Alex Schroeder 2020-03-20 17:05 UTC


Hah! Excellent. 🙂

I only have localhost listed in the Jicofo config file:

# grep HOST /etc/jitsi/*/config 
/etc/jitsi/jicofo/config:JICOFO_HOST=localhost
/etc/jitsi/jicofo/config:JICOFO_HOSTNAME=chat.campaignwiki.org
/etc/jitsi/videobridge/config:JVB_HOSTNAME=chat.campaignwiki.org
/etc/jitsi/videobridge/config:JVB_HOST=

– Alex Schroeder 2020-03-20 17:06 UTC


Thanks!

I have localhost in both HOST= lines; works.

I can’t make the Android app work, though - it just immediately says it was disconnected. I can’t see it trying to connect in the webserver nor the prosody log - did you do something special to get that working?

Adam 2020-03-20 18:39 UTC


Ah, the app didn’t work because I used the cert.pem instead of the fullchain.pem as the ssl-certificate in the webserver - now the Android app works as well!

Adam 2020-03-20 18:58 UTC


Perfect. Thanks for posting about your experience!

– Alex Schroeder 2020-03-20 23:29 UTC


Let’s see... Changing from “stable” to “unstable” in /etc/apt/sources.list.d/jitsi-stable.list and running apt update and apt list --upgradable:

jicofo/unstable 1.0-534-1 amd64 [upgradable from: 1.0-508-1]
jitsi-meet-prosody/unstable 1.0.3905-1 all [upgradable from: 1.0.3729-1]
jitsi-meet-web-config/unstable 1.0.3905-1 all [upgradable from: 1.0.3729-1]
jitsi-meet-web/unstable 1.0.3905-1 all [upgradable from: 1.0.3729-1]
jitsi-meet/unstable 1.0.4304-1 all [upgradable from: 1.0.4101-1]
jitsi-videobridge/unstable 1132-1 amd64 [upgradable from: 1126-1]

Unfortunately, however:

The following NEW packages will be installed:
  coturn jitsi-meet-turnserver libevent-core-2.1-6 libevent-extra-2.1-6 libevent-openssl-2.1-6 libevent-pthreads-2.1-6 libhiredis0.14
  libnginx-mod-http-auth-pam libnginx-mod-http-dav-ext libnginx-mod-http-echo libnginx-mod-http-geoip libnginx-mod-http-image-filter
  libnginx-mod-http-subs-filter libnginx-mod-http-upstream-fair libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream nginx
  nginx-common nginx-full sqlite3 uuid-runtime
The following packages will be upgraded:
  jicofo jitsi-meet jitsi-meet-prosody jitsi-meet-web jitsi-meet-web-config jitsi-videobridge
6 upgraded, 22 newly installed, 0 to remove and 0 not upgraded.

I don’t really want nginx – I’m an Apache person!

– Alex Schroeder 2020-03-23 14:56 UTC


Installing Coturn to get rid of Google’s STUN servers.

– Alex Schroeder 2020-03-23 23:48 UTC


I think I’m running an anonymous TURN server for now. The things we do for Corona! 😇

apt install coturn

Edit /etc/default/coturn.conf and change it to TURNSERVER_ENABLED=1. Then systemctl restart coturn and systemctl restart jitsi-videobridge (I guess?). It’s still working, as far as I can tell.

– Alex Schroeder 2020-03-27 16:13 UTC


Also note 2020-03-26 Jitsi and the CPU.

– Alex Schroeder 2020-03-29 10:04 UTC

Add Comment

2020-02-16 Firefox syncserver

OK, so I’m trying to run my own syncserver. It’s separate from the account server, so you still need a Firefox Account. If you do things in the wrong order your browser syncs immediately – to their own sync server, which is not what I wanted. 😭

Anyway, let’s start from the beginning.

First, check out the project, syncserver. It uses Python 2. Oh well!

The Sync Server software runs using python 2.7, and the build process requires make and virtualenv.

I looked at this blog post by Matthias Dietel.

apt install python-dev git-core python-virtualenv g++

Easy enough! Build the project:

cd ~/src
git clone https://github.com/mozilla-services/syncserver.git
cd syncserver
make build
make test

Edit the syncserver.ini file. I’ve made the following changes:

diff --git a/syncserver.ini b/syncserver.ini
index ccf1ae0..21d0586 100644
--- a/syncserver.ini
+++ b/syncserver.ini
@@ -1,6 +1,6 @@
 [server:main]
 use = egg:gunicorn
-host = 0.0.0.0
+host = localhost
 port = 5000
 workers = 1
 timeout = 30
@@ -11,7 +11,7 @@ use = egg:syncserver
 [syncserver]
 # This must be edited to point to the public URL of your server,
 # i.e. the URL as seen by Firefox.
-public_url = http://localhost:5000/
+public_url = https://alexschroeder.ch/sync
 
 # By default, syncserver will accept identity assertions issued by
 # any BrowserID issuer.  The line below restricts it to accept assertions
@@ -20,7 +20,7 @@ public_url = http://localhost:5000/
 identity_provider = https://accounts.firefox.com/
 
 # This defines the database in which to store all server data.
-#sqluri = sqlite:////tmp/syncserver.db
+sqluri = sqlite:////home/alex/syncserver.db
 #sqluri = pymysql://sample_user:sample_password@127.0.0.1/syncstorage
 
 # This is a secret key used for signing authentication tokens.
@@ -34,7 +34,7 @@ identity_provider = https://accounts.firefox.com/
 
 # Set this to "false" to disable new-user signups on the server.
 # Only requests by existing accounts will be honoured.
-# allow_new_users = false
+allow_new_users = new
 
 # Set this to "true" to work around a mismatch between public_url and
 # the application URL as seen by python, which can happen in certain reverse-
@@ -55,4 +55,4 @@ force_wsgi_environ = false
 # MySQL based syncstorage-rs 1.5 server hosted at http://localhost:8000/1.5
 
 # "{node}/1.5/{uid}"
-# sync-1.5 = "http://localhost:8000/1.5/{uid}"
+sync-1.5 = "https://alexschroeder.ch/sync/token/{node}/sync/1.5/{uid}"

That is to say:

  1. the server only listens on localhost:5000
  2. the server can be reached at https://alexschroeder.ch/sync
  3. it uses a SQLite db at /home/alex/syncserver.db
  4. it allows new users to sync their stuff
  5. and I had to change that endpoint at the end... 🤷

So now I need to set up my website. I use Apache and I already have proxy stuff set up. All I had to add was this:

ProxyPass /sync	    http://localhost:5000/

Thus, any request starting with /sync to my existing website gets sent to port 5000 on localhost which happens to be the URL where the sync server is running.

Next, open about:config in the browser and change identity.sync.tokenserver.uri to https://alexschroeder.ch/sync/token/1.0/sync/1.5 – then I’m ready to open the browser preferences and sign in.

If everything worked, you should see your display name in the top spot of the hamburger menu. 🍔 😁

If you see a warning sign after a second or two, stuff isn’t working.

It all sounds so easy now, but it took me a while to get everything working, believe me. 😭

Now I’m seeing the following errors in the log output of make serve:

ERROR:syncserver:The public_url setting doesn't match the application url.
This will almost certainly cause authentication failures!
    public_url setting is: https://alexschroeder.ch/sync
    application url is:    http://localhost:5000/sync
You can disable this check by setting the force_wsgi_environ
option in your config file, but do so at your own risk.

I have no idea what it means. I’m thinking it works anyway? I’m making an additional change to syncserver.ini just to be sure.

force_wsgi_environ = true

The instructions tell me that we only need this in certain reverse-proxy setups but this is a reverse-proxy setup so I think I should be fine?

Now I wonder how to leave the sync server running... Perhaps it’s OK to just do this every now and then?

Now that I have it running I wonder about the utility of it all:

  1. there’s no need for me to mix my private Firefox and my work Firefox bookmarks and logins
  2. I currently cannot make Firefox on my iPad and my iPhone use a different sync address

Oh Apple, the golden prison, where I’m safe, but also where I’m locked in. Sigh. 😔

But wait… This issue is closed: Add ability to set custom identity.sync.tokenserver.uri for self-hosted Sync #5006?

One of the last comments on that issue, by user fireglow:

Just to chime in a little: Python 2.7, the flavor of Python the sync software is written in, will go End-of-Life at the end of this month, year, and decade. Mozilla already has indicated that there will be no rewrite for Python 3. I gather there’s a rewrite of these services in Rust in the works, at https://github.com/mozilla-services/syncstorage-rs It’s as of now unclear to me how all these parts will fit together in a way so us self-hosters will be able migrate over.

Oh wow.

I think I’m going to stop all of this. It’s making my head hurt. I checked the Rust rewrite project. Apparently you need to use either MySQL or Spanner as your DB. And with that, I’ve decided that not running this service and not syncing my stuff is probably for the best.

I undid all the changes, stopped the server, uninstalled the software, and deleted the Firefox account again.

Tags:

Comments on 2020-02-16 Firefox syncserver

Hi Alex,

You can set a custom sync server amd token server in Firefox ios.

To access it:

  • Enter the settings menu
  • Hit the version number 5 times, this opens debug mode
  • Under the sync option, there is a new menu item, Advanced Sync
  • The two settings are now available

Note that I haven’t done this, as I don’t (yet) have a sync server.

dgold 2020-02-16 19:25 UTC


I get the feeling that this doesn’t work on the iPad... I get a bunch of extra options but no place where I can set the sync server URL.

– Alex Schroeder 2020-02-16 19:28 UTC


I don’t know what to say to you. I set up my server in the way you described (except I didn’t set the last two options in the file)

I accessed the Advanced Settings in FFox on iPadOS. All works perfectly.

dgold 2020-02-16 20:24 UTC


How weird. I just updated Firefox on the iPad and it does look different, but I still don’t know where to start. Do you feel like pasting a screenshot, or can you explain it like I’m super confused? Because I feel like I am!

  1. open Firefox on the iPad
  2. click hamburger menu
  3. scroll down until you see “Version 22.0 (17157)
  4. tap this section five time until the list of options changes
  5. now what?

At the top, I see three items:

  1. my email address and a note saying I need to enter my password (but since I deleted my account, clicking on this item just takes me to accounts.firefox.com where I could probably recreated my account and start sync immediately but with their servers)
  2. error diagnosis: ask for an upgrade (translating from German)
  3. error diagnosis: forgot sync-status (translating from German)

No other item in these settings seem related to sync. What am I not seeing?

– Alex Schroeder 2020-02-16 22:08 UTC


After you tap the section until the lost of options changes, there should be a new menu item at the top of the Preferences under “Firefox Account” called “Advanced Sync Settings”.

In that modal dialog you can set the address of your sync server, in the form https://example.com/sync/token/1.0/sync/1.5

I didn’t create a FFox account until after I’d created my sync server.

dgold 2020-02-17 11:00 UTC


Oh wow, I just tried it on the iPhone and it worked. Tapped on the Version five times, it automatically scrolls to the top showing me the things I listed previously, but now I scroll back to the bottom and do it again and now I see new items at the top:

  1. Sign in to Sync
  2. Advanced Sync Settings
  3. Debug: use stage servers

Hah, thanks for pointing me at it again. I might give this another try.

– Alex Schroeder 2020-02-17 11:40 UTC


Well, I think it’s working:

Firefox on iOS Advanced Sync Settings Firefox on iOS Advanced Settings

On the iPad, the situation was different. I had to do the following:

  1. log into sync even though I couldn’t change the sync server and Firefox synced with the default sync server
  2. log out of sync
  3. activate the advanced settings again
  4. now you can change the sync server
  5. log into sync again

🙄

I’m looking at Run your own Sync-1.5 Server right now and I’m wondering about the WSGI setup. Are you using it?

I guess I don’t need to use it as my setup is basically Apache + Gunicorn. 😀

Except have to turn on force_wsgi_environ. As far as I can see in the Apache documentation on Reverse Proxy Request Headers but then again, the nginx setup instructions mention X-Forwarded-Proto and X-Real-IP, both of which the Apache docs don’t mention. Gaaaaah! 😭

Setup for Monit:

check process syncserver matching syncserver
    start program = "/bin/bash -c '(cd /home/alex/src/syncserver && exec /usr/bin/make serve 2&>1 syncserver.log)' &"
    stop program = "/usr/bin/killall gunicorn"
    if failed
	host alexschroeder.ch
	port 443
	type tcpssl
	protocol http
	request "/sync"
	for 5 cycles
	then restart
    if totalmem > 100 MB for 5 cycles then restart
    if 3 restarts within 15 cycles then stop

– Alex Schroeder 2020-02-17 21:19 UTC


thank you very much for your post! i learned a lot here!

one question: does your setup still work on your iPad?

i have the following sync (token) server running: https://github.com/crazy-max/docker-firefox-syncserver

but i cant get past the following issue:

https://github.com/mozilla-mobile/firefox-ios/issues/6535

all the best, ma

– ma 2020-07-31 10:05 UTC


I don’t remember seeing any error messages about OAuth. In fact, I don’t remember seeing any errors at all. It was all silent fails.

– Alex 2020-07-31 13:03 UTC

Add Comment

More...

Comments


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. Note: in order to facilitate peer review and fight vandalism, we will store your IP number for a number of days. See Privacy Policy for more information. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Just say HELLO