Country flags both IP types

General support for problems installing or using Deluge
Post Reply
zone4444
Member
Member
Posts: 18
Joined: Wed Aug 11, 2021 12:49 pm

Country flags both IP types

Post by zone4444 »

Hello,
Is there a way to make deluge show country flags for users connected on both IPv4 and IPv6 (if my machine supports both) ?
Right now I can only see IPv4 flags.
Thank you in advance.
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Country flags both IP types

Post by mhertz »

I previously made that work in my unofficial deluge2 windows installer, so is possible, but needs little work I.e applying the IPv6-GeoIP part of strangelovian's multi-homed PR here: https://github.com/deluge-torrent/delug ... 2e1d35fcbd

Then needs obviously additional GeoIPv6 database file, and last, if using libtorrent 1.2.x, then need change in deluge code to by default bind and announce also from your IPv6 IP, as the default 0.0.0.0 deluge hardcodes as listen_interfaces, isn't expanded also to IPv6 anymore , like done previously before libtorrent 1.2.x - I did submit deluge bug-ticket to this last part btw. Here's my older patch for this last part: https://github.com/mhertz/deluge2/blob/ ... sten.patch

If applying the full strangelovian PR, and so not only the IPv6-GeoIP part I linked previously, then can get away without needing apply my listen.patch above, if then also manually defining as listen_interface in deluge '0.0.0.0,::', but if applying my patch then will be default behavior.

Edit: Come to think of it, I did apply the full strangelovian PR when I made my unofficial installer, so in hindsight I don't really know if my last posted patch needs that to work or not, but not 100% sure though. Anyway, here's full strangelovian PR just in case, and nonetheless is nice PR in full imho, which I tested working good before: https://github.com/deluge-torrent/deluge/pull/300
zone4444
Member
Member
Posts: 18
Joined: Wed Aug 11, 2021 12:49 pm

Re: Country flags both IP types

Post by zone4444 »

All this sounds a bit cryptic to me. New to Linux here, but thanks for the reply.

Edit: I tried downloading DB-IP - Country > IPv6/IPv4 from here and I then replaced my GeoIP.dat but that didn't work.
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Country flags both IP types

Post by mhertz »

If you or any others wanna get this enabled, then i've threw together some command-lines doing these before-mentioned changes automatically, by e.g. copy/pasting commands into a file and running 'sh filename' in a terminal. I tested it working in my ubuntu 21.04 VM using deluge 2.0.3 package, but I could only check patches applied correctly and not the actual ipv6 geoip support, because have no ipv6 on my connection, and when adding this to the unofficial installer then I tested it working through the terredo ipv4-to-ipv6 built-in layer, but don't know how enable such on linux and to lazy to look into it honestly.

If during patching some files shows failing/missing, then that's because you don't have that particular deluge component installed e.g. deluge-console and/or deluge-web etc, but irrelevant since you don't use it anyway, and hence I intentionally made 'patch' skip such.

I edited/fixed-up the patches and uploaded them to free webhost, as I only implemented this before for deluge-dev builds for the unofficial installer and there where incompatible changes in-between dev and stable, breaking several of them.

To revert back to default if wanted, then either run the revert script or alternativelly just uninstall and reinstall deluge.

Should work on other than ubuntu too, i.e. everywhere using deluge 2.0.3 pretty much.

I used wget instead of curl since that was default installed on ubuntu and not curl.

Apply:

Code: Select all

sudo find /usr -type d -path "*/python3*/*/deluge" -exec sh -c "wget -O- https://paste.c-net.org/WondrousProperty | sudo patch -f -p2 --no-backup-if-mismatch -d {}" \;
sudo find /usr -type d -path "*/python3*/*/deluge" -exec sh -c "wget -O- https://paste.c-net.org/SpiderVersion | sudo patch -f -p2 --no-backup-if-mismatch -d {}" \;
sudo find /usr -type d -path "*/python3*/*/deluge/core" -exec sh -c "wget -O- https://github.com/mhertz/deluge2/raw/master/deluge-build/listen.patch | sudo patch -f -p1 --no-backup-if-mismatch -d {}" \;
Revert:

Code: Select all

sudo find /usr -type d -path "*/python3*/*/deluge/core" -exec sh -c "wget -O- https://github.com/mhertz/deluge2/raw/master/deluge-build/listen.patch | sudo patch -f -R -p1 --no-backup-if-mismatch -d {}" \;
sudo find /usr -type d -path "*/python3*/*/deluge" -exec sh -c "wget -O- https://paste.c-net.org/SpiderVersion | sudo patch -f -R -p2 --no-backup-if-mismatch -d {}" \;
sudo find /usr -type d -path "*/python3*/*/deluge" -exec sh -c "wget -O- https://paste.c-net.org/WondrousProperty | sudo patch -f -R -p2 --no-backup-if-mismatch -d {}" \;
Edit: Tested working also for actual ipv6 geoip functionality now(and ipv6 in general i.e. bind/announce also to/from IPv6 in addition to IPv4, as otherwise not done on libtorrent 1.2.x without this). I felt bad not testing it properly so looked into how emulate ipv6 on linux so could test it, and that was easy i.e. simply running 'sudo apt-get install miredo' and restart deluge.
zone4444
Member
Member
Posts: 18
Joined: Wed Aug 11, 2021 12:49 pm

Re: Country flags both IP types

Post by zone4444 »

Ty for your time mhertz :)
Post Reply