#!/usr/bin/env bash # IranTalk relay (docs/04 "Community relays"): one more door into the IranTalk network, on a # server outside Iran. # # A relay is a Reticulum transport node and nothing else. It passes encrypted packets between # the people who connect to it and the rest of the network. It holds none of the project's # secrets, answers nothing itself, cannot read what it carries, and keeps no log. # # curl -fsSLO https://irantalk.com/relay.sh && sudo bash relay.sh # # On a fresh Ubuntu 24.04 (or Debian 13) server with one public IPv4, as root, it: # 1. installs Reticulum into /opt/irantalk-relay/venv, every package checked against the # hashes at the end of this file; # 2. writes one config (/var/lib/irantalk-relay/reticulum/config): a public TCP entry on # port 4242, links to IranTalk's own entry points and to three public transport nodes; # 3. runs it as the service irantalk-relay, under its own user; # 4. registers it on the IranTalk dashboard: the relay signs a challenge with the key it made # on first start, and the dashboard lists it under the address the request came from, # after checking that the port answers. A maintainer approves it before it is published; # 5. renews that signature every week by a timer, so there is nothing to remember. # # Before you run it: # - Only on a server outside Iran. A relay inside Iran is never listed. # - Once approved, the server's IP address and port are public, in IranTalk's signed list. # - A relay sees the IP addresses of the people who connect through it (never their # messages). It writes none of them down; do not add logging that does. # - Open TCP 4242 inbound in the provider's firewall. Nothing else is needed. # # Options (kept for later runs; run the file again to change one, or to update): # --port N listen on another TCP port (default 4242) # --host NAME list the relay under a DNS name that points at this server (or name one of # its IPv4 addresses), not the address the dashboard sees it from; --host ip # goes back to that # --private run the relay but do not list it: sudo bash relay.sh --private # (--listed turns listing back on) # --inbox also run an Offline Inbox (an LXMF propagation node): it holds messages for # people who are offline until their app asks for them. It gets a key of its # own and is registered next to the relay. --no-inbox takes it away again. # The site serves this same file as node.sh with --inbox already on: # a relay with an Offline Inbox is what IranTalk calls a volunteer's node # # Afterwards, on the server: # irantalk-relay status the service, its links, and the listing # irantalk-relay register sign and submit again now (the timer does this weekly) # irantalk-relay uninstall stop and remove it (--purge also deletes its key) # # The five values below and the package lists at the end are filled in when irantalk.com is # built, from the signed list it was built with (apps/web/src/lib/relay.ts). In the repository # they are placeholders, and the file refuses to install. set -euo pipefail # The signed list's version; IranTalk's own entry points in it (entry.rns_tcp), host:port, # space-separated; where relays register; where this file is served. LIST_VERSION='11' ENTRIES='rns.irantalk.com:4242' DASHBOARD='https://dashboard.irantalk.com' SOURCE='https://irantalk.com/relay.sh' # yes in the copy served as node.sh, no in relay.sh: whether an Offline Inbox comes with it # unless an option says otherwise. INBOX='no' # The name this file was served under, for the commands it tells you to run. FILE=${SOURCE##*/} SVC=irantalk-relay PREFIX=/opt/irantalk-relay VENV=$PREFIX/venv STATE=/var/lib/irantalk-relay CONFIG_DIR=$STATE/reticulum IDENTITY=$CONFIG_DIR/storage/transport_identity SETTINGS=/etc/irantalk-relay.conf CMD=/usr/local/sbin/irantalk-relay UNITS=/etc/systemd/system # The Offline Inbox (--inbox): lxmd, a client of the relay's own Reticulum, with its own key. INBOX_SVC=$SVC-inbox INBOX_DIR=$STATE/lxmd INBOX_IDENTITY=$INBOX_DIR/identity PORT=4242 HOST= LISTED=yes # The port the last run left the relay on, if there was one. KEPT_PORT= say() { printf '==> %s\n' "$*"; } die() { printf 'irantalk-relay: %s\n' "$*" >&2; exit 1; } # From /: the service user cannot read the folder root happens to stand in. as_svc() { (cd / && runuser -u "$SVC" -- "$@"); } # The comment at the top of this file is the help. usage() { sed -n '2,/^set -euo pipefail$/p' "${BASH_SOURCE[0]}" | sed -e '$d' -e 's/^# \{0,1\}//'; } need_root() { [[ $EUID -eq 0 ]] || die "this needs root: run the same command with sudo in front"; } need_filled() { if [[ "$LIST_VERSION $ENTRIES $DASHBOARD $INBOX" =~ @[A-Z_]+@ ]]; then die "this is the template from the repository; the file to run is served by the site as /relay.sh" fi } # ---- The Reticulum config. Keys checked against RNS 1.5.5 (`rnsd --exampleconfig`). ---- reticulum_config() { local n=0 entry name local_programs='' # With an Offline Inbox there is a program behind this Reticulum. Without this setting an app # one hop away (Ratspeak) can never link to it: its link request arrives addressed to the # transport, is passed on unchanged, and the program ignores it (docs/04, 2026-10-24). if [[ $INBOX == yes ]]; then local_programs=$'\n local_hops_delta = yes'; fi cat <"$SETTINGS" chmod 644 "$SETTINGS" } check_options() { [[ $PORT =~ ^[0-9]{1,5}$ ]] && ((PORT >= 1 && PORT <= 65535)) || die "--port takes a number from 1 to 65535" [[ -z $HOST || $HOST =~ ^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$ \ || $HOST =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]] \ || die "--host takes a DNS name that points at this server, like relay.example.org, or its IPv4" [[ $LISTED == yes || $LISTED == no ]] || die "bad settings in $SETTINGS; remove the file and run again" [[ $INBOX == yes || $INBOX == no ]] || die "bad settings in $SETTINGS; remove the file and run again" } check_platform() { command -v apt-get >/dev/null 2>&1 && command -v systemctl >/dev/null 2>&1 \ || die "needs Ubuntu 24.04 or Debian 13 (apt and systemd)" python3 -c 'import sys; sys.exit(sys.version_info < (3, 12))' 2>/dev/null \ || die "needs Python 3.12 or newer (Ubuntu 24.04, Debian 13): the pinned packages are built for it" case "$(uname -m)" in x86_64 | aarch64) ;; *) die "needs a 64-bit x86 or ARM server; this one is $(uname -m)" ;; esac } listening() { ss -H -ltn "sport = :$PORT" 2>/dev/null | grep -q .; } # ---- install: also the update. Every step can be run again. ---- install_relay() { local self=${BASH_SOURCE[0]:-} req need_root need_filled [[ -f $self ]] || die "save the file first, then run it: curl -fsSLO $SOURCE && sudo bash $FILE" check_platform check_options if [[ $INBOX == yes ]]; then say "IranTalk relay with an Offline Inbox, on TCP port $PORT (signed list v$LIST_VERSION)" else say "IranTalk relay on TCP port $PORT (signed list v$LIST_VERSION)" fi if [[ $LISTED == yes ]]; then cat </dev/null && [[ $PORT == "$KEPT_PORT" ]]; }; then die "TCP port $PORT is already in use on this server; choose another with --port" fi # Debian and Ubuntu ship Python without the half of venv that installs pip. if ! python3 -c 'import ensurepip, venv' 2>/dev/null; then say "system package python3-venv" export DEBIAN_FRONTEND=noninteractive # A failed update is not the end: the install below says whether the package was found. apt-get update -q || true apt-get install -y -q python3-venv \ || die "could not install python3-venv: this server cannot reach its package mirror (apt's lines are above). Nothing was changed" fi say "service user $SVC" id -u "$SVC" >/dev/null 2>&1 \ || useradd --system --no-create-home --home-dir "$STATE" --shell /usr/sbin/nologin "$SVC" install -d -o "$SVC" -g "$SVC" -m 700 "$STATE" "$CONFIG_DIR" say "Reticulum, every package checked against its pinned hash" install -d -m 755 "$PREFIX" [[ -x $VENV/bin/python ]] || python3 -m venv "$VENV" req=$(mktemp) requirements >"$req" # The Offline Inbox is one more package, LXMF, pinned the same way. if [[ $INBOX == yes ]]; then requirements_inbox >>"$req"; fi # Wheels only: nothing is compiled, so the server needs no build tools. "$VENV/bin/pip" install -q --disable-pip-version-check --require-hashes --no-deps \ --only-binary :all: -r "$req" || { rm -f "$req" die "could not install the packages (pip's lines are above): either this server cannot reach pypi.org, or a file did not match its hash. Nothing runs yet; run the file again" } rm -f "$req" say "config, service and weekly renewal" reticulum_config >"$CONFIG_DIR/config" chown "$SVC:$SVC" "$CONFIG_DIR/config" chmod 600 "$CONFIG_DIR/config" if [[ $INBOX == yes ]]; then install -d -o "$SVC" -g "$SVC" -m 700 "$INBOX_DIR" inbox_config >"$INBOX_DIR/config" chown "$SVC:$SVC" "$INBOX_DIR/config" chmod 600 "$INBOX_DIR/config" fi write_units [[ $self -ef $CMD ]] || install -m 755 "$self" "$CMD" save_settings # Never switch a firewall on or change its policy on someone's server: only add our port to # one that is already active. if command -v ufw >/dev/null 2>&1 && ufw status 2>/dev/null | grep -q '^Status: active'; then ufw allow "$PORT/tcp" >/dev/null say "ufw is active: TCP $PORT allowed" fi systemctl daemon-reload systemctl enable -q "$SVC.service" "$SVC-register.timer" systemctl restart "$SVC.service" "$SVC-register.timer" wait_up if [[ $INBOX == yes ]]; then systemctl enable -q "$INBOX_SVC.service" systemctl restart "$INBOX_SVC.service" wait_inbox fi say "running" show_links echo echo "Open TCP $PORT inbound in the provider's firewall if it has one." echo "On this server, as root: irantalk-relay status | register | uninstall" if [[ $INBOX == yes ]]; then echo "Offline Inbox address: $(inbox_address)"; fi echo if [[ $LISTED == yes ]]; then register_relay || { echo "The relay runs, but it is not registered yet. Fix the line above, then: sudo irantalk-relay register" >&2 exit 1 } else echo "Not listed (--private). People reach it only if you give them this server's address and port $PORT." fi } write_units() { cat >"$UNITS/$SVC.service" <"$UNITS/$INBOX_SVC.service" </dev/null || true rm -f "$UNITS/$INBOX_SVC.service" fi cat >"$UNITS/$SVC-register.service" <"$UNITS/$SVC-register.timer" <&2 || true die "the relay did not start (the service's last lines are above)" } # lxmd makes its key on the first start, twenty seconds after the relay is up. wait_inbox() { local _ for _ in $(seq 1 90); do if [[ -s $INBOX_IDENTITY ]] && systemctl is-active --quiet "$INBOX_SVC"; then return 0; fi sleep 1 done journalctl -u "$INBOX_SVC" -n 20 --no-pager >&2 || true die "the Offline Inbox did not start (the service's last lines are above). The relay itself runs" } # The address people put in their app: the lxmf.propagation destination of the inbox's key. inbox_address() { as_svc "$VENV/bin/rnid" --config "$CONFIG_DIR" -i "$INBOX_IDENTITY" -H lxmf.propagation 2>/dev/null \ | sed -n 's/.*lxmf\.propagation destination for this Identity is <\([0-9a-f]\{32\}\)>.*/\1/p' } show_links() { as_svc "$VENV/bin/rnstatus" --config "$CONFIG_DIR" || true; } # ---- register: also the renewal. The dashboard lists the address this request comes from. ---- register_relay() { local result need_root need_filled [[ -s $IDENTITY ]] || die "no relay on this server yet: sudo bash $FILE" if [[ $LISTED != yes ]]; then echo "Not listed (--private). To list it: sudo bash $FILE --listed" return 0 fi # As the service user, which owns the key and nothing else. The key never leaves the server: # only the signature does. result=$(register_program | as_svc env RELAY_DASHBOARD="$DASHBOARD" RELAY_PORT="$PORT" \ RELAY_HOST="$HOST" RELAY_RNID="$VENV/bin/rnid" RELAY_IDENTITY="$IDENTITY" "$VENV/bin/python" -) \ || return 1 printf '%s %s\n' "$result" "$(date -u +%Y-%m-%d)" >"$STATE/listing" # shellcheck disable=SC2086 set -- $result if [[ $2 == approved ]]; then echo "Listed as $1. Signature renewed until $3." else echo "Registered as $1. It waits for a maintainer's approval; after that it is in IranTalk's" echo "signed list, which is public. Renewed by the weekly timer: nothing more to do." fi if [[ $INBOX == yes ]]; then register_inbox; fi } # The Offline Inbox is registered like any node an operator adds by hand (docs/12): its address # is the hash of its own key, and signing with that key proves it. Same two requests. register_inbox() { local result address [[ -s $INBOX_IDENTITY ]] || { echo "The Offline Inbox has no key yet; try again in a minute: sudo irantalk-relay register" >&2; return 1; } address=$(inbox_address) [[ $address =~ ^[0-9a-f]{32}$ ]] || { echo "Could not read the Offline Inbox's address" >&2; return 1; } result=$(register_program | as_svc env RELAY_DASHBOARD="$DASHBOARD" RELAY_KIND=lxmf_propagation \ RELAY_ADDRESS="$address" RELAY_RNID="$VENV/bin/rnid" RELAY_IDENTITY="$INBOX_IDENTITY" \ RELAY_PORT="$PORT" RELAY_HOST= "$VENV/bin/python" -) || return 1 printf '%s %s\n' "$result" "$(date -u +%Y-%m-%d)" >"$STATE/listing-inbox" # shellcheck disable=SC2086 set -- $result if [[ $2 == approved ]]; then echo "Offline Inbox listed as $1. Signature renewed until $3." else echo "Offline Inbox registered as $1. It waits for a maintainer's approval too." fi } # Two requests to the dashboard (docs/12): ask for a challenge, send it back signed. register_program() { cat <<'PY' import json import os import socket import subprocess import sys import urllib.error import urllib.request # IPv4 only: the relay listens on IPv4, and the dashboard lists the address it sees us from. _resolve = socket.getaddrinfo socket.getaddrinfo = lambda host, port, family=0, *rest, **kw: _resolve( host, port, socket.AF_INET, *rest, **kw ) base = os.environ["RELAY_DASHBOARD"].rstrip("/") port = int(os.environ["RELAY_PORT"]) host = os.environ["RELAY_HOST"] def post(path, body): request = urllib.request.Request( base + path, json.dumps(body).encode(), {"content-type": "application/json", "user-agent": "irantalk-relay"}, ) try: with urllib.request.urlopen(request, timeout=30) as response: return json.load(response) except urllib.error.HTTPError as e: try: return json.load(e) except ValueError: return {"error": f"the dashboard answered {e.code}"} except (OSError, ValueError) as e: return {"error": f"the dashboard did not answer ({e})"} # A relay is listed under the address this request comes from. Anything else an operator adds # (the Offline Inbox) is listed under the hash its own key proves. kind = os.environ.get("RELAY_KIND", "rns_relay") if kind == "rns_relay": ask = {"kind": kind, "region": "outside", "port": port} if host: ask["address"] = f"{host}:{port}" else: ask = {"kind": kind, "region": "outside", "address": os.environ["RELAY_ADDRESS"]} challenge = post("/api/register/challenge", ask) if "challenge" not in challenge: sys.exit(f"not registered: {challenge.get('error', 'no challenge in the answer')}") signed = subprocess.run( [os.environ["RELAY_RNID"], "-i", os.environ["RELAY_IDENTITY"], "-S", challenge["challenge"], "-b"], capture_output=True, text=True, timeout=60, ) # Only the signed block is sent: rnid also prints which file it loaded. first, last = "#### Start of rsg data", "End of rsg data ####" start, end = signed.stdout.find(first), signed.stdout.find(last) if signed.returncode != 0 or start < 0 or end < start: sys.exit("not registered: could not sign the challenge with this server's key") block = signed.stdout[start : end + len(last)] listing = post("/api/register/signature", {"challenge": challenge["challenge"], "signed": block}) if "address" not in listing: sys.exit(f"not registered: {listing.get('error', 'no listing in the answer')}") print(listing["address"], listing["status"], str(listing["signed_until"])[:10]) PY } status_relay() { local address state good_until asked need_root [[ -x $VENV/bin/rnstatus ]] || die "no relay on this server: sudo bash $FILE" echo "service: $(systemctl is-active "$SVC" 2>/dev/null || true), TCP port $PORT" if [[ $LISTED != yes ]]; then echo "listing: none (--private)" elif [[ -s $STATE/listing ]]; then # address, status, signed until, when asked read -r address state good_until asked <"$STATE/listing" echo "listing: $address, $state when last signed ($asked), signature good until $good_until" else echo "listing: not registered yet (irantalk-relay register)" fi if [[ $INBOX == yes ]]; then echo "offline inbox: $(systemctl is-active "$INBOX_SVC" 2>/dev/null || true), address $(inbox_address)" if [[ $LISTED == yes && -s $STATE/listing-inbox ]]; then read -r address state good_until asked <"$STATE/listing-inbox" echo " listing: $state when last signed ($asked), signature good until $good_until" fi fi echo show_links } uninstall_relay() { need_root systemctl disable -q --now "$INBOX_SVC.service" "$SVC.service" "$SVC-register.timer" 2>/dev/null || true rm -f "$UNITS/$INBOX_SVC.service" "$UNITS/$SVC.service" "$UNITS/$SVC-register.service" \ "$UNITS/$SVC-register.timer" systemctl daemon-reload if command -v ufw >/dev/null 2>&1 && ufw status 2>/dev/null | grep -q '^Status: active'; then ufw delete allow "$PORT/tcp" >/dev/null 2>&1 || true fi rm -rf "$PREFIX" "$SETTINGS" rm -f "$CMD" if [[ ${PURGE:-no} == yes ]]; then rm -rf "$STATE" userdel "$SVC" 2>/dev/null || true echo "Removed, with its key. A relay installed here later is a new one." else echo "Removed. Its key stays in $STATE, so installing again brings back the same relay;" echo "irantalk-relay uninstall --purge deletes that too." fi echo "A listed relay leaves IranTalk's signed list when a maintainer retires it, or when its" echo "signature runs out (90 days after the last renewal)." } # ---- The packages: Reticulum and what it needs, with the hash of every file pip may take. ---- # The same versions IranTalk's own box runs (uv.lock, node/relay/requirements.lock.txt). requirements() { cat <<'REQUIREMENTS' cffi==2.1.1 ; platform_python_implementation != 'PyPy' \ --hash=sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e \ --hash=sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66 \ --hash=sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2 \ --hash=sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971 \ --hash=sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c \ --hash=sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d \ --hash=sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517 \ --hash=sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735 \ --hash=sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80 \ --hash=sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f \ --hash=sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1 \ --hash=sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29 \ --hash=sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8 \ --hash=sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c \ --hash=sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e \ --hash=sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48 \ --hash=sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac \ --hash=sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6 \ --hash=sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688 \ --hash=sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062 \ --hash=sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779 \ --hash=sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94 \ --hash=sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50 \ --hash=sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab \ --hash=sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac \ --hash=sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6 \ --hash=sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676 \ --hash=sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1 \ --hash=sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13 \ --hash=sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e \ --hash=sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e \ --hash=sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973 \ --hash=sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527 \ --hash=sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72 \ --hash=sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890 \ --hash=sha256:6a8dddef476fab96d066d578fc88526767b836ab5ab21754e1d5bf3879c31c7c \ --hash=sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94 \ --hash=sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3 \ --hash=sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80 \ --hash=sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5 \ --hash=sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c \ --hash=sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a \ --hash=sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4 \ --hash=sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e \ --hash=sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6 \ --hash=sha256:a2d7755bef5a12ed488f4ef1f1b69ee9191d7396083b755a5d2295f6edb4768b \ --hash=sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03 \ --hash=sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231 \ --hash=sha256:a931079504ecc49efed7744c476a5c343a92fabf66dec2db95edb1b2fdc770e2 \ --hash=sha256:aa9511c62d14da7aacc9b4bf51f3f697a621e83b2d6919008243c3aad168eea3 \ --hash=sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836 \ --hash=sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5 \ --hash=sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399 \ --hash=sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96 \ --hash=sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e \ --hash=sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf \ --hash=sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc \ --hash=sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0 \ --hash=sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7 \ --hash=sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692 \ --hash=sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54 \ --hash=sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3 \ --hash=sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b \ --hash=sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be \ --hash=sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d \ --hash=sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358 \ --hash=sha256:e0bcb7e0f677f543555d2adff3bf19c05f66cdb4796e5ff602442ab2fe3c4ef7 \ --hash=sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc \ --hash=sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960 \ --hash=sha256:f16c709686a78c727bbbf059f92b0bf41c6fc60deec706d2dc19f529175a6125 \ --hash=sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb \ --hash=sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a \ --hash=sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf \ --hash=sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4 \ --hash=sha256:fcd22650c908d7b7da162bbfaab594a1227a15d1643a98c68b122ac642fa2264 cryptography==50.0.2 \ --hash=sha256:0ddc924c04591c2811ca024d62ecad4f7f6f08af8939c211438f48a16bd23602 \ --hash=sha256:0ec5f09541743261e66e291b4a0cbf0fb2997aeaab6d9e9c740b9dba1b58d1c2 \ --hash=sha256:0ecbc5652bdb6fc9eaf89a7d196e20941adfe812f43bc4ca05d9150496821047 \ --hash=sha256:1981f1db4630889b9ef7803fadef12b056f428cb6b85c27ba57b774793b6093c \ --hash=sha256:241449bf940a5d27309bd317e6f9a2af6932113818bb2b8f5c59ddc7ef16da18 \ --hash=sha256:25784ce8b9621c90c643efb9e1e2162ab3b0224cae446ad5e70e7fcb1ce18b51 \ --hash=sha256:4061c0079120205fb760c58acab6443e217307dcf05e3702cf970e0689972856 \ --hash=sha256:4a20ce1e5cb4284a86692fdcba7cb8754185c6b2e5c56fcef3751cf451d3cdc2 \ --hash=sha256:4e81d95e5bafc2d6e34e4bed780e53e4d5b9a2f928573428aa4d35fbec1eb0de \ --hash=sha256:58a0c478eeca76fe5e07993c5a0703def34a6dc6a0cda4f5564639b33112ffe7 \ --hash=sha256:58ddb5a8e3179d12f19e4ea34d2d32e9d63a4baa142c875c1eb59f41b7243acd \ --hash=sha256:630ebfea3bf689d075f82316324ff7433dc447fe6bc1bfc76524b74b4a9567d2 \ --hash=sha256:6f8700550aa1474a91e5dc07049c46f98b423b5b1ddd0483e0b51362eeeaf5be \ --hash=sha256:78198641e5be9521beea5aa782bb551a58068d10e6eb04c9c680c1b69f2e7d45 \ --hash=sha256:79def8d059362e7831389ed3be0ecdf58a89386e1271e35dd9f5af84e81bffd0 \ --hash=sha256:7a8701d6b584d76e909e3d305b7d126b41439876a5aaf76cddc67fc230eafa2e \ --hash=sha256:7afa5a6602a9f29af1f3a2965f831bae7c9d5d597b7cbb716d41ab3b7d89879c \ --hash=sha256:7b46165bb56eb4704e2eaaf86f3c940d19154535d9b0ca7d6d590b04060e00d5 \ --hash=sha256:828d49b0ff5a0e3975865571c5d91dbbdd0d38d8289b249a163e9425413a5e05 \ --hash=sha256:84f964e537f916e2cc85199e5a88742e964939b575ac8598b3f9d6cc416cdaf1 \ --hash=sha256:85d0d9a31b9098e98534226d5686b47264b95e62ce459dc2e62fdfc809f9fe93 \ --hash=sha256:87e9ce85beb6b328ba370cc6e6aea483c92617b4c95b1d33a49297eb662bfb04 \ --hash=sha256:8c71ba2cd31fc93748c38e1b613200ff1c2665cbfd5341fe3a61cfde35a1430e \ --hash=sha256:94e5e9f108ee10471288214d3d233fbfbb492840a8457eb85178d643ddeb32c7 \ --hash=sha256:9c8402a82ea0dc4ceeab793db05f0fafa8ca139ca34fcde5df0f596103c74107 \ --hash=sha256:9dab55f57c74c3cad24c323bacbbd04be4705ba6eb0d92e920b1fc4837ed5079 \ --hash=sha256:a582ab2ae1d34f67112cadc86702774c9ea4374df6bca6afe672817203c99134 \ --hash=sha256:a6557e5f38e065ca9fbdaf7cfc7435ecb1d113aa81a022d1b51921ee7432e227 \ --hash=sha256:a9f7355e6fab51f6c369b86fb7571cffa05edee2c2121e0380a37fb9ac1cd5c1 \ --hash=sha256:ab50ee449bf968271e820086f10a33d101dd060370abc10bcd22279be2656539 \ --hash=sha256:ac9ed99d81760c62fe89d5f0815cdfa1ba9a35141cf30f1c2d044f04b4803d2e \ --hash=sha256:b13478603dcd0a2479ff8e87e2c19a7d525734686fe3c49542472293a204212d \ --hash=sha256:c423ab384a46c4dff7217b2ea5ba2e11cffdeab6441acd04cf65a369caf0366c \ --hash=sha256:c5e67125c7dca78d199ec4e116aa93dbb83494808ecbb8211a2cb09b1bf41dbd \ --hash=sha256:c71be1cbfa5cd9a41ee452acf1eccd82b2c05950358b106ec8ceb83411d1a020 \ --hash=sha256:cbc8738fd8526d80f35cb3a40d41f41a2e7030bb3b18b09a6778ef63d291c2fd \ --hash=sha256:ce47f66801c20ec6c6632453bb5960fe38939e9306970b48b3a5a26de7745d94 \ --hash=sha256:d370b8d1dfcdf7130178137f6fbee6140774a1acc6cacefc4b42643ec11d0a3a \ --hash=sha256:d38cdff612d06fa6a32840d5e1b1f7a27cee4a349aa9085d94a67789d6bfd408 \ --hash=sha256:d8947001be83df1394050758ce0e745dd74fb134eef0a4b5124208dfc3a68c37 \ --hash=sha256:deb9fde5c60e437ee4821bc9bc39ff31b42135c27e1dc61ef0a629389c1de62e \ --hash=sha256:dfe9763530994147d9af1def057a5b9658b00e8f8fe8743d144d1e0911c2e454 \ --hash=sha256:e105ab60406787da31fccc883fc0f733af1efd78f0136a4599692c4083a73d0c \ --hash=sha256:e275096ea1e60cc595cda2836fd4a6c725d1125108b868be17f53684d164e2cc \ --hash=sha256:edc3342adf8f697fc5f59c887a304356f147b397809440ed64e2fa6af2f50f37 \ --hash=sha256:ee247f5c245c9a2fe7c8e2214e295918838e44e00a45a6718451e4004219e767 \ --hash=sha256:f21e8a22c8605750c7af886bab299a363721264061b4ac0a30efb73cfd58efc5 \ --hash=sha256:f265528741e048bce55c3463ed721fb0aa45a5888d8add8cfeccb3035451bbdc \ --hash=sha256:f2f9bd7f90c64fe89253f0a2c05e3c4856072660429ce8831b4235bf29403a67 \ --hash=sha256:f785f6161f202ab04d8ca194158968798e480ca058943907972da5f12e2881e8 \ --hash=sha256:f9f6143a8c75945eb960d9eb98905a441394abfa24afaae239d514ffb2586480 \ --hash=sha256:fa8f5efb344d6908a1ce62f4a24e2e5780f825d6f53f5f50ec5ffacac72936cb \ --hash=sha256:fdd28f912fccfec1846a94e2e1e8f9b0012f557f0c46fe4f3eb0d7a87afcf90b pycparser==3.0 ; implementation_name != 'PyPy' and platform_python_implementation != 'PyPy' \ --hash=sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29 \ --hash=sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992 pyserial==3.5 \ --hash=sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb \ --hash=sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0 rns==1.5.5 \ --hash=sha256:665508974d6d874167edadef59fefadf56faaedf76315847aef4a2af8c75bfab \ --hash=sha256:94f2352c7462e2fcf485d5c770eb2b41e666b753906ac3ce0a94e8a0c489a460 REQUIREMENTS } # ---- The Offline Inbox's package: LXMF, the same version IranTalk's own box runs. ---- requirements_inbox() { cat <<'REQUIREMENTS' lxmf==1.2.0 \ --hash=sha256:805f053e61082f585efc6d09beffd039fd921174c5e1547a2e690bc479d75b85 \ --hash=sha256:f14243283b90ad06356071d90394357640924201f9c992dcdfecbc23614fb309 REQUIREMENTS } main() { local command=install port='' host=keep listed='' inbox='' case "${1:-}" in install | status | register | uninstall | config) command=$1; shift ;; esac while [[ $# -gt 0 ]]; do case "$1" in --port) port=${2:-}; shift 2 || die "--port takes a number" ;; --host) host=${2:-}; shift 2 || die "--host takes a DNS name, an IPv4, or ip" ;; --private) listed=no; shift ;; --listed) listed=yes; shift ;; --inbox) inbox=yes; shift ;; --no-inbox) inbox=no; shift ;; --purge) PURGE=yes; shift ;; -h | --help) usage; exit 0 ;; *) usage >&2; die "unknown option $1" ;; esac done # What this file brings unless told otherwise (yes when it was served as node.sh). local file_inbox=$INBOX load_settings if [[ -r $SETTINGS ]]; then KEPT_PORT=$PORT; fi # An option given now wins over the one kept from the last run. PORT=${port:-$PORT} case "$host" in keep) ;; ip) HOST= ;; *) HOST=$host ;; esac LISTED=${listed:-$LISTED} INBOX=${inbox:-$INBOX} # Installing from node.sh means the inbox is wanted, whatever an earlier relay.sh run kept; # every other command goes by what is installed. if [[ $command == install && -z $inbox && $file_inbox == yes ]]; then INBOX=yes; fi case "$command" in install) install_relay ;; status) status_relay ;; register) register_relay ;; uninstall) uninstall_relay ;; # The Reticulum config this relay would write, without installing anything. config) check_options; reticulum_config ;; esac } main "$@"