Firefox with ublock is all I need. For Youtube I have Libretube, and I guess I could get streamlink to work somehow if I were so inclined to watch twitch streams and whatever.
I guess your /bin/sh
is linked to bash
. I have changed the offending bit now so it should work both with bash and busybox (see previous comments). Please try again.
Thank you very much for the update! Now it worked. My Shell is busybox, though.
/bin/sh -> ../usr/bin/busybox
Anyway, thanks a lot!
Small new thing I discovered is this: (but I don’t really want to bother you any further)
rm: can't remove 'meta-list': No such file or directory
It’s no bother. It should’ve been meta.list
instead of meta-list
. Fixed, pull again.
Btw and @everybody: this will result in pretty strict domain blocking. Not to everyone’s taste. If you want less maybe you can choose one of Steven Black’s ready-made files instead.
Just out of curiosity - isn’t it possible to create a rpm package from your scripts that can be put on openrepos/chum so everybody can install it easily without the need to ssh to the device?
Not everybody is able/willing to do this - but i guess everybody would appreciate an rpm package that could be easily installed via a store.
What do you think?
This issue has been just raised. A RPM package can run scripts but they are not designed for that task.
This kind of changes would go into something like a configuration manager but SFOS is missing completely such a tool. On the other hand, the tool that could have fulfill that role was Patch Manager but the evolution of PM gone in the direction of applying in-memory-only patches that do not survive to a reboot because otherwise a patch can mess up the system. This choice, as demonstrated in trying to patches some system configuration files, prevent to have a configuration manager tool with the minimum effort starting from the current PM.
However, because a configuration manager can potentially interfere also with the RPM installation / removing / update and for sure with the SFOS version upgrade no any way of applying persistent changes have been made but SSH. Hence, when you use SSH, it is your fault!
Welcome aboard, sailor!
It exists a package as described into DNS CACHING section of this guide
The name of that package is dns alternative.
It is not part of the SFOS, but the OpenRepos community contributions.
No.
What was asked was to package the script in to an installable RPM file to make the script available to a user at leisure.
What was not asked was to run said script during installation of an RPM.
Now we have that misunderstanding out of the way: Patchmanager has nothing to do with anything asked here, and you still haven’t completely grokked how it actually works.
But that’s harmless, as it’s not really relevant to the topic of this thread.
Back on Topic, doing stuff with DNS, be it the way you propose in your links or otherwise is a valid approach and on topic in this thread, but the participants here apparently prefer the /etc/hosts/
approach. (Which in a way is a DNS approach, just without DNS.)
I already stated earlier:
Yes but it might take me a while. Thanks for the vote of confidence (well that’s how I choose to interpret it).
The question was specific but in general what is required is a configuration manager.
How to provide a configuration manager?
Can be an RPM that install a set of scripts and allows to run them by a GUI providing parameters.
Because a configuration manager should be available also in rescue mode (no graphic interface available) or via remote console (e.g. SSH).
Is this enough?
Nope, if the configuration manager does not manage also the package installation set, as well.
This is possible only if there is a centralized organisation of the RPM repositories which is not the case of SFOS.
Changing the DNS is not the only thing that people wish to do, but just one of many.
Where is the best place to put a configuration manager considering the peculiarities of the smartphone market?
Into a rescue image, not in the system.
Oplà!
Hello,
my most promising solution for ad block is the modification of the hosts file. AdBlocking on Sailfish OS via /etc/hosts | dt.iki.fi developed a suitable solution. However for me it was still very complicated to process all the steps. Therefore I wrote a bash script that includes all steps.
just download and run the following script with root permission and after reboot ad block should work out of the box: adblock-script/adblock-script.sh at main · teertinker/adblock-script · GitHub
I hope this helps some users.
This usually works for me.
Type in terminal as root -
curl https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts -o /etc/hosts
Naturally, you should be able to link it to any other hosts file of your choice.
After you do that, reboot the device, and that’s it.
Just to clarify:
There’s nothing wrong with using a single hosts file, but I wanted to go the extra mile, as discussed in this thread.
Therefore the script has grown quite complex:
- it converts uBO’s uAssets as far as possible to be used by /etc/hosts
- it downloads everything from firebog.net’s meta list plus Steven Black’s largest hosts file
- it combines and unique-sorts everything, adds a header and finally overwrites the old /etc/hosts
My tutorial mostly describes how to make updates automatic; the script itself can be treated as opaque.
Thanks to @FelixWilke for automating that in turn, and directly linking to my script. If you want you can use this link instead and I’ll try my best to make sure not to break compatibility in future updates.
That sounds pretty cool. Thanks for making it.
Finally when actually trying to move to C2 I have made an attempt to rpm-ize this @ohnonot RPM packaging (!1) · Merge requests · ohnonot / sfos · GitLab
(Waiting for @olf’s review of course )
I may have misused chum metadata, I can edit that later. One thing I am not comfortable with is that I placed the rpm folder inside the hosts folder, which might prevent a chum build on OBS, maybe I should stick to a top-level rpm dir…
Still, if you checkout that repo, cd hosts and sfdk build
you’d get a rpm.
For testing purposes I am pre-publishing the package on hosts-block | OpenRepos.net — Community Repository System
I’m not an expert but looking at this script, I perceive it as something missing. As far as I know, you need reboot for updated hosts list to take effect? Don’t you?
Changes to the /etc/hosts
file are usually picked up immetiately without a reboot. Just give it a try by changing some IP and use ping to trigger hostname resolution.
Well, I don’t know about ‘usually’ but it sure doesn’t work like that on my C2 - SFOS 5.0.0.43.
I did my test a bit different, like this…
- Add openrepos.net to your hosts file and save.
- Launch Jolla browser and go to openrepos.net with no errors.
- Reboot phone.
- Launch Jolla browser and go to openrepos.net, and get error message ‘cold not access’.
- Update hosts file to be without openrepos.net
- Launch Jolla browser and go to openrepos.net, and get error message ‘cold not access’.
- Reboot phone
- Launch Jolla browser and go to openrepos.net with no errors.
The same goes for my Linux desktop.
With these steps I get the result you describe als on 4.6.0.15 but the reason is probably, that the browser uses its own resolver. After a pkill -f browser
that should have killed sailfish-browser as well as browser-booster, the changes are picked up without a reboot.
I don’t have the time to test right now, but if that is true, there actually is something missing in that script.