faup icon indicating copy to clipboard operation
faup copied to clipboard

TLD updates no longer available

Open jdiner opened this issue 9 years ago • 2 comments

TLD updates are no longer working. After running:

  faup -u

the mozilla.tlds file contains only an error message:

  HTTP/1.1 404 Not Found^M
  Date: Fri, 24 Feb 2017 16:35:35 GMT^M
  Server: Apache/2.4.10 (Debian)^M
  Content-Length: 298^M
  Connection: close^M
  Content-Type: text/html; charset=iso-8859-1^M
  ^M
  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  <html><head>
  <title>404 Not Found</title>
  </head><body>
  <h1>Not Found</h1>
  <p>The requested URL /effective_tld_names.dat was not found on this server.</p>
  <hr>
  <address>Apache/2.4.10 (Debian) Server at io.libio.so Port 80</address>
  </body></html>

I've confirmed this issue on multiple clients and networks. It appears that the TLD update endpoint has disappeared.

Also note that this issue renders libfaup unable to provide useful TLD information for parsed URLs. This is because the mozilla.tlds file is overwritten even if the update fails, rather than keeping the old mozilla.tlds data.

jdiner avatar Feb 24 '17 16:02 jdiner

I've created a workaround that I'd like to share in case anyone else needs public suffix list updates. It's a bash script that downloads the latest data via curl. It should be run in the directory where the mozilla.tlds file is stored. It maintains a backup of the previous mozilla.tlds file and reverts to it if the download fails.

#!/bin/bash

# Keep backup
mv mozilla.tlds mozilla.tlds.bak 2> /dev/null

# Download latest list
curl "https://publicsuffix.org/list/public_suffix_list.dat" -k -s > mozilla.tlds 2> /dev/null

if [ $? -ne 0 ]; then
    # Failed, restore backup
    rm -f mozilla.tlds
    mv mozilla.tlds.bak mozilla.tlds 2> /dev/null
    exit -1
fi

# Check for success
size=`stat -c '%s' mozilla.tlds`
if (( $size < 100000 )); then
    # Too small to be valid, restore backup
    rm -f mozilla.tlds
    mv mozilla.tlds.bak mozilla.tlds 2> /dev/null
    exit -1
fi

# Clean up backup
rm -f mozilla.tlds.bak

exit 0

jdiner avatar Feb 28 '17 21:02 jdiner

Thanks. Will see what I can do upstream as soon as I find some time.

stricaud avatar Feb 28 '17 23:02 stricaud