Block ads on Sailfish 4.4

No, you have to update the script /usr/share/harbour-defender/qml/python/ . I replaced baseDomain with host on line 157.

You need to close the browser before starting Defender. That’s because the DB get locked by the browser when it’s open.

I did that but defender (installed from Chum, V0.6.0-1.1.1.jolla) still shows no Sources when selecting Update now.

I think a din´t make any mistake… but look what it says when i launch it…
/tmp/tmp.srukKv: line 22: syntax error: unexpected "("

Do you want to always run the latest version of hosty? (recommended) y/n

Installing hosty…
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1277 100 1277 0 0 3659 0 --:–:-- --:–:-- --:–:-- 3659

Fixing permissions…

Checking optional dependencies…

Do you want to automatically update your hosts file with latest ads list? (recommended) y/n

[root@Xperia10III defaultuser]# sudo hosty
======== hosty v1.7.6 (10/Mar/21) ========
======== ========

/tmp/tmp.srukKv: line 22: syntax error: unexpected “(”
[root@Xperia10III defaultuser]#

Check if you missed any steps. If not, try to run ‘sudo hosty’ again.

1 Like

Try to start defender from Terminal.

When starting defender from app-grid, it doesn´t show me the Sources either.

There are a few lingering problems:

  • execution permissions aren’t granted and thus cannot call wc -l (but it’s possible to rewrite this in Python).
  • there are a few files that aren’t made visible within the sailjail: /etc/hosts.editable is missing, the browser cookie files is missing too, causing the code to fall back to an older filepath which isn’t used anymore, etc. (I think /etc/defender.conf is missing, too)


in defender, the actual engine is separate from the GUI.
so you can manually edit / fetch from backup a copy of .config/harbour-defender/defender.conf (warning, it will be overwritten on defender’s startup as it can’t read the list of sources - presumably from /etc/defender.conf? I haven’t checked that). then either run systemctl status harbour-defender.service (or touch ~/.config/harbour-defender/update to use the .path automatic trigger)


Is anyone already fixing defender for 4.4? Its a bit of a shame that we have no usable userfriendly adblocker right now

1 Like

I tried a bit. At least I found a workaround, but all engine should be written again. It takes too much time to update the host file and all process is very heavy.

Is it working again? I’d suggest that we fix it, before the rewrite as this may take some time.

I created a few comments on the defender issues that might help to fix the current issues

1 Like

Not a Sailfish question, who did you utilize Steven Black hosts blacklist project on postmarketOS on Pinephone?


The general instructions are on the github project. I used what’s now called “option 3” since the docker options weren’t a thing when I first generated my blocklist.

Since pmos is pretty much alpine linux, the only hiccups are making sure that you’ve got the python requirements met. You might need to google how to get pip3 installed on pmos/alpine. IIRC, this wasn’t too much of a hassle. I think I’ve saved a shell script somewhere if things go pear shaped.

Once all that is working, the “Common Steps . . .” section is all you need to do to generate the specific list you need for your purposes.

My solutiin is to VPN to my Firewalla and nuke it at that endpoint, works for SFOS and Android apps

1 Like

Hosty works like a charm on my Xperia 10 III. I’ve added 3 additional lists to it and Sailcron refresh all during an 9 hour cycle.

Next try is on Ubuntu Touch. Should also run their. :+1:

1 Like

It’s scaring me to download and run a foreign script as root on my phone. So even if hosty doesn’t do anything wrong, we never know what’s happening tomorrow.
Running hosty as a cron job as root gives the owner of the repository access to all of your data and your system. It will be easy for them to install a backdoor without any sign to the user of the phone. So I would comment to not deploy hosty without supervision.

As far as I understand hosty just updates /etc/hosts. Wouldn’t it be simple to download hosty’s data and create your own script, or even analyse, verify and use hosty’s script statically?


It is easy!
Just choose your StevenBlack list combination (or any list of your choice) and run a cron job on the below.
devel-su curl -o /etc/hosts
Of course change the url to your prefered combo.


Take care to do that as root. It breaks some apps if the file /etc/hosts has a different owner/group.


Of course, my bad. I should have told.

For another approach: use the Brave browser (from the aurora store).

You can sync across Windows/Mac/Linux and Jolla. The browser needs some config to remove wallet etc. but then runs quite well (for me).

I just use the addware/malware hosts:

That is probably good enough, but I decided to try a combined list.