b32lookup/README.md

3.4 KiB

b32lookup

Tool to convert hostname, b32, b64 from addressbooks. Downloads hosts.txt files from a list of registrars into /i2phosts (relative to script directory) with -up. Checks for discrepancies between registrars and duplicates. Has shortcuts for notbob tools for newhost and viewing status of eepsites.

On first run it makes .settings in same directory, some settings can be changed by the script like -sdef reg to set the default addressbook to reg. To add sites to watch_list or more addressbook subscriptions edit .settings.

Get / Run

There are no outside dependencies besides python, just download lookup.py:

curl --retry 5 -x http://127.0.0.1:4444 -O http://git.simp.i2p/simp/b32lookup/raw/branch/main/lookup.py

Then you can run commands as python3 lookup.py <command>

You can run -ex which will allow running commands as ./lookup <command>

curl --retry 5 -x http://127.0.0.1:4444 -O http://git.simp.i2p/simp/b32lookup/raw/branch/main/lookup.py && python3 lookup.py -ex

Commands

  -h, --help            show this help message and exit
  -3 B32, --b32 B32     lookup b32
  -6 B64, --b64 B64     lookup b64
  -hn HOSTNAME, --hostname HOSTNAME
                    lookup hostname
  -dup, --duplicates    Checks a given host.txt file for duplicates. The default is notbob
  -chk, --checkmismatched
                    Checks all hosts.txt files for discrepancies.
  -up, --updatehosts    Uses curl to download all host.txt files. --setport to change http port
  -subs, --subscriptions
                    Shows subscription list for host.txt files
  -all, --allunique     Shows all unique b32s between all host.txt files
  -new, --notbobnew     See new hosts from notbob
  -st, --notbobstatus   See uptime status of site list from notbob
  -ex, --makeexecutable
                    Makes lookup.py executable, so it can be ran as ./lookup
  -shost SETHOST, --sethost SETHOST
                    Set the host for http proxy to use. [current: 127.0.0.1]
  -sport SETPORT, --setport SETPORT
                    Set the HTTP port for http proxy. [current: 4444]
  -sdef SETDEFAULT, --setdefault SETDEFAULT
                    Set the default host.txt file to use. [current is notbob]
  -stries SETMAXTRIES, --setmaxtries SETMAXTRIES
                    Set the max tries for curl command. [current: 3]
  -swatch SETNOTBOBWATCH, --setnotbobwatch SETNOTBOBWATCH
                    Seconds to refresh site status. [current: 1200]

Hostname | b32 | b64 Conversion

Accepts hostname, b32, or b64 and gives the other 2. Displays other hostnames if any others were registered with same b32 (like git.i2p and git.community.i2p). Needs host.txt file in /i2phosts. Can get by running -up

Example:

python3 lookup.py -hn simp.i2p

Registrar Discrepancy | Duplicates

Download hosts.txt files first with

python3 lookup.py -up

Then for discrepancies:

python3 lookup.py -chk

For duplicates:

python3 lookup.py -dup

Unique hostnames | Subscriptions

Show subscriptions with

python3 lookup.py -subs

To see uniqe hostnames, after -up do

python3 lookup.py -all

This combines host.txt files from all registrars. Order the registrars are given in .settings is the priority.

Notbob

New sites

python3 lookup.py -new

Status of watch list

python3 lookup.py -st

watch_list is set by editing .settings.

To adjusts the refresh time:

python3 lookup.py -swatch <seconds>