tordam

A library for peer discovery inside the Tor network
git clone https://git.parazyd.org/tordam
Log | Files | Refs | README | LICENSE

commit 7fc35c1c28c73e9416e2460bdebd79dc3a315ad3
parent 286c4b5b75ddf272aa0ba0875b51129bad31340d
Author: parazyd <parazyd@dyne.org>
Date:   Sat,  9 Dec 2017 18:25:50 +0100

Makefile fixes; rename dirauth.py to damauth.py

Diffstat:
Mpython/Makefile | 8+++-----
Apython/damauth.py | 16++++++++++++++++
Dpython/dirauth.py | 16----------------
3 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/python/Makefile b/python/Makefile @@ -4,7 +4,7 @@ PREFIX ?= /usr/local BIN =\ damhs.py \ - dirauth.py + damauth.py all: @echo 'Run "make install" to install the scripts to $(DESTDIR)$(PREFIX)/bin' @@ -13,12 +13,10 @@ install: @echo 'Installing scripts to $(DESTDIR)$(PREFIX)/bin' mkdir -p $(DESTDIR)$(PREFIX)/bin cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin - cd $(DESTDIR)$(PREFIX)/bin - chmod 755 $(BIN) + for f in $(BIN); do chmod 755 "$(DESTDIR)$(PREFIX)/bin/$$f"; done uninstall: @echo 'Uninstalling scripts from $(DESTDIR)$(PREFIX)/bin' - cd $(DESTDIR)$(PREFIX)/bin - rm -f $(BIN) + for f in $(BIN); do rm -f "$(DESTDIR)$(PREFIX)/bin/$$f"; done .PHONY: all install uninstall diff --git a/python/damauth.py b/python/damauth.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +# See LICENSE file for copyright and license details. +""" +Retrieves and prints a hidden service's public key to stdout. + +Usage: damauth.py <foo.onion> +""" + +from sys import argv, stdout +from stem.control import Controller + + +with Controller.from_port() as ctl: + ctl.authenticate(password='topkek') + stdout.write(ctl.get_hidden_service_descriptor(argv[1]).permanent_key) + stdout.flush() diff --git a/python/dirauth.py b/python/dirauth.py @@ -1,16 +0,0 @@ -#!/usr/bin/env python3 -# See LICENSE file for copyright and license details. -""" -Retrieves and prints a hidden service's public key to stdout. - -Usage: dirauth.py <foo.onion> -""" - -from sys import argv, stdout -from stem.control import Controller - - -with Controller.from_port() as ctl: - ctl.authenticate(password='topkek') - stdout.write(ctl.get_hidden_service_descriptor(argv[1]).permanent_key) - stdout.flush()